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)
committerJeremy Allison <jra@samba.org>
Sat, 16 Oct 2010 00:38:21 +0000 (17:38 -0700)
Jeremy.

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

index c2907822af00e5d711590b8a6b453bec790585fd..2cbb84cad0c4f14378937ec8b0d891ac600450d5 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 10e01203745303c456d0dcbb2b8c67c05534966d..01f0cd699a0a7c751a01f7b323a0ccaf6e7252c2 100644 (file)
@@ -1997,7 +1997,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, "