components/openssh/patches/014-disable_banner.patch
author Jan Parcel <jan.parcel@oracle.com>
Mon, 01 Feb 2016 06:53:50 -0800
changeset 5376 4615bc2f4a50
parent 4503 bf30d46ab06e
child 6930 31ef2580c45d
permissions -rw-r--r--
22631538 Patch comment incorrect/outdated for patch 039-sshd_config_5_defaults.patch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     1
#
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     2
# This patch is to add a new DisableBanner option to the ssh client command,
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     3
# which allows the ssh command to disable the display of the banner message.
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     4
# We have contributed back this feature to the OpenSSH upstream community. For
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     5
# more information, see https://bugzilla.mindrot.org/show_bug.cgi?id=2242.
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     6
# In the future, if this feature is accepted by the upsteam in a later release,
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     7
# we will remove this patch when we upgrade to that release.  
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
     8
#
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
     9
diff -pur old/readconf.c new/readconf.c
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    10
--- old/readconf.c	2015-03-28 21:57:35.551727235 +0100
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    11
+++ new/readconf.c	2015-03-28 22:06:01.694836272 +0100
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    12
@@ -150,6 +150,9 @@ typedef enum {
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    13
 	oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    14
 	oSendEnv, oControlPath, oControlMaster, oControlPersist,
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    15
 	oHashKnownHosts,
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    16
+#ifdef DISABLE_BANNER 
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    17
+	oDisableBanner,
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    18
+#endif
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    19
 	oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    20
 	oVisualHostKey, oUseRoaming,
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    21
 	oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, oProxyUseFdpass,
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    22
@@ -254,6 +257,9 @@ static struct {
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    23
 	{ "controlmaster", oControlMaster },
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    24
 	{ "controlpersist", oControlPersist },
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    25
 	{ "hashknownhosts", oHashKnownHosts },
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    26
+#ifdef DISABLE_BANNER
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    27
+	{ "disablebanner", oDisableBanner },
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    28
+#endif
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    29
 	{ "tunnel", oTunnel },
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    30
 	{ "tunneldevice", oTunnelDevice },
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    31
 	{ "localcommand", oLocalCommand },
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    32
@@ -754,6 +760,17 @@ static const struct multistate multistat
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    33
 	{ NULL, -1 }
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    34
 };
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    35
 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    36
+#ifdef DISABLE_BANNER
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    37
+static const struct multistate multistate_disablebanner[] = {
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    38
+	{ "true",			SSH_DISABLEBANNER_YES },
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    39
+	{ "false",			SSH_DISABLEBANNER_NO },
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    40
+	{ "yes",			SSH_DISABLEBANNER_YES },
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    41
+	{ "no",				SSH_DISABLEBANNER_NO },
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    42
+	{ "in-exec-mode",		SSH_DISABLEBANNER_INEXECMODE },
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    43
+	{ NULL, -1 }
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    44
+}; 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    45
+#endif
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    46
+
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    47
 /*
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    48
  * Processes a single option line as used in the configuration files. This
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    49
  * only sets those values that have not already been set.
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    50
@@ -1514,6 +1531,13 @@ parse_int:
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    51
 			*charptr = xstrdup(arg);
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    52
 		break;
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    53
 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    54
+#ifdef DISABLE_BANNER
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    55
+	case oDisableBanner:
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    56
+	        intptr = &options->disable_banner;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    57
+                multistate_ptr = multistate_disablebanner;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    58
+                goto parse_multistate; 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    59
+#endif
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    60
+
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    61
 	case oDeprecated:
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    62
 		debug("%s line %d: Deprecated option \"%s\"",
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    63
 		    filename, linenum, keyword);
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    64
@@ -1684,6 +1708,9 @@ initialize_options(Options * options)
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    65
 	options->ip_qos_bulk = -1;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    66
 	options->request_tty = -1;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    67
 	options->proxy_use_fdpass = -1;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    68
+#ifdef DISABLE_BANNER
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    69
+	options->disable_banner = -1;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    70
+#endif
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    71
 	options->ignored_unknown = NULL;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    72
 	options->num_canonical_domains = 0;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    73
 	options->num_permitted_cnames = 0;
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    74
@@ -1871,6 +1898,10 @@ fill_default_options(Options * options)
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    75
 		options->canonicalize_fallback_local = 1;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    76
 	if (options->canonicalize_hostname == -1)
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    77
 		options->canonicalize_hostname = SSH_CANONICALISE_NO;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    78
+#ifdef DISABLE_BANNER
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    79
+	if (options->disable_banner == -1)
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    80
+		options->disable_banner = 0;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    81
+#endif
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    82
 	if (options->fingerprint_hash == -1)
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    83
 		options->fingerprint_hash = SSH_FP_HASH_DEFAULT;
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    84
 	if (options->update_hostkeys == -1)
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    85
diff -pur old/readconf.h new/readconf.h
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    86
--- old/readconf.h	2015-03-17 06:49:20.000000000 +0100
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    87
+++ new/readconf.h	2015-03-28 21:57:35.684348892 +0100
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    88
@@ -153,6 +153,9 @@ typedef struct {
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    89
 	char	*hostbased_key_types;
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    90
 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    91
 	char	*ignored_unknown; /* Pattern list of unknown tokens to ignore */
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    92
+#ifdef DISABLE_BANNER
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    93
+        int     disable_banner; /* Disable display of banner */
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    94
+#endif
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    95
 }       Options;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    96
 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    97
 #define SSH_CANONICALISE_NO	0
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    98
@@ -178,6 +181,12 @@ typedef struct {
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    99
 #define SSH_UPDATE_HOSTKEYS_YES	1
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
   100
 #define SSH_UPDATE_HOSTKEYS_ASK	2
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   101
 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   102
+#ifdef DISABLE_BANNER
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   103
+#define SSH_DISABLEBANNER_NO		0
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   104
+#define SSH_DISABLEBANNER_YES		1
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   105
+#define SSH_DISABLEBANNER_INEXECMODE	2
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   106
+#endif
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   107
+
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   108
 void     initialize_options(Options *);
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   109
 void     fill_default_options(Options *);
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
   110
 void	 fill_default_options_for_canonicalization(Options *);
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
   111
diff -pur old/ssh_config.5 new/ssh_config.5
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
   112
--- old/ssh_config.5	2015-03-28 21:57:35.544033907 +0100
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
   113
+++ new/ssh_config.5	2015-03-28 21:57:35.684635985 +0100
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
   114
@@ -566,6 +566,14 @@ If set to a time in seconds, or a time i
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   115
 then the backgrounded master connection will automatically terminate
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   116
 after it has remained idle (with no client connections) for the
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   117
 specified time.
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   118
+.It Cm DisableBanner
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   119
+If set to yes, disables the display of the  banner  message.
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   120
+If set to in-exec-mode, disables the display of banner message when in remote 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   121
+command mode only.
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   122
+.Pp
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   123
+The default value is no, which means that the banner is displayed unless the 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   124
+log level  is  QUIET, FATAL, or ERROR. See also the Banner option in
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   125
+.Xr sshd_config 4 . This option applies to protocol version 2 only.
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   126
 .It Cm DynamicForward
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   127
 Specifies that a TCP port on the local machine be forwarded
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   128
 over the secure channel, and the application
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
   129
diff -pur old/sshconnect2.c new/sshconnect2.c
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
   130
--- old/sshconnect2.c	2015-03-17 06:49:20.000000000 +0100
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
   131
+++ new/sshconnect2.c	2015-03-28 21:57:35.684940995 +0100
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
   132
@@ -81,6 +81,10 @@ extern char *client_version_string;
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   133
 extern char *server_version_string;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   134
 extern Options options;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   135
 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   136
+#ifdef DISABLE_BANNER
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   137
+extern Buffer command;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   138
+#endif
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   139
+
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   140
 /*
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   141
  * SSH2 key exchange
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   142
  */
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
   143
@@ -480,7 +484,20 @@ input_userauth_banner(int type, u_int32_
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   144
 	debug3("input_userauth_banner");
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   145
 	raw = packet_get_string(&len);
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   146
 	lang = packet_get_string(NULL);
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   147
+
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   148
+#ifdef DISABLE_BANNER
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   149
+	/*
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   150
+	 * Banner is a warning message according to RFC 4252. So, never print
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   151
+	 * a banner in error log level or lower. If the log level is higher,
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   152
+	 * use DisableBanner option to decide whether to display it or not.
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   153
+	 */
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   154
+	if (len > 0 && options.log_level >= SYSLOG_LEVEL_INFO && 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   155
+            (options.disable_banner == SSH_DISABLEBANNER_NO ||
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   156
+            (options.disable_banner == SSH_DISABLEBANNER_INEXECMODE &&
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   157
+            buffer_len(&command) == 0))) {
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   158
+#else
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   159
 	if (len > 0 && options.log_level >= SYSLOG_LEVEL_INFO) {
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   160
+#endif
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   161
 		if (len > 65536)
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   162
 			len = 65536;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   163
 		msg = xmalloc(len * 4 + 1); /* max expansion from strnvis() */