vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Jakub Jelen 3f5513
diff -up openssh-7.0p1/configure.ac.vendor openssh-7.0p1/configure.ac
Jakub Jelen 3f5513
--- openssh-7.0p1/configure.ac.vendor	2015-08-12 11:14:54.102628399 +0200
Jakub Jelen 3f5513
+++ openssh-7.0p1/configure.ac	2015-08-12 11:14:54.129628356 +0200
Jakub Jelen 3f5513
@@ -4776,6 +4776,12 @@ AC_ARG_WITH([lastlog],
Petr Lautrbach 47b1c9
 		fi
Petr Lautrbach 47b1c9
 	]
Jan F. Chadima 69dd72
 )
Jan F. Chadima 69dd72
+AC_ARG_ENABLE(vendor-patchlevel,
Jan F. Chadima 69dd72
+  [  --enable-vendor-patchlevel=TAG  specify a vendor patch level],
Jan F. Chadima 69dd72
+  [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.])
Jan F. Chadima 69dd72
+   SSH_VENDOR_PATCHLEVEL="$enableval"],
Jan F. Chadima 69dd72
+  [AC_DEFINE(SSH_VENDOR_PATCHLEVEL,SSH_RELEASE,[Define to your vendor patch level, if it has been modified from the upstream source release.])
Jan F. Chadima 69dd72
+   SSH_VENDOR_PATCHLEVEL=none])
Petr Lautrbach 47b1c9
 
Jan F. Chadima 69dd72
 dnl lastlog, [uw]tmpx? detection
Jan F. Chadima 69dd72
 dnl  NOTE: set the paths in the platform section to avoid the
Jakub Jelen 3f5513
@@ -5038,6 +5044,7 @@ echo "           Translate v4 in v6 hack
Jan F. Chadima 69dd72
 echo "                  BSD Auth support: $BSD_AUTH_MSG"
Jan F. Chadima 69dd72
 echo "              Random number source: $RAND_MSG"
Jan F. Chadima 69dd72
 echo "             Privsep sandbox style: $SANDBOX_STYLE"
Jan F. Chadima 69dd72
+echo "                Vendor patch level: $SSH_VENDOR_PATCHLEVEL"
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
 echo ""
Jan F. Chadima 69dd72
 
Jakub Jelen 3f5513
diff -up openssh-7.0p1/servconf.c.vendor openssh-7.0p1/servconf.c
Jakub Jelen 3f5513
--- openssh-7.0p1/servconf.c.vendor	2015-08-11 10:57:29.000000000 +0200
Jakub Jelen 3f5513
+++ openssh-7.0p1/servconf.c	2015-08-12 11:15:33.201565712 +0200
Jakub Jelen 3f5513
@@ -149,6 +149,7 @@ initialize_server_options(ServerOptions
Jan F. Chadima 69dd72
 	options->max_authtries = -1;
Jan F. Chadima 69dd72
 	options->max_sessions = -1;
Jan F. Chadima 69dd72
 	options->banner = NULL;
Jan F. Chadima 69dd72
+	options->show_patchlevel = -1;
Jan F. Chadima 69dd72
 	options->use_dns = -1;
Jan F. Chadima 69dd72
 	options->client_alive_interval = -1;
Jan F. Chadima 69dd72
 	options->client_alive_count_max = -1;
Jakub Jelen 535d34
@@ -335,6 +336,8 @@ fill_default_server_options(ServerOption
Jan F. Chadima 69dd72
 		options->ip_qos_bulk = IPTOS_THROUGHPUT;
Petr Lautrbach 9fe1af
 	if (options->version_addendum == NULL)
Petr Lautrbach 9fe1af
 		options->version_addendum = xstrdup("");
Jan F. Chadima 69dd72
+	if (options->show_patchlevel == -1)
Petr Lautrbach 9fe1af
+		options->show_patchlevel = 0;
Petr Lautrbach 190035
 	if (options->fwd_opts.streamlocal_bind_mask == (mode_t)-1)
Petr Lautrbach 190035
 		options->fwd_opts.streamlocal_bind_mask = 0177;
Petr Lautrbach 190035
 	if (options->fwd_opts.streamlocal_bind_unlink == -1)
Jakub Jelen 3f5513
@@ -407,7 +410,7 @@ typedef enum {
Jan F. Chadima 69dd72
 	sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile,
Jakub Jelen 132f8f
 	sGatewayPorts, sPubkeyAuthentication, sPubkeyAcceptedKeyTypes,
Jakub Jelen 132f8f
 	sXAuthLocation, sSubsystem, sMaxStartups, sMaxAuthTries, sMaxSessions,
Jan F. Chadima 69dd72
-	sBanner, sUseDNS, sHostbasedAuthentication,
Jan F. Chadima 69dd72
+	sBanner, sShowPatchLevel, sUseDNS, sHostbasedAuthentication,
Jakub Jelen 132f8f
 	sHostbasedUsesNameFromPacketOnly, sHostbasedAcceptedKeyTypes,
Jakub Jelen 3f5513
 	sHostKeyAlgorithms,
Jakub Jelen 132f8f
 	sClientAliveInterval, sClientAliveCountMax, sAuthorizedKeysFile,
Jakub Jelen 3f5513
@@ -529,6 +532,7 @@ static struct {
Jan F. Chadima 69dd72
 	{ "maxauthtries", sMaxAuthTries, SSHCFG_ALL },
Jan F. Chadima 69dd72
 	{ "maxsessions", sMaxSessions, SSHCFG_ALL },
Jan F. Chadima 69dd72
 	{ "banner", sBanner, SSHCFG_ALL },
Jan F. Chadima 69dd72
+	{ "showpatchlevel", sShowPatchLevel, SSHCFG_GLOBAL },
Jan F. Chadima 69dd72
 	{ "usedns", sUseDNS, SSHCFG_GLOBAL },
Jan F. Chadima 69dd72
 	{ "verifyreversemapping", sDeprecated, SSHCFG_GLOBAL },
Jan F. Chadima 69dd72
 	{ "reversemappingcheck", sDeprecated, SSHCFG_GLOBAL },
Jakub Jelen 3f5513
@@ -1389,6 +1393,10 @@ process_server_config_line(ServerOptions
Jan F. Chadima 69dd72
 		multistate_ptr = multistate_privsep;
Jan F. Chadima 69dd72
 		goto parse_multistate;
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
+	case sShowPatchLevel:
Jan F. Chadima 69dd72
+		intptr = &options->show_patchlevel;
Jan F. Chadima 69dd72
+		goto parse_flag;
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
 	case sAllowUsers:
Jan F. Chadima 69dd72
 		while ((arg = strdelim(&cp)) && *arg != '\0') {
Jan F. Chadima 69dd72
 			if (options->num_allow_users >= MAX_ALLOW_USERS)
Jakub Jelen 3f5513
@@ -2266,6 +2274,7 @@ dump_config(ServerOptions *o)
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sUseLogin, o->use_login);
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sCompression, o->compression);
Petr Lautrbach 190035
 	dump_cfg_fmtint(sGatewayPorts, o->fwd_opts.gateway_ports);
Jan F. Chadima 69dd72
+	dump_cfg_fmtint(sShowPatchLevel, o->show_patchlevel);
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sUseDNS, o->use_dns);
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding);
Jakub Jelen 535d34
 	dump_cfg_fmtint(sAllowAgentForwarding, o->allow_agent_forwarding);
Jakub Jelen 3f5513
diff -up openssh-7.0p1/servconf.h.vendor openssh-7.0p1/servconf.h
Jakub Jelen 3f5513
--- openssh-7.0p1/servconf.h.vendor	2015-08-11 10:57:29.000000000 +0200
Jakub Jelen 3f5513
+++ openssh-7.0p1/servconf.h	2015-08-12 11:14:54.130628355 +0200
Jakub Jelen 3f5513
@@ -155,6 +155,7 @@ typedef struct {
Jan F. Chadima 69dd72
 	int	max_authtries;
Jan F. Chadima 69dd72
 	int	max_sessions;
Jan F. Chadima 69dd72
 	char   *banner;			/* SSH-2 banner message */
Jan F. Chadima 69dd72
+	int	show_patchlevel;	/* Show vendor patch level to clients */
Jan F. Chadima 69dd72
 	int	use_dns;
Jan F. Chadima 69dd72
 	int	client_alive_interval;	/*
Jan F. Chadima 69dd72
 					 * poke the client this often to
Jakub Jelen 3f5513
diff -up openssh-7.0p1/sshd_config.0.vendor openssh-7.0p1/sshd_config.0
Jakub Jelen 3f5513
--- openssh-7.0p1/sshd_config.0.vendor	2015-08-12 11:14:54.125628363 +0200
Jakub Jelen 3f5513
+++ openssh-7.0p1/sshd_config.0	2015-08-12 11:14:54.130628355 +0200
Jakub Jelen 3f5513
@@ -841,6 +841,11 @@ DESCRIPTION
Jan F. Chadima 69dd72
              Defines the number of bits in the ephemeral protocol version 1
Jakub Jelen 3f5513
              server key.  The default and minimum value is 1024.
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
+     ShowPatchLevel
Jan F. Chadima 69dd72
+	     Specifies whether sshd will display the specific patch level of
Jan F. Chadima 69dd72
+	     the binary in the server identification string.  The patch level
Jan F. Chadima 69dd72
+	     is set at compile-time.  The default is M-bM-^@M-^\noM-bM-^@M-^].
Jan F. Chadima 69dd72
+
Petr Lautrbach 190035
      StreamLocalBindMask
Petr Lautrbach 190035
              Sets the octal file creation mode mask (umask) used when creating
Petr Lautrbach 190035
              a Unix-domain socket file for local or remote port forwarding.
Jakub Jelen 3f5513
diff -up openssh-7.0p1/sshd_config.5.vendor openssh-7.0p1/sshd_config.5
Jakub Jelen 3f5513
--- openssh-7.0p1/sshd_config.5.vendor	2015-08-12 11:14:54.125628363 +0200
Jakub Jelen 3f5513
+++ openssh-7.0p1/sshd_config.5	2015-08-12 11:14:54.131628353 +0200
Jakub Jelen 3f5513
@@ -1411,6 +1411,13 @@ This option applies to protocol version
Jan F. Chadima 69dd72
 .It Cm ServerKeyBits
Jan F. Chadima 69dd72
 Defines the number of bits in the ephemeral protocol version 1 server key.
Jakub Jelen 3f5513
 The default and minimum value is 1024.
Jan F. Chadima 69dd72
+.It Cm ShowPatchLevel 
Jan F. Chadima 69dd72
+Specifies whether 
Jan F. Chadima 69dd72
+.Nm sshd 
Jan F. Chadima 69dd72
+will display the patch level of the binary in the identification string. 
Jan F. Chadima 69dd72
+The patch level is set at compile-time. 
Jan F. Chadima 69dd72
+The default is 
Jan F. Chadima 69dd72
+.Dq no . 
Petr Lautrbach 190035
 .It Cm StreamLocalBindMask
Petr Lautrbach 190035
 Sets the octal file creation mode mask
Petr Lautrbach 190035
 .Pq umask
Jakub Jelen 3f5513
diff -up openssh-7.0p1/sshd_config.vendor openssh-7.0p1/sshd_config
Jakub Jelen 3f5513
--- openssh-7.0p1/sshd_config.vendor	2015-08-12 11:14:54.125628363 +0200
Jakub Jelen 3f5513
+++ openssh-7.0p1/sshd_config	2015-08-12 11:14:54.131628353 +0200
Jakub Jelen 3f5513
@@ -119,6 +119,7 @@ UsePrivilegeSeparation sandbox		# Defaul
Jakub Jelen 3f5513
 #Compression delayed
Jakub Jelen 3f5513
 #ClientAliveInterval 0
Jakub Jelen 3f5513
 #ClientAliveCountMax 3
Jakub Jelen 3f5513
+#ShowPatchLevel no
Jakub Jelen 3f5513
 #UseDNS no
Jakub Jelen 3f5513
 #PidFile /var/run/sshd.pid
Jakub Jelen 3f5513
 #MaxStartups 10:30:100
Jakub Jelen 3f5513
diff -up openssh-7.0p1/sshd.c.vendor openssh-7.0p1/sshd.c
Jakub Jelen 3f5513
--- openssh-7.0p1/sshd.c.vendor	2015-08-12 11:14:54.100628403 +0200
Jakub Jelen 3f5513
+++ openssh-7.0p1/sshd.c	2015-08-12 11:14:54.131628353 +0200
Jakub Jelen 3f5513
@@ -432,7 +432,7 @@ sshd_exchange_identification(int sock_in
Jakub Jelen 3f5513
 	}
Jakub Jelen 3f5513
 
Jakub Jelen 3f5513
 	xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
Jakub Jelen 3f5513
-	    major, minor, SSH_VERSION,
Jakub Jelen 3f5513
+	    major, minor, (options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_VERSION,
Jakub Jelen 3f5513
 	    *options.version_addendum == '\0' ? "" : " ",
Jakub Jelen 3f5513
 	    options.version_addendum, newline);
Jakub Jelen 3f5513
 
Jakub Jelen 3f5513
@@ -1749,7 +1749,8 @@ main(int ac, char **av)
Jakub Jelen 3f5513
 		exit(1);
Jakub Jelen 3f5513
 	}
Jakub Jelen 3f5513
 
Jakub Jelen 3f5513
-	debug("sshd version %s, %s", SSH_VERSION,
Jakub Jelen 3f5513
+	debug("sshd version %s, %s", 
Jakub Jelen 3f5513
+		(options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_VERSION,
Jakub Jelen 3f5513
 #ifdef WITH_OPENSSL
Jakub Jelen 3f5513
 	    SSLeay_version(SSLEAY_VERSION)
Jakub Jelen 3f5513
 #else