summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2017-08-21 16:45:13 +0000
committermillert <millert@openbsd.org>2017-08-21 16:45:13 +0000
commite5dd404e1941d0097f108bb8b6035ff55237b7d1 (patch)
treed9b554a391e7e68062223c3d916e890a2b238f32
parentsync (diff)
downloadwireguard-openbsd-e5dd404e1941d0097f108bb8b6035ff55237b7d1.tar.xz
wireguard-openbsd-e5dd404e1941d0097f108bb8b6035ff55237b7d1.zip
When executing ssh, use "--" to indicate end of arguments before the
host name. Adapted from a MirBSD diff by Thorsten Glaser.
-rw-r--r--gnu/usr.bin/cvs/src/client.c6
-rw-r--r--usr.bin/cvs/client.c5
2 files changed, 7 insertions, 4 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;
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c
index 664ba300f69..56dafef8e01 100644
--- a/usr.bin/cvs/client.c
+++ b/usr.bin/cvs/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.126 2017/06/01 08:17:27 joris Exp $ */
+/* $OpenBSD: client.c,v 1.127 2017/08/21 16:45:13 millert Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -197,7 +197,7 @@ void
cvs_client_connect_to_server(void)
{
struct cvs_var *vp;
- char *cmd, *argv[9], *resp;
+ char *cmd, *argv[10], *resp;
int ifd[2], ofd[2], argc;
if (cvs_server_active == 1)
@@ -241,6 +241,7 @@ cvs_client_connect_to_server(void)
argv[argc++] = current_cvsroot->cr_user;
}
+ argv[argc++] = "--";
argv[argc++] = current_cvsroot->cr_host;
argv[argc++] = cmd;
argv[argc++] = "server";