diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2017-08-21 16:45:14 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2017-08-21 16:45:14 +0000 |
commit | a255c719fcad9b87a867d5b39fb8bc4f8167ab5a (patch) | |
tree | 6b0fce95ada31b1663d0464e159b1e6e99aee79a /gnu | |
parent | 283eff24e5c6ca393e1a347bc244dc6b2c616122 (diff) |
When executing ssh, use "--" to indicate end of arguments before the
host name. Adapted from a MirBSD diff by Thorsten Glaser.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/cvs/src/client.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gnu/usr.bin/cvs/src/client.c b/gnu/usr.bin/cvs/src/client.c index f7abc83391f..afd2453f72b 100644 --- a/gnu/usr.bin/cvs/src/client.c +++ b/gnu/usr.bin/cvs/src/client.c @@ -4833,7 +4833,7 @@ start_rsh_server (tofdp, fromfdp) char *cvs_rsh = getenv ("CVS_RSH"); char *cvs_server = getenv ("CVS_SERVER"); int i = 0; - /* This needs to fit "rsh", "-b", "-l", "USER", "host", + /* This needs to fit "rsh", "-b", "-l", "USER", "--", "host", "cmd (w/ args)", and NULL. We leave some room to grow. */ char *rsh_argv[10]; @@ -4880,6 +4880,7 @@ start_rsh_server (tofdp, fromfdp) rsh_argv[i++] = current_parsed_root->username; } + rsh_argv[i++] = "--"; rsh_argv[i++] = current_parsed_root->hostname; rsh_argv[i++] = cvs_server; rsh_argv[i++] = "server"; @@ -4943,7 +4944,6 @@ start_rsh_server (tofdp, fromfdp) char **p = argv; *p++ = cvs_rsh; - *p++ = current_parsed_root->hostname; /* If the login names differ between client and server * pass it on to rsh. @@ -4954,6 +4954,8 @@ start_rsh_server (tofdp, fromfdp) *p++ = current_parsed_root->username; } + *p++ = "--"; + *p++ = current_parsed_root->hostname; *p++ = command; *p++ = NULL; |