openssh: Fix version stuff.
authorPeter Avalos <pavalos@dragonflybsd.org>
Sun, 25 Jan 2015 22:00:28 +0000 (14:00 -0800)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 25 Jan 2015 22:00:28 +0000 (14:00 -0800)
The previous code was trying to get too fancy by trying to use
configuration options in places where those options weren't sent yet.

Fix a case in sshconnect.c where version_addendum wasn't being used.

Update README.DRAGONFLY to reflect the latest upgrade instructions.

crypto/openssh/README.DRAGONFLY
crypto/openssh/ssh.c
crypto/openssh/sshconnect.c
crypto/openssh/sshd.c
crypto/openssh/version.h

index b383ee7..b890d98 100644 (file)
@@ -5,9 +5,10 @@ A list of deleted files is in README.DELETED.
 
 Upgrading notes:
 ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-sandbox=rlimit \
-       --with-pam --with-tcp-wrappers --with-libedit --with-ssl-engine
+       --with-pam --with-libedit --with-ssl-engine
 
-Update config.h and version.h in secure/lib/libssh.
+Update SSH_VERSION_DRAGONFLY in version.h.
+Update config.h in secure/lib/libssh.
 Update ssh{,d}_config and ssh{,d}_config.5.
 Update ssh_namespace.h
 
index b6a0cb1..9aeaf49 100644 (file)
@@ -636,22 +636,14 @@ main(int ac, char **av)
                        }
                        break;
                case 'V':
-                       if (options.version_addendum &&
-                           *options.version_addendum != '\0')
-                               fprintf(stderr, "%s%s %s, %s\n", SSH_RELEASE,
-                                   options.hpn_disabled ? "" : SSH_VERSION_HPN,
-                                   options.version_addendum,
-                                   SSLeay_version(SSLEAY_VERSION));
-                       else
-                               fprintf(stderr, "%s%s, %s\n",
-                                   SSH_RELEASE,
-                                   options.hpn_disabled ? "" : SSH_VERSION_HPN,
+                       fprintf(stderr, "%s%s %s, %s\n", SSH_RELEASE,
+                           SSH_VERSION_HPN, SSH_VERSION_DRAGONFLY,
 #ifdef WITH_OPENSSL
-                                   SSLeay_version(SSLEAY_VERSION)
+                           SSLeay_version(SSLEAY_VERSION)
 #else
-                                   "without OpenSSL"
+                           "without OpenSSL"
 #endif
-                               );
+                       );
                        if (opt == 'V')
                                exit(0);
                        break;
index 7900919..f108101 100644 (file)
@@ -548,13 +548,12 @@ static void
 send_client_banner(int connection_out, int minor1)
 {
        /* Send our own protocol version identification. */
-       if (compat20) {
-               xasprintf(&client_version_string, "SSH-%d.%d-%.100s\r\n",
-                   PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_RELEASE);
-       } else {
-               xasprintf(&client_version_string, "SSH-%d.%d-%.100s\n",
-                   PROTOCOL_MAJOR_1, minor1, SSH_RELEASE);
-       }
+       xasprintf(&client_version_string, "SSH-%d.%d-%.100s%s%s%s%s",
+           compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
+           compat20 ? PROTOCOL_MINOR_2 : minor1,
+           SSH_RELEASE, options.hpn_disabled ? "" : SSH_VERSION_HPN,
+           *options.version_addendum == '\0' ? "" : " ",
+           options.version_addendum, compat20 ? "\r\n" : "\n");
        if (roaming_atomicio(vwrite, connection_out, client_version_string,
            strlen(client_version_string)) != strlen(client_version_string))
                fatal("write: %.100s", strerror(errno));
index 3de6f7f..39fb4b8 100644 (file)
@@ -435,8 +435,9 @@ sshd_exchange_identification(int sock_in, int sock_out)
                minor = PROTOCOL_MINOR_1;
        }
 
-       xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
+       xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s%s",
            major, minor, SSH_RELEASE,
+           options.hpn_disabled ? "" : SSH_VERSION_HPN,
            *options.version_addendum == '\0' ? "" : " ",
            options.version_addendum, newline);
 
@@ -940,8 +941,8 @@ drop_connection(int startups)
 static void
 usage(void)
 {
-       fprintf(stderr, "%s, %s\n",
-           SSH_RELEASE,
+       fprintf(stderr, "%s%s %s, %s\n",
+           SSH_RELEASE, SSH_VERSION_HPN, SSH_VERSION_DRAGONFLY,
 #ifdef WITH_OPENSSL
            SSLeay_version(SSLEAY_VERSION)
 #else
index abef40c..83a605c 100644 (file)
@@ -3,7 +3,7 @@
 #define SSH_VERSION    "OpenSSH_6.7"
 
 #define SSH_PORTABLE   "p1"
+#define SSH_RELEASE    SSH_VERSION SSH_PORTABLE
 
 #define SSH_VERSION_DRAGONFLY  "DragonFly-20050123"
 #define SSH_VERSION_HPN        "_hpn14v5"
-#define SSH_RELEASE    SSH_VERSION SSH_PORTABLE SSH_VERSION_HPN