freebsd-ports/security/ssh/files/patch-af
Dima Ruban 64e630d83b 1.2.22 -> 1.2.25
Somebody needs to go through patch-af to check it, since I'm not sure
about some of the stuff.

This version fixes a security flaw in previous version.
1998-06-12 07:55:14 +00:00

108 lines
3.3 KiB
Text

*** 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