X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/a71b436858ba82aa171bd4b9f7deccd69a7541b1..refs/heads/wip/copy-unsafe-links-double:/backup.c diff --git a/backup.c b/backup.c index 8512e00c..840bab7f 100644 --- a/backup.c +++ b/backup.c @@ -98,7 +98,7 @@ static BOOL copy_valid_path(const char *fname) rsyserr(FERROR, errno, "backup stat %s failed", full_fname(rel)); else { struct file_struct *file; - if (!(file = make_file(rel, NULL, NULL, 0, NO_FILTERS))) + if (!(file = make_file(rel, NULL, NULL, 0, NO_FILTERS, PHYS_DEPTH_N_A))) continue; #ifdef SUPPORT_ACLS if (preserve_acls && !S_ISLNK(file->mode)) { @@ -221,7 +221,7 @@ int make_backup(const char *fname, BOOL prefer_rename) } /* Fall back to making a copy. */ - if (!(file = make_file(fname, NULL, &sx.st, 0, NO_FILTERS))) + if (!(file = make_file(fname, NULL, &sx.st, 0, NO_FILTERS, PHYS_DEPTH_N_A))) return 1; /* the file could have disappeared */ #ifdef SUPPORT_ACLS @@ -252,7 +252,7 @@ int make_backup(const char *fname, BOOL prefer_rename) #ifdef SUPPORT_LINKS if (!ret && preserve_links && S_ISLNK(file->mode)) { 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(SYMSAFE, 1)) { rprintf(FINFO, "ignoring unsafe symlink %s -> %s\n", full_fname(buf), sl);