vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Jan F. Chadima 69dd72
diff -up openssh-5.9p0/configure.ac.vendor openssh-5.9p0/configure.ac
Jan F. Chadima 69dd72
--- openssh-5.9p0/configure.ac.vendor	2011-09-03 20:24:29.899501572 +0200
Jan F. Chadima 69dd72
+++ openssh-5.9p0/configure.ac	2011-09-03 20:24:39.153501595 +0200
Jan F. Chadima 69dd72
@@ -4131,6 +4131,12 @@ AC_ARG_WITH([lastlog],
Jan F. Chadima 69dd72
 		fi
Jan F. Chadima 69dd72
 	]
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])
Jan F. Chadima 69dd72
 
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
Jan F. Chadima 69dd72
@@ -4357,6 +4363,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
 
Jan F. Chadima 69dd72
diff -up openssh-5.9p0/servconf.c.vendor openssh-5.9p0/servconf.c
Jan F. Chadima 69dd72
--- openssh-5.9p0/servconf.c.vendor	2011-09-03 20:24:29.080500853 +0200
Jan F. Chadima 69dd72
+++ openssh-5.9p0/servconf.c	2011-09-03 20:27:15.727564566 +0200
Jan F. Chadima 69dd72
@@ -130,6 +130,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;
Jan F. Chadima 69dd72
@@ -300,6 +301,8 @@ fill_default_server_options(ServerOption
Jan F. Chadima 69dd72
 		options->ip_qos_interactive = IPTOS_LOWDELAY;
Jan F. Chadima 69dd72
 	if (options->ip_qos_bulk == -1)
Jan F. Chadima 69dd72
 		options->ip_qos_bulk = IPTOS_THROUGHPUT;
Jan F. Chadima 69dd72
+	if (options->show_patchlevel == -1)
Jan F. Chadima 69dd72
+ 		options->show_patchlevel = 0;
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
 	/* Turn privilege separation on by default */
Jan F. Chadima 69dd72
 	if (use_privsep == -1)
Jan F. Chadima 69dd72
@@ -338,7 +341,7 @@ typedef enum {
Jan F. Chadima 69dd72
 	sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile,
Jan F. Chadima 69dd72
 	sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem,
Jan F. Chadima 69dd72
 	sMaxStartups, sMaxAuthTries, sMaxSessions,
Jan F. Chadima 69dd72
-	sBanner, sUseDNS, sHostbasedAuthentication,
Jan F. Chadima 69dd72
+	sBanner, sShowPatchLevel, sUseDNS, sHostbasedAuthentication,
Jan F. Chadima 69dd72
 	sHostbasedUsesNameFromPacketOnly, sTwoFactorAuthentication,
Jan F. Chadima 69dd72
 	sSecondPubkeyAuthentication, sSecondGssAuthentication,
Jan F. Chadima 69dd72
 	sSecondPasswordAuthentication, sSecondKbdInteractiveAuthentication,
Jan F. Chadima 69dd72
@@ -470,6 +473,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 },
Jan F. Chadima 69dd72
@@ -1152,6 +1156,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)
Jan F. Chadima 69dd72
@@ -1849,6 +1857,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);
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sGatewayPorts, o->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);
Jan F. Chadima 69dd72
 	dump_cfg_fmtint(sUsePrivilegeSeparation, use_privsep);
Jan F. Chadima 69dd72
diff -up openssh-5.9p0/servconf.h.vendor openssh-5.9p0/servconf.h
Jan F. Chadima 69dd72
--- openssh-5.9p0/servconf.h.vendor	2011-09-03 20:24:29.179632045 +0200
Jan F. Chadima 69dd72
+++ openssh-5.9p0/servconf.h	2011-09-03 20:24:39.426502323 +0200
Jan F. Chadima 69dd72
@@ -148,6 +148,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
Jan F. Chadima 69dd72
diff -up openssh-5.9p0/sshd.c.vendor openssh-5.9p0/sshd.c
Jan F. Chadima 69dd72
--- openssh-5.9p0/sshd.c.vendor	2011-09-03 20:24:35.987501565 +0200
Jan F. Chadima 69dd72
+++ openssh-5.9p0/sshd.c	2011-09-03 20:24:39.542501643 +0200
Jan F. Chadima 69dd72
@@ -431,7 +431,7 @@ sshd_exchange_identification(int sock_in
Jan F. Chadima 69dd72
 		minor = PROTOCOL_MINOR_1;
Jan F. Chadima 69dd72
 	}
Jan F. Chadima 69dd72
 	snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", major, minor,
Jan F. Chadima 69dd72
-	    SSH_VERSION, newline);
Jan F. Chadima 69dd72
+	   (options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_VERSION, newline);
Jan F. Chadima 69dd72
 	server_version_string = xstrdup(buf);
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
 	/* Send our protocol version identification. */
Jan F. Chadima 69dd72
@@ -1627,7 +1627,8 @@ main(int ac, char **av)
Jan F. Chadima 69dd72
 		exit(1);
Jan F. Chadima 69dd72
 	}
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
-	debug("sshd version %.100s", SSH_RELEASE);
Jan F. Chadima 69dd72
+	debug("sshd version %.100s",
Jan F. Chadima 69dd72
+	      (options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_RELEASE);
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
 	/* Store privilege separation user for later use if required. */
Jan F. Chadima 69dd72
 	if ((privsep_pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) {
Jan F. Chadima 69dd72
diff -up openssh-5.9p0/sshd_config.0.vendor openssh-5.9p0/sshd_config.0
Jan F. Chadima 69dd72
--- openssh-5.9p0/sshd_config.0.vendor	2011-09-03 20:24:37.524438185 +0200
Jan F. Chadima 69dd72
+++ openssh-5.9p0/sshd_config.0	2011-09-03 20:24:39.677508255 +0200
Jan F. Chadima 69dd72
@@ -556,6 +556,11 @@ DESCRIPTION
Jan F. Chadima 69dd72
              Defines the number of bits in the ephemeral protocol version 1
Jan F. Chadima 69dd72
              server key.  The minimum value is 512, and the default 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
+
Jan F. Chadima 69dd72
      StrictModes
Jan F. Chadima 69dd72
              Specifies whether sshd(8) should check file modes and ownership
Jan F. Chadima 69dd72
              of the user's files and home directory before accepting login.
Jan F. Chadima 69dd72
diff -up openssh-5.9p0/sshd_config.5.vendor openssh-5.9p0/sshd_config.5
Jan F. Chadima 69dd72
--- openssh-5.9p0/sshd_config.5.vendor	2011-09-03 20:24:37.640442022 +0200
Jan F. Chadima 69dd72
+++ openssh-5.9p0/sshd_config.5	2011-09-03 20:24:40.176544206 +0200
Jan F. Chadima 69dd72
@@ -952,6 +952,14 @@ 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.
Jan F. Chadima 69dd72
 The minimum value is 512, and the default 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 . 
Jan F. Chadima 69dd72
+This option applies to protocol version 1 only. 
Jan F. Chadima 69dd72
 .It Cm StrictModes
Jan F. Chadima 69dd72
 Specifies whether
Jan F. Chadima 69dd72
 .Xr sshd 8
Jan F. Chadima 69dd72
diff -up openssh-5.9p0/sshd_config.vendor openssh-5.9p0/sshd_config
Jan F. Chadima 69dd72
--- openssh-5.9p0/sshd_config.vendor	2011-09-03 20:24:37.770439735 +0200
Jan F. Chadima 69dd72
+++ openssh-5.9p0/sshd_config	2011-09-03 20:24:40.278628002 +0200
Jan F. Chadima 69dd72
@@ -120,6 +120,7 @@ X11Forwarding yes
Jan F. Chadima 69dd72
 #Compression delayed
Jan F. Chadima 69dd72
 #ClientAliveInterval 0
Jan F. Chadima 69dd72
 #ClientAliveCountMax 3
Jan F. Chadima 69dd72
+#ShowPatchLevel no
Jan F. Chadima 69dd72
 #UseDNS yes
Jan F. Chadima 69dd72
 #PidFile /var/run/sshd.pid
Jan F. Chadima 69dd72
 #MaxStartups 10