summaryrefslogtreecommitdiff
path: root/source4/auth/credentials/credentials.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/auth/credentials/credentials.c')
-rw-r--r--source4/auth/credentials/credentials.c9
1 files changed, 5 insertions, 4 deletions
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;
}