summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-01-03 12:02:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:36:02 -0500
commitcc8e2febb897f6e6a41c5062e533e332304843a9 (patch)
treed2d5cec77bc0659ae14bb2682d5053362fb93b13 /source4/torture/raw
parentf06f5e3deea235161bad07ce2376dcb13ccfecc0 (diff)
downloadsamba-cc8e2febb897f6e6a41c5062e533e332304843a9.tar.gz
samba-cc8e2febb897f6e6a41c5062e533e332304843a9.tar.bz2
samba-cc8e2febb897f6e6a41c5062e533e332304843a9.zip
r20508: Confirm a special case in samba3 reply_getatr that getatr("") always returns
HIDDEN. Volker (This used to be commit 83a20912061c663ff422b038b41f01a9c7583afe)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/samba3misc.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source4/torture/raw/samba3misc.c b/source4/torture/raw/samba3misc.c
index 0b196b1587..490b0c8cde 100644
--- a/source4/torture/raw/samba3misc.c
+++ b/source4/torture/raw/samba3misc.c
@@ -340,6 +340,11 @@ BOOL torture_samba3_badpath(struct torture_context *torture)
status = smbcli_chkpath(cli_dos->tree, "<\\bla");
CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadpath));
+ status = smbcli_chkpath(cli_nt->tree, "");
+ CHECK_STATUS(status, NT_STATUS_OK);
+ status = smbcli_chkpath(cli_dos->tree, "");
+ CHECK_STATUS(status, NT_STATUS_OK);
+
/*
* .... And the same gang against getatr. Note that the DOS error codes
* differ....
@@ -380,6 +385,35 @@ BOOL torture_samba3_badpath(struct torture_context *torture)
status = smbcli_getatr(cli_dos->tree, "<\\bla", NULL, NULL, NULL);
CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRinvalidname));
+ {
+ uint16_t attr;
+
+ status = smbcli_getatr(cli_nt->tree, "", &attr, NULL, NULL);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ if (attr != (FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_DIRECTORY)) {
+ d_printf("(%s) getatr(\"\") returned 0x%x, expected "
+ "0x%x\n", __location__, attr,
+ FILE_ATTRIBUTE_HIDDEN
+ |FILE_ATTRIBUTE_DIRECTORY);
+ ret = False;
+ }
+
+ status = smbcli_setatr(cli_nt->tree, "",
+ FILE_ATTRIBUTE_DIRECTORY, -1);
+ CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
+ status = smbcli_setatr(cli_dos->tree, "",
+ FILE_ATTRIBUTE_DIRECTORY, -1);
+ CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRnoaccess));
+
+ status = smbcli_setatr(cli_nt->tree, ".",
+ FILE_ATTRIBUTE_DIRECTORY, -1);
+ CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID);
+ status = smbcli_setatr(cli_dos->tree, ".",
+ FILE_ATTRIBUTE_DIRECTORY, -1);
+ CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRinvalidname));
+ }
+
+
/* Try the same set with openX. */
status = raw_smbcli_open(cli_nt->tree, "..", O_RDONLY, DENY_NONE, NULL);