summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-03 07:57:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:15 -0500
commit586949362684864a18f9a56b5a96f7c4b8331281 (patch)
tree3477f3af69548dbb5c3dd33963c4ef0ff1819f48 /source4/ntvfs/posix
parentc8ba520c5a66f2d4a4d95baf366a2194a752e9c5 (diff)
downloadsamba-586949362684864a18f9a56b5a96f7c4b8331281.tar.gz
samba-586949362684864a18f9a56b5a96f7c4b8331281.tar.bz2
samba-586949362684864a18f9a56b5a96f7c4b8331281.zip
r4501: when copying files it is common for clients to copy the ACL. When the
ACL is the default ACL this menas the copied file would have an xattr but the original would not. Avoid this by checking if the ACL being set is the original ACL, and avoid the copy. (This used to be commit 1df985a49b200a41eed39023aa668afb233f2e53)
Diffstat (limited to 'source4/ntvfs/posix')
-rw-r--r--source4/ntvfs/posix/pvfs_acl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c
index ba5fa96b07..86a9a56ee9 100644
--- a/source4/ntvfs/posix/pvfs_acl.c
+++ b/source4/ntvfs/posix/pvfs_acl.c
@@ -190,7 +190,7 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
{
struct xattr_NTACL *acl;
uint32_t secinfo_flags = info->set_secdesc.in.secinfo_flags;
- struct security_descriptor *new_sd, *sd;
+ struct security_descriptor *new_sd, *sd, orig_sd;
NTSTATUS status;
uid_t uid = -1;
gid_t gid = -1;
@@ -217,6 +217,7 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
}
new_sd = info->set_secdesc.in.sd;
+ orig_sd = *sd;
uid = name->st.st_uid;
gid = name->st.st_gid;
@@ -265,7 +266,12 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
}
}
- status = pvfs_acl_save(pvfs, name, fd, acl);
+ /* we avoid saving if the sd is the same. This means when clients
+ copy files and end up copying the default sd that we don't
+ needlessly use xattrs */
+ if (!security_descriptor_equal(sd, &orig_sd)) {
+ status = pvfs_acl_save(pvfs, name, fd, acl);
+ }
return status;
}