CVE-2016-2111: s4:torture/base: don't use ntlmv2 for dos connection in base.samba3error
authorStefan Metzmacher <metze@samba.org>
Sat, 26 Mar 2016 21:24:23 +0000 (22:24 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 12 Apr 2016 17:25:24 +0000 (19:25 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11749

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source4/torture/basic/base.c

index e8ae4b6526b52fa9bd7571367639a5660143c84e..081f4792843d70b1d45fa50155ed8dbedf6762c9 100644 (file)
@@ -1526,6 +1526,7 @@ static bool torture_chkpath_test(struct torture_context *tctx,
 static bool torture_samba3_errorpaths(struct torture_context *tctx)
 {
        bool nt_status_support;
+       bool client_ntlmv2_auth;
        struct smbcli_state *cli_nt = NULL, *cli_dos = NULL;
        bool result = false;
        int fnum;
@@ -1535,18 +1536,27 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
        NTSTATUS status;
 
        nt_status_support = lpcfg_nt_status_support(tctx->lp_ctx);
+       client_ntlmv2_auth = lpcfg_client_ntlmv2_auth(tctx->lp_ctx);
 
        if (!lpcfg_set_cmdline(tctx->lp_ctx, "nt status support", "yes")) {
                torture_result(tctx, TORTURE_FAIL, "Could not set 'nt status support = yes'\n");
                goto fail;
        }
+       if (!lpcfg_set_cmdline(tctx->lp_ctx, "client ntlmv2 auth", "yes")) {
+               torture_result(tctx, TORTURE_FAIL, "Could not set 'client ntlmv2 auth = yes'\n");
+               goto fail;
+       }
 
        if (!torture_open_connection(&cli_nt, tctx, 0)) {
                goto fail;
        }
 
        if (!lpcfg_set_cmdline(tctx->lp_ctx, "nt status support", "no")) {
-               torture_result(tctx, TORTURE_FAIL, "Could not set 'nt status support = yes'\n");
+               torture_result(tctx, TORTURE_FAIL, "Could not set 'nt status support = no'\n");
+               goto fail;
+       }
+       if (!lpcfg_set_cmdline(tctx->lp_ctx, "client ntlmv2 auth", "no")) {
+               torture_result(tctx, TORTURE_FAIL, "Could not set 'client ntlmv2 auth = no'\n");
                goto fail;
        }
 
@@ -1556,7 +1566,12 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
 
        if (!lpcfg_set_cmdline(tctx->lp_ctx, "nt status support",
                            nt_status_support ? "yes":"no")) {
-               torture_result(tctx, TORTURE_FAIL, "Could not reset 'nt status support = yes'");
+               torture_result(tctx, TORTURE_FAIL, "Could not reset 'nt status support'");
+               goto fail;
+       }
+       if (!lpcfg_set_cmdline(tctx->lp_ctx, "client ntlmv2 auth",
+                              client_ntlmv2_auth ? "yes":"no")) {
+               torture_result(tctx, TORTURE_FAIL, "Could not reset 'client ntlmv2 auth'");
                goto fail;
        }