s3:ntlm_auth: pass manage_squid_request() needs a valid struct ntlm_auth_state from...
authorStefan Metzmacher <metze@samba.org>
Mon, 21 Mar 2016 18:41:53 +0000 (19:41 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 22 Mar 2016 18:20:38 +0000 (19:20 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Mar 22 19:20:38 CET 2016 on sn-devel-144

source3/utils/ntlm_auth.c

index 25c20d86834e70fa53fc961f38e68fe050d250d8..1b27a88ec1b0c7f93446e1e461441aa981efaec3 100644 (file)
@@ -229,13 +229,25 @@ static void manage_gensec_get_pw_request(enum stdio_helper_mode stdio_helper_mod
 
 static const char *get_password(struct cli_credentials *credentials)
 {
+       TALLOC_CTX *frame = talloc_stackframe();
        char *password = NULL;
+       struct ntlm_auth_state *state;
+
+       state = talloc_zero(frame, struct ntlm_auth_state);
+       if (state == NULL) {
+               DEBUG(0, ("squid_stream: Failed to talloc ntlm_auth_state\n"));
+               x_fprintf(x_stderr, "ERR\n");
+               exit(1);
+       }
+
+       state->mem_ctx = state;
 
        /* Ask for a password */
        x_fprintf(x_stdout, "PW\n");
 
-       manage_squid_request(NUM_HELPER_MODES /* bogus */, NULL, NULL, manage_gensec_get_pw_request, (void **)&password);
+       manage_squid_request(NUM_HELPER_MODES /* bogus */, NULL, state, manage_gensec_get_pw_request, (void **)&password);
        talloc_steal(credentials, password);
+       TALLOC_FREE(frame);
        return password;
 }