aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sshexec.110
-rw-r--r--sshexec.c5
2 files changed, 14 insertions, 1 deletions
diff --git a/sshexec.1 b/sshexec.1
index 6e087fa..b17cc82 100644
--- a/sshexec.1
+++ b/sshexec.1
@@ -211,6 +211,12 @@ utility forces the remote shell to treat each of the
as separate arguments and cause the shell to executing
them as a non-builtin command.
+.I command
+must not contain an equals sign
+.RB ( = )
+or be just a dash
+.RB (\(dq - \(dq).
+
.SH STDIN
The
.B sshexec
@@ -272,7 +278,9 @@ None.
None.
.SH RATIONALE
-None.
+The restrictions on
+.I command
+is in place to avoid unspecified behaviour.
.SH NOTES
None.
diff --git a/sshexec.c b/sshexec.c
index 987511d..9306c5c 100644
--- a/sshexec.c
+++ b/sshexec.c
@@ -235,6 +235,11 @@ main(int argc_unused, char *argv[])
if (!destination || !*argv)
usage();
+ if (!strcmp(*argv, "-"))
+ exitf("%s: the command argument must not be \"-\"\n", argv0);
+ else if (strchr(*argv, '='))
+ exitf("%s: the command argument must contain an \'=\'\n", argv0);
+
if (dir) {
build_command_asis("cd -- ");
build_command_escape(dir);