2013-10-08 15:04:51 +00:00
diff -up openssh-6.2p1/configure.ac.vendor openssh-6.2p1/configure.ac
--- openssh-6.2p1/configure.ac.vendor 2013-03-25 19:34:01.277495179 +0100
+++ openssh-6.2p1/configure.ac 2013-03-25 19:34:01.377495818 +0100
@@ -4420,6 +4420,12 @@ AC_ARG_WITH([lastlog],
fi
]
2011-09-07 13:12:54 +00:00
)
+AC_ARG_ENABLE(vendor-patchlevel,
+ [ --enable-vendor-patchlevel=TAG specify a vendor patch level],
+ [AC_DEFINE_UNQUOTED(SSH_VENDOR_PATCHLEVEL,[SSH_RELEASE "-" "$enableval"],[Define to your vendor patch level, if it has been modified from the upstream source release.])
+ SSH_VENDOR_PATCHLEVEL="$enableval"],
+ [AC_DEFINE(SSH_VENDOR_PATCHLEVEL,SSH_RELEASE,[Define to your vendor patch level, if it has been modified from the upstream source release.])
+ SSH_VENDOR_PATCHLEVEL=none])
2013-10-08 15:04:51 +00:00
2011-09-07 13:12:54 +00:00
dnl lastlog, [uw]tmpx? detection
dnl NOTE: set the paths in the platform section to avoid the
2013-10-08 15:04:51 +00:00
@@ -4681,6 +4687,7 @@ echo " Translate v4 in v6 hack
2011-09-07 13:12:54 +00:00
echo " BSD Auth support: $BSD_AUTH_MSG"
echo " Random number source: $RAND_MSG"
echo " Privsep sandbox style: $SANDBOX_STYLE"
+echo " Vendor patch level: $SSH_VENDOR_PATCHLEVEL"
echo ""
2013-04-04 14:42:32 +00:00
diff -up openssh-6.2p1/servconf.c.vendor openssh-6.2p1/servconf.c
--- openssh-6.2p1/servconf.c.vendor 2013-03-25 19:34:01.197494668 +0100
+++ openssh-6.2p1/servconf.c 2013-03-25 19:34:01.379495831 +0100
2012-09-14 20:18:22 +00:00
@@ -128,6 +128,7 @@ initialize_server_options(ServerOptions
2011-09-07 13:12:54 +00:00
options->max_authtries = -1;
options->max_sessions = -1;
options->banner = NULL;
+ options->show_patchlevel = -1;
options->use_dns = -1;
options->client_alive_interval = -1;
options->client_alive_count_max = -1;
2013-04-04 14:42:32 +00:00
@@ -287,6 +288,9 @@ fill_default_server_options(ServerOption
2011-09-07 13:12:54 +00:00
options->ip_qos_bulk = IPTOS_THROUGHPUT;
2012-09-14 20:18:22 +00:00
if (options->version_addendum == NULL)
options->version_addendum = xstrdup("");
2011-09-07 13:12:54 +00:00
+ if (options->show_patchlevel == -1)
2012-09-14 20:18:22 +00:00
+ options->show_patchlevel = 0;
+
2011-09-07 13:12:54 +00:00
/* Turn privilege separation on by default */
if (use_privsep == -1)
2012-09-14 20:18:22 +00:00
use_privsep = PRIVSEP_NOSANDBOX;
2013-04-04 14:42:32 +00:00
@@ -324,7 +328,7 @@ typedef enum {
2011-09-07 13:12:54 +00:00
sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile,
sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem,
sMaxStartups, sMaxAuthTries, sMaxSessions,
- sBanner, sUseDNS, sHostbasedAuthentication,
+ sBanner, sShowPatchLevel, sUseDNS, sHostbasedAuthentication,
2012-02-06 21:15:10 +00:00
sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
sClientAliveCountMax, sAuthorizedKeysFile,
sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel,
2013-04-04 14:42:32 +00:00
@@ -439,6 +443,7 @@ static struct {
2011-09-07 13:12:54 +00:00
{ "maxauthtries", sMaxAuthTries, SSHCFG_ALL },
{ "maxsessions", sMaxSessions, SSHCFG_ALL },
{ "banner", sBanner, SSHCFG_ALL },
+ { "showpatchlevel", sShowPatchLevel, SSHCFG_GLOBAL },
{ "usedns", sUseDNS, SSHCFG_GLOBAL },
{ "verifyreversemapping", sDeprecated, SSHCFG_GLOBAL },
{ "reversemappingcheck", sDeprecated, SSHCFG_GLOBAL },
2013-04-04 14:42:32 +00:00
@@ -1163,6 +1168,10 @@ process_server_config_line(ServerOptions
2011-09-07 13:12:54 +00:00
multistate_ptr = multistate_privsep;
goto parse_multistate;
+ case sShowPatchLevel:
+ intptr = &options->show_patchlevel;
+ goto parse_flag;
+
case sAllowUsers:
while ((arg = strdelim(&cp)) && *arg != '\0') {
if (options->num_allow_users >= MAX_ALLOW_USERS)
2013-04-04 14:42:32 +00:00
@@ -1950,6 +1959,7 @@ dump_config(ServerOptions *o)
2011-09-07 13:12:54 +00:00
dump_cfg_fmtint(sUseLogin, o->use_login);
dump_cfg_fmtint(sCompression, o->compression);
dump_cfg_fmtint(sGatewayPorts, o->gateway_ports);
+ dump_cfg_fmtint(sShowPatchLevel, o->show_patchlevel);
dump_cfg_fmtint(sUseDNS, o->use_dns);
dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding);
dump_cfg_fmtint(sUsePrivilegeSeparation, use_privsep);
2013-04-04 14:42:32 +00:00
diff -up openssh-6.2p1/servconf.h.vendor openssh-6.2p1/servconf.h
--- openssh-6.2p1/servconf.h.vendor 2013-01-09 05:56:45.000000000 +0100
+++ openssh-6.2p1/servconf.h 2013-03-25 19:34:01.379495831 +0100
@@ -147,6 +147,7 @@ typedef struct {
2011-09-07 13:12:54 +00:00
int max_authtries;
int max_sessions;
char *banner; /* SSH-2 banner message */
+ int show_patchlevel; /* Show vendor patch level to clients */
int use_dns;
int client_alive_interval; /*
* poke the client this often to
2013-04-04 14:42:32 +00:00
diff -up openssh-6.2p1/sshd_config.vendor openssh-6.2p1/sshd_config
--- openssh-6.2p1/sshd_config.vendor 2013-03-25 19:34:01.380495837 +0100
+++ openssh-6.2p1/sshd_config 2013-03-25 19:44:43.471296362 +0100
@@ -118,6 +118,7 @@ UsePrivilegeSeparation sandbox # Defaul
2012-02-06 21:15:10 +00:00
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
+#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
2013-04-04 14:42:32 +00:00
#MaxStartups 10:30:100
diff -up openssh-6.2p1/sshd_config.0.vendor openssh-6.2p1/sshd_config.0
--- openssh-6.2p1/sshd_config.0.vendor 2013-03-25 19:34:01.361495716 +0100
+++ openssh-6.2p1/sshd_config.0 2013-03-25 19:34:01.381495844 +0100
@@ -595,6 +595,11 @@ DESCRIPTION
2011-09-07 13:12:54 +00:00
Defines the number of bits in the ephemeral protocol version 1
server key. The minimum value is 512, and the default is 1024.
+ ShowPatchLevel
+ Specifies whether sshd will display the specific patch level of
+ the binary in the server identification string. The patch level
+ is set at compile-time. The default is M-bM-^@M-^\noM-bM-^@M-^].
+
StrictModes
Specifies whether sshd(8) should check file modes and ownership
of the user's files and home directory before accepting login.
2013-04-04 14:42:32 +00:00
diff -up openssh-6.2p1/sshd_config.5.vendor openssh-6.2p1/sshd_config.5
--- openssh-6.2p1/sshd_config.5.vendor 2013-03-25 19:34:01.362495722 +0100
+++ openssh-6.2p1/sshd_config.5 2013-03-25 19:34:01.382495850 +0100
@@ -1019,6 +1019,14 @@ This option applies to protocol version
2011-09-07 13:12:54 +00:00
.It Cm ServerKeyBits
Defines the number of bits in the ephemeral protocol version 1 server key.
The minimum value is 512, and the default is 1024.
+.It Cm ShowPatchLevel
+Specifies whether
+.Nm sshd
+will display the patch level of the binary in the identification string.
+The patch level is set at compile-time.
+The default is
+.Dq no .
+This option applies to protocol version 1 only.
.It Cm StrictModes
Specifies whether
.Xr sshd 8
2013-04-04 14:42:32 +00:00
diff -up openssh-6.2p1/sshd.c.vendor openssh-6.2p1/sshd.c
--- openssh-6.2p1/sshd.c.vendor 2013-03-25 19:34:01.332495531 +0100
+++ openssh-6.2p1/sshd.c 2013-03-25 19:44:11.864112092 +0100
@@ -442,7 +442,7 @@ sshd_exchange_identification(int sock_in
2012-02-06 21:15:10 +00:00
}
2012-09-14 20:18:22 +00:00
xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
- major, minor, SSH_VERSION,
+ major, minor, (options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_VERSION,
*options.version_addendum == '\0' ? "" : " ",
options.version_addendum, newline);
2013-10-08 15:04:51 +00:00
@@ -1675,7 +1675,8 @@ main(int ac, char **av)
2012-02-06 21:15:10 +00:00
exit(1);
}
2013-04-04 14:42:32 +00:00
- debug("sshd version %s, %s", SSH_VERSION,
+ debug("sshd version %s, %s",
+ (options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_VERSION,
SSLeay_version(SSLEAY_VERSION));
2012-02-06 21:15:10 +00:00
/* Store privilege separation user for later use if required. */