components/openssh/patches/014-disable_banner.patch
author Sean Wilcox <sean.wilcox@oracle.com>
Tue, 08 Nov 2016 11:16:49 -0700
changeset 7262 19860fd7b64f
parent 6930 31ef2580c45d
permissions -rw-r--r--
24692363 restart of nova-compute went to maintenance
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
#
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
     9
--- orig/readconf.c	Mon Aug 15 15:45:25 2016
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    10
+++ new/readconf.c	Mon Aug 15 15:53:23 2016
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    11
@@ -163,6 +163,9 @@
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    12
 	oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    13
 	oSendEnv, oControlPath, oControlMaster, oControlPersist,
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    14
 	oHashKnownHosts,
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    15
+#ifdef DISABLE_BANNER 
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    16
+        oDisableBanner,
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    17
+#endif
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    18
 	oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    19
 	oVisualHostKey,
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    20
 	oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, oProxyUseFdpass,
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    21
@@ -271,6 +274,9 @@
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    22
 	{ "controlmaster", oControlMaster },
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    23
 	{ "controlpersist", oControlPersist },
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    24
 	{ "hashknownhosts", oHashKnownHosts },
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    25
+#ifdef DISABLE_BANNER
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    26
+        { "disablebanner", oDisableBanner },
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    27
+#endif
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    28
 	{ "include", oInclude },
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 },
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    31
@@ -794,6 +800,18 @@
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    32
 	{ NULL, -1 }
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    33
 };
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    34
 
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    35
+ 
1924
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[] = {
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    38
+        { "true",                       SSH_DISABLEBANNER_YES },
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    39
+        { "false",                      SSH_DISABLEBANNER_NO },
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    40
+        { "yes",                        SSH_DISABLEBANNER_YES },
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    41
+        { "no",                         SSH_DISABLEBANNER_NO },
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    42
+        { "in-exec-mode",               SSH_DISABLEBANNER_INEXECMODE },
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    43
+        { NULL, -1 }
1924
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.
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    50
@@ -1657,6 +1675,13 @@
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    51
 		charptr = &options->identity_agent;
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    52
 		goto parse_string;
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
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    55
+        case oDisableBanner:
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    56
+                intptr = &options->disable_banner;
1924
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);
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    64
@@ -1847,6 +1872,9 @@
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
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    69
+        options->disable_banner = -1;
1924
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;
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    74
@@ -2041,6 +2069,10 @@
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
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    79
+        if (options->disable_banner == -1)
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    80
+                options->disable_banner = 0;
1924
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)
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    85
--- orig/readconf.h	Mon Aug 15 15:45:28 2016
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    86
+++ new/readconf.h	Mon Aug 15 15:55:00 2016
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    87
@@ -169,6 +169,9 @@
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    88
 	char   *jump_extra;
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    89
 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    90
 	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
    91
+#ifdef DISABLE_BANNER
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    92
+        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
    93
+#endif
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    94
 }       Options;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    95
 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
    96
 #define SSH_CANONICALISE_NO	0
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
    97
@@ -195,6 +198,12 @@
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    98
 #define SSH_UPDATE_HOSTKEYS_YES	1
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
    99
 #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
   100
 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   101
+#ifdef DISABLE_BANNER
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   102
+#define SSH_DISABLEBANNER_NO            0
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   103
+#define SSH_DISABLEBANNER_YES           1
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   104
+#define SSH_DISABLEBANNER_INEXECMODE    2
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   105
+#endif
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   106
+
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   107
 void     initialize_options(Options *);
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   108
 void     fill_default_options(Options *);
4503
bf30d46ab06e PSARC/2015/179 OpenSSH 6.8
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 1924
diff changeset
   109
 void	 fill_default_options_for_canonicalization(Options *);
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   110
--- orig/ssh_config.5	Mon Aug 15 15:45:37 2016
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   111
+++ new/ssh_config.5	Mon Aug 15 15:57:36 2016
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   112
@@ -643,6 +643,14 @@
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   113
 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
   114
 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
   115
 specified time.
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   116
+.It Cm DisableBanner
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   117
+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
   118
+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
   119
+command mode only.
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   120
+.Pp
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   121
+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
   122
+log level  is  QUIET, FATAL, or ERROR. See also the Banner option in
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   123
++.Xr sshd_config 5 . This option applies to protocol version 2 only.
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   124
 .It Cm DynamicForward
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   125
 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
   126
 over the secure channel, and the application
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   127
--- orig/sshconnect2.c	Mon Aug 15 15:45:44 2016
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   128
+++ new/sshconnect2.c	Thu Aug 18 18:28:20 2016
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   129
@@ -82,6 +82,10 @@
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   130
 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
   131
 extern Options options;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   132
 
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   133
+#ifdef DISABLE_BANNER
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   134
+extern Buffer command;
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   135
+#endif
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   136
+
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   137
 /*
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   138
  * SSH2 key exchange
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   139
  */
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   140
@@ -502,7 +506,20 @@
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   141
 	debug3("%s", __func__);
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   142
 	msg = packet_get_string(&len);
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   143
 	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
   144
+
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   145
+#ifdef DISABLE_BANNER
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   146
+        /*
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   147
+         * Banner is a warning message according to RFC 4252. So, never print
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   148
+         * a banner in error log level or lower. If the log level is higher,
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   149
+         * use DisableBanner option to decide whether to display it or not.
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   150
+         */
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   151
+        if (len > 0 && options.log_level >= SYSLOG_LEVEL_INFO && 
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   152
+            (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
   153
+            (options.disable_banner == SSH_DISABLEBANNER_INEXECMODE &&
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   154
+            buffer_len(&command) == 0))) 
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   155
+#else
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   156
 	if (len > 0 && options.log_level >= SYSLOG_LEVEL_INFO)
1924
72ec8810274b 18828925 migrate the disablebanner feature from SunSSH to OpenSSH
Huie-Ying Lee <huieying.lee@oracle.com>
parents:
diff changeset
   157
+#endif
6930
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   158
 		fmprintf(stderr, "%s", msg);
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   159
 	free(msg);
31ef2580c45d 24525860 upgrade OpenSSH to 7.3p1
Tomas Kuthan <tomas.kuthan@oracle.com>
parents: 4503
diff changeset
   160
 	free(lang);