summaryrefslogtreecommitdiff
path: root/source3/utils/ntlm_auth.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2016-03-21 19:41:53 +0100
committerStefan Metzmacher <metze@samba.org>2016-03-22 19:20:38 +0100
commitef1ad0e122659b5ff9097f0f7046f10fc2f3ec30 (patch)
tree8b4f53cdd22613cabb22912aa1a52c4f1bb0b734 /source3/utils/ntlm_auth.c
parent0906d61bb2f3446483d82928b55f5b797bac4804 (diff)
downloadsamba-ef1ad0e122659b5ff9097f0f7046f10fc2f3ec30.tar.gz
s3:ntlm_auth: pass manage_squid_request() needs a valid struct ntlm_auth_state from within get_password()
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
Diffstat (limited to 'source3/utils/ntlm_auth.c')
-rw-r--r--source3/utils/ntlm_auth.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c
index 25c20d86834..1b27a88ec1b 100644
--- a/source3/utils/ntlm_auth.c
+++ b/source3/utils/ntlm_auth.c
@@ -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;
}