summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-12-04 16:07:35 -0800
committerTim Prouty <tprouty@samba.org>2009-12-07 16:54:17 -0800
commitf717a79eff334835eb33783adcbb261e126185d6 (patch)
tree11298a53885cac55169ae84e8515e912f2180e23 /source4/torture/raw
parentf4aa47b5ab265b30a0708b72936e1bc26a793df6 (diff)
downloadsamba-f717a79eff334835eb33783adcbb261e126185d6.tar.gz
samba-f717a79eff334835eb33783adcbb261e126185d6.tar.bz2
samba-f717a79eff334835eb33783adcbb261e126185d6.zip
s4 torture: Add a new torture:hide_on_access_denied parameter
It appears some newer versions of windows return NT_STATUS_OBJECT_NAME_NOT_FOUND on a createfile when access is denied rather than NT_STATUS_ACCESS_DENIED. I'm not sure how this translates to directory enumeration yet, but for now make this a parameter that can be checked in the various torture tests. This also gets RAW-ACLS and SMB2-CREATE passing against win7.
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/acls.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/source4/torture/raw/acls.c b/source4/torture/raw/acls.c
index 94274237af..e34a901ebc 100644
--- a/source4/torture/raw/acls.c
+++ b/source4/torture/raw/acls.c
@@ -1768,20 +1768,32 @@ static bool test_inheritance(struct torture_context *tctx,
CHECK_ACCESS_FLAGS(fnum2, SEC_RIGHTS_FILE_ALL);
smbcli_close(cli->tree, fnum2);
} else {
- CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
+ if (TARGET_IS_WIN7(tctx)) {
+ CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND);
+ } else {
+ CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
+ }
}
torture_comment(tctx, "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, tctx, &io);
- CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
+ if (TARGET_IS_WIN7(tctx)) {
+ CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND);
+ } else {
+ CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
+ }
torture_comment(tctx, "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, tctx, &io);
- CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
+ if (TARGET_IS_WIN7(tctx)) {
+ CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND);
+ } else {
+ CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
+ }
io.ntcreatex.in.access_mask = SEC_FILE_WRITE_DATA;
status = smb_raw_open(cli->tree, tctx, &io);
@@ -1802,7 +1814,11 @@ static bool test_inheritance(struct torture_context *tctx,
io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
status = smb_raw_open(cli->tree, tctx, &io);
- CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
+ if (TARGET_IS_WIN7(tctx)) {
+ CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND);
+ } else {
+ CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
+ }
io.ntcreatex.in.access_mask = SEC_FILE_WRITE_DATA;
status = smb_raw_open(cli->tree, tctx, &io);
@@ -1811,9 +1827,6 @@ static bool test_inheritance(struct torture_context *tctx,
CHECK_ACCESS_FLAGS(fnum2, SEC_FILE_WRITE_DATA | SEC_FILE_READ_ATTRIBUTE);
smbcli_close(cli->tree, fnum2);
- smbcli_unlink(cli->tree, fname1);
- smbcli_rmdir(cli->tree, dname);
-
done:
if (sd_orig != NULL) {
set.set_secdesc.level = RAW_SFILEINFO_SEC_DESC;
@@ -1824,6 +1837,8 @@ done:
}
smbcli_close(cli->tree, fnum);
+ smbcli_unlink(cli->tree, fname1);
+ smbcli_rmdir(cli->tree, dname);
smb_raw_exit(cli->session);
smbcli_deltree(cli->tree, BASEDIR);
return ret;