]> granicus.if.org Git - shadow/log
shadow
16 years agoSimplify pwck's main(). Remove gotos.
nekral-guest [Tue, 1 Jan 2008 15:52:07 +0000 (15:52 +0000)]
Simplify pwck's main(). Remove gotos.

16 years agoSplit also check_pw_file() and check_spw_file() out of main().
nekral-guest [Tue, 1 Jan 2008 15:49:33 +0000 (15:49 +0000)]
Split also check_pw_file() and check_spw_file() out of main().

16 years agoAlso split open_files and close_files out of main().
nekral-guest [Tue, 1 Jan 2008 15:29:47 +0000 (15:29 +0000)]
Also split open_files and close_files out of main().
New global variables use_system_pw_file and use_system_spw_file

16 years agoSplit process_flags() out of main(). New global variables is_shadow,
nekral-guest [Tue, 1 Jan 2008 15:07:41 +0000 (15:07 +0000)]
Split process_flags() out of main(). New global variables is_shadow,
sort_mode.

16 years agoDe-comment code (duplicate the entry when the _R function is not present on the system).
nekral-guest [Tue, 1 Jan 2008 14:48:04 +0000 (14:48 +0000)]
De-comment code (duplicate the entry when the _R function is not present on the system).

16 years ago* src/lastlog.c: Remove statbuf, not used.
nekral-guest [Tue, 1 Jan 2008 14:38:47 +0000 (14:38 +0000)]
* src/lastlog.c: Remove statbuf, not used.
* src/lastlog.c: Fix types, cast umin and umax to uid_t.
* src/lastlog.c: (option -u) user needs to be a signed long, not
  uid_t (to accept rangees like -<uid>

16 years agoAvoid ?: construct without the middle term.
nekral-guest [Tue, 1 Jan 2008 14:34:07 +0000 (14:34 +0000)]
Avoid ?: construct without the middle term.

16 years agoForgot to commit that one.
nekral-guest [Tue, 1 Jan 2008 14:32:41 +0000 (14:32 +0000)]
Forgot to commit that one.
Avoid empty file when USE_PAM is set.

16 years ago* libmisc/copydir.c, src/usermod.c, lib/prototypes.h: The uid and
nekral-guest [Tue, 1 Jan 2008 14:31:00 +0000 (14:31 +0000)]
* libmisc/copydir.c, src/usermod.c, lib/prototypes.h: The uid and
  gid parameters can be set to -1 to indicate that the original
  owners must be kept. Change the types from uid_t/gid_t to a
  long int (signed).
* libmisc/copydir.c: Change the copy_entry(), copy_dir(),
  copy_symlink(), copy_special(), and copy_file() prototypes
  accordingly.
* lib/prototypes.h: Add the parameters' name for the
  libmisc/copydir.c functions.

16 years agoAvoid empty file when WITH_AUDIT is not set.
nekral-guest [Tue, 1 Jan 2008 14:20:36 +0000 (14:20 +0000)]
Avoid empty file when WITH_AUDIT is not set.

16 years ago* libmisc/limits.c, libmisc/obscure.c, src/login_nopam.c,
nekral-guest [Tue, 1 Jan 2008 14:18:55 +0000 (14:18 +0000)]
* libmisc/limits.c, libmisc/obscure.c, src/login_nopam.c,
  lib/pwauth.c: Avoid empty file when USE_PAM is set.
* src/login_nopam.c: Fix warnings: resolve_hostname takes and
  returns a constant string.

16 years agoRemove inaccurate documentation.
nekral-guest [Tue, 1 Jan 2008 14:12:34 +0000 (14:12 +0000)]
Remove inaccurate documentation.
The password file is no more opened in read only mode.

16 years agoAdd missing prototype declarations.
nekral-guest [Tue, 1 Jan 2008 14:10:21 +0000 (14:10 +0000)]
Add missing prototype declarations.
Document the new functions.

16 years agoI forgot to mention compare_members_lists().
nekral-guest [Tue, 1 Jan 2008 14:09:47 +0000 (14:09 +0000)]
I forgot to mention compare_members_lists().

16 years agoSplit check_members() out of check_grp_file() and check_sgr_file().
nekral-guest [Tue, 1 Jan 2008 13:50:06 +0000 (13:50 +0000)]
Split check_members() out of check_grp_file() and check_sgr_file().

16 years agoSplit check_grp_file() and check_sgr_file() out of main().
nekral-guest [Tue, 1 Jan 2008 13:48:49 +0000 (13:48 +0000)]
Split check_grp_file() and check_sgr_file() out of main().

16 years agoSplit process_flags(), open_files(), and close_files() out of main(). New
nekral-guest [Tue, 1 Jan 2008 13:13:47 +0000 (13:13 +0000)]
Split process_flags(), open_files(), and close_files() out of main(). New
global variables is_shadow, sort_mode, use_system_grp_file, and
use_system_sgr_file.

16 years agoIf remove-potcdate.sin does not exist, use the one from teh po directory
nekral-guest [Mon, 31 Dec 2007 20:16:46 +0000 (20:16 +0000)]
If remove-potcdate.sin does not exist, use the one from teh po directory
(it is not installed automatically by autopoint.

16 years agoCompilation fix. pamh needs to be global since the split of check_perms().
nekral-guest [Mon, 31 Dec 2007 20:15:15 +0000 (20:15 +0000)]
Compilation fix. pamh needs to be global since the split of check_perms().

16 years agoCompilation fix. user was removed from the list of global variables.
nekral-guest [Mon, 31 Dec 2007 20:14:31 +0000 (20:14 +0000)]
Compilation fix. user was removed from the list of global variables.

16 years agoFix the type of the bitfields in the commonio_entry and commonio_db
nekral-guest [Mon, 31 Dec 2007 20:12:48 +0000 (20:12 +0000)]
Fix the type of the bitfields in the commonio_entry and commonio_db
structures to unsigned int (instead of int).

16 years agoRe-indent.
nekral-guest [Mon, 31 Dec 2007 15:34:29 +0000 (15:34 +0000)]
Re-indent.

16 years agoRe-indent.
nekral-guest [Mon, 31 Dec 2007 15:32:15 +0000 (15:32 +0000)]
Re-indent.

16 years agoAvoid assignments in comparisons.
nekral-guest [Mon, 31 Dec 2007 15:30:29 +0000 (15:30 +0000)]
Avoid assignments in comparisons.

16 years agoAvoid implicit brackets.
nekral-guest [Mon, 31 Dec 2007 15:27:23 +0000 (15:27 +0000)]
Avoid implicit brackets.

16 years ago(compil fix) Use pw->pw_name instead of user.
nekral-guest [Mon, 31 Dec 2007 15:13:39 +0000 (15:13 +0000)]
(compil fix) Use pw->pw_name instead of user.

16 years agosflg needs to be global.
nekral-guest [Mon, 31 Dec 2007 15:07:59 +0000 (15:07 +0000)]
sflg needs to be global.

16 years agoAlso split update_shell() out of main().
nekral-guest [Mon, 31 Dec 2007 15:06:22 +0000 (15:06 +0000)]
Also split update_shell() out of main().

16 years ago* Split also check_perms() out of main().
nekral-guest [Mon, 31 Dec 2007 14:54:46 +0000 (14:54 +0000)]
* Split also check_perms() out of main().
* Before pam_end(), the return value of the previous
  pam API was already checked. No need to validate it again.

16 years agoSplit process_flags() out of main().
nekral-guest [Mon, 31 Dec 2007 14:52:52 +0000 (14:52 +0000)]
Split process_flags() out of main().

16 years agoAvoid assignments in comparisons.
nekral-guest [Mon, 31 Dec 2007 14:37:24 +0000 (14:37 +0000)]
Avoid assignments in comparisons.

16 years agoAvoid assignments in comparisons.
nekral-guest [Mon, 31 Dec 2007 14:25:06 +0000 (14:25 +0000)]
Avoid assignments in comparisons.

16 years agoAvoid implicit conversions to booleans.
nekral-guest [Mon, 31 Dec 2007 14:15:29 +0000 (14:15 +0000)]
Avoid implicit conversions to booleans.

16 years agoDocument may_change_field().
nekral-guest [Mon, 31 Dec 2007 14:03:14 +0000 (14:03 +0000)]
Document may_change_field().

16 years agoAvoid implicit brackets.
nekral-guest [Mon, 31 Dec 2007 13:48:48 +0000 (13:48 +0000)]
Avoid implicit brackets.

16 years ago* New function: process_flags() split out of main().
nekral-guest [Mon, 31 Dec 2007 13:43:04 +0000 (13:43 +0000)]
* New function: process_flags() split out of main().
  The flags variables are now global.
* New functions: check_perms(), update_gecos(),
  get_old_fields(), and check_fields() split out of main().
* Before pam_end(), the return value of the previous
  pam API was already checked. No need to validate it again.

16 years ago* src/newusers.c: Compilation fix for PAM support (pamh needs to be
nekral-guest [Mon, 31 Dec 2007 04:57:54 +0000 (04:57 +0000)]
* src/newusers.c: Compilation fix for PAM support (pamh needs to be
  global since the function split).
* src/chpasswd.c: Likewise.
* src/chgpasswd.c: Likewise.
* src/chpasswd.c: Avoid implicit conversions to booleans.

16 years agoSort the tools in the NEWS entries of 4.1.1.
nekral-guest [Mon, 31 Dec 2007 04:34:10 +0000 (04:34 +0000)]
Sort the tools in the NEWS entries of 4.1.1.

16 years agoRewrote to match the previous commit message.
nekral-guest [Mon, 31 Dec 2007 04:31:28 +0000 (04:31 +0000)]
Rewrote to match the previous commit message.

16 years ago * src/chage.c: Fix typo: s/maximim/maximum/
nekral-guest [Mon, 31 Dec 2007 04:29:30 +0000 (04:29 +0000)]
* src/chage.c: Fix typo: s/maximim/maximum/
* src/chage.c: New function: fail_exit(). Change most of the exit()
to a fail_exit, which makes sure the files are unlocked (new global
variables: pw_locked, spw_locked), the PAM transaction is ended, and
the failure is logged to libaudit (use a global user_name and user_uid
for logging).
* src/chage.c: Compilation fix for PAM support (pamh needs to be
global since the function split).
* src/chage.c: Document process_flags(), check_flags(), check_perms(),
open_files(), and close_files().
* src/chage.c: Split update_age() and get_defaults() out of main()
* src/chage.c: Drop the privileges just after opening the files.
* src/chage.c: Do not log to audit only if the user has an entry in
the shadow file.
* NEWS, src/chage.c (open_files): Also open the password file for
writing. This fix chage when the user only has a password entry (and
no shadow entries).
* src/chage.c (get_defaults): Use default values that don't change the
behavior of the account for the fields that are not specified when the
user has no shadow entry.

16 years ago* Compilation fix for PAM support (pamh needs to be
nekral-guest [Sun, 30 Dec 2007 21:48:55 +0000 (21:48 +0000)]
* Compilation fix for PAM support (pamh needs to be
  global since the function split).
* End the PAM transaction in fail_exit().
* Document check_flags().

16 years agoCompilation fix for non-gshadow support.
nekral-guest [Sun, 30 Dec 2007 21:39:57 +0000 (21:39 +0000)]
Compilation fix for non-gshadow support.

16 years agoI forgot to open and close gshadow.
nekral-guest [Sat, 29 Dec 2007 17:34:02 +0000 (17:34 +0000)]
I forgot to open and close gshadow.

16 years agoAdded support for gshadow.
nekral-guest [Sat, 29 Dec 2007 17:26:28 +0000 (17:26 +0000)]
Added support for gshadow.

16 years agoDo not add the new user to the group's members, because the group is already
nekral-guest [Sat, 29 Dec 2007 17:05:13 +0000 (17:05 +0000)]
Do not add the new user to the group's members, because the group is already
the primary group of the new user.

16 years agoAvoid variables with the name of a type.
nekral-guest [Sat, 29 Dec 2007 14:52:35 +0000 (14:52 +0000)]
Avoid variables with the name of a type.

16 years agoAvoid assignments in comparisons.
nekral-guest [Sat, 29 Dec 2007 14:48:33 +0000 (14:48 +0000)]
Avoid assignments in comparisons.

16 years agoAvoid implicit brackets and re-indent.
nekral-guest [Sat, 29 Dec 2007 14:34:39 +0000 (14:34 +0000)]
Avoid implicit brackets and re-indent.

16 years agoBefore pam_end(), the return value of the previous
nekral-guest [Sat, 29 Dec 2007 14:17:06 +0000 (14:17 +0000)]
Before pam_end(), the return value of the previous
pam API was already checked. No need to validate it again.

16 years agonewusers cleanups
nekral-guest [Sat, 29 Dec 2007 14:11:54 +0000 (14:11 +0000)]
newusers cleanups
main() split in new functions: process_flags(), check_flags(), check_perms(),
open_files(), and close_files().

16 years agoAvoid assignments in comparisons.
nekral-guest [Sat, 29 Dec 2007 11:34:31 +0000 (11:34 +0000)]
Avoid assignments in comparisons.

16 years agoRe-indent.
nekral-guest [Sat, 29 Dec 2007 11:19:39 +0000 (11:19 +0000)]
Re-indent.

16 years ago * Avoid implicit brackets.
nekral-guest [Sat, 29 Dec 2007 11:06:35 +0000 (11:06 +0000)]
 * Avoid implicit brackets.
 * Avoid implicit conversion to booleans.

16 years agoRemove dead code. It was probably put here to add more
nekral-guest [Sat, 29 Dec 2007 10:50:03 +0000 (10:50 +0000)]
Remove dead code. It was probably put here to add more
information to the audit_logger.

16 years agoAvoid using a variable with the same name as a type.
nekral-guest [Sat, 29 Dec 2007 10:47:04 +0000 (10:47 +0000)]
Avoid using a variable with the same name as a type.

16 years agochage cleanups
nekral-guest [Sat, 29 Dec 2007 10:42:25 +0000 (10:42 +0000)]
chage cleanups
* src/chage.c: Before pam_end(), the return value of the previous
pam API was already checked. No need to validate it again.
* src/chage.c: main() split in new functions: process_flags(),
check_flags(), check_perms(), open_files(), and close_files().

16 years ago * src/chgpasswd.c: Avoid assignments in comparisons.
nekral-guest [Fri, 28 Dec 2007 23:14:59 +0000 (23:14 +0000)]
* src/chgpasswd.c: Avoid assignments in comparisons.
* src/chgpasswd.c: Avoid implicit brackets.
* src/chgpasswd.c: Fix comments to match chgpasswd (group instead of
user's passwords are changed).

Fix the previous ChangeLog entries regarding chgpasswd.

16 years agoSame changes as for chpasswd:
nekral-guest [Fri, 28 Dec 2007 22:59:17 +0000 (22:59 +0000)]
Same changes as for chpasswd:
* src/chpasswd.c: main() split in process_flags(), check_flags(),
check_perms(), open_files(), and close_files().

16 years agoSame changes as for chpasswd:
nekral-guest [Fri, 28 Dec 2007 22:54:35 +0000 (22:54 +0000)]
Same changes as for chpasswd:
* src/chpasswd.c: main() split in process_flags(), check_flags(),
check_perms(), open_files(), and close_files().

16 years agoAvoid implicit brackets.
nekral-guest [Fri, 28 Dec 2007 22:34:14 +0000 (22:34 +0000)]
Avoid implicit brackets.

16 years agoRe-indent.
nekral-guest [Fri, 28 Dec 2007 22:31:45 +0000 (22:31 +0000)]
Re-indent.

16 years agoRe-indent.
nekral-guest [Fri, 28 Dec 2007 22:30:02 +0000 (22:30 +0000)]
Re-indent.

16 years agoAvoid assignments in comparisons.
nekral-guest [Fri, 28 Dec 2007 22:24:02 +0000 (22:24 +0000)]
Avoid assignments in comparisons.

16 years agoOther new functions: open_files(), close_files().
nekral-guest [Fri, 28 Dec 2007 22:18:55 +0000 (22:18 +0000)]
Other new functions: open_files(), close_files().
This force flushing the password database after the password file is unlocked.

16 years agoNew functions: process_flags(), check_flags(),
nekral-guest [Fri, 28 Dec 2007 22:05:51 +0000 (22:05 +0000)]
New functions: process_flags(), check_flags(),
check_perms(). Split out of main().

16 years agoBefore pam_end(), the return value of the previous
nekral-guest [Fri, 28 Dec 2007 21:29:06 +0000 (21:29 +0000)]
Before pam_end(), the return value of the previous
pam API was already checked. No need to validate it again.

16 years agoNew function check_flags(). Split the validation of
nekral-guest [Fri, 28 Dec 2007 21:04:04 +0000 (21:04 +0000)]
New function check_flags(). Split the validation of
options and arguments out of process_flags.

16 years ago(main, check_perms): New function check_perms().
nekral-guest [Fri, 28 Dec 2007 20:46:24 +0000 (20:46 +0000)]
(main, check_perms): New function check_perms().
Split the validation of the user's permissions out of main()

16 years ago(main): Before pam_end(), the return value of the previous pam API was already
nekral-guest [Fri, 28 Dec 2007 20:40:59 +0000 (20:40 +0000)]
(main): Before pam_end(), the return value of the previous pam API was already
checked. No need to validate it again.

16 years agoRe-indent.
nekral-guest [Fri, 28 Dec 2007 20:35:05 +0000 (20:35 +0000)]
Re-indent.

16 years ago(process_flags): prefer fail_exit to exit. This avoid
nekral-guest [Fri, 28 Dec 2007 19:15:14 +0000 (19:15 +0000)]
(process_flags): prefer fail_exit to exit. This avoid
an explicit call to audit_logger().

16 years agoI forgot the initialization of group_id in find_new_gid().
nekral-guest [Fri, 28 Dec 2007 19:08:33 +0000 (19:08 +0000)]
I forgot the initialization of group_id in find_new_gid().

16 years ago * process_args renamed process_flags
nekral-guest [Fri, 28 Dec 2007 11:22:27 +0000 (11:22 +0000)]
 * process_args renamed process_flags
 * Add the options checks in process_flags (group_name, group ID uniqueness)
 * Add the parameters' names in the prototypes.

16 years agoSplit the processing of options out of main().
nekral-guest [Fri, 28 Dec 2007 10:41:22 +0000 (10:41 +0000)]
Split the processing of options out of main().

16 years agofind_new_gid is never called when an
nekral-guest [Fri, 28 Dec 2007 10:30:39 +0000 (10:30 +0000)]
find_new_gid is never called when an
GID is specified with -g. Simplify find_new_gid accordingly.

16 years agotypo cleared/clearer
nekral-guest [Fri, 28 Dec 2007 10:20:02 +0000 (10:20 +0000)]
typo cleared/clearer

16 years ago(find_new_gid): If oflg is set, gflg is also set.
nekral-guest [Fri, 28 Dec 2007 10:19:21 +0000 (10:19 +0000)]
(find_new_gid): If oflg is set, gflg is also set.
Use (!gflg), which is cleared than (!gflg || !oflg).

16 years agoA group with the specified name cannot exist at that time in find_new_gid.
nekral-guest [Fri, 28 Dec 2007 10:15:42 +0000 (10:15 +0000)]
A group with the specified name cannot exist at that time in find_new_gid.
Remove the check.

16 years agoAvoid implict brackets.
nekral-guest [Fri, 28 Dec 2007 10:12:09 +0000 (10:12 +0000)]
Avoid implict brackets.

16 years agoWhen compiled without AUDIT support, if the return code was E_SUCCESS,
nekral-guest [Fri, 28 Dec 2007 09:39:22 +0000 (09:39 +0000)]
When compiled without AUDIT support, if the return code was E_SUCCESS,
fail_exit() wouldn't have exited. Fix the scope of #idef WITH_AUDIT.

16 years agoDocument the new functions.
nekral-guest [Fri, 28 Dec 2007 00:35:41 +0000 (00:35 +0000)]
Document the new functions.

16 years agoOther cleanups and documentation.
nekral-guest [Fri, 28 Dec 2007 00:23:33 +0000 (00:23 +0000)]
Other cleanups and documentation.
Do the checks, then build the filenames. Do not mix both.

16 years agoStop at the first error.
nekral-guest [Fri, 28 Dec 2007 00:08:16 +0000 (00:08 +0000)]
Stop at the first error.

16 years agoAvoid assignement in comparison.
nekral-guest [Fri, 28 Dec 2007 00:04:46 +0000 (00:04 +0000)]
Avoid assignement in comparison.

16 years agoAvoid implicit conversions to booleans.
nekral-guest [Fri, 28 Dec 2007 00:03:26 +0000 (00:03 +0000)]
Avoid implicit conversions to booleans.

16 years agoAvoid implicit casts.
nekral-guest [Thu, 27 Dec 2007 23:41:36 +0000 (23:41 +0000)]
Avoid implicit casts.

16 years agoAvoid implicit brackets.
nekral-guest [Thu, 27 Dec 2007 23:40:00 +0000 (23:40 +0000)]
Avoid implicit brackets.

16 years agoDocument selinux_file_context.
nekral-guest [Thu, 27 Dec 2007 23:32:47 +0000 (23:32 +0000)]
Document selinux_file_context.

16 years agoAvoid assignment in comparisons.
nekral-guest [Thu, 27 Dec 2007 23:30:36 +0000 (23:30 +0000)]
Avoid assignment in comparisons.

16 years agolibmisc/copydir.c cleanup
nekral-guest [Thu, 27 Dec 2007 23:23:51 +0000 (23:23 +0000)]
libmisc/copydir.c cleanup
* libmisc/copydir.c: Split copy_tree() in more maintainable functions:
copy_entry(), copy_dir(), copy_symlink(), copy_hardlink(),
copy_special(), and copy_file().
* libmisc/copydir.c: -1 is used to indicate an error, directly set err
to -1, instead of incrementing it, and checking if not nul at the
end.

16 years agoAvoid implicit conversions to booleans.
nekral-guest [Thu, 27 Dec 2007 21:56:45 +0000 (21:56 +0000)]
Avoid implicit conversions to booleans.

16 years agoAvoid assignment in comparisons.
nekral-guest [Thu, 27 Dec 2007 21:43:29 +0000 (21:43 +0000)]
Avoid assignment in comparisons.

16 years agoDocument check_list's return value.
nekral-guest [Thu, 27 Dec 2007 21:30:12 +0000 (21:30 +0000)]
Document check_list's return value.

16 years agoAvoid implicit brackets.
nekral-guest [Thu, 27 Dec 2007 21:28:50 +0000 (21:28 +0000)]
Avoid implicit brackets.

16 years agoSimplify gpasswd's main():
nekral-guest [Thu, 27 Dec 2007 21:19:57 +0000 (21:19 +0000)]
Simplify gpasswd's main():
Also split check_flags() out of main().

16 years agoSimplify gpasswd's main():
nekral-guest [Thu, 27 Dec 2007 21:04:22 +0000 (21:04 +0000)]
Simplify gpasswd's main():
Split also get_group() and change_passwd() out of main().

16 years agoSimplify gpasswd's main():
nekral-guest [Thu, 27 Dec 2007 19:08:31 +0000 (19:08 +0000)]
Simplify gpasswd's main():
New function: check_perms(). Split out of main() to simplify main().

16 years agoSimplify gpasswd's main():
nekral-guest [Thu, 27 Dec 2007 18:52:40 +0000 (18:52 +0000)]
Simplify gpasswd's main():
New functions: open_files(), close_files(), update_group(). Split out
from main() to simplify this (too) big function.

16 years agoSimplify gpasswd's main():
nekral-guest [Thu, 27 Dec 2007 18:27:57 +0000 (18:27 +0000)]
Simplify gpasswd's main():
New function: process_flags(). Split the processing of options out of main().

16 years agogpasswd cleanup
nekral-guest [Thu, 27 Dec 2007 17:36:08 +0000 (17:36 +0000)]
gpasswd cleanup
* src/gpasswd.c: Add argument name to the internal function
prototypes.
* src/gpasswd.c: Document global variables.