From 677633480bfa2438d6af69fd2d48292184a08c2b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 14 Jan 2007 10:38:06 +0000 Subject: 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) --- source4/torture/raw/unlink.c | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'source4/torture/raw') 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); -- cgit