[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Fri Nov 2 15:17:02 MDT 2012


The branch, master has been updated
       via  60cf4cb vfs_acl_common: In add_directory_inheritable_components allocate on psd as parent
      from  92e17d5 smb2_server: Fix typo in comment.

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


- Log -----------------------------------------------------------------
commit 60cf4cb5a630506747431ecbf00d890509baf2f3
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Nov 1 09:51:28 2012 +1100

    vfs_acl_common: In add_directory_inheritable_components allocate on psd as parent
    
    When we add a new DACL to the security descriptor, we need to use the
    SD as the memory context, so we can talloc_move() it as a tree to a
    new parent.
    
    Andrew Bartlett
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri Nov  2 22:16:14 CET 2012 on sn-devel-104

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

Summary of changes:
 source3/modules/vfs_acl_common.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index ef2dda1..59ced29 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -195,9 +195,21 @@ static NTSTATUS add_directory_inheritable_components(vfs_handle_struct *handle,
 	mode_t dir_mode;
 	mode_t file_mode;
 	mode_t mode;
-	struct security_ace *new_ace_list = talloc_zero_array(talloc_tos(),
-						struct security_ace,
-						num_aces + 3);
+	struct security_ace *new_ace_list;
+
+	if (psd->dacl) {
+		new_ace_list = talloc_zero_array(psd->dacl,
+						 struct security_ace,
+						 num_aces + 3);
+	} else {
+		/*
+		 * make_sec_acl() at the bottom of this function
+		 * dupliates new_ace_list
+		 */
+		new_ace_list = talloc_zero_array(talloc_tos(),
+						 struct security_ace,
+						 num_aces + 3);
+	}
 
 	if (new_ace_list == NULL) {
 		return NT_STATUS_NO_MEMORY;
@@ -256,7 +268,7 @@ static NTSTATUS add_directory_inheritable_components(vfs_handle_struct *handle,
 		psd->dacl->aces = new_ace_list;
 		psd->dacl->num_aces += 3;
 	} else {
-		psd->dacl = make_sec_acl(talloc_tos(),
+		psd->dacl = make_sec_acl(psd,
 				NT4_ACL_REVISION,
 				3,
 				new_ace_list);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list