X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/57dee64e826b2132c61b1bda18801a79a06c4088..37802f40dcbe8956ba8ee3bfbddf10c60f94c209:/main.c diff --git a/main.c b/main.c index 02bee6bf..fc67eae2 100644 --- a/main.c +++ b/main.c @@ -44,6 +44,7 @@ extern int keep_dirlinks; extern int preserve_hard_links; extern int protocol_version; extern int recurse; +extern int fuzzy_basis; extern int relative_paths; extern int rsync_port; extern int whole_file; @@ -222,7 +223,7 @@ static void report(int f) **/ static void show_malloc_stats(void) { -#if HAVE_MALLINFO +#ifdef HAVE_MALLINFO struct mallinfo mi; mi = mallinfo(); @@ -292,7 +293,7 @@ static pid_t do_cmd(char *cmd, char *machine, char *user, char *path, dash_l_set = 1; } -#if HAVE_REMSH +#ifdef HAVE_REMSH /* remsh (on HPUX) takes the arguments the other way around */ args[argc++] = machine; if (user && !(daemon_over_rsh && dash_l_set)) { @@ -337,7 +338,7 @@ static pid_t do_cmd(char *cmd, char *machine, char *user, char *path, if (verbose > 3) { rprintf(FINFO,"cmd="); for (i = 0; i < argc; i++) - rprintf(FINFO,"%s ",args[i]); + rprintf(FINFO, "%s ", safe_fname(args[i])); rprintf(FINFO,"\n"); } @@ -407,7 +408,7 @@ static char *get_local_name(struct file_list *flist,char *name) exit_cleanup(RERR_FILEIO); } if (verbose > 0) - rprintf(FINFO, "created directory %s\n", name); + rprintf(FINFO, "created directory %s\n", safe_fname(name)); if (dry_run) { dry_run++; @@ -488,7 +489,8 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name) int pid; int status = 0; int error_pipe[2], name_pipe[2]; - BOOL need_name_pipe = (basis_dir[0] || partial_dir) && !dry_run; + BOOL need_name_pipe = (basis_dir[0] || partial_dir || fuzzy_basis) + && !dry_run; /* The receiving side mustn't obey this, or an existing symlink that * points to an identical file won't be replaced by the referent. */ @@ -965,10 +967,10 @@ static int start_client(int argc, char *argv[]) if (verbose > 3) { rprintf(FINFO,"cmd=%s machine=%s user=%s path=%s\n", - shell_cmd?shell_cmd:"", - shell_machine?shell_machine:"", - shell_user?shell_user:"", - shell_path?shell_path:""); + shell_cmd ? safe_fname(shell_cmd) : "", + shell_machine ? safe_fname(shell_machine) : "", + shell_user ? safe_fname(shell_user) : "", + shell_path ? safe_fname(shell_path) : ""); } /* for remote source, only single dest arg can remain ... */ @@ -1156,7 +1158,7 @@ int main(int argc,char *argv[]) } if (batch_fd < 0) { rsyserr(FERROR, errno, "Batch file %s open error", - batch_name); + full_fname(batch_name)); exit_cleanup(RERR_FILEIO); } if (read_batch)