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

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Thu Aug 7 08:02:53 UTC 2008


Author: nekral-guest
Date: 2008-08-07 08:02:52 +0000 (Thu, 07 Aug 2008)
New Revision: 2247

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/chage.c
Log:
	* src/chage.c: Report failure to unlock the passwd or shadow file
	to stderr and syslog.

Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-08-07 08:02:34 UTC (rev 2246)
+++ upstream/trunk/ChangeLog	2008-08-07 08:02:52 UTC (rev 2247)
@@ -1,5 +1,10 @@
 2008-08-06  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/chage.c: Report failure to unlock the passwd or shadow file
+	to stderr and syslog.
+
+2008-08-06  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/pwconv.c: Report failure to unlock the passwd or shadow file
 	to stderr and syslog.
 	* src/pwconv.c: Report failure to chmod the backup file.

Modified: upstream/trunk/src/chage.c
===================================================================
--- upstream/trunk/src/chage.c	2008-08-07 08:02:34 UTC (rev 2246)
+++ upstream/trunk/src/chage.c	2008-08-07 08:02:52 UTC (rev 2247)
@@ -109,10 +109,18 @@
 static void fail_exit (int code)
 {
 	if (spw_locked) {
-		spw_unlock ();
+		if (spw_unlock () == 0) {
+			fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
+			SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+			/* continue */
+		}
 	}
 	if (pw_locked) {
-		pw_unlock ();
+		if (pw_unlock () == 0) {
+			fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
+			SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+			/* continue */
+		}
 	}
 	closelog ();
 
@@ -616,9 +624,17 @@
 		SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
 		fail_exit (E_NOPERM);
 	}
-	spw_unlock ();
+	if (spw_unlock () == 0) {
+		fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
+		SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+		/* continue */
+	}
 	spw_locked = false;
-	pw_unlock ();
+	if (pw_unlock () == 0) {
+		fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
+		SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+		/* continue */
+	}
 	pw_locked = false;
 }
 




More information about the Pkg-shadow-commits mailing list