]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2001/03/03 23:52:22
authormouring <mouring>
Mon, 5 Mar 2001 07:10:47 +0000 (07:10 +0000)
committermouring <mouring>
Mon, 5 Mar 2001 07:10:47 +0000 (07:10 +0000)
     [sftp.c]
     clean up arg processing. based on work by Christophe_Moret@hp.com

ChangeLog
sftp.c

index 65198b41aae700d8188c51bfb4c68a29c64f3f54..ced7cbfab78055caa181dadb021c7a616b83c71a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
    - deraadt@cvs.openbsd.org 2001/03/03 22:07:50
      [sftp-server.c]
      KNF
+   - markus@cvs.openbsd.org 2001/03/03 23:52:22
+     [sftp.c]
+     clean up arg processing. based on work by Christophe_Moret@hp.com
 
 20010304
  - (bal) Remove make-ssh-known-hosts.1 since it's no longer valid.
diff --git a/sftp.c b/sftp.c
index 16a2616a9aa085bab5c0aa0606ed9839c7080446..b2c4a649aa48a97d9b29eb4ab030d5a78c45ea69 100644 (file)
--- a/sftp.c
+++ b/sftp.c
@@ -24,7 +24,7 @@
 
 #include "includes.h"
 
-RCSID("$OpenBSD: sftp.c,v 1.8 2001/02/28 05:36:28 deraadt Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.9 2001/03/03 23:52:22 markus Exp $");
 
 /* XXX: commandline mode */
 /* XXX: copy between two remote hosts (commandline) */
@@ -91,24 +91,14 @@ make_ssh_args(char *add_arg)
        static char **args = NULL;
        static int nargs = 0;
        char debug_buf[4096];
-       int i, use_subsystem = 1;
-
-       /* no subsystem if protocol 1 or the server-spec contains a '/' */
-       if (use_ssh1 ||
-           (sftp_server != NULL && strchr(sftp_server, '/') != NULL))
-               use_subsystem = 0;
+       int i;
 
        /* Init args array */
        if (args == NULL) {
-               nargs = use_subsystem ? 6 : 5;
+               nargs = 2;
                i = 0;
                args = xmalloc(sizeof(*args) * nargs);
                args[i++] = "ssh";
-               args[i++] = use_ssh1 ? "-oProtocol=1" : "-oProtocol=2";
-               if (use_subsystem)
-                       args[i++] = "-s";
-               args[i++] = "-oForwardAgent=no";
-               args[i++] = "-oForwardX11=no";
                args[i++] = NULL;
        }
 
@@ -121,6 +111,13 @@ make_ssh_args(char *add_arg)
                return(NULL);
        }
 
+       /* no subsystem if the server-spec contains a '/' */
+       if (sftp_server == NULL || strchr(sftp_server, '/') == NULL)
+               make_ssh_args("-s");
+       make_ssh_args("-oForwardX11=no");
+       make_ssh_args("-oForwardAgent=no");
+       make_ssh_args(use_ssh1 ? "-oProtocol=1" : "-oProtocol=2");
+
        /* Otherwise finish up and return the arg array */
        if (sftp_server != NULL)
                make_ssh_args(sftp_server);
This page took 0.135345 seconds and 5 git commands to generate.