X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/a71b436858ba82aa171bd4b9f7deccd69a7541b1..refs/heads/wip/copy-unsafe-links-double:/generator.c diff --git a/generator.c b/generator.c index acf4b888..48ef16c7 100644 --- a/generator.c +++ b/generator.c @@ -1354,7 +1354,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, if (preserve_links && S_ISLNK(file->mode)) { #ifdef SUPPORT_LINKS const char *sl = F_SYMLINK(file); - if (safe_symlinks && unsafe_symlink(sl, fname)) { + if (safe_symlinks && unsafe_symlink(sl, path_depth(fname))) { if (INFO_GTE(NAME, 1)) { if (solo_file) fname = f_name(file, NULL); @@ -1644,7 +1644,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, if (inplace && make_backups > 0 && fnamecmp_type == FNAMECMP_FNAME) { if (!(backupptr = get_backup_name(fname))) goto cleanup; - if (!(back_file = make_file(fname, NULL, NULL, 0, NO_FILTERS))) + if (!(back_file = make_file(fname, NULL, NULL, 0, NO_FILTERS, PHYS_DEPTH_N_A))) goto pretend_missing; if (copy_file(fname, backupptr, -1, back_file->mode) < 0) { unmake_file(back_file); @@ -1682,7 +1682,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, close(fd); goto cleanup; } - if (!(back_file = make_file(fname, NULL, NULL, 0, NO_FILTERS))) { + if (!(back_file = make_file(fname, NULL, NULL, 0, NO_FILTERS, PHYS_DEPTH_N_A))) { close(fd); goto pretend_missing; }