winbindd: Call make_auth_context_subsystem directly
authorVolker Lendecke <vl@samba.org>
Mon, 13 Mar 2017 07:14:00 +0000 (08:14 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 24 Mar 2017 10:57:08 +0000 (11:57 +0100)
Soon we'll call specific methods here

BUG: https://bugzilla.samba.org/show_bug.cgi?id=2976

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/winbindd/winbindd_pam.c

index 782b28a01733e29d767b02be0f67677c78911a0e..4ff6eaab92689e33781ab55ac7ebfe2060b0b31f 100644 (file)
@@ -1235,6 +1235,7 @@ static NTSTATUS winbindd_dual_auth_passdb(TALLOC_CTX *mem_ctx,
        struct tsocket_address *local;
        struct netr_SamInfo3 *info3;
        NTSTATUS status;
+       bool ok;
        int rc;
        TALLOC_CTX *frame = talloc_stackframe();
 
@@ -1268,15 +1269,22 @@ static NTSTATUS winbindd_dual_auth_passdb(TALLOC_CTX *mem_ctx,
                user_info->flags |= USER_INFO_INTERACTIVE_LOGON;
        }
 
-       status = make_auth_context_fixed(frame, &auth_context, challenge->data);
+       status = make_auth_context_subsystem(frame, &auth_context);
 
        if (!NT_STATUS_IS_OK(status)) {
-               DBG_ERR("make_auth_context_fixed failed: %s\n",
+               DBG_ERR("make_auth_context_subsystem failed: %s\n",
                        nt_errstr(status));
                TALLOC_FREE(frame);
                return status;
        }
 
+       ok = auth3_context_set_challenge(auth_context,
+                                        challenge->data, "fixed");
+       if (!ok) {
+               TALLOC_FREE(frame);
+               return NT_STATUS_NO_MEMORY;
+       }
+
        status = auth_check_ntlm_password(mem_ctx,
                                          auth_context,
                                          user_info,