X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/b4a09b72ee15757c8ae41039e9bef6c5c309b6a8..dfe1ed5e97be175a7a95aba6a334744d59df4af5:/flist.c diff --git a/flist.c b/flist.c index 6bbf3224..16c95aba 100644 --- a/flist.c +++ b/flist.c @@ -1073,7 +1073,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) if (filesfrom_fd >= 0) { if (sanitize_paths) die_on_unsafe_path(argv[0], 0); - if (argv[0] && !push_dir(argv[0])) { + if (argv[0] && !push_dir(argv[0], 0)) { rsyserr(FERROR, errno, "push_dir %s failed", full_fname(argv[0])); exit_cleanup(RERR_FILESELECT); @@ -1185,6 +1185,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) } else break; } + if (len == 1 && fn[0] == '/') + fn[len++] = '.'; fn[len] = '\0'; /* Reject a ".." dir in the active part of the path. */ for (p = fn; (p = strstr(p, "..")) != NULL; p += 2) { @@ -1209,7 +1211,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) strlcpy(olddir, curr_dir, sizeof olddir); - if (!push_dir(dir)) { + if (!push_dir(dir, 0)) { io_error |= IOERR_GENERAL; rsyserr(FERROR, errno, "push_dir %s failed", full_fname(dir));