[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Tue Sep 11 23:07:02 MDT 2012


The branch, master has been updated
       via  e8375dd smbd: Add extra VFS hooks to get the posix ACL as a blob
       via  6638d10 smbd: Remove pre-allocation of ACL array in sys_acl_init()
       via  ac804f0 smbd-posix_acls: Use a IDL union to store the ACL entry
      from  bd2f160 Make metze happy and the code clearer :-).

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e8375ddf2d29b12cfe84ceec7195de957d0a743c
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Sep 10 12:44:01 2012 +1000

    smbd: Add extra VFS hooks to get the posix ACL as a blob
    
    This will allow us to hash this, rather than the NT ACL it maps to.
    This will in turn allow us to know if the NT ACL is valid even if we
    have to change the mapping code.
    
    Andrew Bartlett
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Wed Sep 12 07:06:01 CEST 2012 on sn-devel-104

commit 6638d1036688f7b0f15a1a18c9a251ab0a7ab626
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Sep 7 17:44:24 2012 +1000

    smbd: Remove pre-allocation of ACL array in sys_acl_init()
    
    Instead, this is just handled with realloc in sys_acl_create_entry()
    
    This allows us to remove the size element from the SMB_ACL_T.
    
    Andrew Bartlett

commit ac804f0d7f5a93ff2710e213d9213ad9960a15d6
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Sep 7 15:49:47 2012 +1000

    smbd-posix_acls: Use a IDL union to store the ACL entry
    
    This is a clearer, long-term-stable structure we can hash without
    risking it changing.
    
    Andrew Bartlett

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

Summary of changes:
 examples/VFS/skel_opaque.c                       |   15 +++++
 examples/VFS/skel_transparent.c                  |   18 ++++++
 librpc/idl/smb_acl.idl                           |   25 ++++++--
 source3/include/smb_acls.h                       |    2 +-
 source3/include/vfs.h                            |   18 ++++++
 source3/include/vfs_macros.h                     |   10 +++
 source3/lib/sysacls.c                            |   37 +++++-------
 source3/modules/vfs_fake_acls.c                  |   68 ++++++++++++++++++++++
 source3/modules/vfs_full_audit.c                 |   37 ++++++++++++
 source3/modules/vfs_posixacl.c                   |   10 ++--
 source3/modules/vfs_time_audit.c                 |   48 +++++++++++++++
 source3/smbd/posix_acls.c                        |    6 +-
 source3/smbd/pysmbd.c                            |    2 +-
 source3/smbd/vfs.c                               |   21 +++++++
 source4/scripting/python/samba/tests/posixacl.py |   52 ++++-------------
 15 files changed, 292 insertions(+), 77 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index edfb772..a786a23 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -586,6 +586,18 @@ static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fs
 	return (SMB_ACL_T)NULL;
 }
 
+static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle,  const char *path_p, SMB_ACL_TYPE_T type, TALLOC_CTX *mem_ctx, char **blob_description, DATA_BLOB *blob)
+{
+	errno = ENOSYS;
+	return -1;
+}
+
+static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle, files_struct *fsp, TALLOC_CTX *mem_ctx, char **blob_description, DATA_BLOB *blob)
+{
+	errno = ENOSYS;
+	return -1;
+}
+
 static int skel_sys_acl_set_file(vfs_handle_struct *handle,  const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
 {
 	errno = ENOSYS;
@@ -771,10 +783,13 @@ struct vfs_fn_pointers skel_opaque_fns = {
 
 	.sys_acl_get_file_fn = skel_sys_acl_get_file,
 	.sys_acl_get_fd_fn = skel_sys_acl_get_fd,
+	.sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file,
+	.sys_acl_blob_get_fd_fn = skel_sys_acl_blob_get_fd,
 	.sys_acl_set_file_fn = skel_sys_acl_set_file,
 	.sys_acl_set_fd_fn = skel_sys_acl_set_fd,
 	.sys_acl_delete_def_file_fn = skel_sys_acl_delete_def_file,
 
+
 	/* EA operations. */
 	.getxattr_fn = skel_getxattr,
 	.fgetxattr_fn = skel_fgetxattr,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 711b7fc..02a994c 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -699,6 +699,22 @@ static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fs
 	return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp);
 }
 
+static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle,  const char *path_p, SMB_ACL_TYPE_T type,
+				      TALLOC_CTX *mem_ctx,
+				      char **blob_description, 
+				      DATA_BLOB *blob)
+{
+	return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, type, mem_ctx, blob_description, blob);
+}
+
+static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle, files_struct *fsp,
+				      TALLOC_CTX *mem_ctx,
+				      char **blob_description, 
+				      DATA_BLOB *blob)
+{
+	return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description, blob);
+}
+
 static int skel_sys_acl_set_file(vfs_handle_struct *handle,  const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
 {
 	return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl);
@@ -869,6 +885,8 @@ struct vfs_fn_pointers skel_transparent_fns = {
 
 	.sys_acl_get_file_fn = skel_sys_acl_get_file,
 	.sys_acl_get_fd_fn = skel_sys_acl_get_fd,
+	.sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file,
+	.sys_acl_blob_get_fd_fn = skel_sys_acl_blob_get_fd,
 	.sys_acl_set_file_fn = skel_sys_acl_set_file,
 	.sys_acl_set_fd_fn = skel_sys_acl_set_fd,
 	.sys_acl_delete_def_file_fn = skel_sys_acl_delete_def_file,
diff --git a/librpc/idl/smb_acl.idl b/librpc/idl/smb_acl.idl
index 7f67299..f7332d9 100644
--- a/librpc/idl/smb_acl.idl
+++ b/librpc/idl/smb_acl.idl
@@ -40,18 +40,33 @@ interface smb_acl
 		SMB_ACL_OTHER       = 5,
 		SMB_ACL_MASK        = 6
 	} smb_acl_tag_t;
-	
+
 	typedef struct {
-		smb_acl_tag_t a_type;
-		mode_t a_perm;
 		uid_t uid;
+	} smb_acl_user;
+
+	typedef struct {
 		gid_t gid;
+	} smb_acl_group;
+
+	typedef [switch_type(uint16)] union {
+		[case (SMB_ACL_USER)] smb_acl_user user;
+		[case (SMB_ACL_USER_OBJ)];
+		[case (SMB_ACL_GROUP)] smb_acl_group group;
+		[case (SMB_ACL_GROUP_OBJ)];
+		[case (SMB_ACL_OTHER)];
+		[case (SMB_ACL_MASK)];		
+	} smb_acl_entry_info;
+
+	typedef struct {
+		smb_acl_tag_t a_type;
+		[switch_is(a_type)] smb_acl_entry_info info;
+		mode_t a_perm;
 	} smb_acl_entry;
 	
 	[public] typedef struct {
-		int	size;
 		int	count;
-		int	next;
+		[value(0)] int	next;
 		[size_is(count)] smb_acl_entry acl[*];
 	} smb_acl_t;
 	
diff --git a/source3/include/smb_acls.h b/source3/include/smb_acls.h
index 750bbc6..dbcf3b7 100644
--- a/source3/include/smb_acls.h
+++ b/source3/include/smb_acls.h
@@ -44,7 +44,7 @@ int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset_d);
 int sys_acl_add_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm);
 int sys_acl_get_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm);
 char *sys_acl_to_text(const struct smb_acl_t *acl_d, ssize_t *len_p);
-SMB_ACL_T sys_acl_init(int count);
+SMB_ACL_T sys_acl_init(void);
 int sys_acl_create_entry(SMB_ACL_T *acl_p, SMB_ACL_ENTRY_T *entry_p);
 int sys_acl_set_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T tag_type);
 int sys_acl_set_qualifier(SMB_ACL_ENTRY_T entry_d, void *qual_p);
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 17ec262..8e48803 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -143,6 +143,7 @@
 /* Leave at 29 - not yet released. Remove sys_acl functions other than set and get - abartlet */
 /* Leave at 29 - not yet released. Added backup_intent bool to files_struct - JRA */
 /* Leave at 29 - not yet released. Add durable handle functions - metze/obnox */
+/* Leave at 29 - not yet released. Added sys_acl_blob_get_file and sys_acl_blob_get_fd */
 /* Bump to version 30 - Samba 4.0.0 will ship with interface version 30 */
 #define SMB_VFS_INTERFACE_VERSION 30
 
@@ -691,6 +692,12 @@ struct vfs_fn_pointers {
 
 	SMB_ACL_T (*sys_acl_get_file_fn)(struct vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type);
 	SMB_ACL_T (*sys_acl_get_fd_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp);
+	int (*sys_acl_blob_get_file_fn)(struct vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type, 	
+					TALLOC_CTX *mem_ctx, char **blob_description,
+					DATA_BLOB *blob);
+	int (*sys_acl_blob_get_fd_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, 	
+				      TALLOC_CTX *mem_ctx, char **blob_description,
+				      DATA_BLOB *blob);
 	int (*sys_acl_set_file_fn)(struct vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl);
 	int (*sys_acl_set_fd_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_ACL_T theacl);
 	int (*sys_acl_delete_def_file_fn)(struct vfs_handle_struct *handle, const char *path);
@@ -1088,6 +1095,17 @@ SMB_ACL_T smb_vfs_call_sys_acl_get_file(struct vfs_handle_struct *handle,
 					SMB_ACL_TYPE_T type);
 SMB_ACL_T smb_vfs_call_sys_acl_get_fd(struct vfs_handle_struct *handle,
 				      struct files_struct *fsp);
+int smb_vfs_call_sys_acl_blob_get_file(struct vfs_handle_struct *handle,
+				       const char *path_p,
+				       SMB_ACL_TYPE_T type, 	
+				       TALLOC_CTX *mem_ctx,
+				       char **blob_description,
+				       DATA_BLOB *blob);
+int smb_vfs_call_sys_acl_blob_get_fd(struct vfs_handle_struct *handle,
+				     struct files_struct *fsp, 	
+				     TALLOC_CTX *mem_ctx,
+				     char **blob_description,
+				     DATA_BLOB *blob);
 int smb_vfs_call_sys_acl_set_file(struct vfs_handle_struct *handle,
 				  const char *name, SMB_ACL_TYPE_T acltype,
 				  SMB_ACL_T theacl);
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index f077a6f..4eca1b0 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -439,6 +439,16 @@
 #define SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp) \
 	smb_vfs_call_sys_acl_get_fd((handle)->next, (fsp))
 
+#define SMB_VFS_SYS_ACL_BLOB_GET_FILE(conn, path_p, type, mem_ctx, blob_description, blob)	\
+	smb_vfs_call_sys_acl_blob_get_file((conn)->vfs_handles, (path_p), (type), (mem_ctx), (blob_description), (blob))
+#define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, type, mem_ctx, blob_description, blob) \
+	smb_vfs_call_sys_acl_blob_get_file((handle)->next, (path_p), (type), (mem_ctx), (blob_description), (blob))
+
+#define SMB_VFS_SYS_ACL_BLOB_GET_FD(fsp, mem_ctx, blob_description, blob)			\
+	smb_vfs_call_sys_acl_blob_get_fd((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (blob_description), (blob))
+#define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description, blob)	\
+	smb_vfs_call_sys_acl_blob_get_fd((handle)->next, (fsp), mem_ctx, (blob_description), (blob))
+
 #define SMB_VFS_SYS_ACL_SET_FILE(conn, name, acltype, theacl) \
 	smb_vfs_call_sys_acl_set_file((conn)->vfs_handles, (name), (acltype), (theacl))
 #define SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl) \
diff --git a/source3/lib/sysacls.c b/source3/lib/sysacls.c
index 31966c6..a5430d6 100644
--- a/source3/lib/sysacls.c
+++ b/source3/lib/sysacls.c
@@ -107,11 +107,11 @@ int sys_acl_get_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p)
 void *sys_acl_get_qualifier(SMB_ACL_ENTRY_T entry_d)
 {
 	if (entry_d->a_type == SMB_ACL_USER) {
-		return &entry_d->uid;
+		return &entry_d->info.user.uid;
 		}
 
 	if (entry_d->a_type == SMB_ACL_GROUP) {
-		return &entry_d->gid;
+		return &entry_d->info.group.gid;
 	}
 
 	errno = EINVAL;
@@ -189,15 +189,15 @@ char *sys_acl_to_text(const struct smb_acl_t *acl_d, ssize_t *len_p)
 				break;
  
 			case SMB_ACL_USER:
-				id = uidtoname(ap->uid);
+				id = uidtoname(ap->info.user.uid);
 			case SMB_ACL_USER_OBJ:
 				tag = "user";
 				break;
 
 			case SMB_ACL_GROUP:
-				if ((gr = getgrgid(ap->gid)) == NULL) {
+				if ((gr = getgrgid(ap->info.group.gid)) == NULL) {
 					slprintf(idbuf, sizeof(idbuf)-1, "%ld",
-						(long)ap->gid);
+						(long)ap->info.group.gid);
 					id = idbuf;
 				} else {
 					id = gr->gr_name;
@@ -249,25 +249,19 @@ char *sys_acl_to_text(const struct smb_acl_t *acl_d, ssize_t *len_p)
 	return text;
 }
 
-SMB_ACL_T sys_acl_init(int count)
+SMB_ACL_T sys_acl_init(void)
 {
 	SMB_ACL_T	a;
 
-	if (count < 0) {
-		errno = EINVAL;
-		return NULL;
-	}
-
 	if ((a = talloc(NULL, struct smb_acl_t)) == NULL) {
 		errno = ENOMEM;
 		return NULL;
 	}
  
-	a->size = count + 1;
 	a->count = 0;
 	a->next = -1;
 
-	a->acl = talloc_array(a, struct smb_acl_entry, count+1);
+	a->acl = talloc_array(a, struct smb_acl_entry, 0);
 	if (!a->acl) {
 		TALLOC_FREE(a);
 		errno = ENOMEM;
@@ -281,24 +275,25 @@ int sys_acl_create_entry(SMB_ACL_T *acl_p, SMB_ACL_ENTRY_T *entry_p)
 {
 	SMB_ACL_T	acl_d;
 	SMB_ACL_ENTRY_T	entry_d;
+	struct smb_acl_entry *acl;
 
 	if (acl_p == NULL || entry_p == NULL || (acl_d = *acl_p) == NULL) {
 		errno = EINVAL;
 		return -1;
 	}
 
-	if (acl_d->count >= acl_d->size) {
-		errno = ENOSPC;
+	acl = talloc_realloc(acl_d, acl_d->acl, struct smb_acl_entry, acl_d->count+1);
+	if (!acl) {
+		errno = ENOMEM;
 		return -1;
 	}
-
-	entry_d		= &acl_d->acl[acl_d->count++];
+	acl_d->acl = acl;
+	entry_d		= &acl_d->acl[acl_d->count];
 	entry_d->a_type	= SMB_ACL_TAG_INVALID;
-	entry_d->uid	= -1;
-	entry_d->gid	= -1;
 	entry_d->a_perm	= 0;
 	*entry_p	= entry_d;
 
+	acl_d->count++;
 	return 0;
 }
 
@@ -324,11 +319,11 @@ int sys_acl_set_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T tag_type)
 int sys_acl_set_qualifier(SMB_ACL_ENTRY_T entry_d, void *qual_p)
 {
 	if (entry_d->a_type == SMB_ACL_USER) {
-		entry_d->uid = *((uid_t *)qual_p);
+		entry_d->info.user.uid = *((uid_t *)qual_p);
 		return 0;
 		}
 	if (entry_d->a_type == SMB_ACL_GROUP) {
-		entry_d->gid = *((gid_t *)qual_p);
+		entry_d->info.group.gid = *((gid_t *)qual_p);
 		return 0;
 	}
 
diff --git a/source3/modules/vfs_fake_acls.c b/source3/modules/vfs_fake_acls.c
index abe6570..258cb19 100644
--- a/source3/modules/vfs_fake_acls.c
+++ b/source3/modules/vfs_fake_acls.c
@@ -294,6 +294,72 @@ static SMB_ACL_T fake_acls_sys_acl_get_fd(struct vfs_handle_struct *handle, file
 	return acl;
 }
 
+
+static int fake_acls_sys_acl_blob_get_file(struct vfs_handle_struct *handle, const char *path, SMB_ACL_TYPE_T type, TALLOC_CTX *mem_ctx, 
+					   char **blob_description, DATA_BLOB *blob)
+{
+	ssize_t length;
+	const char *name = NULL;
+	switch (type) {
+	case SMB_ACL_TYPE_ACCESS:
+		name = FAKE_ACL_ACCESS_XATTR;
+		break;
+	case SMB_ACL_TYPE_DEFAULT:
+		name = FAKE_ACL_DEFAULT_XATTR;
+		break;
+	}
+
+	*blob_description = talloc_strdup(mem_ctx, "fake_acls");
+	if (!*blob_description) {
+		errno = ENOMEM;
+		return -1;
+	}
+
+	*blob = data_blob_null;
+	do {
+		blob->length += 1000;
+		blob->data = talloc_realloc(mem_ctx, blob->data, uint8_t, blob->length);
+		if (!blob->data) {
+			errno = ENOMEM;
+			return -1;
+		}
+		length = SMB_VFS_NEXT_GETXATTR(handle, path, name, blob->data, blob->length);
+		blob->length = length;
+	} while (length == -1 && errno == ERANGE);
+	if (length == -1) {
+		return -1;
+	}
+	return 0;
+}
+
+static int fake_acls_sys_acl_blob_get_fd(struct vfs_handle_struct *handle, files_struct *fsp, TALLOC_CTX *mem_ctx, 
+					 char **blob_description, DATA_BLOB *blob)
+{
+	ssize_t length;
+	const char *name = FAKE_ACL_ACCESS_XATTR;
+		
+	*blob_description = talloc_strdup(mem_ctx, "fake_acls");
+	if (!*blob_description) {
+		errno = ENOMEM;
+		return -1;
+	}
+	*blob = data_blob_null;
+	do {
+		blob->length += 1000;
+		blob->data = talloc_realloc(mem_ctx, blob->data, uint8_t, blob->length);
+		if (!blob->data) {
+			errno = ENOMEM;
+			return -1;
+		}
+		length = SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, blob->data, blob->length);
+		blob->length = length;
+	} while (length == -1 && errno == ERANGE);
+	if (length == -1) {
+		return -1;
+	}
+	return 0;
+}
+
 static int fake_acls_sys_acl_set_file(vfs_handle_struct *handle, const char *path, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
 {
 	int ret;
@@ -450,6 +516,8 @@ static struct vfs_fn_pointers vfs_fake_acls_fns = {
 	.fstat_fn = fake_acls_fstat,
 	.sys_acl_get_file_fn = fake_acls_sys_acl_get_file,
 	.sys_acl_get_fd_fn = fake_acls_sys_acl_get_fd,
+	.sys_acl_blob_get_file_fn = fake_acls_sys_acl_blob_get_file,
+	.sys_acl_blob_get_fd_fn = fake_acls_sys_acl_blob_get_fd,
 	.sys_acl_set_file_fn = fake_acls_sys_acl_set_file,
 	.sys_acl_set_fd_fn = fake_acls_sys_acl_set_fd,
 	.sys_acl_delete_def_file_fn = fake_acls_sys_acl_delete_def_file,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 48198e7..392baea 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -175,6 +175,8 @@ typedef enum _vfs_op_type {
 
 	SMB_VFS_OP_SYS_ACL_GET_FILE,
 	SMB_VFS_OP_SYS_ACL_GET_FD,
+	SMB_VFS_OP_SYS_ACL_BLOB_GET_FILE,
+	SMB_VFS_OP_SYS_ACL_BLOB_GET_FD,
 	SMB_VFS_OP_SYS_ACL_SET_FILE,
 	SMB_VFS_OP_SYS_ACL_SET_FD,
 	SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE,
@@ -284,6 +286,8 @@ static struct {
 	{ SMB_VFS_OP_FCHMOD_ACL,	"fchmod_acl" },
 	{ SMB_VFS_OP_SYS_ACL_GET_FILE,	"sys_acl_get_file" },
 	{ SMB_VFS_OP_SYS_ACL_GET_FD,	"sys_acl_get_fd" },
+	{ SMB_VFS_OP_SYS_ACL_BLOB_GET_FILE,	"sys_acl_blob_get_file" },
+	{ SMB_VFS_OP_SYS_ACL_BLOB_GET_FD,	"sys_acl_blob_get_fd" },
 	{ SMB_VFS_OP_SYS_ACL_SET_FILE,	"sys_acl_set_file" },
 	{ SMB_VFS_OP_SYS_ACL_SET_FD,	"sys_acl_set_fd" },
 	{ SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE,	"sys_acl_delete_def_file" },
@@ -1821,6 +1825,39 @@ static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle,
 	return result;
 }
 
+static int smb_full_audit_sys_acl_blob_get_file(vfs_handle_struct *handle,
+						const char *path_p,
+						SMB_ACL_TYPE_T type, 
+						TALLOC_CTX *mem_ctx, 
+						char **blob_description,
+						DATA_BLOB *blob)
+{
+	SMB_ACL_T result;
+
+	result = SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, type, mem_ctx, blob_description, blob);
+
+	do_log(SMB_VFS_OP_SYS_ACL_BLOB_GET_FILE,  (result >= 0), handle,
+	       "%s", path_p);
+
+	return result;
+}
+
+static int smb_full_audit_sys_acl_blob_get_fd(vfs_handle_struct *handle,
+					      files_struct *fsp, 
+					      TALLOC_CTX *mem_ctx, 
+					      char **blob_description,
+					      DATA_BLOB *blob)
+{
+	SMB_ACL_T result;
+
+	result = SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description,blob);
+
+	do_log(SMB_VFS_OP_SYS_ACL_BLOB_GET_FD,  (result >= 0), handle,
+	       "%s", fsp_str_do_log(fsp));
+
+	return result;
+}
+
 static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle,
 
 				  const char *name, SMB_ACL_TYPE_T acltype,
diff --git a/source3/modules/vfs_posixacl.c b/source3/modules/vfs_posixacl.c
index 407a3a1..50487ff 100644
--- a/source3/modules/vfs_posixacl.c
+++ b/source3/modules/vfs_posixacl.c
@@ -177,7 +177,7 @@ static bool smb_ace_to_internal(acl_entry_t posix_ace,
 			DEBUG(0, ("smb_acl_get_qualifier failed\n"));
 			return False;
 		}
-		ace->uid = *puid;
+		ace->info.user.uid = *puid;
 		acl_free(puid);
 		break;
 	}
@@ -188,7 +188,7 @@ static bool smb_ace_to_internal(acl_entry_t posix_ace,
 			DEBUG(0, ("smb_acl_get_qualifier failed\n"));
 			return False;
 		}
-		ace->gid = *pgid;
+		ace->info.group.gid = *pgid;
 		acl_free(pgid);
 		break;
 	}
@@ -214,7 +214,7 @@ static bool smb_ace_to_internal(acl_entry_t posix_ace,
 
 static struct smb_acl_t *smb_acl_to_internal(acl_t acl)
 {
-	struct smb_acl_t *result = sys_acl_init(0);
+	struct smb_acl_t *result = sys_acl_init();
 	int entry_id = ACL_FIRST_ENTRY;
 	acl_entry_t e;
 	if (result == NULL) {
@@ -323,14 +323,14 @@ static acl_t smb_acl_to_posix(const struct smb_acl_t *acl)
 
 		switch (entry->a_type) {
 		case SMB_ACL_USER:
-			if (acl_set_qualifier(e, &entry->uid) != 0) {
+			if (acl_set_qualifier(e, &entry->info.user.uid) != 0) {
 				DEBUG(1, ("acl_set_qualifiier failed: %s\n",
 					  strerror(errno)));
 				goto fail;
 			}
 			break;
 		case SMB_ACL_GROUP:
-			if (acl_set_qualifier(e, &entry->gid) != 0) {
+			if (acl_set_qualifier(e, &entry->info.group.gid) != 0) {
 				DEBUG(1, ("acl_set_qualifiier failed: %s\n",
 					  strerror(errno)));
 				goto fail;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list