]> andersk Git - openssh.git/blobdiff - sshconnect.c
Whoops, forgot changelog
[openssh.git] / sshconnect.c
index 835ca7b3abf4b68c7fecdb75a7ec0597aa94dd28..d6072b36c65eebf034722674b2b857664df41af8 100644 (file)
@@ -2,13 +2,18 @@
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
- * Created: Sat Mar 18 22:15:47 1995 ylo
  * Code to connect to a remote host, and to perform the client side of the
  * login (authentication) dialog.
+ *
+ * As far as I am concerned, the code I have written for this software
+ * can be used freely for any purpose.  Any derived versions of this
+ * software must be clearly marked as such, and if the derived work is
+ * incompatible with the protocol description in the RFC file, it must be
+ * called by a name other than "ssh" or "Secure Shell".
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshconnect.c,v 1.76 2000/06/17 20:30:10 markus Exp $");
+RCSID("$OpenBSD: sshconnect.c,v 1.79 2000/09/17 15:52:51 markus Exp $");
 
 #include <openssl/bn.h>
 #include <openssl/dsa.h>
@@ -108,15 +113,15 @@ ssh_proxy_connect(const char *host, u_short port, uid_t original_real_uid,
 
                /* Stderr is left as it is so that error messages get
                   printed on the user's terminal. */
-               argv[0] = "/bin/sh";
+               argv[0] = _PATH_BSHELL;
                argv[1] = "-c";
                argv[2] = command_string;
                argv[3] = NULL;
 
                /* Execute the proxy command.  Note that we gave up any
                   extra privileges above. */
-               execv("/bin/sh", argv);
-               perror("/bin/sh");
+               execv(_PATH_BSHELL, argv);
+               perror(_PATH_BSHELL);
                exit(1);
        }
        /* Parent. */
@@ -193,8 +198,8 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
        int gaierr;
        struct linger linger;
 
-       debug("ssh_connect: getuid %d geteuid %d anon %d",
-             (int) getuid(), (int) geteuid(), anonymous);
+       debug("ssh_connect: getuid %u geteuid %u anon %d",
+             (u_int) getuid(), (u_int) geteuid(), anonymous);
 
        /* Get default port if port has not been set. */
        if (port == 0) {
@@ -243,7 +248,11 @@ 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,
+#else
                            !anonymous && geteuid() == 0 && port < IPPORT_RESERVED,
+#endif
                            ai->ai_family);
                        if (sock < 0)
                                continue;
@@ -435,8 +444,10 @@ read_yes_or_no(const char *prompt, int defval)
                        retval = defval;
                if (strcmp(buf, "yes") == 0)
                        retval = 1;
-               if (strcmp(buf, "no") == 0)
+               else if (strcmp(buf, "no") == 0)
                        retval = 0;
+               else
+                       fprintf(stderr, "Please type 'yes' or 'no'.\n");
 
                if (retval != -1) {
                        if (f != stdin)
@@ -669,7 +680,7 @@ ssh_login(int host_key_valid, RSA *own_host_key, const char *orighost,
        /* Get local user name.  Use it as server user if no user name was given. */
        pw = getpwuid(original_real_uid);
        if (!pw)
-               fatal("User id %d not found from user database.", original_real_uid);
+               fatal("User id %u not found from user database.", original_real_uid);
        local_user = xstrdup(pw->pw_name);
        server_user = options.user ? options.user : local_user;
 
This page took 0.034754 seconds and 4 git commands to generate.