[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-4149-ge60be05

Jeremy Allison jra at samba.org
Wed Sep 17 20:45:53 GMT 2008


The branch, v3-3-test has been updated
       via  e60be05baff1a0d9f99cd2be8fbfd66e76893c1d (commit)
      from  299fbaad957d214f47bb468f751bb500bb1956a2 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit e60be05baff1a0d9f99cd2be8fbfd66e76893c1d
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Sep 17 13:45:10 2008 -0700

    Correctly get+set the NT ACL on a file. Now to make us check it on open..
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source/modules/vfs_acl_xattr.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/modules/vfs_acl_xattr.c b/source/modules/vfs_acl_xattr.c
index ff0c2cb..fd59310 100644
--- a/source/modules/vfs_acl_xattr.c
+++ b/source/modules/vfs_acl_xattr.c
@@ -103,7 +103,7 @@ static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
 	val = tmp;
 
 	become_root();
-	if (fsp) {
+	if (fsp && fsp->fh->fd != -1) {
 		sizeret = SMB_VFS_FGETXATTR(fsp, XATTR_NTACL_NAME, val, size);
 	} else {
 		sizeret = SMB_VFS_GETXATTR(handle->conn, name,
@@ -263,16 +263,25 @@ static NTSTATUS store_acl_blob(files_struct *fsp,
 	int ret;
 	int saved_errno;
 
+	DEBUG(10,("store_acl_blob: storing blob length %u on file %s\n",
+			(unsigned int)pblob->length, fsp->fsp_name));
+
 	become_root();
-	ret = SMB_VFS_FSETXATTR(fsp, XATTR_NTACL_NAME,
+	if (fsp->fh->fd != -1) {
+		ret = SMB_VFS_FSETXATTR(fsp, XATTR_NTACL_NAME,
 			pblob->data, pblob->length, 0);
+	} else {
+		ret = SMB_VFS_SETXATTR(fsp->conn, fsp->fsp_name,
+				XATTR_NTACL_NAME,
+				pblob->data, pblob->length, 0);
+	}
 	if (ret) {
 		saved_errno = errno;
 	}
 	unbecome_root();
 	if (ret) {
 		errno = saved_errno;
-		DEBUG(5, ("store_acl_blob: fsetxattr failed for file %s "
+		DEBUG(5, ("store_acl_blob: setting attr failed for file %s"
 			"with error %s\n",
 			fsp->fsp_name,
 			strerror(errno) ));


-- 
Samba Shared Repository


More information about the samba-cvs mailing list