From bfbc269d0d8b06537c540d4052bf8e1b47d454e5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 7 May 2006 18:08:57 +0000 Subject: r15498: Initialise the callback_running field, and get the flag set/clear the right way around for all the callers. Andrew Bartlett (This used to be commit f9bcfb04aa3ec93eed7076dbb1fed50cf1edb424) --- source4/auth/credentials/credentials.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source4/auth') diff --git a/source4/auth/credentials/credentials.c b/source4/auth/credentials/credentials.c index 1ffc27dab6..d884fb59ce 100644 --- a/source4/auth/credentials/credentials.c +++ b/source4/auth/credentials/credentials.c @@ -59,6 +59,7 @@ struct cli_credentials *cli_credentials_init(TALLOC_CTX *mem_ctx) cred->bind_dn = NULL; cred->tries = 3; + cred->callback_running = False; cli_credentials_set_kerberos_state(cred, CRED_AUTO_USE_KERBEROS); @@ -157,9 +158,9 @@ const char *cli_credentials_get_principal(struct cli_credentials *cred, TALLOC_C if (cred->principal_obtained == CRED_CALLBACK && !cred->callback_running) { - cred->callback_running = False; - cred->principal = cred->principal_cb(cred); cred->callback_running = True; + cred->principal = cred->principal_cb(cred); + cred->callback_running = False; cred->principal_obtained = CRED_SPECIFIED; } @@ -241,9 +242,9 @@ const char *cli_credentials_get_password(struct cli_credentials *cred) if (cred->password_obtained == CRED_CALLBACK && !cred->callback_running) { - cred->callback_running = False; - cred->password = cred->password_cb(cred); cred->callback_running = True; + cred->password = cred->password_cb(cred); + cred->callback_running = False; cred->password_obtained = CRED_CALLBACK_RESULT; } -- cgit