summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-05-23 10:45:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:31 -0500
commit61bd8760650fab45870f7c6f6ce1aefa8e2c3fa5 (patch)
treea2b85573960d305d6540c9c9cb87d0d938c3bc9e
parent0b56e916a762d77cb7dd06a4130ad78d33d57b53 (diff)
downloadsamba-61bd8760650fab45870f7c6f6ce1aefa8e2c3fa5.tar.gz
samba-61bd8760650fab45870f7c6f6ce1aefa8e2c3fa5.tar.bz2
samba-61bd8760650fab45870f7c6f6ce1aefa8e2c3fa5.zip
r15836: Test an invalid DOS share mode.
Volker (This used to be commit 0369d59142c6015f62bf50087f261c1e8430a8e2)
-rw-r--r--source4/torture/basic/base.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c
index 29f0996bd4..ddcbcba2e6 100644
--- a/source4/torture/basic/base.c
+++ b/source4/torture/basic/base.c
@@ -1707,6 +1707,39 @@ static BOOL torture_samba3_errorpaths(struct torture_context *torture)
goto fail;
}
+ {
+ /* Test an invalid DOS deny mode */
+ const char *fname = "test.txt";
+
+ fnum = smbcli_open(cli_nt->tree, fname, O_RDWR | O_CREAT, 5);
+ if (fnum != -1) {
+ printf("Open(%s) with invalid deny mode succeeded -- "
+ "expected failure\n", fname);
+ smbcli_close(cli_nt->tree, fnum);
+ goto fail;
+ }
+ if (!NT_STATUS_EQUAL(smbcli_nt_error(cli_nt->tree),
+ NT_STATUS_DOS(ERRDOS,ERRbadaccess))) {
+ printf("Expected DOS error ERRDOS/ERRbadaccess, "
+ "got %s\n", smbcli_errstr(cli_nt->tree));
+ goto fail;
+ }
+
+ fnum = smbcli_open(cli_dos->tree, fname, O_RDWR | O_CREAT, 5);
+ if (fnum != -1) {
+ printf("Open(%s) with invalid deny mode succeeded -- "
+ "expected failure\n", fname);
+ smbcli_close(cli_nt->tree, fnum);
+ goto fail;
+ }
+ if (!NT_STATUS_EQUAL(smbcli_nt_error(cli_nt->tree),
+ NT_STATUS_DOS(ERRDOS,ERRbadaccess))) {
+ printf("Expected DOS error ERRDOS:ERRbadaccess, "
+ "got %s\n", smbcli_errstr(cli_nt->tree));
+ goto fail;
+ }
+ }
+
if (!lp_parm_bool(-1, "target", "samba3", False)) {
goto done;
}
@@ -1740,7 +1773,7 @@ static BOOL torture_samba3_errorpaths(struct torture_context *torture)
if (!NT_STATUS_EQUAL(smbcli_nt_error(cli_nt->tree),
NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
- printf("Expected DOS error NT_STATUS_OBJECT_NAME_NOT_FOUND, "
+ printf("Expected error NT_STATUS_OBJECT_NAME_NOT_FOUND, "
"got %s\n", smbcli_errstr(cli_nt->tree));
goto fail;
}