From 3bc9704ce0210ea86c916eacc1755f3d0308ff00 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 7 Jan 2007 10:29:12 +0000 Subject: r20595: W2k and XP don't always show the top directory as hidden, w2k3 does. I think Samba should follow w2k3 in this respect. Volker (This used to be commit 6094ee9df5820cd26858e9c4eff5dfc7e60181ab) --- source4/torture/raw/samba3misc.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/source4/torture/raw/samba3misc.c b/source4/torture/raw/samba3misc.c index 490b0c8cde..eea6fe2bc6 100644 --- a/source4/torture/raw/samba3misc.c +++ b/source4/torture/raw/samba3misc.c @@ -229,6 +229,8 @@ BOOL torture_samba3_badpath(struct torture_context *torture) BOOL ret = True; TALLOC_CTX *mem_ctx; BOOL nt_status_support; + uint16_t attr; + if (!(mem_ctx = talloc_init("torture_samba3_badpath"))) { d_printf("talloc_init failed\n"); @@ -385,8 +387,13 @@ 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; + if (lp_parm_bool(-1, "torture", "w2k3", False) || + lp_parm_bool(-1, "torture", "samba3", False)) { + + /* + * XP and w2k don't show this behaviour, but I think + * Samba3 should follow W2k3 + */ status = smbcli_getatr(cli_nt->tree, "", &attr, NULL, NULL); CHECK_STATUS(status, NT_STATUS_OK); @@ -397,22 +404,21 @@ BOOL torture_samba3_badpath(struct torture_context *torture) |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)); } - + + 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. */ -- cgit