* 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).
This commit is contained in:
nekral-guest 2008-08-22 02:29:31 +00:00
parent cfeacc4d67
commit c9119dc6bb
2 changed files with 24 additions and 12 deletions

View File

@ -1,3 +1,9 @@
2008-08-20 Nicolas François <nicolas.francois@centraliens.net>
* 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 <nicolas.francois@centraliens.net>
* NEWS, src/gpasswd.c: Use getopt_long instead of getopt. Added

View File

@ -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 ();