]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
* src/usermod.c: date_to_str() is always called with negativ set
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 18 Sep 2011 17:34:21 +0000 (17:34 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 18 Sep 2011 17:34:21 +0000 (17:34 +0000)
to "never", remove this argument.
* src/usermod.c: Added missing cast for gr_free argument.

ChangeLog
src/usermod.c

index fa76576a10beea8d98573ea3eb31671be0c5cc84..5f3d453204ec4935197d9b6194caabb53a007eac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-18  Nicolas François  <nicolas.francois@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@centraliens.net>
 
        * src/pwconv.c: Fail if not called correctly.
index 4b95225912ada497a752eaf3b9e664874fa40298..51ef3c01595caf5b9bd8c582fded2d2dc78c8579 100644 (file)
@@ -150,7 +150,7 @@ static bool sgr_locked = false;
 
 /* 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 @@ static void move_mailbox (void);
 #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 @@ static int get_groups (char *list)
                        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 @@ static int get_groups (char *list)
                        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 @@ static int get_groups (char *list)
                 * 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 @@ static void new_spent (struct spwd *spent)
                /* 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",