diff options
author | Wayne Davison <wayned@samba.org> | 2010-12-23 09:26:39 -0800 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2010-12-23 22:09:45 -0800 |
commit | 8f30d215843a58e159335158dd2e060560479b60 (patch) | |
tree | d6cd0e31d55a648442dfb5921c85445e7ac28019 /main.c | |
parent | 3f770ab0a5922604392808109fb778d31ec78bf2 (diff) | |
download | rsync-8f30d215843a58e159335158dd2e060560479b60.tar.gz rsync-8f30d215843a58e159335158dd2e060560479b60.tar.bz2 rsync-8f30d215843a58e159335158dd2e060560479b60.zip |
Protect a remote filename that starts with a dash.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -493,7 +493,11 @@ static pid_t do_cmd(char *cmd, char *machine, char *user, char **remote_argv, in rprintf(FERROR, "internal: args[] overflowed in do_cmd()\n"); exit_cleanup(RERR_SYNTAX); } - args[argc++] = *remote_argv++; + if (**remote_argv == '-') { + if (asprintf(args + argc++, "./%s", *remote_argv++) < 0) + out_of_memory("do_cmd"); + } else + args[argc++] = *remote_argv++; remote_argc--; } } |