]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix bug #7734 - When creating files with "inherit ACLs" set to true, we neglect to...
authorJeremy Allison <jra@samba.org>
Fri, 15 Oct 2010 21:12:04 +0000 (14:12 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 24 Nov 2010 17:10:41 +0000 (18:10 +0100)
Jeremy.
(cherry picked from commit 8cad5e23b6e2440a566def6fb138d484e3b47643)

source3/modules/vfs_default.c
source3/smbd/open.c

index 6e2a5712c83fe6d8209934f13d3921a42ee1abb6..691fd7c463f0cafe37787991de477c551a095611 100644 (file)
@@ -217,7 +217,7 @@ static int vfswrap_mkdir(vfs_handle_struct *handle,  const char *path, mode_t mo
        if (lp_inherit_acls(SNUM(handle->conn))
            && parent_dirname(talloc_tos(), path, &parent, NULL)
            && (has_dacl = directory_has_default_acl(handle->conn, parent)))
-               mode = 0777;
+               mode = (0777 & lp_dir_mask(SNUM(handle->conn)));
 
        TALLOC_FREE(parent);
 
index fa647544571086999829ff73c0e35beabfc4cc7a..4b36f542917484ed2bbfc76179c3ca15c0bc9591 100644 (file)
@@ -1966,7 +1966,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 
         if ((flags2 & O_CREAT) && lp_inherit_acls(SNUM(conn)) &&
            (def_acl = directory_has_default_acl(conn, parent_dir))) {
-               unx_mode = 0777;
+               unx_mode = (0777 & lp_create_mask(SNUM(conn)));
        }
 
        DEBUG(4,("calling open_file with flags=0x%X flags2=0x%X mode=0%o, "