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

# The man page change here is Solaris-specific and thus is not being
# contributed back to the upstream community.  The servconf.c change
# was developed in-house and has been submitted upstream to OpenSSH for
# their consideration:
# https://bugzilla.mindrot.org/show_bug.cgi?id=2278
#
# OpenSSH normally updates lastlog when users login and reads lastlog to
# determine the last login time of the user however on Solaris the
# pam_unix_session(5) module handles both of these tasks so we compile
# OpenSSH with --disable-lastlog to disable all lastlog references.
# This means the sshd_config option of PrintLastLog is now ignored and
# can't be changed so we update sshd's configuration parsing to flag
# this as unsupported and update the man page here.
#
diff -pur old/servconf.c new/servconf.c
--- old/servconf.c
+++ new/servconf.c
@@ -504,7 +504,11 @@ static struct {
 	{ "listenaddress", sListenAddress, SSHCFG_GLOBAL },
 	{ "addressfamily", sAddressFamily, SSHCFG_GLOBAL },
 	{ "printmotd", sPrintMotd, SSHCFG_GLOBAL },
+#ifdef DISABLE_LASTLOG
+	{ "printlastlog", sUnsupported, SSHCFG_GLOBAL },
+#else
 	{ "printlastlog", sPrintLastLog, SSHCFG_GLOBAL },
+#endif
 	{ "ignorerhosts", sIgnoreRhosts, SSHCFG_GLOBAL },
 	{ "ignoreuserknownhosts", sIgnoreUserKnownHosts, SSHCFG_GLOBAL },
 	{ "x11forwarding", sX11Forwarding, SSHCFG_ALL },
@@ -2268,7 +2272,9 @@ dump_config(ServerOptions *o)
 	dump_cfg_fmtint(sChallengeResponseAuthentication,
 	    o->challenge_response_authentication);
 	dump_cfg_fmtint(sPrintMotd, o->print_motd);
+#ifndef DISABLE_LASTLOG
 	dump_cfg_fmtint(sPrintLastLog, o->print_lastlog);
+#endif /* !DISABLE_LASTLOG */
 	dump_cfg_fmtint(sX11Forwarding, o->x11_forwarding);
 	dump_cfg_fmtint(sX11UseLocalhost, o->x11_use_localhost);
 	dump_cfg_fmtint(sPermitTTY, o->permit_tty);
diff -pur old/sshd_config.5 new/sshd_config.5
--- old/sshd_config.5
+++ new/sshd_config.5
@@ -1300,8 +1300,8 @@ Specifies whether
 .Xr sshd 8
 should print the date and time of the last user login when a user logs
 in interactively.
-The default is
-.Dq yes .
+On Solaris this option is always ignored since pam_unix_session(5)
+reports the last login time.
 .It Cm PrintMotd
 Specifies whether
 .Xr sshd 8
@@ -1721,7 +1721,8 @@ This file should be writable by root onl
 (though not necessary) that it be world-readable.
 .El
 .Sh SEE ALSO
-.Xr sshd 8
+.Xr sshd 8 ,
+.Xr pam_unix_session 5
 .Sh AUTHORS
 OpenSSH is a derivative of the original and free
 ssh 1.2.12 release by Tatu Ylonen.