]> andersk Git - openssh.git/blobdiff - sftp.c
- (djm) Release OpenSSH 4.3p1
[openssh.git] / sftp.c
diff --git a/sftp.c b/sftp.c
index ff3223ad27f2193e094d69500a303c5eb81de6c9..a2e3f6aad65f36fcd3e7e2ed79c3e2dbd6596419 100644 (file)
--- a/sftp.c
+++ b/sftp.c
@@ -16,7 +16,7 @@
 
 #include "includes.h"
 
-RCSID("$OpenBSD: sftp.c,v 1.68 2005/10/31 06:15:04 dtucker Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.70 2006/01/31 10:19:02 djm Exp $");
 
 #ifdef USE_LIBEDIT
 #include <histedit.h>
@@ -1453,10 +1453,12 @@ main(int argc, char **argv)
        sanitise_stdfd();
 
        __progname = ssh_get_progname(argv[0]);
+       memset(&args, '\0', sizeof(args));
        args.list = NULL;
-       addargs(&args, "ssh");          /* overwritten with ssh_program */
+       addargs(&args, ssh_program);
        addargs(&args, "-oForwardX11 no");
        addargs(&args, "-oForwardAgent no");
+       addargs(&args, "-oPermitLocalCommand no");
        addargs(&args, "-oClearAllForwardings yes");
 
        ll = SYSLOG_LEVEL_INFO;
@@ -1488,6 +1490,7 @@ main(int argc, char **argv)
                        break;
                case 'S':
                        ssh_program = optarg;
+                       replacearg(&args, 0, "%s", ssh_program);
                        break;
                case 'b':
                        if (batchmode)
@@ -1564,7 +1567,6 @@ main(int argc, char **argv)
                addargs(&args, "%s", host);
                addargs(&args, "%s", (sftp_server != NULL ?
                    sftp_server : "sftp"));
-               args.list[0] = ssh_program;
 
                if (!batchmode)
                        fprintf(stderr, "Connecting to %s...\n", host);
@@ -1577,6 +1579,7 @@ main(int argc, char **argv)
                        fprintf(stderr, "Attaching to %s...\n", sftp_direct);
                connect_to_server(sftp_direct, args.list, &in, &out);
        }
+       freeargs(&args);
 
        err = interactive_loop(in, out, file1, file2);
 
This page took 0.164094 seconds and 4 git commands to generate.