]> andersk Git - openssh.git/blobdiff - ssh.c
*** empty log message ***
[openssh.git] / ssh.c
diff --git a/ssh.c b/ssh.c
index ac1c1db4afc323beb90ce2cb65e99deb76be2bf9..21bfc56e372e5ac345bdfa222cac750662c45566 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -40,7 +40,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh.c,v 1.187 2002/11/21 23:04:33 markus Exp $");
+RCSID("$OpenBSD: ssh.c,v 1.190 2003/02/06 09:27:29 markus Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/err.h>
@@ -253,7 +253,7 @@ main(int ac, char **av)
        /* Get user data. */
        pw = getpwuid(original_real_uid);
        if (!pw) {
-               log("You don't exist, go away!");
+               logit("You don't exist, go away!");
                exit(1);
        }
        /* Take a copy of the returned structure. */
@@ -495,9 +495,9 @@ again:
        av += optind;
 
        if (ac > 0 && !host && **av != '-') {
-               if (strchr(*av, '@')) {
+               if (strrchr(*av, '@')) {
                        p = xstrdup(*av);
-                       cp = strchr(p, '@');
+                       cp = strrchr(p, '@');
                        if (cp == NULL || cp == p)
                                usage();
                        options.user = p;
@@ -505,12 +505,11 @@ again:
                        host = ++cp;
                } else
                        host = *av;
-               ac--, av++;
-               if (ac > 0) {
-                       optind = 0;
-                       optreset = 1;
+               if (ac > 1) {
+                       optind = optreset = 1;
                        goto again;
                }
+               ac--, av++;
        }
 
        /* Check that we got a host name. */
@@ -560,7 +559,7 @@ again:
        /* Do not allocate a tty if stdin is not a tty. */
        if (!isatty(fileno(stdin)) && !force_tty_flag) {
                if (tty_flag)
-                       log("Pseudo-terminal will not be allocated because stdin is not a terminal.");
+                       logit("Pseudo-terminal will not be allocated because stdin is not a terminal.");
                tty_flag = 0;
        }
 
@@ -602,6 +601,10 @@ again:
        if (options.hostname != NULL)
                host = options.hostname;
 
+       if (options.proxy_command != NULL &&
+           strcmp(options.proxy_command, "none") == 0)
+               options.proxy_command = NULL;
+
        /* Disable rhosts authentication if not running as root. */
 #ifdef HAVE_CYGWIN
        /* Ignore uid if running under Windows */
@@ -790,7 +793,7 @@ x11_get_proto(char **_proto, char **_data)
        if (!got_data) {
                u_int32_t rand = 0;
 
-               log("Warning: No xauth data; using fake authentication data for X11 forwarding.");
+               logit("Warning: No xauth data; using fake authentication data for X11 forwarding.");
                strlcpy(proto, "MIT-MAGIC-COOKIE-1", sizeof proto);
                for (i = 0; i < 16; i++) {
                        if (i % 4 == 0)
@@ -870,7 +873,7 @@ ssh_session(void)
                if (type == SSH_SMSG_SUCCESS)
                        packet_start_compression(options.compression_level);
                else if (type == SSH_SMSG_FAILURE)
-                       log("Warning: Remote host refused compression.");
+                       logit("Warning: Remote host refused compression.");
                else
                        packet_disconnect("Protocol error waiting for compression response.");
        }
@@ -909,7 +912,7 @@ ssh_session(void)
                        interactive = 1;
                        have_tty = 1;
                } else if (type == SSH_SMSG_FAILURE)
-                       log("Warning: Remote host failed or refused to allocate a pseudo tty.");
+                       logit("Warning: Remote host failed or refused to allocate a pseudo tty.");
                else
                        packet_disconnect("Protocol error waiting for pty request response.");
        }
@@ -927,7 +930,7 @@ ssh_session(void)
                if (type == SSH_SMSG_SUCCESS) {
                        interactive = 1;
                } else if (type == SSH_SMSG_FAILURE) {
-                       log("Warning: Remote host denied X11 forwarding.");
+                       logit("Warning: Remote host denied X11 forwarding.");
                } else {
                        packet_disconnect("Protocol error waiting for X11 forwarding");
                }
@@ -946,7 +949,7 @@ ssh_session(void)
                type = packet_read();
                packet_check_eom();
                if (type != SSH_SMSG_SUCCESS)
-                       log("Warning: Remote host denied authentication agent forwarding.");
+                       logit("Warning: Remote host denied authentication agent forwarding.");
        }
 
        /* Initiate port forwardings. */
@@ -1014,7 +1017,7 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt)
            options.remote_forwards[i].host,
            options.remote_forwards[i].host_port);
        if (type == SSH2_MSG_REQUEST_FAILURE)
-               log("Warning: remote port forwarding failed for listen port %d",
+               logit("Warning: remote port forwarding failed for listen port %d",
                    options.remote_forwards[i].port);
 }
 
This page took 0.07612 seconds and 4 git commands to generate.