nekral-guest [Mon, 9 Jun 2008 20:02:46 +0000 (20:02 +0000)]
* src/logoutd.c: Use a bool when possible instead of int integers.
* src/logoutd.c: Avoid implicit conversion of pointers / integers
/ chars to booleans.
* src/logoutd.c: Ignore return value of setlocale(),
bindtextdomain(), and textdomain().
* src/logoutd.c: Add brackets and parenthesis.
nekral-guest [Mon, 9 Jun 2008 19:46:11 +0000 (19:46 +0000)]
* src/chpasswd.c: Use a bool when possible instead of int
integers.
* src/chpasswd.c: Avoid implicit conversion of pointers / integers
/ chars to booleans.
* src/chpasswd.c: Ignore return value of setlocale(),
bindtextdomain(), and textdomain().
nekral-guest [Mon, 9 Jun 2008 19:43:22 +0000 (19:43 +0000)]
* src/pwconv.c: Use a bool when possible instead of int integers.
* src/pwconv.c: Add brackets and parenthesis.
* src/pwconv.c: Ignore return value of setlocale(),
bindtextdomain(), and textdomain().
* src/pwconv.c: Avoid implicit conversion of pointers / integers /
chars to booleans.
nekral-guest [Mon, 9 Jun 2008 19:36:08 +0000 (19:36 +0000)]
* NEWS, src/newusers.c: Implement the -r, --system option.
* src/newusers.c: Use a bool when possible instead of int
integers.
* src/newusers.c: Avoid implicit conversion of pointers / integers
/ chars to booleans.
* src/newusers.c: Ignore the return value of pam_end() before
exiting.
* src/newusers.c: Ignore return value of setlocale(),
bindtextdomain(), and textdomain().
* src/newusers.c: Avoid multi-statements lines.
* src/newusers.c: Add brackets and parenthesis.
nekral-guest [Mon, 9 Jun 2008 19:26:19 +0000 (19:26 +0000)]
* src/gpasswd.c: Use a bool when possible instead of int integers.
* src/gpasswd.c: Avoid implicit conversion of pointers / integers
/ chars to booleans.
* src/gpasswd.c: Ignore the return value of putchar() and fflush()
before exiting.
* src/gpasswd.c: check_list() renamed is_valid_user_list(), and
return a bool.
* src/gpasswd.c: Ignore return value of setlocale(),
bindtextdomain(), and textdomain().
nekral-guest [Mon, 9 Jun 2008 19:20:00 +0000 (19:20 +0000)]
* src/grpck.c: Use a bool when possible instead of int integers.
* src/grpck.c: Ignore return value of setlocale(),
bindtextdomain(), and textdomain().
nekral-guest [Mon, 9 Jun 2008 19:15:27 +0000 (19:15 +0000)]
* src/lastlog.c: Use a bool when possible instead of int integers.
* src/lastlog.c: Avoid implicit conversion of pointers / integers
/ chars to booleans.
* src/lastlog.c: Add brackets and parenthesis.
* src/lastlog.c: Ignore return value of setlocale(),
bindtextdomain(), and textdomain().
nekral-guest [Mon, 9 Jun 2008 19:10:44 +0000 (19:10 +0000)]
* src/userdel.c: Use a bool for the is_shadow_pwd, is_shadow_grp,
deleted_user_group, was_member, was_admin, and the
options' flags.
* src/userdel.c: Change path_prefix() prototype to return a bool.
* src/userdel.c: Ignore return value of setlocale(),
bindtextdomain(), and textdomain().
* src/userdel.c: Ignore the return value from pam_end() since we
are exiting anyway just afterwards.
* src/userdel.c: Avoid implicit conversion of pointers /
integers / chars to booleans.
* src/userdel.c: Add brackets and parenthesis.
* src/userdel.c: Avoid assignments in comparisons.
* src/userdel.c: Do not ignore the return value of the *_unlock()
functions.
nekral-guest [Mon, 9 Jun 2008 18:35:32 +0000 (18:35 +0000)]
* src/login_nopam.c: Do not use the YES and NO macros. Use the
booleans true and false instead. Change the prototypes of
list_match(), user_match(), from_match(), and string_match()
accordingly. Also use booleans internally.
* src/login_nopam.c: Add brackets and parenthesis.
* src/login_nopam.c: Avoid implicit conversion of pointers /
integers / chars to booleans.
* src/login_nopam.c: Avoid assignments in comparisons.
nekral-guest [Mon, 9 Jun 2008 18:23:23 +0000 (18:23 +0000)]
* src/newgrp.c: Use a bool for is_newgrp, notfound, needspasswd,
initflag, and cflag.
* src/newgrp.c: Add brackets and parenthesis.
* src/newgrp.c: Avoid implicit conversion of pointers / integers /
chars to booleans.
* src/newgrp.c: Avoid multi-statements lines.
* src/newgrp.c: Ignore return value of setlocale(),
bindtextdomain(), and textdomain().
* src/newgrp.c: Avoid assignments in comparisons.
nekral-guest [Mon, 9 Jun 2008 18:11:20 +0000 (18:11 +0000)]
* libmisc/console.c: Change is_listed() prototype to return a bool.
The default parameter should also be a bool.
* libmisc/console.c: Add brackets and parenthesis.
* libmisc/console.c: Avoid assignments in comparisons.
* libmisc/console.c: Change console() prototype to return a bool.
nekral-guest [Mon, 26 May 2008 08:56:34 +0000 (08:56 +0000)]
* lib/prototypes.h: Fix prototypes according to earlier changes (usage of the bool type).
* lib/prototypes.h: Add the arguments' name to the prototypes.
nekral-guest [Mon, 26 May 2008 08:46:41 +0000 (08:46 +0000)]
* lib/sgroupio.c: Avoid assignments in comparisons.
* lib/sgroupio.c: Add brackets.
* lib/sgroupio.c: Avoid implicit conversion of pointers / integers to booleans.
* lib/sgroupio.c: The changed, isopen, locked, and readonly fields of the db are booleans.
* lib/sgroupio.h, lib/sgroupio.c: sgr_file_present returns a bool.
* lib/sgroupio.h: Add protection against multiple inclusions.
nekral-guest [Mon, 26 May 2008 08:43:50 +0000 (08:43 +0000)]
* lib/sgroupio.c: Avoid assignments in comparisons.
* lib/sgroupio.c: Add brackets.
* lib/sgroupio.c: Avoid implicit conversion of pointers / integers to booleans.
* lib/sgroupio.c: The changed, isopen, locked, and readonly fields of the db are booleans.
* lib/sgroupio.h, lib/sgroupio.c: sgr_file_present returns a bool.
* lib/sgroupio.h: Add protection against multiple inclusions.
nekral-guest [Mon, 26 May 2008 00:46:25 +0000 (00:46 +0000)]
* lib/commonio.h: commonio_entry.changed, commonio_db.changed, commonio_db.isopen, commonio_db.locked, and commonio_db.readonly are no booleans.
* lib/commonio.h: Include defines.h to get the definition of bool.
* lib/commonio.h: commonio_present returns a bool
* lib/commonio.c: Implement above changes.
* lib/commonio.c: add argument names in prototypes.
* lib/commonio.c: name_is_nis returns a bool.
* lib/commonio.c: nscd_need_reload is a bool.
* lib/commonio.c: Improve types (use size_t / pid_t when needed instead of int).
* lib/commonio.c: Avoid assignments in comparisons.
* lib/commonio.c: Add brackets and parenthesis.
* lib/commonio.c: Avoid implicit conversion of pointers / integers to booleans
* lib/commonio.c: The return values of utime is not checked on purpose.
nekral-guest [Mon, 26 May 2008 00:14:10 +0000 (00:14 +0000)]
* libmisc/isexpired.c: ARGSUSED is no more needed (shadow is always supported).
* libmisc/isexpired.c: Avoid implicit conversion of pointers to booleans.
* libmisc/isexpired.c: Add brackets and parenthesis.
nekral-guest [Mon, 26 May 2008 00:09:24 +0000 (00:09 +0000)]
* libmisc/sulog.c (sulog): The success argument is a bool.
* libmisc/sulog.c: The return values of fflush is not checked on purpose.
* libmisc/sulog.c: Indicate that some return values should be checked.
nekral-guest [Mon, 26 May 2008 00:02:15 +0000 (00:02 +0000)]
* libmisc/ttytype.c: Avoid implicit conversion of pointers / integers to booleans.
* libmisc/ttytype.c: Avoid assignments in comparisons.
* libmisc/ttytype.c: Add brackets and parenthesis.
* libmisc/ttytype.c: The return values of fclose is not checked on purpose.
nekral-guest [Sun, 25 May 2008 23:57:41 +0000 (23:57 +0000)]
* libmisc/loginprompt.c: Avoid implicit conversion of pointers / chars to booleans.
* libmisc/loginprompt.c: Add brackets.
* libmisc/loginprompt.c: Avoid assignments in comparisons.
* libmisc/loginprompt.c: The return values of fclose and fflush are not checked on purpose.
nekral-guest [Sun, 25 May 2008 23:42:39 +0000 (23:42 +0000)]
* libmisc/setugid.c (setup_uid_gid): The is_console argument is now a bool.
* libmisc/setugid.c: Avoid implicit conversion of integers / pointers to booleans.
* libmisc/setugid.c: Add brackets.
nekral-guest [Sun, 25 May 2008 23:39:59 +0000 (23:39 +0000)]
* libmisc/setugid.c (setup_uid_gid): The is_console argument is no a bool.
* libmisc/setugid.c: Avoid implicit conversion of integers / pointers to booleans.
* libmisc/setugid.c: Add brackets.
nekral-guest [Sun, 25 May 2008 23:38:05 +0000 (23:38 +0000)]
* libmisc/pam_pass.c (do_pam_passwd): The silent and
change_expired are no booleans instead of int.
* libmisc/pam_pass.c: The return value of pam_end is not checked
on purpose.
nekral-guest [Sun, 25 May 2008 23:01:14 +0000 (23:01 +0000)]
* libmisc/yesno.c: yes_or_no returns a bool instead of int.
* libmisc/yesno.c: Avoid implicit conversion of pointers to booleans.
* libmisc/yesno.c: The return value of fflush is not checked on purpose.
nekral-guest [Sun, 25 May 2008 22:11:12 +0000 (22:11 +0000)]
* libmisc/utmp.c (checkutmp): Change picky argument's type to
bool.
* libmisc/utmp.c: Use bool when possible (found_utmpx,
found_utmp).
* libmisc/utmp.c: Add note about unchecked return values.
nekral-guest [Sun, 25 May 2008 21:52:14 +0000 (21:52 +0000)]
* hushed returns a bool instead of int.
* Avoid assignments in comparisons.
* (hushed) Change type of found to bool.
* Add brackets.
* Always check if the user or the shell is in
the file. Do not check the first character of the line first. This
is simpler and match better with the HUSHLOGIN_FILE documentation.
nekral-guest [Sun, 25 May 2008 21:23:28 +0000 (21:23 +0000)]
* Avoid assignment in comparisons, implicit comparison of integers to booleans.
* The return value of closedir is not checked on purpose.
* Add brackets.
nekral-guest [Sun, 25 May 2008 20:58:16 +0000 (20:58 +0000)]
* libmisc/chkname.h, libmisc/chkname.c: check_group_name (resp.
check_user_name) renamed to is_valid_user_name (resp.
is_valid_group_name). is_valid_user_name and is_valid_group_name
return a bool.
* src/grpck.c, src/newusers.c, src/usermod.c, src/useradd.c,
src/groupmod.c, src/pwck.c, src/groupadd.c: Use is_valid_user_name
and is_valid_group_name, following above change.
* libmisc/chkname.c: Avoid implicit conversion of chars to
booleans. Add brackets and parenthesis.
nekral-guest [Sat, 24 May 2008 15:35:15 +0000 (15:35 +0000)]
* libmisc/copydir.c (remove_tree): As we always use remove_tree
followed by rmdir to remove the directory itself, delete also the
root directory in remove_tree.
* src/userdel.c, src/usermod.c: Do not call rmdir after
remove_tree.
nekral-guest [Sat, 24 May 2008 15:19:02 +0000 (15:19 +0000)]
* libmisc/fields.c: Avoid assignments in comparisons, assignments
with post increments (x++), use of integers as booleans, and
explicitly mark blocks with brackets.
* libmisc/copydir.c: Likewise.
* libmisc/fields.c: Add comments.
* libmisc/copydir.c: Mark function whose return value is not
checked as such.
* libmisc/copydir.c (remove_tree): Make sure unlink is successful
when removing files.
nekral-guest [Sat, 24 May 2008 14:09:35 +0000 (14:09 +0000)]
* libmisc/list.c: Avoid assignments in comparisons, assignments
with post increments (x++), use of integers as booleans, and
explicitly mark blocks with brackets.
nekral-guest [Sat, 24 May 2008 13:08:58 +0000 (13:08 +0000)]
Fix compiler warnings:
* libmisc/audit_help.c: Include prototypes.h to get the prototype
of audit_help_open.
* libmisc/salt.c: Use booleans instead of negating integers.
* src/passwd.c: Declare the check_selinux_access prototype and
avoid name clashes (change_user -> changed_user; change_uid ->
changed_uid; access -> requested_access)
nekral-guest [Tue, 20 May 2008 13:34:06 +0000 (13:34 +0000)]
*** security:
- generation of SHA encrypted passwords (chpasswd, gpasswd, newusers,
chgpasswd; and also passwd if configured without PAM support).
The number of rounds and number of salt bytes was fixed to their lower
allowed values (resp. configurable and 8), hence voiding some of the
advantages of this encryption method. Dictionary attacks with
precomputed tables were easier than expected, but still harder than with
the MD5 (or DES) methods.
* NEWS, libmisc/salt.c (SHA_salt_size): Seed the RNG, and fix a
overflow. These caused the SHA salt size to always be 8 bytes,
instead of being in the 8-16 range. Thanks to Peter Vrabec
pvrabec@redhat.com for noticing.
* NEWS, libmisc/salt.c (SHA_salt_rounds): Seed the RNG with
seedRNG instead of srand, and fix the same overflow. This caused
the number of rounds to always be the smallest one.
nekral-guest [Sun, 18 May 2008 15:06:51 +0000 (15:06 +0000)]
Import Debian patch 487_passwd_chauthtok_failed_message
* libmisc/pam_pass.c: Be more verbose and indicate that the
password was not changed when pam_chauthtok fails (in addition to
the PAM error, which may not be comprehensible for the users).
nekral-guest [Sun, 18 May 2008 14:54:35 +0000 (14:54 +0000)]
Import Debian patch 434_login_stop_checking_args_after--
* NEWS, src/login.c (check_flags): Stop checking the arguments
after --. The later options will be sent to the shell, and do not
need to be checked.
Make sure every source files are distributed with a copyright and license.
Files with no license use the default 3-clauses BSD license. The copyright
were mostly not recorded; they were updated according to the Changelog.
"Julianne Frances Haugh and contributors" changed to "copyright holders
and contributors".
If the SULOG_FILE does not exist when an su session is logged, make sure
the file is created with group root, instead of using the group of the
caller.