extern int preserve_gid;
extern int force_delete;
extern int recurse;
+extern int keep_dirlinks;
extern int make_backups;
extern char *backup_dir;
extern int inplace;
continue;
pathjoin(buf, sizeof buf, fname, dname);
if (verbose > 0)
- rprintf(FINFO, "deleting %s\n", buf);
+ rprintf(FINFO, "deleting %s\n", safe_fname(buf));
if (delete_file(buf) != 0) {
closedir(d);
return -1;
* destination had the setuid or setgid bits set due
* to the side effect of the chown call */
if (st->st_mode & (S_ISUID | S_ISGID)) {
- link_stat(fname, st, 0);
+ link_stat(fname, st,
+ keep_dirlinks && S_ISDIR(st->st_mode));
}
updated = 1;
}