components/openssh/patches/003-last_login.patch
author Tomas Kuthan <tomas.kuthan@oracle.com>
Thu, 29 Oct 2015 02:40:10 -0700
changeset 5025 bdd7dc7d2af4
parent 2128 ea2364416471
child 5819 c5f05bd2a9bc
permissions -rw-r--r--
PSARC/2015/395 OpenSSH 7.1p1 21696247 upgrade OpenSSH to 7.1p1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2128
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
     1
# The man page change here is Solaris-specific and thus is not being
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
     2
# contributed back to the upstream community.  The servconf.c change
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
     3
# was developed in-house and has been submitted upstream to OpenSSH for
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
     4
# their consideration:
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
     5
# https://bugzilla.mindrot.org/show_bug.cgi?id=2278
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
     6
#
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
     7
# OpenSSH normally updates lastlog when users login and reads lastlog to
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
     8
# determine the last login time of the user however on Solaris the
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
     9
# pam_unix_session(5) module handles both of these tasks so we compile
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
    10
# OpenSSH with --disable-lastlog to disable all lastlog references.
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
    11
# This means the sshd_config option of PrintLastLog is now ignored and
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
    12
# can't be changed so we update sshd's configuration parsing to flag
ea2364416471 PSARC/2014/342 pam_unix_session lastlog support
Brent Paulson <Brent.Paulson@Oracle.COM>
parents: 2070
diff changeset
    13
# this as unsupported and update the man page here.
1612
3f2ec017627f PSARC 2012/335 OpenSSH migration
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    14
#
5025
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    15
diff -pur old/servconf.c new/servconf.c
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    16
--- old/servconf.c
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    17
+++ new/servconf.c
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    18
@@ -504,7 +504,11 @@ static struct {
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    19
 	{ "listenaddress", sListenAddress, SSHCFG_GLOBAL },
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    20
 	{ "addressfamily", sAddressFamily, SSHCFG_GLOBAL },
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    21
 	{ "printmotd", sPrintMotd, SSHCFG_GLOBAL },
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    22
+#ifdef DISABLE_LASTLOG
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    23
+	{ "printlastlog", sUnsupported, SSHCFG_GLOBAL },
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    24
+#else
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    25
 	{ "printlastlog", sPrintLastLog, SSHCFG_GLOBAL },
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    26
+#endif
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    27
 	{ "ignorerhosts", sIgnoreRhosts, SSHCFG_GLOBAL },
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    28
 	{ "ignoreuserknownhosts", sIgnoreUserKnownHosts, SSHCFG_GLOBAL },
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    29
 	{ "x11forwarding", sX11Forwarding, SSHCFG_ALL },
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    30
@@ -2268,7 +2272,9 @@ dump_config(ServerOptions *o)
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    31
 	dump_cfg_fmtint(sChallengeResponseAuthentication,
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    32
 	    o->challenge_response_authentication);
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    33
 	dump_cfg_fmtint(sPrintMotd, o->print_motd);
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    34
+#ifndef DISABLE_LASTLOG
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    35
 	dump_cfg_fmtint(sPrintLastLog, o->print_lastlog);
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    36
+#endif /* !DISABLE_LASTLOG */
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    37
 	dump_cfg_fmtint(sX11Forwarding, o->x11_forwarding);
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    38
 	dump_cfg_fmtint(sX11UseLocalhost, o->x11_use_localhost);
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    39
 	dump_cfg_fmtint(sPermitTTY, o->permit_tty);
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    40
diff -pur old/sshd_config.5 new/sshd_config.5
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    41
--- old/sshd_config.5
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    42
+++ new/sshd_config.5
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    43
@@ -1300,8 +1300,8 @@ Specifies whether
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    44
 .Xr sshd 8
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    45
 should print the date and time of the last user login when a user logs
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    46
 in interactively.
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    47
-The default is
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    48
-.Dq yes .
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    49
+On Solaris this option is always ignored since pam_unix_session(5)
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    50
+reports the last login time.
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    51
 .It Cm PrintMotd
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    52
 Specifies whether
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    53
 .Xr sshd 8
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    54
@@ -1721,7 +1721,8 @@ This file should be writable by root onl
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    55
 (though not necessary) that it be world-readable.
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    56
 .El
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    57
 .Sh SEE ALSO
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    58
-.Xr sshd 8
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    59
+.Xr sshd 8 ,
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    60
+.Xr pam_unix_session 5
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    61
 .Sh AUTHORS
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    62
 OpenSSH is a derivative of the original and free
bdd7dc7d2af4 PSARC/2015/395 OpenSSH 7.1p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 2128
diff changeset
    63
 ssh 1.2.12 release by Tatu Ylonen.