s3: smbd: Ensure POSIX default ACL is mapped into returned Windows ACL for directory...
authorJeremy Allison <jra@samba.org>
Mon, 17 May 2021 22:34:55 +0000 (15:34 -0700)
committerNoel Power <npower@samba.org>
Wed, 19 May 2021 09:22:56 +0000 (09:22 +0000)
Remove knownfail.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14708

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed May 19 09:22:56 UTC 2021 on sn-devel-184

selftest/knownfail.d/posix_dir_default_acl [deleted file]
source3/smbd/posix_acls.c

diff --git a/selftest/knownfail.d/posix_dir_default_acl b/selftest/knownfail.d/posix_dir_default_acl
deleted file mode 100644 (file)
index 5c8a5d9..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-^samba3.smbtorture_s3.plain.POSIX-DIR-DEFAULT-ACL.smbtorture\(nt4_dc_smb1\)
-^samba3.smbtorture_s3.crypt.POSIX-DIR-DEFAULT-ACL.smbtorture\(nt4_dc_smb1\)
index c3e00fa2475e75ae9f910716ba60ecc5845de3aa..489a4695ba13d4e3139a001a0c37a5f110866477 100644 (file)
@@ -3426,6 +3426,7 @@ NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
 {
        SMB_STRUCT_STAT sbuf;
        SMB_ACL_T posix_acl = NULL;
+       SMB_ACL_T def_acl = NULL;
        struct pai_val *pal;
        TALLOC_CTX *frame = talloc_stackframe();
        NTSTATUS status;
@@ -3444,10 +3445,19 @@ NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
        /* Get the ACL from the fd. */
        posix_acl = SMB_VFS_SYS_ACL_GET_FD(fsp, frame);
 
+       /* If it's a directory get the default POSIX ACL. */
+       if(fsp->fsp_flags.is_directory) {
+               def_acl = SMB_VFS_SYS_ACL_GET_FILE(fsp->conn,
+                                                  fsp->fsp_name,
+                                                  SMB_ACL_TYPE_DEFAULT,
+                                                  frame);
+               def_acl = free_empty_sys_acl(fsp->conn, def_acl);
+       }
+
        pal = fload_inherited_info(fsp);
 
        status = posix_get_nt_acl_common(fsp->conn, fsp->fsp_name->base_name,
-                                        &sbuf, pal, posix_acl, NULL,
+                                        &sbuf, pal, posix_acl, def_acl,
                                         security_info, mem_ctx, ppdesc);
        TALLOC_FREE(frame);
        return status;