]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs: 2730965
authorThorsten Kukuk <kukuk@thkukuk.de>
Wed, 4 Aug 2010 13:54:02 +0000 (13:54 +0000)
committerThorsten Kukuk <kukuk@thkukuk.de>
Wed, 4 Aug 2010 13:54:02 +0000 (13:54 +0000)
Purpose of commit: workaround

Commit summary:
---------------

2010-08-04  Thorsten Kukuk  <kukuk@thkukuk.de>

        * modules/pam_unix/passverify.c (PAMH_ARG_DECL): Don't request
        password change if time is not yet set (1.1.1970). Bug #2730965.

ChangeLog
modules/pam_unix/passverify.c

index 74259ab84b8657a3951dd2ca2e7b65cca41b6439..dcaf92c27344c3a885103980fb368c6584e23e3c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-08-04  Thorsten Kukuk  <kukuk@thkukuk.de>
 
+       * modules/pam_unix/passverify.c (PAMH_ARG_DECL): Don't request
+       password change if time is not yet set (1.1.1970). Bug #2730965.
+
        * modules/pam_access/pam_access.c (user_match): Make sure
        that user@host will not match @@netgroup. Bug #3035919.
 
index d175dfa58e72c74a929e34babf84a0845c3c51d4..ec63a431c3216596690c7fe706c054a82def675a 100644 (file)
@@ -909,6 +909,9 @@ PAMH_ARG_DECL(int unix_update_shadow,
        if (!strcmp(stmpent->sp_namp, forwho)) {
            stmpent->sp_pwdp = towhat;
            stmpent->sp_lstchg = time(NULL) / (60 * 60 * 24);
+           if (stmpent->sp_lstchg == 0)
+               stmpent->sp_lstchg = -1; /* Don't request passwort change
+                                           only because time isn't set yet. */
            wroteentry = 1;
            D(("Set password %s for %s", stmpent->sp_pwdp, forwho));
        }
@@ -928,6 +931,9 @@ PAMH_ARG_DECL(int unix_update_shadow,
        spwdent.sp_namp = forwho;
        spwdent.sp_pwdp = towhat;
        spwdent.sp_lstchg = time(NULL) / (60 * 60 * 24);
+       if (spwdent.sp_lstchg == 0)
+           spwdent.sp_lstchg = -1; /* Don't request passwort change
+                                      only because time isn't set yet. */
        spwdent.sp_min = spwdent.sp_max = spwdent.sp_warn = spwdent.sp_inact =
            spwdent.sp_expire = -1;
        spwdent.sp_flag = (unsigned long)-1l;