summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-01-14 10:38:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:40:46 -0500
commit677633480bfa2438d6af69fd2d48292184a08c2b (patch)
tree98270c01d098d224e076691da66496df78677a23 /source4/torture
parent70dcbd1f0f4fa0c8cd5b473ac57ac7aad11e9343 (diff)
downloadsamba-677633480bfa2438d6af69fd2d48292184a08c2b.tar.gz
samba-677633480bfa2438d6af69fd2d48292184a08c2b.tar.bz2
samba-677633480bfa2438d6af69fd2d48292184a08c2b.zip
r20758: Adapt RAW-UNLINK error returns for wildcard unlinks to Samba3.
If someone is feeling like solving that puzzle, contact Jeremy or me for hints :-) Volker (This used to be commit 93e6dbaf5b81661d85539877fd0874480cfa5673)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/raw/unlink.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/source4/torture/raw/unlink.c b/source4/torture/raw/unlink.c
index c4f08beb7f..63c163cfc1 100644
--- a/source4/torture/raw/unlink.c
+++ b/source4/torture/raw/unlink.c
@@ -128,7 +128,21 @@ static BOOL test_unlink(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
io.unlink.in.pattern = BASEDIR "\\z*";
io.unlink.in.attrib = FILE_ATTRIBUTE_DIRECTORY;
status = smb_raw_unlink(cli->tree, &io);
- CHECK_STATUS(status, NT_STATUS_NO_SUCH_FILE);
+
+ if (lp_parm_bool(-1, "torture", "samba3", False)) {
+ /*
+ * In Samba3 we gave up upon getting the error codes in
+ * wildcard unlink correct. Trying gentest showed that this is
+ * irregular beyond our capabilities. So for
+ * FILE_ATTRIBUTE_DIRECTORY we always return NAME_INVALID.
+ * Tried by jra and vl. If others feel like solving this
+ * puzzle, please tell us :-)
+ */
+ CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID);
+ }
+ else {
+ CHECK_STATUS(status, NT_STATUS_NO_SUCH_FILE);
+ }
io.unlink.in.pattern = BASEDIR "\\*";
io.unlink.in.attrib = FILE_ATTRIBUTE_DIRECTORY;
@@ -143,19 +157,34 @@ static BOOL test_unlink(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
io.unlink.in.pattern = BASEDIR "\\t*";
io.unlink.in.attrib = FILE_ATTRIBUTE_DIRECTORY;
status = smb_raw_unlink(cli->tree, &io);
- CHECK_STATUS(status, NT_STATUS_OK);
+ if (lp_parm_bool(-1, "torture", "samba3", False)) {
+ CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID);
+ }
+ else {
+ CHECK_STATUS(status, NT_STATUS_OK);
+ }
smbcli_close(cli->tree, smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE));
io.unlink.in.pattern = BASEDIR "\\*.dat";
io.unlink.in.attrib = FILE_ATTRIBUTE_DIRECTORY;
status = smb_raw_unlink(cli->tree, &io);
- CHECK_STATUS(status, NT_STATUS_NO_SUCH_FILE);
+ if (lp_parm_bool(-1, "torture", "samba3", False)) {
+ CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID);
+ }
+ else {
+ CHECK_STATUS(status, NT_STATUS_NO_SUCH_FILE);
+ }
io.unlink.in.pattern = BASEDIR "\\*.tx?";
io.unlink.in.attrib = 0;
status = smb_raw_unlink(cli->tree, &io);
- CHECK_STATUS(status, NT_STATUS_OK);
+ if (lp_parm_bool(-1, "torture", "samba3", False)) {
+ CHECK_STATUS(status, NT_STATUS_NO_SUCH_FILE);
+ }
+ else {
+ CHECK_STATUS(status, NT_STATUS_OK);
+ }
status = smb_raw_unlink(cli->tree, &io);
CHECK_STATUS(status, NT_STATUS_NO_SUCH_FILE);