git.samba.org
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
894e629
)
Fixed the itemizing of perms with -E.
author
Wayne Davison
<wayned@samba.org>
Mon, 10 Mar 2008 02:50:51 +0000
(19:50 -0700)
committer
Wayne Davison
<wayned@samba.org>
Mon, 10 Mar 2008 02:50:51 +0000
(19:50 -0700)
generator.c
patch
|
blob
|
history
syscall.c
patch
|
blob
|
history
diff --git
a/generator.c
b/generator.c
index 5273201631e00ab9346e2388d7c06189d9f92909..9e24f56432f56557cca6793b62b2adf6e8f2b25b 100644
(file)
--- a/
generator.c
+++ b/
generator.c
@@
-582,10
+582,11
@@
int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
if (preserve_times && cmp_time(sxp->st.st_mtime, file->modtime) != 0)
return 0;
if (preserve_times && cmp_time(sxp->st.st_mtime, file->modtime) != 0)
return 0;
- if (preserve_perms && !BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
- return 0;
-
- if (preserve_executability && ((sxp->st.st_mode & 0111 ? 1 : 0) ^ (file->mode & 0111 ? 1 : 0)))
+ if (preserve_perms) {
+ if (!BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
+ return 0;
+ } else if (preserve_executability
+ && ((sxp->st.st_mode & 0111 ? 1 : 0) ^ (file->mode & 0111 ? 1 : 0)))
return 0;
if (am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file))
return 0;
if (am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file))
@@
-638,8
+639,11
@@
void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
;
} else
#endif
;
} else
#endif
- if ((preserve_perms || preserve_executability)
- && !BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
+ if (preserve_perms) {
+ if (!BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
+ iflags |= ITEM_REPORT_PERMS;
+ } else if (preserve_executability
+ && ((sxp->st.st_mode & 0111 ? 1 : 0) ^ (file->mode & 0111 ? 1 : 0)))
iflags |= ITEM_REPORT_PERMS;
if (uid_ndx && am_root && (uid_t)F_OWNER(file) != sxp->st.st_uid)
iflags |= ITEM_REPORT_OWNER;
iflags |= ITEM_REPORT_PERMS;
if (uid_ndx && am_root && (uid_t)F_OWNER(file) != sxp->st.st_uid)
iflags |= ITEM_REPORT_OWNER;
diff --git
a/syscall.c
b/syscall.c
index f2f5bc2329ef1a3991641a4b466f2297c8821644..c2180de3b75fec23532bbfdfddf2c7e8347ec63b 100644
(file)
--- a/
syscall.c
+++ b/
syscall.c
@@
-169,7
+169,7
@@
int do_chmod(const char *path, mode_t mode)
} else
code = chmod(path, mode & CHMOD_BITS);
if (code != 0 && (preserve_perms || preserve_executability))
} else
code = chmod(path, mode & CHMOD_BITS);
if (code != 0 && (preserve_perms || preserve_executability))
- return code;
+
return code;
return 0;
}
#endif
return 0;
}
#endif