Fix bug 8636 - When returning an ACL without SECINFO_DACL requested, we still set...
authorJeremy Allison <jra@samba.org>
Sat, 21 Jan 2012 00:37:50 +0000 (16:37 -0800)
committerKarolin Seeger <kseeger@samba.org>
Mon, 23 Jan 2012 20:37:26 +0000 (21:37 +0100)
source3/modules/vfs_acl_common.c
source3/smbd/nttrans.c

index 17e1874376b352dda6dbc4eb5f2925b8d9db1858..3ca0384a277d1b4daee2e857a399aa01218e31a4 100644 (file)
@@ -408,9 +408,11 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
                psd->group_sid = NULL;
        }
        if (!(security_info & DACL_SECURITY_INFORMATION)) {
+               psd->type &= ~SEC_DESC_DACL_PRESENT;
                psd->dacl = NULL;
        }
        if (!(security_info & SACL_SECURITY_INFORMATION)) {
+               psd->type &= ~SEC_DESC_SACL_PRESENT;
                psd->sacl = NULL;
        }
 
@@ -532,7 +534,8 @@ static NTSTATUS get_parent_acl_common(vfs_handle_struct *handle,
                                        parent_name,
                                        (SECINFO_OWNER |
                                         SECINFO_GROUP |
-                                        SECINFO_DACL),
+                                        SECINFO_DACL  |
+                                        SECINFO_SACL),
                                        pp_parent_desc);
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -615,7 +618,8 @@ static int open_acl_common(vfs_handle_struct *handle,
                                fname,
                                (OWNER_SECURITY_INFORMATION |
                                 GROUP_SECURITY_INFORMATION |
-                                DACL_SECURITY_INFORMATION),
+                                DACL_SECURITY_INFORMATION  |
+                                SACL_SECURITY_INFORMATION),
                                &pdesc);
         if (NT_STATUS_IS_OK(status)) {
                /* See if we can access it. */
index decb07cfb29de3844010d88f1ed8b0ed97381d62..6fbbed9bfe04e923cf321a89713435ece7952324 100644 (file)
@@ -1883,9 +1883,11 @@ static void call_nt_transact_query_security_desc(connection_struct *conn,
                psd->group_sid = NULL;
        }
        if (!(security_info_wanted & SECINFO_DACL)) {
+               psd->type &= ~SEC_DESC_DACL_PRESENT;
                psd->dacl = NULL;
        }
        if (!(security_info_wanted & SECINFO_SACL)) {
+               psd->type &= ~SEC_DESC_SACL_PRESENT;
                psd->sacl = NULL;
        }