Article View: comp.bugs.2bsd
Article #68password expiration is incorrect (+FIX)
From: Steven M. Schultz
Date: Sun, 22 Jul 1990 22:31
Date: Sun, 22 Jul 1990 22:31
51 lines
2657 bytes
2657 bytes
In the verson of login.c which implements the password
aging there is a bug in the notification of a soon to
expire password or account.
The test for an account or password expiring in less than
two weeks is reversed, causing the reminder that the password
or account will expire in the future to always be given rather
than waiting until the expiration is within two weeks or less.
The test for the current time being greater than or
equal to the expiration time having already been done,
the order of subtraction should be reversed in the test
which follows.
*** login.c.old Tue Sep 19 17:58:41 1989
--- login.c Sun Jul 22 18:23:46 1990
***************
*** 344,350 ****
(void)printf("Sorry -- your password has expired.\n");
sleepexit(1);
}
! else if (tp.tv_sec - pwd->pw_change < TWOWEEKS && !quietlog) {
ttp = localtime(&pwd->pw_change);
(void)printf("Warning: your password expires on %s %d, %d\n",
months[ttp->tm_mon], ttp->tm_mday, TM_YEAR_BASE + ttp->tm_year);
--- 344,350 ----
(void)printf("Sorry -- your password has expired.\n");
sleepexit(1);
}
! else if (pwd->pw_change - tp.tv_sec < TWOWEEKS && !quietlog) {
ttp = localtime(&pwd->pw_change);
(void)printf("Warning: your password expires on %s %d, %d\n",
months[ttp->tm_mon], ttp->tm_mday, TM_YEAR_BASE + ttp->tm_year);
***************
*** 354,360 ****
(void)printf("Sorry -- your account has expired.\n");
sleepexit(1);
}
! else if (tp.tv_sec - pwd->pw_expire < TWOWEEKS && !quietlog) {
ttp = localtime(&pwd->pw_expire);
(void)printf("Warning: your account expires on %s %d, %d\n",
months[ttp->tm_mon], ttp->tm_mday, TM_YEAR_BASE + ttp->tm_year);
--- 354,360 ----
(void)printf("Sorry -- your account has expired.\n");
sleepexit(1);
}
! else if (pwd->pw_expire - tp.tv_sec < TWOWEEKS && !quietlog) {
ttp = localtime(&pwd->pw_expire);
(void)printf("Warning: your account expires on %s %d, %d\n",
months[ttp->tm_mon], ttp->tm_mday, TM_YEAR_BASE + ttp->tm_year);
Technical Details
Message-ID:
<56029@wlbr.IMSD.CONTEL.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!usc!elroy.jpl.nasa.gov!mahendo!wlbr!wlv.imsd.contel.com!smsShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!usc!elroy.jpl.nasa.gov!mahendo!wlbr!wlv.imsd.contel.com!sms From: sms@wlv.imsd.contel.com (Steven M. Schultz) Newsgroups: comp.bugs.2bsd,comp.bugs.4bsd Subject: password expiration is incorrect (+FIX) Message-ID: <56029@wlbr.IMSD.CONTEL.COM> Date: 22 Jul 90 22:31:36 GMT Sender: news@wlbr.IMSD.CONTEL.COM Reply-To: sms@wlv.imsd.contel.com (Steven M. Schultz) Followup-To: comp.bugs.2bsd Organization: Contel Federal Systems Lines: 51