Deleted Added
full compact
login.c (8874) login.c (9987)
1/*-
2 * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 50 unchanged lines hidden (view full) ---

59#include <pwd.h>
60#include <setjmp.h>
61#include <signal.h>
62#include <stdio.h>
63#include <stdlib.h>
64#include <string.h>
65#include <syslog.h>
66#include <ttyent.h>
1/*-
2 * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 50 unchanged lines hidden (view full) ---

59#include <pwd.h>
60#include <setjmp.h>
61#include <signal.h>
62#include <stdio.h>
63#include <stdlib.h>
64#include <string.h>
65#include <syslog.h>
66#include <ttyent.h>
67#include <tzfile.h>
68#include <unistd.h>
69#include <utmp.h>
70
71#ifdef SKEY
72#include <skey.h>
73#endif
74
75#include "pathnames.h"

--- 285 unchanged lines hidden (view full) ---

361 (void)gettimeofday(&tp, (struct timezone *)NULL);
362
363 changepass=0;
364 if (pwd->pw_change)
365 if (tp.tv_sec >= pwd->pw_change) {
366 (void)printf("Sorry -- your password has expired.\n");
367 changepass=1;
368 } else if (pwd->pw_change - tp.tv_sec <
67#include <unistd.h>
68#include <utmp.h>
69
70#ifdef SKEY
71#include <skey.h>
72#endif
73
74#include "pathnames.h"

--- 285 unchanged lines hidden (view full) ---

360 (void)gettimeofday(&tp, (struct timezone *)NULL);
361
362 changepass=0;
363 if (pwd->pw_change)
364 if (tp.tv_sec >= pwd->pw_change) {
365 (void)printf("Sorry -- your password has expired.\n");
366 changepass=1;
367 } else if (pwd->pw_change - tp.tv_sec <
369 2 * DAYSPERWEEK * SECSPERDAY && !quietlog)
368 2 * 7 * 86400 && !quietlog)
370 (void)printf("Warning: your password expires on %s",
371 ctime(&pwd->pw_change));
372 if (pwd->pw_expire)
373 if (tp.tv_sec >= pwd->pw_expire) {
374 (void)printf("Sorry -- your account has expired.\n");
375 sleepexit(1);
376 } else if (pwd->pw_expire - tp.tv_sec <
369 (void)printf("Warning: your password expires on %s",
370 ctime(&pwd->pw_change));
371 if (pwd->pw_expire)
372 if (tp.tv_sec >= pwd->pw_expire) {
373 (void)printf("Sorry -- your account has expired.\n");
374 sleepexit(1);
375 } else if (pwd->pw_expire - tp.tv_sec <
377 2 * DAYSPERWEEK * SECSPERDAY && !quietlog)
376 2 * 7 * 86400 && !quietlog)
378 (void)printf("Warning: your account expires on %s",
379 ctime(&pwd->pw_expire));
380
381 /* Nothing else left to fail -- really log in. */
382 memset((void *)&utmp, 0, sizeof(utmp));
383 (void)time(&utmp.ut_time);
384 (void)strncpy(utmp.ut_name, username, sizeof(utmp.ut_name));
385 if (hostname)

--- 294 unchanged lines hidden ---
377 (void)printf("Warning: your account expires on %s",
378 ctime(&pwd->pw_expire));
379
380 /* Nothing else left to fail -- really log in. */
381 memset((void *)&utmp, 0, sizeof(utmp));
382 (void)time(&utmp.ut_time);
383 (void)strncpy(utmp.ut_name, username, sizeof(utmp.ut_name));
384 if (hostname)

--- 294 unchanged lines hidden ---