From: Jeremy Allison Date: Wed, 1 Dec 2021 20:05:20 +0000 (-0800) Subject: s4: torture: Remove the wildcard unlink test code. X-Git-Tag: tdb-1.4.6~398 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c9a33ca3463ab010e24430a1743f4669c70a75f;p=thirdparty%2Fsamba.git s4: torture: Remove the wildcard unlink test code. This is pre WindowXP SMB1 functionality, and we need to remove this from the server in order to move towards SMB2-only, so the test must go. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source4/torture/raw/unlink.c b/source4/torture/raw/unlink.c index 4f198fa2759..53059aa576a 100644 --- a/source4/torture/raw/unlink.c +++ b/source4/torture/raw/unlink.c @@ -112,78 +112,6 @@ static bool test_unlink(struct torture_context *tctx, struct smbcli_state *cli) status = smb_raw_unlink(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_FILE_IS_A_DIRECTORY); - printf("Trying wildcards\n"); - smbcli_close(cli->tree, smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE)); - io.unlink.in.pattern = BASEDIR "\\t*.t"; - io.unlink.in.attrib = 0; - status = smb_raw_unlink(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_NO_SUCH_FILE); - - io.unlink.in.pattern = BASEDIR "\\z*"; - io.unlink.in.attrib = 0; - status = smb_raw_unlink(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_NO_SUCH_FILE); - - io.unlink.in.pattern = BASEDIR "\\z*"; - io.unlink.in.attrib = FILE_ATTRIBUTE_DIRECTORY; - status = smb_raw_unlink(cli->tree, &io); - - if (torture_setting_bool(tctx, "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; - status = smb_raw_unlink(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); - - io.unlink.in.pattern = BASEDIR "\\?"; - io.unlink.in.attrib = FILE_ATTRIBUTE_DIRECTORY; - status = smb_raw_unlink(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); - - io.unlink.in.pattern = BASEDIR "\\t*"; - io.unlink.in.attrib = FILE_ATTRIBUTE_DIRECTORY; - status = smb_raw_unlink(cli->tree, &io); - if (torture_setting_bool(tctx, "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); - if (torture_setting_bool(tctx, "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); - - status = smb_raw_unlink(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_NO_SUCH_FILE); - - done: smb_raw_exit(cli->session); smbcli_deltree(cli->tree, BASEDIR);