~ubuntu-branches/ubuntu/oneiric/pam/oneiric-proposed

« back to all changes in this revision

Viewing changes to modules/pam_unix/passverify.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-02-17 16:15:47 UTC
  • mfrom: (3.2.15 sid)
  • Revision ID: james.westby@ubuntu.com-20110217161547-afxi0yboxvn18a5t
Tags: 1.1.2-2ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/libpam-modules.postinst: Add PATH to /etc/environment if it's
    not present there or in /etc/security/pam_env.conf. (should send to
    Debian).
  - debian/libpam0g.postinst: only ask questions during update-manager when
    there are non-default services running.
  - debian/patches-applied/series: Ubuntu patches are as below ...
  - debian/patches-applied/ubuntu-rlimit_nice_correction: Explicitly
    initialise RLIMIT_NICE rather than relying on the kernel limits.
  - Change Vcs-Bzr to point at the Ubuntu branch.
  - debian/patches-applied/pam_motd-legal-notice: display the contents of
    /etc/legal once, then set a flag in the user's homedir to prevent
    showing it again.
  - debian/update-motd.5, debian/libpam-modules.manpages: add a manpage
    for update-motd, with some best practices and notes of explanation.
  - debian/patches/update-motd-manpage-ref: add a reference in pam_motd(8)
    to update-motd(5)

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
        *daysleft = -1;
241
241
        curdays = (long int)(time(NULL) / (60 * 60 * 24));
242
242
        D(("today is %d, last change %d", curdays, spent->sp_lstchg));
243
 
        if ((curdays > spent->sp_expire) && (spent->sp_expire != -1)) {
 
243
        if ((curdays >= spent->sp_expire) && (spent->sp_expire != -1)) {
244
244
                D(("account expired"));
245
245
                return PAM_ACCT_EXPIRED;
246
246
        }
909
909
        if (!strcmp(stmpent->sp_namp, forwho)) {
910
910
            stmpent->sp_pwdp = towhat;
911
911
            stmpent->sp_lstchg = time(NULL) / (60 * 60 * 24);
 
912
            if (stmpent->sp_lstchg == 0)
 
913
                stmpent->sp_lstchg = -1; /* Don't request passwort change
 
914
                                            only because time isn't set yet. */
912
915
            wroteentry = 1;
913
916
            D(("Set password %s for %s", stmpent->sp_pwdp, forwho));
914
917
        }
928
931
        spwdent.sp_namp = forwho;
929
932
        spwdent.sp_pwdp = towhat;
930
933
        spwdent.sp_lstchg = time(NULL) / (60 * 60 * 24);
 
934
        if (spwdent.sp_lstchg == 0)
 
935
            spwdent.sp_lstchg = -1; /* Don't request passwort change
 
936
                                       only because time isn't set yet. */
931
937
        spwdent.sp_min = spwdent.sp_max = spwdent.sp_warn = spwdent.sp_inact =
932
938
            spwdent.sp_expire = -1;
933
939
        spwdent.sp_flag = (unsigned long)-1l;