summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-05-07 18:08:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:05:42 -0500
commitbfbc269d0d8b06537c540d4052bf8e1b47d454e5 (patch)
treec4bdea265e39ba9c1b13f4d9eb8b5c4fd095038c
parent490d6120a9b76d5d53bcf90fff5aeac48ac3c1fe (diff)
downloadsamba-bfbc269d0d8b06537c540d4052bf8e1b47d454e5.tar.gz
samba-bfbc269d0d8b06537c540d4052bf8e1b47d454e5.tar.bz2
samba-bfbc269d0d8b06537c540d4052bf8e1b47d454e5.zip
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)
-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;
}