vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Jan F 003cb0
diff -up openssh-5.8p1/configure.ac.vendor openssh-5.8p1/configure.ac
Jan F 003cb0
--- openssh-5.8p1/configure.ac.vendor	2011-02-04 01:42:14.000000000 +0100
Jan F 003cb0
+++ openssh-5.8p1/configure.ac	2011-02-09 22:39:55.000000000 +0100
Jan F 003cb0
@@ -4097,6 +4097,12 @@ AC_ARG_WITH(lastlog,
Jan F. Chadima a3ba41
 		fi
Jan F. Chadima a3ba41
 	]
Jan F. Chadima a3ba41
 )
Jan F. Chadima a3ba41
+AC_ARG_ENABLE(vendor-patchlevel,
Jan F. Chadima a3ba41
+  [  --enable-vendor-patchlevel=TAG  specify a vendor patch level],
Jan F. Chadima a3ba41
+  [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 a3ba41
+   SSH_VENDOR_PATCHLEVEL="$enableval"],
Jan F. Chadima a3ba41
+  [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 a3ba41
+   SSH_VENDOR_PATCHLEVEL=none])
Jan F. Chadima a3ba41
 
Jan F. Chadima a3ba41
 dnl lastlog, [uw]tmpx? detection
Jan F. Chadima a3ba41
 dnl  NOTE: set the paths in the platform section to avoid the
Jan F 003cb0
@@ -4327,6 +4333,7 @@ echo "       IP address in \$DISPLAY hac
Jan F. Chadima a3ba41
 echo "           Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
Jan F. Chadima a3ba41
 echo "                  BSD Auth support: $BSD_AUTH_MSG"
Jan F. Chadima a3ba41
 echo "              Random number source: $RAND_MSG"
Jan F. Chadima a3ba41
+echo "                Vendor patch level: $SSH_VENDOR_PATCHLEVEL"
Jan F. Chadima a3ba41
 if test ! -z "$USE_RAND_HELPER" ; then
Jan F. Chadima a3ba41
 echo "     ssh-rand-helper collects from: $RAND_HELPER_MSG"
Jan F. Chadima a3ba41
 fi
Jan F 003cb0
diff -up openssh-5.8p1/servconf.c.vendor openssh-5.8p1/servconf.c
Jan F 003cb0
--- openssh-5.8p1/servconf.c.vendor	2010-11-20 05:19:38.000000000 +0100
Jan F 003cb0
+++ openssh-5.8p1/servconf.c	2011-02-09 22:41:32.000000000 +0100
Jan F 003cb0
@@ -123,6 +123,7 @@ initialize_server_options(ServerOptions 
Jan F. Chadima a3ba41
 	options->max_authtries = -1;
Jan F. Chadima a3ba41
 	options->max_sessions = -1;
Jan F. Chadima a3ba41
 	options->banner = NULL;
Jan F. Chadima a3ba41
+	options->show_patchlevel = -1;
Jan F. Chadima a3ba41
 	options->use_dns = -1;
Jan F. Chadima a3ba41
 	options->client_alive_interval = -1;
Jan F. Chadima a3ba41
 	options->client_alive_count_max = -1;
Jan F 003cb0
@@ -281,7 +282,9 @@ fill_default_server_options(ServerOption
Jan F 003cb0
 		options->ip_qos_interactive = IPTOS_LOWDELAY;
Jan F 003cb0
 	if (options->ip_qos_bulk == -1)
Jan F 003cb0
 		options->ip_qos_bulk = IPTOS_THROUGHPUT;
Jan F 003cb0
-
Jan F. Chadima a3ba41
+	if (options->show_patchlevel == -1)
Jan F. Chadima a3ba41
+ 		options->show_patchlevel = 0;
Jan F. Chadima a3ba41
+ 
Jan F. Chadima a3ba41
 	/* Turn privilege separation on by default */
Jan F. Chadima a3ba41
 	if (use_privsep == -1)
Jan F. Chadima a3ba41
 		use_privsep = 1;
Jan F 003cb0
@@ -319,7 +322,7 @@ typedef enum {
Jan F. Chadima a3ba41
 	sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile,
Jan F. Chadima a3ba41
 	sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem,
Jan F. Chadima a3ba41
 	sMaxStartups, sMaxAuthTries, sMaxSessions,
Jan F. Chadima a3ba41
-	sBanner, sUseDNS, sHostbasedAuthentication,
Jan F. Chadima a3ba41
+	sBanner, sShowPatchLevel, sUseDNS, sHostbasedAuthentication,
Jan F. Chadima a3ba41
 	sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
Jan F. Chadima a3ba41
 	sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2,
Jan F. Chadima a3ba41
 	sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel,
Jan F 003cb0
@@ -432,6 +435,7 @@ static struct {
Jan F. Chadima a3ba41
 	{ "maxauthtries", sMaxAuthTries, SSHCFG_ALL },
Jan F. Chadima a3ba41
 	{ "maxsessions", sMaxSessions, SSHCFG_ALL },
Jan F. Chadima a3ba41
 	{ "banner", sBanner, SSHCFG_ALL },
Jan F. Chadima a3ba41
+	{ "showpatchlevel", sShowPatchLevel, SSHCFG_GLOBAL },
Jan F. Chadima a3ba41
 	{ "usedns", sUseDNS, SSHCFG_GLOBAL },
Jan F. Chadima a3ba41
 	{ "verifyreversemapping", sDeprecated, SSHCFG_GLOBAL },
Jan F. Chadima a3ba41
 	{ "reversemappingcheck", sDeprecated, SSHCFG_GLOBAL },
Jan F 003cb0
@@ -1086,6 +1090,10 @@ process_server_config_line(ServerOptions
Jan F. Chadima a3ba41
 		intptr = &use_privsep;
Jan F. Chadima a3ba41
 		goto parse_flag;
Jan F. Chadima a3ba41
 
Jan F. Chadima a3ba41
+	case sShowPatchLevel:
Jan F. Chadima a3ba41
+		intptr = &options->show_patchlevel;
Jan F. Chadima a3ba41
+		goto parse_flag;
Jan F. Chadima a3ba41
+
Jan F. Chadima a3ba41
 	case sAllowUsers:
Jan F. Chadima a3ba41
 		while ((arg = strdelim(&cp)) && *arg != '\0') {
Jan F. Chadima a3ba41
 			if (options->num_allow_users >= MAX_ALLOW_USERS)
Jan F 003cb0
@@ -1726,6 +1734,7 @@ dump_config(ServerOptions *o)
Jan F. Chadima a3ba41
 	dump_cfg_fmtint(sUseLogin, o->use_login);
Jan F. Chadima a3ba41
 	dump_cfg_fmtint(sCompression, o->compression);
Jan F. Chadima a3ba41
 	dump_cfg_fmtint(sGatewayPorts, o->gateway_ports);
Jan F. Chadima a3ba41
+	dump_cfg_fmtint(sShowPatchLevel, o->show_patchlevel);
Jan F. Chadima a3ba41
 	dump_cfg_fmtint(sUseDNS, o->use_dns);
Jan F. Chadima a3ba41
 	dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding);
Jan F. Chadima a3ba41
 	dump_cfg_fmtint(sUsePrivilegeSeparation, use_privsep);
Jan F 003cb0
diff -up openssh-5.8p1/servconf.h.vendor openssh-5.8p1/servconf.h
Jan F 003cb0
--- openssh-5.8p1/servconf.h.vendor	2010-11-20 05:19:38.000000000 +0100
Jan F 003cb0
+++ openssh-5.8p1/servconf.h	2011-02-09 22:39:55.000000000 +0100
Jan F 003cb0
@@ -134,6 +134,7 @@ typedef struct {
Jan F 003cb0
 	int	max_authtries;
Jan F 003cb0
 	int	max_sessions;
Jan F 003cb0
 	char   *banner;			/* SSH-2 banner message */
Jan F 003cb0
+	int	show_patchlevel;	/* Show vendor patch level to clients */
Jan F 003cb0
 	int	use_dns;
Jan F 003cb0
 	int	client_alive_interval;	/*
Jan F 003cb0
 					 * poke the client this often to
Jan F 003cb0
diff -up openssh-5.8p1/sshd_config.0.vendor openssh-5.8p1/sshd_config.0
Jan F 003cb0
--- openssh-5.8p1/sshd_config.0.vendor	2011-02-09 22:39:54.000000000 +0100
Jan F 003cb0
+++ openssh-5.8p1/sshd_config.0	2011-02-09 22:39:55.000000000 +0100
Jan F 003cb0
@@ -535,6 +535,11 @@ DESCRIPTION
Jan F. Chadima a3ba41
              Defines the number of bits in the ephemeral protocol version 1
Jan F. Chadima a3ba41
              server key.  The minimum value is 512, and the default is 1024.
Jan F. Chadima a3ba41
 
Jan F. Chadima a3ba41
+     ShowPatchLevel
Jan F. Chadima a3ba41
+	     Specifies whether sshd will display the specific patch level of
Jan F. Chadima a3ba41
+	     the binary in the server identification string.  The patch level
Jan F. Chadima a3ba41
+	     is set at compile-time.  The default is M-bM-^@M-^\noM-bM-^@M-^].
Jan F. Chadima a3ba41
+
Jan F. Chadima a3ba41
      StrictModes
Jan F. Chadima a3ba41
              Specifies whether sshd(8) should check file modes and ownership
Jan F. Chadima a3ba41
              of the user's files and home directory before accepting login.
Jan F 003cb0
diff -up openssh-5.8p1/sshd_config.5.vendor openssh-5.8p1/sshd_config.5
Jan F 003cb0
--- openssh-5.8p1/sshd_config.5.vendor	2011-02-09 22:39:54.000000000 +0100
Jan F 003cb0
+++ openssh-5.8p1/sshd_config.5	2011-02-09 22:39:55.000000000 +0100
Jan F 003cb0
@@ -931,6 +931,14 @@ This option applies to protocol version 
Jan F 003cb0
 .It Cm ServerKeyBits
Jan F 003cb0
 Defines the number of bits in the ephemeral protocol version 1 server key.
Jan F 003cb0
 The minimum value is 512, and the default is 1024.
Jan F 003cb0
+.It Cm ShowPatchLevel 
Jan F 003cb0
+Specifies whether 
Jan F 003cb0
+.Nm sshd 
Jan F 003cb0
+will display the patch level of the binary in the identification string. 
Jan F 003cb0
+The patch level is set at compile-time. 
Jan F 003cb0
+The default is 
Jan F 003cb0
+.Dq no . 
Jan F 003cb0
+This option applies to protocol version 1 only. 
Jan F 003cb0
 .It Cm StrictModes
Jan F 003cb0
 Specifies whether
Jan F 003cb0
 .Xr sshd 8
Jan F 003cb0
diff -up openssh-5.8p1/sshd_config.vendor openssh-5.8p1/sshd_config
Jan F 003cb0
--- openssh-5.8p1/sshd_config.vendor	2011-02-09 22:39:54.000000000 +0100
Jan F 003cb0
+++ openssh-5.8p1/sshd_config	2011-02-09 22:39:55.000000000 +0100
Jan F. Chadima a3ba41
@@ -112,6 +112,7 @@ X11Forwarding yes
Jan F. Chadima a3ba41
 #Compression delayed
Jan F. Chadima a3ba41
 #ClientAliveInterval 0
Jan F. Chadima a3ba41
 #ClientAliveCountMax 3
Jan F. Chadima a3ba41
+#ShowPatchLevel no
Jan F. Chadima a3ba41
 #UseDNS yes
Jan F. Chadima a3ba41
 #PidFile /var/run/sshd.pid
Jan F. Chadima a3ba41
 #MaxStartups 10
Jan F 003cb0
diff -up openssh-5.8p1/sshd.c.vendor openssh-5.8p1/sshd.c
Jan F 003cb0
--- openssh-5.8p1/sshd.c.vendor	2011-02-09 22:39:55.000000000 +0100
Jan F 003cb0
+++ openssh-5.8p1/sshd.c	2011-02-09 22:39:55.000000000 +0100
Jan F 003cb0
@@ -419,7 +419,7 @@ sshd_exchange_identification(int sock_in
Jan F. Chadima a3ba41
 		minor = PROTOCOL_MINOR_1;
Jan F. Chadima a3ba41
 	}
Jan F. Chadima a3ba41
 	snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", major, minor,
Jan F. Chadima a3ba41
-	    SSH_VERSION, newline);
Jan F. Chadima a3ba41
+	   (options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_VERSION, newline);
Jan F. Chadima a3ba41
 	server_version_string = xstrdup(buf);
Jan F. Chadima a3ba41
 
Jan F. Chadima a3ba41
 	/* Send our protocol version identification. */
Jan F 003cb0
@@ -1550,7 +1550,8 @@ main(int ac, char **av)
Jan F. Chadima a3ba41
 		exit(1);
Jan F. Chadima a3ba41
 	}
Jan F. Chadima a3ba41
 
Jan F. Chadima a3ba41
-	debug("sshd version %.100s", SSH_RELEASE);
Jan F. Chadima a3ba41
+	debug("sshd version %.100s",
Jan F. Chadima a3ba41
+	      (options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_RELEASE);
Jan F. Chadima a3ba41
 
Jan F. Chadima a3ba41
 	/* Store privilege separation user for later use if required. */
Jan F. Chadima a3ba41
 	if ((privsep_pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) {