]> andersk Git - openssh.git/blobdiff - sshconnect.c
- (djm) Merge OpenBSD changes:
[openssh.git] / sshconnect.c
index d6072b36c65eebf034722674b2b857664df41af8..12ca69fd6b6b45316eecc35b74e541538454ba2f 100644 (file)
@@ -13,7 +13,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshconnect.c,v 1.79 2000/09/17 15:52:51 markus Exp $");
+RCSID("$OpenBSD: sshconnect.c,v 1.81 2000/11/06 23:16:35 markus Exp $");
 
 #include <openssl/bn.h>
 #include <openssl/dsa.h>
@@ -249,9 +249,9 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
                        /* Create a socket for connecting. */
                        sock = ssh_create_socket(original_real_uid,
 #ifdef HAVE_CYGWIN
-                           !anonymous && port < IPPORT_RESERVED,
+                           !anonymous,
 #else
-                           !anonymous && geteuid() == 0 && port < IPPORT_RESERVED,
+                           !anonymous && geteuid() == 0,
 #endif
                            ai->ai_family);
                        if (sock < 0)
@@ -321,6 +321,7 @@ ssh_exchange_identification()
        int remote_major, remote_minor, i, mismatch;
        int connection_in = packet_get_connection_in();
        int connection_out = packet_get_connection_out();
+       int minor1 = PROTOCOL_MINOR_1; 
 
        /* Read other side\'s version identification. */
        for (;;) {
@@ -374,9 +375,10 @@ ssh_exchange_identification()
                }
                if (remote_minor < 3) {
                        fatal("Remote machine has too old SSH software version.");
-               } else if (remote_minor == 3) {
+               } else if (remote_minor == 3 || remote_minor == 4) {
                        /* We speak 1.3, too. */
                        enable_compat13();
+                       minor1 = 3;
                        if (options.forward_agent) {
                                log("Agent forwarding disabled for protocol 1.3");
                                options.forward_agent = 0;
@@ -402,7 +404,7 @@ ssh_exchange_identification()
        /* Send our own protocol version identification. */
        snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n",
            compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
-           compat20 ? PROTOCOL_MINOR_2 : PROTOCOL_MINOR_1,
+           compat20 ? PROTOCOL_MINOR_2 : minor1,
            SSH_VERSION);
        if (atomicio(write, connection_out, buf, strlen(buf)) != strlen(buf))
                fatal("write: %.100s", strerror(errno));
This page took 0.034666 seconds and 4 git commands to generate.