svn commit: samba r4501 - in branches/SAMBA_4_0/source/ntvfs/posix: .

tridge at samba.org tridge at samba.org
Mon Jan 3 07:57:06 GMT 2005


Author: tridge
Date: 2005-01-03 07:57:05 +0000 (Mon, 03 Jan 2005)
New Revision: 4501

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4501

Log:
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.


Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_acl.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_acl.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_acl.c	2005-01-03 07:08:14 UTC (rev 4500)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_acl.c	2005-01-03 07:57:05 UTC (rev 4501)
@@ -190,7 +190,7 @@
 {
 	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 @@
 	}
 
 	new_sd = info->set_secdesc.in.sd;
+	orig_sd = *sd;
 
 	uid = name->st.st_uid;
 	gid = name->st.st_gid;
@@ -265,7 +266,12 @@
 		}
 	}
 
-	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;
 }



More information about the samba-cvs mailing list