r4612: make the output for the w2k3 acl bug a bit clearer
authorAndrew Tridgell <tridge@samba.org>
Sun, 9 Jan 2005 04:31:32 +0000 (04:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:08:33 +0000 (13:08 -0500)
(This used to be commit 24ec8c4274241576683f1f6c86c33a2dfa43848c)

source4/torture/raw/acls.c

index 97f5f4f5e1f901deb3bb2a1a7db6b261446ed911..cc99b40050acc21a05f6cb58681a01d05e0af6ac 100644 (file)
@@ -1211,6 +1211,25 @@ static BOOL test_inheritance(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        CHECK_STATUS(status, NT_STATUS_OK);
        smbcli_close(cli->tree, fnum2);
 
+       io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
+       io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
+       status = smb_raw_open(cli->tree, mem_ctx, &io);
+       if (NT_STATUS_IS_OK(status)) {
+               printf("failed: w2k3 ACL bug (allowed open when ACL should deny)\n");
+               ret = False;
+               fnum2 = io.ntcreatex.out.fnum;
+               smbcli_close(cli->tree, fnum2);
+       } else {
+               CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
+       }
+
+       printf("trying without execute\n");
+       io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
+       io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL & ~SEC_FILE_EXECUTE;
+       status = smb_raw_open(cli->tree, mem_ctx, &io);
+       CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
+
+       printf("and with full permissions again\n");
        io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
        io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
        status = smb_raw_open(cli->tree, mem_ctx, &io);