1 /* Author: Wietse Venema <wietse@wzv.win.tue.nl> */
5 RCSID("$Id: sysv_shadow.c,v 1.8 1997/12/29 19:56:07 bg Exp $");
9 #include <sysv_shadow.h>
11 /* sysv_expire - check account and password expiration times */
14 sysv_expire(struct spwd *spwd)
19 today = time(0)/(60*60*24); /* In days since Jan. 1, 1970 */
21 if (spwd->sp_expire > 0) {
22 if (today > spwd->sp_expire) {
23 printf("Your account has expired.\n");
25 } else if (spwd->sp_expire - today < 14) {
26 printf("Your account will expire in %d days.\n",
27 (int)(spwd->sp_expire - today));
31 if (spwd->sp_max > 0) {
32 if (today > (spwd->sp_lstchg + spwd->sp_max)) {
33 printf("Your password has expired. Choose a new one.\n");
35 } else if (spwd->sp_warn > 0
36 && (today > (spwd->sp_lstchg + spwd->sp_max - spwd->sp_warn))) {
37 printf("Your password will expire in %d days.\n",
38 (int)(spwd->sp_lstchg + spwd->sp_max - today));
45 #endif /* SYSV_SHADOW */