summaryrefslogtreecommitdiff
path: root/clientserver.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2010-12-23 09:26:39 -0800
committerWayne Davison <wayned@samba.org>2010-12-23 22:09:45 -0800
commit8f30d215843a58e159335158dd2e060560479b60 (patch)
treed6cd0e31d55a648442dfb5921c85445e7ac28019 /clientserver.c
parent3f770ab0a5922604392808109fb778d31ec78bf2 (diff)
downloadrsync-8f30d215843a58e159335158dd2e060560479b60.tar.gz
Protect a remote filename that starts with a dash.
Diffstat (limited to 'clientserver.c')
-rw-r--r--clientserver.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/clientserver.c b/clientserver.c
index afd2b179..21ef01c5 100644
--- a/clientserver.c
+++ b/clientserver.c
@@ -265,7 +265,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
if (strncmp(*argv, modname, modlen) == 0
&& argv[0][modlen] == '\0')
sargs[sargc++] = modname; /* we send "modname/" */
- else
+ else if (**argv == '-') {
+ if (asprintf(sargs + sargc++, "./%s", *argv) < 0)
+ out_of_memory("start_inband_exchange");
+ } else
sargs[sargc++] = *argv;
argv++;
argc--;