human_num(stats.literal_data));
rprintf(FINFO,"Matched data: %s bytes\n",
human_num(stats.matched_data));
- rprintf(FINFO,"File list size: %d\n", stats.flist_size);
+ rprintf(FINFO,"File list size: %s\n",
+ human_num(stats.flist_size));
if (stats.flist_buildtime) {
rprintf(FINFO,
"File list generation time: %.3f seconds\n",
return NULL;
/* See what currently exists at the destination. */
- if ((statret = safe_stat(dest_path, &st)) == 0) {
+ if ((statret = do_stat(dest_path, &st)) == 0) {
/* If the destination is a dir, enter it and use mode 1. */
if (S_ISDIR(st.st_mode)) {
- if (sanitize_paths)
- die_on_unsafe_path(dest_path, 0);
if (!push_dir(dest_path, 0)) {
rsyserr(FERROR, errno, "push_dir#1 %s failed",
full_fname(dest_path));
}
return NULL;
}
- if (sanitize_paths && S_ISLNK(st.st_mode))
- die_on_unsafe_path(dest_path, 0);
if (flist->count > 1) {
rprintf(FERROR,
"ERROR: destination must be a directory when"
dry_run++;
}
- if (sanitize_paths)
- die_on_unsafe_path(dest_path, 0);
if (!push_dir(dest_path, dry_run > 1)) {
rsyserr(FERROR, errno, "push_dir#2 %s failed",
full_fname(dest_path));
dest_path = "/";
*cp = '\0';
- if (sanitize_paths)
- die_on_unsafe_path(dest_path, 0);
if (!push_dir(dest_path, 0)) {
rsyserr(FERROR, errno, "push_dir#3 %s failed",
full_fname(dest_path));
}
}
- if (i != -1) {
+ if (i != NDX_DONE) {
rprintf(FERROR, "Invalid packet at end of run (%d) [%s]\n",
i, who_am_i());
exit_cleanup(RERR_PROTOCOL);
}
if (!relative_paths) {
- if (sanitize_paths)
- die_on_unsafe_path(dir, 0);
if (!push_dir(dir, 0)) {
rsyserr(FERROR, errno, "push_dir#3 %s failed",
full_fname(dir));
io_flush(FULL_FLUSH);
if (protocol_version >= 24) {
/* send a final goodbye message */
- write_int(f_out, -1);
+ write_int(f_out, NDX_DONE);
}
io_flush(FULL_FLUSH);
char **dir;
for (dir = basis_dir; *dir; dir++) {
*dir = sanitize_path(NULL, *dir, NULL, curr_dir_depth, NULL);
- die_on_unsafe_path(*dir, 0);
}
if (partial_dir) {
partial_dir = sanitize_path(NULL, partial_dir, NULL, curr_dir_depth, NULL);
- /* A relative path gets this checked at every dir change. */
- if (*partial_dir == '/')
- die_on_unsafe_path(partial_dir, 0);
}
}
fix_basis_dirs();
char cmd_buf[300];
int ret;
- sprintf(cmd_buf, get_panic_action(),
- getpid(), getpid());
+ snprintf(cmd_buf, sizeof cmd_buf, get_panic_action(),
+ getpid(), getpid());
/* Unless we failed to execute gdb, we allow the process to
* continue. I'm not sure if that's right. */