[Pkg-shadow-commits] r3103 - in upstream/trunk: . src

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Thu Mar 11 22:03:47 UTC 2010


Author: nekral-guest
Date: 2010-03-11 22:03:45 +0000 (Thu, 11 Mar 2010)
New Revision: 3103

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/useradd.c
Log:
	* 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.

Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2010-03-11 22:03:37 UTC (rev 3102)
+++ upstream/trunk/ChangeLog	2010-03-11 22:03:45 UTC (rev 3103)
@@ -1,5 +1,13 @@
 2010-03-11  Nicolas François  <nicolas.francois at 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 at centraliens.net>
+
 	* src/vipw.c: Document the sections closed by #endif
 	* src/vipw.c: Avoid implicit conversion of pointers or integers to
 	booleans.

Modified: upstream/trunk/src/useradd.c
===================================================================
--- upstream/trunk/src/useradd.c	2010-03-11 22:03:37 UTC (rev 3102)
+++ upstream/trunk/src/useradd.c	2010-03-11 22:03:45 UTC (rev 3103)
@@ -1471,20 +1471,21 @@
 
 static void open_shadow (void)
 {
-	if (!is_shadow_pwd)
+	if (!is_shadow_pwd) {
 		return;
-	if (!spw_lock ()) {
-		fprintf(stderr,
-			_("%s: cannot lock shadow password file\n"),
-			Prog);
-		fail_exit(E_PW_UPDATE);
 	}
+	if (spw_lock () == 0) {
+		fprintf (stderr,
+		         _("%s: cannot lock %s; try again later.\n"),
+		         Prog, spw_dbname ());
+		fail_exit (E_PW_UPDATE);
+	}
 	spw_locked = true;
-	if (!spw_open (O_RDWR)) {
-		fprintf(stderr,
-			_("%s: cannot open shadow password file\n"),
-			Prog);
-		fail_exit(E_PW_UPDATE);
+	if (spw_open (O_RDWR) == 0) {
+		fprintf (stderr,
+		         _("%s: cannot open %s\n"),
+		         Prog, spw_dbname ());
+		fail_exit (E_PW_UPDATE);
 	}
 }
 
@@ -2002,7 +2003,7 @@
 
 #ifdef WITH_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);
 			fail_exit (E_UID_IN_USE);
 		}




More information about the Pkg-shadow-commits mailing list