diff --git a/ChangeLog b/ChangeLog index 60d61100..84946d8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-20 Nicolas François + + * src/newusers.c: Open syslog with the right identification name. + * src/newusers.c: Mark the files as locked only if they are really + locked (i.e. if shadow is not enabled, the files are not locked). + 2008-08-20 Nicolas François * NEWS, src/gpasswd.c: Use getopt_long instead of getopt. Added diff --git a/src/newusers.c b/src/newusers.c index 7e320261..64ca9950 100644 --- a/src/newusers.c +++ b/src/newusers.c @@ -614,13 +614,15 @@ static void open_files (void) fail_exit (1); } pw_locked = true; - if (is_shadow && (spw_lock () == 0)) { - fprintf (stderr, - _("%s: cannot lock %s; try again later.\n"), - Prog, spw_dbname ()); - fail_exit (1); + if (is_shadow) { + if (spw_lock () == 0) { + fprintf (stderr, + _("%s: cannot lock %s; try again later.\n"), + Prog, spw_dbname ()); + fail_exit (1); + } + spw_locked = true; } - spw_locked = true; if (gr_lock () == 0) { fprintf (stderr, _("%s: cannot lock %s; try again later.\n"), @@ -629,13 +631,15 @@ static void open_files (void) } gr_locked = true; #ifdef SHADOWGRP - if (is_shadow_grp && (sgr_lock () == 0)) { - fprintf (stderr, - _("%s: cannot lock %s; try again later.\n"), - Prog, sgr_dbname ()); - fail_exit (1); + if (is_shadow_grp) { + if (sgr_lock () == 0) { + fprintf (stderr, + _("%s: cannot lock %s; try again later.\n"), + Prog, sgr_dbname ()); + fail_exit (1); + } + sgr_locked = true; } - sgr_locked = true; #endif if (pw_open (O_RDWR) == 0) { @@ -749,6 +753,8 @@ int main (int argc, char **argv) (void) bindtextdomain (PACKAGE, LOCALEDIR); (void) textdomain (PACKAGE); + OPENLOG ("newusers"); + process_flags (argc, argv); check_perms ();