summaryrefslogtreecommitdiff
path: root/acls.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2011-01-03 10:26:02 -0800
committerWayne Davison <wayned@samba.org>2011-01-03 11:20:04 -0800
commit6500e0769a56919df1d47759828104a08df850bb (patch)
tree917dceec66e48f232840ed88c03963f7ddbfa21d /acls.c
parentaa3faf5f8c2a05110bb1f39fd8d0742d5ca0431e (diff)
downloadrsync-6500e0769a56919df1d47759828104a08df850bb.tar.gz
Avoid reading ACL/xattr info on filetypes not being copied.
Make OS X avoid xattr access on device/special files. Fixes bug 5458.
Diffstat (limited to 'acls.c')
-rw-r--r--acls.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/acls.c b/acls.c
index 347356de..ef2751c3 100644
--- a/acls.c
+++ b/acls.c
@@ -31,6 +31,8 @@ extern int list_only;
extern int orig_umask;
extern int numeric_ids;
extern int inc_recurse;
+extern int preserve_devices;
+extern int preserve_specials;
/* Flags used to indicate what items are being transmitted for an entry. */
#define XMIT_USER_OBJ (1<<0)
@@ -537,6 +539,23 @@ static int get_rsync_acl(const char *fname, rsync_acl *racl,
int get_acl(const char *fname, stat_x *sxp)
{
sxp->acc_acl = create_racl();
+
+ if (S_ISREG(sxp->st.st_mode) || S_ISDIR(sxp->st.st_mode)) {
+ /* Everyone supports this. */
+ } else if (S_ISLNK(sxp->st.st_mode)) {
+ return 0;
+ } else if (IS_SPECIAL(sxp->st.st_mode)) {
+#ifndef NO_SPECIAL_ACLS
+ if (!preserve_specials)
+#endif
+ return 0;
+ } else if (IS_DEVICE(sxp->st.st_mode)) {
+#ifndef NO_DEVICE_ACLS
+ if (!preserve_devices)
+#endif
+ return 0;
+ }
+
if (get_rsync_acl(fname, sxp->acc_acl, SMB_ACL_TYPE_ACCESS,
sxp->st.st_mode) < 0) {
free_acl(sxp);