]> granicus.if.org Git - shadow/commitdiff
Really log the expiration date change as human readable strings instead of
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 3 Feb 2008 21:37:45 +0000 (21:37 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 3 Feb 2008 21:37:45 +0000 (21:37 +0000)
integers.

ChangeLog
src/usermod.c

index 48ee8d4a4d84d29789be14a842778bed5c064b47..91cfa86689284b1c30dbb08ddc96a51842ef3427 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
        * src/usermod.c: Use a function to convert the dates from
        /etc/shadow to human readable dates.
+       * src/usermod.c: Really log the expiration date change as human
+       readable strings instead of integers.
 
 2008-02-03  Nicolas François  <nicolas.francois@centraliens.net>
 
index f1ed892df62149830c3085d381f5c8b94eec611c..105d0e0d66067532d0af087330fae644c6008f89 100644 (file)
@@ -468,23 +468,22 @@ static void new_spent (struct spwd *spent)
                spent->sp_inact = user_newinactive;
        }
        if (eflg) {
-               /* XXX - dates might be better than numbers of days.  --marekm */
+               /* log dates rather than numbers of days. */
+               char new_exp[16], old_exp[16];
+               date_to_str (new_exp, sizeof(16),
+                            user_newexpire * DAY, "never");
+               date_to_str (old_exp, sizeof(16),
+                            user_expire * DAY, "never");
 #ifdef WITH_AUDIT
                if (audit_fd >= 0) {
-                       char new_exp[16], old_exp[16];
-                       date_to_str (new_exp, sizeof(16),
-                                    user_newexpire * DAY, "never");
-                       date_to_str (old_exp, sizeof(16),
-                                    user_expire * DAY, "never");
-
                        audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
                                      "changing expiration date", user_newname,
                                      user_newid, 1);
                }
 #endif
                SYSLOG ((LOG_INFO,
-                        "change user `%s' expiration from `%ld' to `%ld'",
-                        spent->sp_namp, spent->sp_expire, user_newexpire));
+                        "change user `%s' expiration from `%s' to `%s'",
+                        spent->sp_namp, old_exp, new_exp));
                spent->sp_expire = user_newexpire;
        }
        spent->sp_pwdp = new_pw_passwd (spent->sp_pwdp);