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

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sat Aug 30 18:28:00 UTC 2008


Author: nekral-guest
Date: 2008-08-30 18:27:59 +0000 (Sat, 30 Aug 2008)
New Revision: 2289

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/chpasswd.c
   upstream/trunk/src/useradd.c
   upstream/trunk/src/userdel.c
   upstream/trunk/src/usermod.c
Log:
	* src/useradd.c: Harmonize some error messages.
	* src/userdel.c: Add log to syslog when the mail file could not be
	removed.
	* src/userdel.c: Give more context an error message (merge with
	perror()).
	* src/usermod.c: Harmonize some error messages.

Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-08-30 18:27:34 UTC (rev 2288)
+++ upstream/trunk/ChangeLog	2008-08-30 18:27:59 UTC (rev 2289)
@@ -1,5 +1,14 @@
 2008-08-25  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/useradd.c: Harmonize some error messages.
+	* src/userdel.c: Add log to syslog when the mail file could not be
+	removed.
+	* src/userdel.c: Give more context an error message (merge with
+	perror()).
+	* src/usermod.c: Harmonize some error messages.
+
+2008-08-25  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/groupmems.c: Check the return value of gr_update().
 	* src/chage.c, src/chfn.c, src/chgpasswd.c, src/chpasswd.c,
 	src/chsh.c, src/gpasswd.c, src/groupadd.c, src/groupmems.c,

Modified: upstream/trunk/src/chpasswd.c
===================================================================
--- upstream/trunk/src/chpasswd.c	2008-08-30 18:27:34 UTC (rev 2288)
+++ upstream/trunk/src/chpasswd.c	2008-08-30 18:27:59 UTC (rev 2289)
@@ -481,16 +481,16 @@
 		if (NULL != sp) {
 			if (spw_update (&newsp) == 0) {
 				fprintf (stderr,
-				         _("%s: line %d: failed to prepare the new %s entry\n"),
-				         Prog, line, spw_dbname ());
+				         _("%s: line %d: failed to prepare the new %s entry '%s'\n"),
+				         Prog, line, spw_dbname (), newsp.sp_namp);
 				errors++;
 				continue;
 			}
 		} else {
-			if (pw_update (&newsp) == 0) {
+			if (pw_update (&newpw) == 0) {
 				fprintf (stderr,
-				         _("%s: line %d: failed to prepare the new %s entry\n"),
-				         Prog, line, pw_dbname ());
+				         _("%s: line %d: failed to prepare the new %s entry '%s'\n"),
+				         Prog, line, pw_dbname (), newpw.pw_name);
 				errors++;
 				continue;
 			}

Modified: upstream/trunk/src/useradd.c
===================================================================
--- upstream/trunk/src/useradd.c	2008-08-30 18:27:34 UTC (rev 2288)
+++ upstream/trunk/src/useradd.c	2008-08-30 18:27:59 UTC (rev 2289)
@@ -832,8 +832,8 @@
 		ngrp = __gr_dup (grp);
 		if (NULL == ngrp) {
 			fprintf (stderr,
-				 _("%s: Out of memory. Cannot update the group database.\n"),
-				 Prog);
+			         _("%s: Out of memory. Cannot update %s.\n"),
+			         Prog, gr_dbname ());
 			fail_exit (E_GRP_UPDATE);	/* XXX */
 		}
 
@@ -1041,8 +1041,7 @@
 				grp = getgr_nam_gid (optarg);
 				if (NULL == grp) {
 					fprintf (stderr,
-						 _
-						 ("%s: unknown group %s\n"),
+					         _("%s: group '%s' does not exist\n"),
 						 Prog, optarg);
 					exit (E_NOTFOUND);
 				}

Modified: upstream/trunk/src/userdel.c
===================================================================
--- upstream/trunk/src/userdel.c	2008-08-30 18:27:34 UTC (rev 2288)
+++ upstream/trunk/src/userdel.c	2008-08-30 18:27:59 UTC (rev 2289)
@@ -708,17 +708,20 @@
 		fprintf (stderr,
 		         _("%s: %s not owned by %s, not removing\n"),
 		         Prog, mailfile, user_name);
+		SYSLOG ((LOG_ERR, "%s not owned by %s, not removed", mailfile, strerror (errno)));
 #ifdef WITH_AUDIT
 		audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
 		              "deleting mail file",
 		              user_name, (unsigned int) user_id, 0);
 #endif
 		return;
-	} else if (i == -1)
+	} else if (i == -1) {
 		return;		/* mailbox doesn't exist */
+	}
 	if (unlink (mailfile) != 0) {
-		fprintf (stderr, _("%s: warning: can't remove "), Prog);
-		perror (mailfile);
+		fprintf (stderr, _("%s: warning: can't remove %s: %s"), Prog, mailfile, strerror (errno));
+		SYSLOG ((LOG_ERR, "Cannot remove %s: %s", mailfile, strerror (errno)));
+		/* continue */
 	}
 #ifdef WITH_AUDIT
 	else {

Modified: upstream/trunk/src/usermod.c
===================================================================
--- upstream/trunk/src/usermod.c	2008-08-30 18:27:34 UTC (rev 2288)
+++ upstream/trunk/src/usermod.c	2008-08-30 18:27:59 UTC (rev 2289)
@@ -250,8 +250,8 @@
 		 * string name.
 		 */
 		if (NULL == grp) {
-			fprintf (stderr, _("%s: unknown group %s\n"),
-				 Prog, list);
+			fprintf (stderr, _("%s: group '%s' does not exist\n"),
+			         Prog, list);
 			errors++;
 		}
 		list = cp;
@@ -954,7 +954,7 @@
 				grp = getgr_nam_gid (optarg);
 				if (NULL == grp) {
 					fprintf (stderr,
-						 _("%s: unknown group %s\n"),
+						 _("%s: group '%s' does not exist\n"),
 						 Prog, optarg);
 					exit (E_NOTFOUND);
 				}




More information about the Pkg-shadow-commits mailing list