summaryrefslogtreecommitdiff
path: root/source4/utils/ntlm_auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/utils/ntlm_auth.c')
-rw-r--r--source4/utils/ntlm_auth.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c
index 93d1909a56..3144fe91b1 100644
--- a/source4/utils/ntlm_auth.c
+++ b/source4/utils/ntlm_auth.c
@@ -339,16 +339,25 @@ static const char *get_password(struct cli_credentials *credentials)
**/
static bool in_list(const char *s, const char *list, bool casesensitive)
{
- pstring tok;
+ char *tok;
+ size_t tok_len = 1024;
const char *p=list;
if (!list)
return false;
- while (next_token(&p, tok, LIST_SEP, sizeof(tok))) {
- if ((casesensitive?strcmp:strcasecmp_m)(tok,s) == 0)
+ tok = (char *)malloc(tok_len);
+ if (!tok) {
+ return false;
+ }
+
+ while (next_token(&p, tok, LIST_SEP, tok_len)) {
+ if ((casesensitive?strcmp:strcasecmp_m)(tok,s) == 0) {
+ free(tok);
return true;
+ }
}
+ free(tok);
return false;
}
@@ -471,7 +480,8 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
if (!ev) {
exit(1);
}
- msg = messaging_client_init(state, lp_messaging_path(state, lp_ctx), ev);
+ msg = messaging_client_init(state, lp_messaging_path(state, lp_ctx),
+ lp_iconv_convenience(lp_ctx), ev);
if (!msg) {
exit(1);
}
@@ -504,7 +514,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
switch (stdio_helper_mode) {
case GSS_SPNEGO_SERVER:
case SQUID_2_5_NTLMSSP:
- cli_credentials_set_machine_account(creds);
+ cli_credentials_set_machine_account(creds, lp_ctx);
break;
default:
break;