From: Vinit Agnihotri Date: Fri, 11 Jul 2025 12:39:08 +0000 (+0530) Subject: s4:torture: Add new target 'w2k16' X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63e9ffee0580a5fdd0602ede3e4dde2c712b5dc2;p=thirdparty%2Fsamba.git s4:torture: Add new target 'w2k16' This fix adds new target 'w2k16' which sets default value for option 'hide_on_access_denied' to true. 'windows 2016 server' returns NT_STATUS_OBJECT_NAME_NOT_FOUND on a createfile when access is denied rather than NT_STATUS_ACCESS_DENIED. Above option takes care of this behaviour. Move TARGET_IS_WINDOWS to utils.h and add all presently defined windows targets for the same. Singed-off-by: Vinit Agnihotri Reviewed-by: Anoop C S Reviewed-by: Ralph Boehme --- diff --git a/source4/torture/raw/lock.c b/source4/torture/raw/lock.c index 5a8714dc3a5..26c26e5984f 100644 --- a/source4/torture/raw/lock.c +++ b/source4/torture/raw/lock.c @@ -72,10 +72,6 @@ #define TARGET_IS_W2K8(_tctx) (torture_setting_bool(_tctx, "w2k8", false)) #define TARGET_IS_WIN7(_tctx) (torture_setting_bool(_tctx, "win7", false)) -#define TARGET_IS_WINDOWS(_tctx) \ - ((torture_setting_bool(_tctx, "w2k3", false)) || \ - (torture_setting_bool(_tctx, "w2k8", false)) || \ - (torture_setting_bool(_tctx, "win7", false))) #define TARGET_IS_SAMBA3(_tctx) (torture_setting_bool(_tctx, "samba3", false)) #define TARGET_IS_SAMBA4(_tctx) (torture_setting_bool(_tctx, "samba4", false)) diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index 0a9d433567d..2aa1acdabab 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -596,6 +596,10 @@ int main(int argc, const char *argv[]) lpcfg_set_cmdline(lp_ctx, "torture:hide_on_access_denied", "true"); + } else if (strcmp(target, "w2k16") == 0) { + lpcfg_set_cmdline(lp_ctx, "torture:hide_on_access_denied", + "true"); + lpcfg_set_cmdline(lp_ctx, "torture:w2k16", "true"); } else if (strcmp(target, "onefs") == 0) { lpcfg_set_cmdline(lp_ctx, "torture:onefs", "true"); lpcfg_set_cmdline(lp_ctx, "torture:openx_deny_dos_support", diff --git a/source4/torture/util.h b/source4/torture/util.h index 385ee157311..5eea1bb55e9 100644 --- a/source4/torture/util.h +++ b/source4/torture/util.h @@ -36,6 +36,14 @@ struct cli_credentials; #define TARGET_IS_WIN7(_tctx) (torture_setting_bool(_tctx, "win7", false)) #define TARGET_IS_SAMBA3(_tctx) (torture_setting_bool(_tctx, "samba3", false)) #define TARGET_IS_SAMBA4(_tctx) (torture_setting_bool(_tctx, "samba4", false)) +#define TARGET_IS_W2K16(_tctx) (torture_setting_bool(_tctx, "w2k16", false)) +#define TARGET_IS_WINDOWS(_tctx) \ + ((torture_setting_bool(_tctx, "winxp", false)) || \ + (torture_setting_bool(_tctx, "w2k3", false)) || \ + (torture_setting_bool(_tctx, "w2k8", false)) || \ + (torture_setting_bool(_tctx, "win7", false)) || \ + (torture_setting_bool(_tctx, "w2k12", false)) || \ + (torture_setting_bool(_tctx, "w2k16", false))) /** setup a directory ready for a test