int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
{
-#if !defined HAVE_LUTIMES || !defined HAVE_UTIMES
+#ifndef CAN_SET_SYMLINK_TIMES
if (S_ISLNK(file->mode)) {
;
} else
if (preserve_acls && !S_ISLNK(file->mode)) {
if (!ACL_READY(*sxp))
get_acl(fname, sxp);
- if (set_acl(NULL, file, sxp) == 0)
+ if (set_acl(NULL, file, sxp, file->mode))
return 0;
}
#endif
if (statret >= 0) { /* A from-dest-dir statret can == 1! */
int keep_time = !preserve_times ? 0
: S_ISDIR(file->mode) ? preserve_times > 1 :
-#if defined HAVE_LUTIMES && defined HAVE_UTIMES
+#ifdef CAN_SET_SYMLINK_TIMES
1;
#else
!S_ISLNK(file->mode);
if (preserve_acls && !S_ISLNK(file->mode)) {
if (!ACL_READY(*sxp))
get_acl(fnamecmp, sxp);
- if (set_acl(NULL, file, sxp) == 0)
+ if (set_acl(NULL, file, sxp, file->mode))
iflags |= ITEM_REPORT_ACL;
}
#endif
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);
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);
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;
}
STRUCT_STAT st;
if (link_stat(fname, &st, 0) == 0
&& cmp_time(st.st_mtime, file->modtime) != 0)
- set_modtime(fname, file->modtime, file->mode);
+ set_modtime(fname, file->modtime, F_MOD_NSEC(file), file->mode);
}
if (counter >= loopchk_limit) {
if (allowed_lull)