* src/useradd.c: Re-indent.

* src/useradd.c: Added brackets.
	* src/useradd.c: Avoid implicit conversion of integers to
	booleans.
	* src/useradd.c: Harmonize error messages.
This commit is contained in:
nekral-guest 2010-03-11 22:03:45 +00:00
parent e7d57e1a77
commit ad6730687f
2 changed files with 21 additions and 12 deletions

View File

@ -1,3 +1,11 @@
2010-03-11 Nicolas François <nicolas.francois@centraliens.net>
* src/useradd.c: Re-indent.
* src/useradd.c: Added brackets.
* src/useradd.c: Avoid implicit conversion of integers to
booleans.
* src/useradd.c: Harmonize error messages.
2010-03-11 Nicolas François <nicolas.francois@centraliens.net> 2010-03-11 Nicolas François <nicolas.francois@centraliens.net>
* src/vipw.c: Document the sections closed by #endif * src/vipw.c: Document the sections closed by #endif

View File

@ -1471,20 +1471,21 @@ static void open_files (void)
static void open_shadow (void) static void open_shadow (void)
{ {
if (!is_shadow_pwd) if (!is_shadow_pwd) {
return; return;
if (!spw_lock ()) { }
fprintf(stderr, if (spw_lock () == 0) {
_("%s: cannot lock shadow password file\n"), fprintf (stderr,
Prog); _("%s: cannot lock %s; try again later.\n"),
fail_exit(E_PW_UPDATE); Prog, spw_dbname ());
fail_exit (E_PW_UPDATE);
} }
spw_locked = true; spw_locked = true;
if (!spw_open (O_RDWR)) { if (spw_open (O_RDWR) == 0) {
fprintf(stderr, fprintf (stderr,
_("%s: cannot open shadow password file\n"), _("%s: cannot open %s\n"),
Prog); Prog, spw_dbname ());
fail_exit(E_PW_UPDATE); fail_exit (E_PW_UPDATE);
} }
} }
@ -2002,7 +2003,7 @@ int main (int argc, char **argv)
#ifdef WITH_TCB #ifdef WITH_TCB
if (getdef_bool("USE_TCB")) { if (getdef_bool("USE_TCB")) {
if (!shadowtcb_create(user_name, user_id)) { if (shadowtcb_create(user_name, user_id) == 0) {
fprintf(stderr, "Failed to create tcb directory for %s\n", user_name); fprintf(stderr, "Failed to create tcb directory for %s\n", user_name);
fail_exit (E_UID_IN_USE); fail_exit (E_UID_IN_USE);
} }