r11777: display the security_descriptor in torture_smb2_all_info()
authorAndrew Tridgell <tridge@samba.org>
Fri, 18 Nov 2005 10:07:14 +0000 (10:07 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:46:25 +0000 (13:46 -0500)
(This used to be commit d1067fc25df57b1b6ef59a69f979ed76df5c46cd)

source4/libcli/smb2/getinfo.c
source4/torture/smb2/util.c

index 4575ae2a4091c56304573102aa675c0401b3bafe..85411fab92517a14cbbc9620a7aaee762d136d5a 100644 (file)
@@ -91,6 +91,10 @@ NTSTATUS smb2_getinfo(struct smb2_tree *tree, TALLOC_CTX *mem_ctx,
 */
 uint16_t smb2_getinfo_map_level(uint16_t level, uint8_t class)
 {
+       if (class == SMB2_GETINFO_FILE && 
+           level == RAW_FILEINFO_SEC_DESC) {
+               return SMB2_GETINFO_SECURITY;
+       }
        if ((level & 0xFF) == class) {
                return level;
        } else if (level > 1000) {
index 776714da9e9bfb8054f99cbf9734e9baaec3ea60..7afce0137f14cb4b0e9de290cd0cbcd6cf1d1384 100644 (file)
@@ -282,6 +282,16 @@ void torture_smb2_all_info(struct smb2_tree *tree, struct smb2_handle handle)
                }
        }       
 
+       /* the security descriptor */
+       io.query_secdesc.level = RAW_FILEINFO_SEC_DESC;
+       io.query_secdesc.secinfo_flags = 
+               SECINFO_OWNER|SECINFO_GROUP|
+               SECINFO_DACL;
+       status = smb2_getinfo_file(tree, tmp_ctx, &io);
+       if (NT_STATUS_IS_OK(status)) {
+               NDR_PRINT_DEBUG(security_descriptor, io.query_secdesc.out.sd);
+       }
+
        talloc_free(tmp_ctx);   
 }