summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-01-08 21:08:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:37:15 -0500
commitdff70f76bcfc4abe6ce24fb7c66efd0476c0522d (patch)
tree02a89836f6d8ca190fc32bdc8de279f62714c8f6 /source4/torture/raw
parentb1730cf39dcf91530cb18859d4cf70b7e622d11b (diff)
downloadsamba-dff70f76bcfc4abe6ce24fb7c66efd0476c0522d.tar.gz
samba-dff70f76bcfc4abe6ce24fb7c66efd0476c0522d.tar.bz2
samba-dff70f76bcfc4abe6ce24fb7c66efd0476c0522d.zip
r20618: Fix a bug in bad_path handling that also exists in 3.0.23: For reply_unlink
under Linux we returned NT_STATUS_NOT_A_DIRECTORY. This is because in the bad_path==True condition lstat(2) returns ENOTDIR and not ENOENT. Not sure if we want to necessarily replicate the INVALID_PARAMETER here, but this is what W2k3 does. Jeremy, I tried to call you, but you were not around. So I'll leave it up to you to merge this. Volker (This used to be commit 838afa8f7d2b10460725c1f0b519ce54fb84de88)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/samba3misc.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/source4/torture/raw/samba3misc.c b/source4/torture/raw/samba3misc.c
index 66462ca5b1..695abfbb8a 100644
--- a/source4/torture/raw/samba3misc.c
+++ b/source4/torture/raw/samba3misc.c
@@ -496,6 +496,22 @@ BOOL torture_samba3_badpath(struct torture_context *torture)
status = smbcli_setatr(cli_dos->tree, invname, 0, 0);
CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadfile));
+ status = smbcli_unlink(cli_nt->tree, invpath);
+ CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
+ status = smbcli_unlink(cli_dos->tree, invpath);
+ CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadpath));
+
+ /*
+ * W2k3 returns INVALID_PARAMETER for a wildcard unlink if the
+ * directory does not exist. They seem to use the t2ffirst, this also
+ * returns INVALID_PARAMETER under this condition.
+ */
+
+ status = smbcli_unlink(cli_nt->tree, "test.txt\\*.*");
+ CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
+ status = smbcli_unlink(cli_dos->tree, "test.txt\\*.*");
+ CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRinvalidparam));
+
/*
* reply_search returns STATUS_NO_MORE_FILES on invalid path
*/
@@ -622,11 +638,6 @@ BOOL torture_samba3_badpath(struct torture_context *torture)
#endif
}
- status = smbcli_unlink(cli_nt->tree, invpath);
- CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
- status = smbcli_unlink(cli_dos->tree, invpath);
- CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadpath));
-
status = smbcli_mkdir(cli_nt->tree, invpath);
CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
status = smbcli_mkdir(cli_dos->tree, invpath);