SCCS-vsn: usr.bin/login/login.c 5.42
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)login.c 5.41 (Berkeley) %G%";
+static char sccsid[] = "@(#)login.c 5.42 (Berkeley) %G%";
months[ttp->tm_mon], ttp->tm_mday, ttp->tm_year);
}
months[ttp->tm_mon], ttp->tm_mday, ttp->tm_year);
}
-#define TWOWEEKS (14*24*60*60)
if (pwd->pw_change || pwd->pw_expire)
(void)gettimeofday(&tp, (struct timezone *)NULL);
if (pwd->pw_change)
if (pwd->pw_change || pwd->pw_expire)
(void)gettimeofday(&tp, (struct timezone *)NULL);
if (pwd->pw_change)
(void)printf("Sorry -- your password has expired.\n");
sleepexit(1);
}
(void)printf("Sorry -- your password has expired.\n");
sleepexit(1);
}
- else if (tp.tv_sec - pwd->pw_change < TWOWEEKS && !quietlog) {
+ else if (pwd->pw_change - tp.tv_sec <
+ 2 * DAYSPERWEEK * SECSPERDAY && !quietlog) {
ttp = localtime(&pwd->pw_change);
(void)printf("Warning: your password expires on %s %d, %d\n",
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);
+ months[ttp->tm_mon], ttp->tm_mday,
+ TM_YEAR_BASE + ttp->tm_year);
}
if (pwd->pw_expire)
if (tp.tv_sec >= pwd->pw_expire) {
(void)printf("Sorry -- your account has expired.\n");
sleepexit(1);
}
}
if (pwd->pw_expire)
if (tp.tv_sec >= pwd->pw_expire) {
(void)printf("Sorry -- your account has expired.\n");
sleepexit(1);
}
- else if (tp.tv_sec - pwd->pw_expire < TWOWEEKS && !quietlog) {
+ else if (pwd->pw_expire - tp.tv_sec <
+ 2 * DAYSPERWEEK * SECSPERDAY && !quietlog) {
ttp = localtime(&pwd->pw_expire);
(void)printf("Warning: your account expires on %s %d, %d\n",
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);
+ months[ttp->tm_mon], ttp->tm_mday,
+ TM_YEAR_BASE + ttp->tm_year);
}
/* nothing else left to fail -- really log in */
}
/* nothing else left to fail -- really log in */