From cc8e2febb897f6e6a41c5062e533e332304843a9 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 3 Jan 2007 12:02:44 +0000 Subject: r20508: Confirm a special case in samba3 reply_getatr that getatr("") always returns HIDDEN. Volker (This used to be commit 83a20912061c663ff422b038b41f01a9c7583afe) --- source4/torture/raw/samba3misc.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) 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); -- cgit