[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Thu Dec 23 23:11:43 MST 2010


The branch, master has been updated
       via  8f30d21 Protect a remote filename that starts with a dash.
      from  3f770ab Set NO_SYMLINK_XATTRS on linux the easy way. Fixes bug 7109.

;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 8f30d215843a58e159335158dd2e060560479b60
Author: Wayne Davison <wayned at samba.org>
Date:   Thu Dec 23 09:26:39 2010 -0800

    Protect a remote filename that starts with a dash.

-----------------------------------------------------------------------

Summary of changes:
 clientserver.c |    5 ++++-
 main.c         |    6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/clientserver.c b/clientserver.c
index afd2b17..21ef01c 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--;
diff --git a/main.c b/main.c
index 161bfad..649aa90 100644
--- a/main.c
+++ b/main.c
@@ -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--;
 		}
 	}


-- 
The rsync repository.


More information about the rsync-cvs mailing list