From: Vinit Agnihotri Date: Wed, 30 Jul 2025 04:46:05 +0000 (+0530) Subject: s4:torture/smb2: Fix torture test case smb2.acls.ACCESS_BASED X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=37c7952a2e5526b8278cba17e5cb4d26ce0a30e0;p=thirdparty%2Fsamba.git s4:torture/smb2: Fix torture test case smb2.acls.ACCESS_BASED Currently this test case fails to run against windows target, as it is hardcoded to use sharename as "hideunread". This change enables this test case to be executed against windows, by omitting use of hideunread share and relevant flags. Signed-off-by: Vinit Agnihotri Reviewed-by: Anoop C S Reviewed-by: Ralph Boehme Autobuild-User(master): Anoop C S Autobuild-Date(master): Wed Aug 13 18:29:53 UTC 2025 on atb-devel-224 --- diff --git a/source4/torture/smb2/acls.c b/source4/torture/smb2/acls.c index ef1f70cb726..65b4b0fe363 100644 --- a/source4/torture/smb2/acls.c +++ b/source4/torture/smb2/acls.c @@ -2201,12 +2201,16 @@ static bool test_access_based(struct torture_context *tctx, ZERO_STRUCT(fhandle); ZERO_STRUCT(dhandle); - if (!torture_smb2_con_share(tctx, "hideunread", &tree1)) { - torture_result(tctx, TORTURE_FAIL, "(%s) Unable to connect " - "to share 'hideunread'\n", - __location__); - ret = false; - goto done; + if (TARGET_IS_WINDOWS(tctx)) { + tree1 = tree; + } else { + if (!torture_smb2_con_share(tctx, "hideunread", &tree1)) { + torture_result(tctx, TORTURE_FAIL, "(%s) Unable to connect " + "to share 'hideunread'\n", + __location__); + ret = false; + goto done; + } } flags = smb2cli_tcon_flags(tree1->smbXcli); @@ -2216,7 +2220,8 @@ static bool test_access_based(struct torture_context *tctx, torture_comment(tctx, "TESTING ACCESS BASED ENUMERATION\n"); - if ((flags & SMB2_SHAREFLAG_ACCESS_BASED_DIRECTORY_ENUM)==0) { + if (((flags & SMB2_SHAREFLAG_ACCESS_BASED_DIRECTORY_ENUM)==0) && + (!TARGET_IS_WINDOWS(tctx))) { torture_result(tctx, TORTURE_FAIL, "(%s) No access enumeration " "on share 'hideunread'\n", __location__); @@ -2346,8 +2351,12 @@ done: smb2_tdis(tree1); smb2_logoff(tree1->session); } - smb2_tdis(tree); - smb2_logoff(tree->session); + + if (tree != tree1) { + smb2_tdis(tree); + smb2_logoff(tree->session); + } + return ret; }