summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-02-19 10:12:14 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-02-19 10:12:14 +0000
commitf145c2e350db43e401cd477eff89fdef136e7f6c (patch)
tree89f95fbc56960cd6e5626e07267e514b09b4c2df
parent3b541bdcfe14d30d961a5de20d382af179c381ee (diff)
downloadsamba-f145c2e350db43e401cd477eff89fdef136e7f6c.tar.gz
samba-f145c2e350db43e401cd477eff89fdef136e7f6c.tar.bz2
samba-f145c2e350db43e401cd477eff89fdef136e7f6c.zip
Only do a kinit if we got told to use kerberos.
Andrew Bartlett (This used to be commit 6af9ec50e010d171cf5287f40ec774e79e4a93fe)
-rw-r--r--source3/libsmb/cliconnect.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 487b184dd6..c57f92eea9 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -630,19 +630,19 @@ static BOOL cli_session_setup_spnego(struct cli_state *cli, const char *user,
/* If password is set we reauthenticate to kerberos server
* and do not store results */
- if (*pass) {
- int ret;
-
- use_in_memory_ccache();
- ret = kerberos_kinit_password(user, pass, 0 /* no time correction for now */);
-
- if (ret){
- DEBUG(0, ("Kinit failed: %s\n", error_message(ret)));
- return False;
- }
- }
-
if (got_kerberos_mechanism && cli->use_kerberos) {
+ if (*pass) {
+ int ret;
+
+ use_in_memory_ccache();
+ ret = kerberos_kinit_password(user, pass, 0 /* no time correction for now */);
+
+ if (ret){
+ DEBUG(0, ("Kinit failed: %s\n", error_message(ret)));
+ return False;
+ }
+ }
+
return cli_session_setup_kerberos(cli, principal, workgroup);
}
#endif