vishalmishra434 / rpms / openssh

Forked from rpms/openssh 3 months ago
Clone
Tomáš Mráz c9833c
diff -up openssh-4.7p1/configure.ac.vendor openssh-4.7p1/configure.ac
Tomáš Mráz c9833c
--- openssh-4.7p1/configure.ac.vendor	2007-09-06 16:27:47.000000000 +0200
Tomáš Mráz c9833c
+++ openssh-4.7p1/configure.ac	2007-09-06 16:27:47.000000000 +0200
Tomáš Mráz c9833c
@@ -3792,6 +3792,12 @@ AC_ARG_WITH(lastlog,
Tomáš Mráz ad07b9
 		fi
Tomáš Mráz ad07b9
 	]
Tomáš Mráz ad07b9
 )
Tomáš Mráz ad07b9
+AC_ARG_ENABLE(vendor-patchlevel,
Tomáš Mráz ad07b9
+  [  --enable-vendor-patchlevel=TAG  specify a vendor patch level],
Tomáš Mráz ad07b9
+  [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.])
Tomáš Mráz ad07b9
+   SSH_VENDOR_PATCHLEVEL="$enableval"],
Tomáš Mráz ad07b9
+  [AC_DEFINE(SSH_VENDOR_PATCHLEVEL,SSH_RELEASE,[Define to your vendor patch level, if it has been modified from the upstream source release.])
Tomáš Mráz ad07b9
+   SSH_VENDOR_PATCHLEVEL=none])
Tomáš Mráz ad07b9
 
Tomáš Mráz ad07b9
 dnl lastlog, [uw]tmpx? detection
Tomáš Mráz ad07b9
 dnl  NOTE: set the paths in the platform section to avoid the
Tomáš Mráz c9833c
@@ -4041,6 +4047,7 @@ echo "       IP address in \$DISPLAY hac
Tomáš Mráz ad07b9
 echo "           Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
Tomáš Mráz ad07b9
 echo "                  BSD Auth support: $BSD_AUTH_MSG"
Tomáš Mráz ad07b9
 echo "              Random number source: $RAND_MSG"
Tomáš Mráz ad07b9
+echo "                Vendor patch level: $SSH_VENDOR_PATCHLEVEL"
Tomáš Mráz ad07b9
 if test ! -z "$USE_RAND_HELPER" ; then
Tomáš Mráz ad07b9
 echo "     ssh-rand-helper collects from: $RAND_HELPER_MSG"
Tomáš Mráz ad07b9
 fi
Tomáš Mráz c9833c
diff -up openssh-4.7p1/sshd_config.5.vendor openssh-4.7p1/sshd_config.5
Tomáš Mráz c9833c
--- openssh-4.7p1/sshd_config.5.vendor	2007-09-06 16:27:47.000000000 +0200
Tomáš Mráz c9833c
+++ openssh-4.7p1/sshd_config.5	2007-09-06 16:27:47.000000000 +0200
Tomáš Mráz c9833c
@@ -725,6 +725,14 @@ This option applies to protocol version 
Tomáš Mráz c9833c
 .It Cm ServerKeyBits
Tomáš Mráz c9833c
 Defines the number of bits in the ephemeral protocol version 1 server key.
Tomáš Mráz c9833c
 The minimum value is 512, and the default is 768.
Tomáš Mráz c9833c
+.It Cm ShowPatchLevel
Tomáš Mráz c9833c
+Specifies whether
Tomáš Mráz c9833c
+.Nm sshd
Tomáš Mráz c9833c
+will display the patch level of the binary in the identification string.
Tomáš Mráz c9833c
+The patch level is set at compile-time.
Tomáš Mráz c9833c
+The default is
Tomáš Mráz c9833c
+.Dq no .
Tomáš Mráz c9833c
+This option applies to protocol version 1 only.
Tomáš Mráz c9833c
 .It Cm StrictModes
Tomáš Mráz c9833c
 Specifies whether
Tomáš Mráz c9833c
 .Xr sshd 8
Tomáš Mráz c9833c
diff -up openssh-4.7p1/servconf.h.vendor openssh-4.7p1/servconf.h
Tomáš Mráz c9833c
--- openssh-4.7p1/servconf.h.vendor	2007-02-19 12:25:38.000000000 +0100
Tomáš Mráz c9833c
+++ openssh-4.7p1/servconf.h	2007-09-06 16:27:47.000000000 +0200
Tomáš Mráz c9833c
@@ -120,6 +120,7 @@ typedef struct {
Tomáš Mráz c9833c
 	int	max_startups;
Tomáš Mráz c9833c
 	int	max_authtries;
Tomáš Mráz c9833c
 	char   *banner;			/* SSH-2 banner message */
Tomáš Mráz c9833c
+	int	show_patchlevel;	/* Show vendor patch level to clients */
Tomáš Mráz c9833c
 	int	use_dns;
Tomáš Mráz c9833c
 	int	client_alive_interval;	/*
Tomáš Mráz c9833c
 					 * poke the client this often to
Tomáš Mráz c9833c
diff -up openssh-4.7p1/servconf.c.vendor openssh-4.7p1/servconf.c
Tomáš Mráz c9833c
--- openssh-4.7p1/servconf.c.vendor	2007-05-20 07:03:16.000000000 +0200
Tomáš Mráz c9833c
+++ openssh-4.7p1/servconf.c	2007-09-06 16:29:11.000000000 +0200
Tomáš Mráz c9833c
@@ -113,6 +113,7 @@ initialize_server_options(ServerOptions 
Tomáš Mráz ad07b9
 	options->max_startups = -1;
Tomáš Mráz ad07b9
 	options->max_authtries = -1;
Tomáš Mráz ad07b9
 	options->banner = NULL;
Tomáš Mráz ad07b9
+	options->show_patchlevel = -1;
Tomáš Mráz ad07b9
 	options->use_dns = -1;
Tomáš Mráz ad07b9
 	options->client_alive_interval = -1;
Tomáš Mráz ad07b9
 	options->client_alive_count_max = -1;
Tomáš Mráz c9833c
@@ -250,6 +251,9 @@ fill_default_server_options(ServerOption
Tomáš Mráz ad07b9
 	if (options->permit_tun == -1)
Tomáš Mráz ad07b9
 		options->permit_tun = SSH_TUNMODE_NO;
Tomáš Mráz ad07b9
 
Tomáš Mráz ad07b9
+	if (options->show_patchlevel == -1)
Tomáš Mráz ad07b9
+		options->show_patchlevel = 0;
Tomáš Mráz ad07b9
+
Tomáš Mráz ad07b9
 	/* Turn privilege separation on by default */
Tomáš Mráz ad07b9
 	if (use_privsep == -1)
Tomáš Mráz ad07b9
 		use_privsep = 1;
Tomáš Mráz c9833c
@@ -293,6 +297,7 @@ typedef enum {
Tomáš Mráz ad07b9
 	sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel,
Tomáš Mráz ad07b9
 	sMatch, sPermitOpen, sForceCommand,
Tomáš Mráz ad07b9
 	sUsePrivilegeSeparation,
Tomáš Mráz ad07b9
+	sShowPatchLevel,
Tomáš Mráz ad07b9
 	sDeprecated, sUnsupported
Tomáš Mráz ad07b9
 } ServerOpCodes;
Tomáš Mráz ad07b9
 
Tomáš Mráz c9833c
@@ -390,6 +395,7 @@ static struct {
Tomáš Mráz ad07b9
 	{ "maxstartups", sMaxStartups, SSHCFG_GLOBAL },
Tomáš Mráz ad07b9
 	{ "maxauthtries", sMaxAuthTries, SSHCFG_GLOBAL },
Tomáš Mráz c9833c
 	{ "banner", sBanner, SSHCFG_ALL },
Tomáš Mráz ad07b9
+	{ "showpatchlevel", sShowPatchLevel, SSHCFG_GLOBAL },
Tomáš Mráz ad07b9
 	{ "usedns", sUseDNS, SSHCFG_GLOBAL },
Tomáš Mráz ad07b9
 	{ "verifyreversemapping", sDeprecated, SSHCFG_GLOBAL },
Tomáš Mráz ad07b9
 	{ "reversemappingcheck", sDeprecated, SSHCFG_GLOBAL },
Tomáš Mráz c9833c
@@ -1005,6 +1011,10 @@ parse_flag:
Tomáš Mráz ad07b9
 		intptr = &use_privsep;
Tomáš Mráz ad07b9
 		goto parse_flag;
Tomáš Mráz ad07b9
 
Tomáš Mráz ad07b9
+	case sShowPatchLevel:
Tomáš Mráz ad07b9
+		intptr = &options->show_patchlevel;
Tomáš Mráz ad07b9
+		goto parse_flag;
Tomáš Mráz ad07b9
+
Tomáš Mráz ad07b9
 	case sAllowUsers:
Tomáš Mráz ad07b9
 		while ((arg = strdelim(&cp)) && *arg != '\0') {
Tomáš Mráz ad07b9
 			if (options->num_allow_users >= MAX_ALLOW_USERS)
Tomáš Mráz c9833c
diff -up openssh-4.7p1/sshd_config.0.vendor openssh-4.7p1/sshd_config.0
Tomáš Mráz c9833c
--- openssh-4.7p1/sshd_config.0.vendor	2007-09-06 16:27:47.000000000 +0200
Tomáš Mráz c9833c
+++ openssh-4.7p1/sshd_config.0	2007-09-06 16:27:47.000000000 +0200
Tomáš Mráz c9833c
@@ -418,6 +418,11 @@ DESCRIPTION
Tomáš Mráz c9833c
              Defines the number of bits in the ephemeral protocol version 1
Tomáš Mráz c9833c
              server key.  The minimum value is 512, and the default is 768.
Tomáš Mráz c9833c
 
Tomáš Mráz c9833c
+     ShowPatchLevel
Tomáš Mráz c9833c
+	     Specifies whether sshd will display the specific patch level of
Tomáš Mráz c9833c
+	     the binary in the server identification string.  The patch level
Tomáš Mráz c9833c
+	     is set at compile-time.  The default is M-bM-^@M-^\noM-bM-^@M-^].
Tomáš Mráz c9833c
+
Tomáš Mráz c9833c
      StrictModes
Tomáš Mráz c9833c
              Specifies whether sshd(8) should check file modes and ownership
Tomáš Mráz c9833c
              of the user's files and home directory before accepting login.
Tomáš Mráz c9833c
diff -up openssh-4.7p1/sshd_config.vendor openssh-4.7p1/sshd_config
Tomáš Mráz c9833c
--- openssh-4.7p1/sshd_config.vendor	2007-09-06 16:27:47.000000000 +0200
Tomáš Mráz c9833c
+++ openssh-4.7p1/sshd_config	2007-09-06 16:27:47.000000000 +0200
Tomáš Mráz c9833c
@@ -109,6 +109,7 @@ X11Forwarding yes
Tomáš Mráz c9833c
 #Compression delayed
Tomáš Mráz c9833c
 #ClientAliveInterval 0
Tomáš Mráz c9833c
 #ClientAliveCountMax 3
Tomáš Mráz c9833c
+#ShowPatchLevel no
Tomáš Mráz c9833c
 #UseDNS yes
Tomáš Mráz c9833c
 #PidFile /var/run/sshd.pid
Tomáš Mráz c9833c
 #MaxStartups 10
Tomáš Mráz c9833c
diff -up openssh-4.7p1/sshd.c.vendor openssh-4.7p1/sshd.c
Tomáš Mráz c9833c
--- openssh-4.7p1/sshd.c.vendor	2007-06-05 10:22:32.000000000 +0200
Tomáš Mráz c9833c
+++ openssh-4.7p1/sshd.c	2007-09-06 16:27:47.000000000 +0200
Tomáš Mráz c9833c
@@ -419,7 +419,8 @@ sshd_exchange_identification(int sock_in
Tomáš Mráz c9833c
 		major = PROTOCOL_MAJOR_1;
Tomáš Mráz c9833c
 		minor = PROTOCOL_MINOR_1;
Tomáš Mráz c9833c
 	}
Tomáš Mráz c9833c
-	snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", major, minor, SSH_VERSION);
Tomáš Mráz c9833c
+	snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", major, minor,
Tomáš Mráz c9833c
+		 (options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_VERSION);
Tomáš Mráz c9833c
 	server_version_string = xstrdup(buf);
Tomáš Mráz c9833c
 
Tomáš Mráz c9833c
 	/* Send our protocol version identification. */
Tomáš Mráz c9833c
@@ -1434,7 +1435,8 @@ main(int ac, char **av)
Tomáš Mráz c9833c
 		exit(1);
Tomáš Mráz c9833c
 	}
Tomáš Mráz c9833c
 
Tomáš Mráz c9833c
-	debug("sshd version %.100s", SSH_RELEASE);
Tomáš Mráz c9833c
+	debug("sshd version %.100s",
Tomáš Mráz c9833c
+	      (options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_RELEASE);
Tomáš Mráz c9833c
 
Tomáš Mráz c9833c
 	/* Store privilege separation user for later use if required. */
Tomáš Mráz c9833c
 	if ((privsep_pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) {