1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
*** sshd.c.WAS Thu Jun 11 23:11:47 1998
--- sshd.c Thu Jun 11 23:30:30 1998
***************
*** 2014,2020 ****
pwcopy.pw_class = xstrdup(pw->pw_class);
pwcopy.pw_change = pw->pw_change;
pwcopy.pw_expire = pw->pw_expire;
! #endif /* __bsdi__ && _BSDI_VERSION >= 199510 */
pwcopy.pw_dir = xstrdup(pw->pw_dir);
pwcopy.pw_shell = xstrdup(pw->pw_shell);
pw = &pwcopy;
--- 2014,2020 ----
pwcopy.pw_class = xstrdup(pw->pw_class);
pwcopy.pw_change = pw->pw_change;
pwcopy.pw_expire = pw->pw_expire;
! #endif /* (__bsdi__ && _BSDI_VERSION >= 199510) || (__FreeBSD__ && HAVE_LOGIN_CAP_H) */
pwcopy.pw_dir = xstrdup(pw->pw_dir);
pwcopy.pw_shell = xstrdup(pw->pw_shell);
pw = &pwcopy;
***************
*** 3045,3054 ****
struct pty_cleanup_context cleanup_context;
#if defined (__FreeBSD__) && defined(HAVE_LOGIN_CAP_H)
login_cap_t *lc;
#endif
! #if defined (__bsdi__) && _BSDI_VERSION >= 199510
struct timeval tp;
! #endif /* __bsdi__ && _BSDI_VERSION >= 199510 */
#ifdef HAVE_OSF1_C2_SECURITY
{
--- 3045,3055 ----
struct pty_cleanup_context cleanup_context;
#if defined (__FreeBSD__) && defined(HAVE_LOGIN_CAP_H)
login_cap_t *lc;
+ time_t warnpassword, warnexpire;
#endif
! #if defined(__FreeBSD__) || (defined (__bsdi__) && _BSDI_VERSION >= 199510)
struct timeval tp;
! #endif /* __FreeBSD__ || (__bsdi__ && _BSDI_VERSION >= 199510) */
#ifdef HAVE_OSF1_C2_SECURITY
{
***************
*** 3183,3188 ****
--- 3184,3197 ----
"The Regents of the University of California. ",
"All rights reserved.");
}
+ #ifdef HAVE_LOGIN_CAP_H
+ #define DEFAULT_WARN (2L * 7L * 86400L) /* Two weeks */
+
+ warnpassword = login_getcaptime(lc, "warnpassword",
+ DEFAULT_WARN, DEFAULT_WARN);
+ warnexpire = login_getcaptime(lc, "warnexpire",
+ DEFAULT_WARN, DEFAULT_WARN);
+ #endif
#endif
/* Print /etc/motd unless a command was specified or printing it was
***************
*** 3206,3212 ****
fputs(line, stdout);
fclose(f);
}
! #if defined (__bsdi__) && _BSDI_VERSION >= 199510
if (pw->pw_change || pw->pw_expire)
(void)gettimeofday(&tp, (struct timezone *)NULL);
if (pw->pw_change)
--- 3215,3221 ----
fputs(line, stdout);
fclose(f);
}
! #if defined(__FreeBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199510)
if (pw->pw_change || pw->pw_expire)
(void)gettimeofday(&tp, (struct timezone *)NULL);
if (pw->pw_change)
***************
*** 3575,3581 ****
while (fgets(buf, sizeof(buf), f))
fputs(buf, stderr);
fclose(f);
! #if defined (__bsdi__) && _BSDI_VERSION >= 199510
if (pw->pw_uid != UID_ROOT &&
!login_getcapbool(lc, "ignorenologin", 0))
exit(254);
--- 3584,3590 ----
while (fgets(buf, sizeof(buf), f))
fputs(buf, stderr);
fclose(f);
! #if (defined(__FreeBSD__) && defined(HAVE_LOGIN_CAP_H)) || (defined (__bsdi__) && _BSDI_VERSION >= 199510)
if (pw->pw_uid != UID_ROOT &&
!login_getcapbool(lc, "ignorenologin", 0))
exit(254);
***************
*** 4121,4127 ****
--- 4130,4140 ----
struct stat mailbuf;
if (stat(mailbox, &mailbuf) == -1 || mailbuf.st_size == 0)
+ #ifdef __FreeBSD__
+ ;
+ #else
printf("No mail.\n");
+ #endif
else if (mailbuf.st_atime > mailbuf.st_mtime)
printf("You have mail.\n");
else
|