1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

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 commit is contained in:
Volker Lendecke 2007-01-14 10:38:06 +00:00 committed by Gerald (Jerry) Carter
parent a3f7b18473
commit 93e6dbaf5b

View File

@ -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);