Bugzilla – Attachment 2064 Details for
Bug 1814
scp get file prepends -- before filename
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Adds -- only when next argument starts with - or wildcard
openbsd-scp-nonposix-getopt.patch (text/plain), 3.55 KB, created by
petiepooo@yahoo.com
on 2011-07-14 04:24:54 AEST
(
hide
)
Description:
Adds -- only when next argument starts with - or wildcard
Filename:
MIME Type:
Creator:
petiepooo@yahoo.com
Created:
2011-07-14 04:24:54 AEST
Size:
3.55 KB
patch
obsolete
>Common subdirectories: openssh-5.8p2/contrib and openssh-5.8p2-pan/contrib >Common subdirectories: openssh-5.8p2/openbsd-compat and openssh-5.8p2-pan/openbsd-compat >Common subdirectories: openssh-5.8p2/regress and openssh-5.8p2-pan/regress >Common subdirectories: openssh-5.8p2/scard and openssh-5.8p2-pan/scard >diff -u openssh-5.8p2/scp.c openssh-5.8p2-pan/scp.c >--- openssh-5.8p2/scp.c 2011-01-06 06:41:21.000000000 -0500 >+++ openssh-5.8p2-pan/scp.c 2011-07-13 14:01:46.000000000 -0400 >@@ -273,7 +273,9 @@ > addargs(&args, "-l"); > addargs(&args, "%s", remuser); > } >- addargs(&args, "--"); >+ /* "--" breaks some non-getopt clients, only use if needed */ >+ if (strchr("-?*", host[0]) != NULL) >+ addargs(&args, "--"); > addargs(&args, "%s", host); > addargs(&args, "%s", cmd); > >@@ -322,7 +324,9 @@ > addargs(&args, "-l"); > addargs(&args, "%s", remuser); > } >- addargs(&args, "--"); >+ /* "--" breaks some non-getopt clients, only use if needed */ >+ if (strchr("-?*", host[0]) != NULL) >+ addargs(&args, "--"); > addargs(&args, "%s", host); > addargs(&args, "%s", cmd); > >@@ -601,12 +605,15 @@ > host = cleanhostname(argv[i]); > suser = NULL; > } >- xasprintf(&bp, "%s -f -- %s", cmd, src); >+ /* "--" breaks some non-getopt clients, only use if needed */ >+ xasprintf(&bp, "%s -f %s%s", cmd, >+ strchr("-?*", src[0]) != NULL ? "-- " : "", src); > if (do_cmd(host, suser, bp, &remin, &remout) < 0) > exit(1); > (void) xfree(bp); > host = cleanhostname(thost); >- xasprintf(&bp, "%s -t -- %s", cmd, targ); >+ xasprintf(&bp, "%s -t %s%s", cmd, >+ strchr("-?*", targ[0]) != NULL ? "-- " : "", targ); > if (do_cmd2(host, tuser, bp, remin, remout) < 0) > exit(1); > (void) xfree(bp); >@@ -641,7 +648,9 @@ > } else { > host = cleanhostname(argv[i]); > } >- addargs(&alist, "--"); >+ /* "--" breaks some non-getopt clients, only use if needed */ >+ if (strchr("-?*", host[0]) != NULL) >+ addargs(&alist, "--"); > addargs(&alist, "%s", host); > addargs(&alist, "%s", cmd); > addargs(&alist, "%s", src); >@@ -652,7 +661,8 @@ > errs = 1; > } else { /* local to remote */ > if (remin == -1) { >- xasprintf(&bp, "%s -t -- %s", cmd, targ); >+ xasprintf(&bp, "%s -t %s%s", cmd, >+ strchr("-?*", targ[0]) != NULL ? "-- " : "", targ); > host = cleanhostname(thost); > if (do_cmd(host, tuser, bp, &remin, > &remout) < 0) >@@ -685,7 +695,9 @@ > addargs(&alist, "-r"); > if (pflag) > addargs(&alist, "-p"); >- addargs(&alist, "--"); >+ /* "--" breaks some non-getopt clients, only use if needed */ >+ if (strchr("-?*", argv[i][0]) != NULL) >+ addargs(&alist, "--"); > addargs(&alist, "%s", argv[i]); > addargs(&alist, "%s", argv[argc-1]); > if (do_local_cmd(&alist)) >@@ -705,7 +717,8 @@ > suser = pwd->pw_name; > } > host = cleanhostname(host); >- xasprintf(&bp, "%s -f -- %s", cmd, src); >+ xasprintf(&bp, "%s -f %s%s", cmd, >+ strchr("-?*", src[0]) != NULL ? "-- " : "", src); > if (do_cmd(host, suser, bp, &remin, &remout) < 0) { > (void) xfree(bp); > ++errs; >diff -u openssh-5.8p2/sftp.c openssh-5.8p2-pan/sftp.c >--- openssh-5.8p2/sftp.c 2010-12-04 17:02:48.000000000 -0500 >+++ openssh-5.8p2-pan/sftp.c 2011-07-13 13:49:29.000000000 -0400 >@@ -2244,7 +2244,9 @@ > if (sftp_server == NULL || strchr(sftp_server, '/') == NULL) > addargs(&args, "-s"); > >- addargs(&args, "--"); >+ /* "--" breaks some non-getopt clients, only use if needed */ >+ if (strchr("-?*", host[0]) != NULL) >+ addargs(&args, "--"); > addargs(&args, "%s", host); > addargs(&args, "%s", (sftp_server != NULL ? > sftp_server : "sftp"));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1814
:
1919
| 2064