X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/719bc858b516afe845f2342bb2de06b6b1f17855..71903f601a37392eb8ecb737c10fac78d18f5777:/flist.c diff --git a/flist.c b/flist.c index 0e81e9ec..de27934a 100644 --- a/flist.c +++ b/flist.c @@ -153,7 +153,7 @@ static void list_file_entry(struct file_struct *f) rprintf(FINFO, "%s %11.0f %s %s -> %s\n", perms, (double)f->length, timestring(f->modtime), - safe_fname(f_name(f)), f->u.link); + safe_fname(f_name(f)), safe_fname(f->u.link)); } else #endif { @@ -194,7 +194,7 @@ static int readlink_stat(const char *path, STRUCT_STAT *buffer, char *linkbuf) if (copy_unsafe_links && unsafe_symlink(linkbuf, path)) { if (verbose > 1) { rprintf(FINFO,"copying unsafe symlink \"%s\" -> \"%s\"\n", - path, linkbuf); + safe_fname(path), safe_fname(linkbuf)); } return do_stat(path, buffer); } @@ -554,7 +554,7 @@ static void receive_file_entry(struct file_list *flist, int ndx, if (l2 >= MAXPATHLEN - l1) { rprintf(FERROR, "overflow: flags=0x%x l1=%d l2=%d lastname=%s\n", - flags, l1, l2, lastname); + flags, l1, l2, safe_fname(lastname)); overflow("receive_file_entry"); } @@ -772,7 +772,8 @@ struct file_struct *make_file(char *fname, struct file_list *flist, if (strlcpy(thisname, fname, sizeof thisname) >= sizeof thisname - flist_dir_len) { - rprintf(FINFO, "skipping overly long name: %s\n", fname); + rprintf(FINFO, "skipping overly long name: %s\n", + safe_fname(fname)); return NULL; } clean_fname(thisname, 0); @@ -817,7 +818,7 @@ struct file_struct *make_file(char *fname, struct file_list *flist, goto skip_filters; if (S_ISDIR(st.st_mode) && !xfer_dirs) { - rprintf(FINFO, "skipping directory %s\n", thisname); + rprintf(FINFO, "skipping directory %s\n", safe_fname(thisname)); return NULL; } @@ -843,7 +844,7 @@ skip_filters: if (verbose > 2) { rprintf(FINFO, "[%s] make_file(%s,*,%d)\n", - who_am_i(), thisname, filter_level); + who_am_i(), safe_fname(thisname), filter_level); } if ((basename = strrchr(thisname, '/')) != NULL) { @@ -1050,7 +1051,7 @@ static void send_directory(int f, struct file_list *flist, if (errno) { io_error |= IOERR_GENERAL; *p = '\0'; - rsyserr(FERROR, errno, "readdir(%s)", fbuf); + rsyserr(FERROR, errno, "readdir(%s)", full_fname(fbuf)); } closedir(d); @@ -1139,7 +1140,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) } if (S_ISDIR(st.st_mode) && !xfer_dirs) { - rprintf(FINFO, "skipping directory %s\n", fname); + rprintf(FINFO, "skipping directory %s\n", + safe_fname(fname)); continue; } @@ -1318,7 +1320,7 @@ struct file_list *recv_file_list(int f) if (verbose > 2) { rprintf(FINFO, "recv_file_name(%s)\n", - f_name(flist->files[i])); + safe_fname(f_name(flist->files[i]))); } } receive_file_entry(NULL, 0, 0, 0); /* Signal that we're done. */ @@ -1474,7 +1476,7 @@ static void clean_flist(struct file_list *flist, int strip_root, int no_dups) if (verbose > 1 && !am_server) { rprintf(FINFO, "removing duplicate name %s from file list %d\n", - f_name(flist->files[i]), i); + safe_fname(f_name(flist->files[i])), i); } /* Make sure that if we unduplicate '.', that we don't * lose track of a user-specified top directory. */ @@ -1527,7 +1529,7 @@ static void output_flist(struct file_list *flist, const char *whose_list) sprintf(depthbuf, "%d", file->dir.depth); rprintf(FINFO, "[%s] i=%d %s %s%s%s%s mode=0%o len=%.0f%s%s flags=%x\n", whose_list, i, am_sender ? NS(file->dir.root) : depthbuf, - file->dirname ? file->dirname : "", + file->dirname ? safe_fname(file->dirname) : "", file->dirname ? "/" : "", NS(file->basename), S_ISDIR(file->mode) ? "/" : "", (int)file->mode, (double)file->length, uidbuf, gidbuf, file->flags);