summaryrefslogtreecommitdiff
path: root/security/ssh/files/patch-af
blob: 17d22fcf75408f5d3c1ceb4222ed3c9f85678b58 (plain) (blame)
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.orig	Wed May 12 20:19:29 1999
--- sshd.c	Sun Jun  6 02:37:18 1999
***************
*** 2222,2228 ****
    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;
--- 2222,2228 ----
    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;
***************
*** 3285,3294 ****
    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 */
  
    /* We no longer need the child running on user's privileges. */
    userfile_uninit();
--- 3285,3295 ----
    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) */
  
    /* We no longer need the child running on user's privileges. */
    userfile_uninit();
***************
*** 3446,3451 ****
--- 3447,3460 ----
                     "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
***************
*** 3469,3475 ****
                  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)
--- 3478,3484 ----
                  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)
***************
*** 3922,3928 ****
            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);
--- 3931,3937 ----
            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);
***************
*** 4525,4531 ****
--- 4534,4544 ----
                    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