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

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Sun Sep 18 17:34:21 UTC 2011


Author: nekral-guest
Date: 2011-09-18 17:34:21 +0000 (Sun, 18 Sep 2011)
New Revision: 3484

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/usermod.c
Log:
	* src/usermod.c: date_to_str() is always called with negativ set
	to "never", remove this argument.
	* src/usermod.c: Added missing cast for gr_free argument.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2011-09-18 17:32:04 UTC (rev 3483)
+++ upstream/trunk/ChangeLog	2011-09-18 17:34:21 UTC (rev 3484)
@@ -1,5 +1,11 @@
 2011-09-18  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/usermod.c: date_to_str() is always called with negativ set
+	to "never", remove this argument.
+	* src/usermod.c: Added missing cast for gr_free argument.
+
+2011-09-18  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/pwconv.c: Fail if not called correctly.
 	* src/pwconv.c: At the end of main, the passwd and shadow files
 	are locked. No need to check before unlocking.

Modified: upstream/trunk/src/usermod.c
===================================================================
--- upstream/trunk/src/usermod.c	2011-09-18 17:32:04 UTC (rev 3483)
+++ upstream/trunk/src/usermod.c	2011-09-18 17:34:21 UTC (rev 3484)
@@ -150,7 +150,7 @@
 
 /* local function prototypes */
 static void date_to_str (/*@unique@*//*@out@*/char *buf, size_t maxsize,
-                         long int date, const char *negativ);
+                         long int date);
 static int get_groups (char *);
 static /*@noreturn@*/void usage (int status);
 static void new_pwent (struct passwd *);
@@ -180,12 +180,12 @@
 #endif
 
 static void date_to_str (/*@unique@*//*@out@*/char *buf, size_t maxsize,
-                         long int date, const char *negativ)
+                         long int date)
 {
 	struct tm *tp;
 
-	if ((negativ != NULL) && (date < 0)) {
-		strncpy (buf, negativ, maxsize);
+	if (date < 0) {
+		strncpy (buf, "never", maxsize);
 	} else {
 		time_t t = (time_t) date;
 		tp = gmtime (&t);
@@ -273,7 +273,7 @@
 			fprintf (stderr,
 			         _("%s: group '%s' is a NIS group.\n"),
 			         Prog, grp->gr_name);
-			gr_free (grp);
+			gr_free ((struct group *)grp);
 			continue;
 		}
 #endif
@@ -282,7 +282,7 @@
 			fprintf (stderr,
 			         _("%s: too many groups specified (max %d).\n"),
 			         Prog, ngroups);
-			gr_free (grp);
+			gr_free ((struct group *)grp);
 			break;
 		}
 
@@ -290,7 +290,7 @@
 		 * Add the group name to the user's list of groups.
 		 */
 		user_groups[ngroups++] = xstrdup (grp->gr_name);
-		gr_free (grp);
+		gr_free ((struct group *)grp);
 	} while (NULL != list);
 
 	user_groups[ngroups] = (char *) 0;
@@ -524,9 +524,9 @@
 		/* log dates rather than numbers of days. */
 		char new_exp[16], old_exp[16];
 		date_to_str (new_exp, sizeof(new_exp),
-		             user_newexpire * DAY, "never");
+		             user_newexpire * DAY);
 		date_to_str (old_exp, sizeof(old_exp),
-		             user_expire * DAY, "never");
+		             user_expire * DAY);
 #ifdef WITH_AUDIT
 		audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
 		              "changing expiration date",




More information about the Pkg-shadow-commits mailing list