diff options
author | Stefan Metzmacher <metze@samba.org> | 2016-11-04 12:57:28 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2017-01-27 08:09:15 +0100 |
commit | 5c7523890dbb1762a84c3092dc35d63a52358d0e (patch) | |
tree | 07a48a38381bc746157917504e51df57400a160a /source3 | |
parent | 022fb7ea149745fdc85bc7c6bf000b4541be9705 (diff) | |
download | samba-5c7523890dbb1762a84c3092dc35d63a52358d0e.tar.gz |
s3:libsmb: use a local got_kerberos_mechanism variable in cli_session_creds_prepare_krb5()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/client.h | 1 | ||||
-rw-r--r-- | source3/libsmb/cliconnect.c | 9 |
2 files changed, 4 insertions, 6 deletions
diff --git a/source3/include/client.h b/source3/include/client.h index 43ec39bb5a7..db8260d4552 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -80,7 +80,6 @@ struct cli_state { bool fallback_after_kerberos; bool use_ccache; bool pw_nt_hash; - bool got_kerberos_mechanism; /* Server supports krb5 in SPNEGO. */ bool use_oplocks; /* should we use oplocks? */ diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 55768bfd6e7..a9451fbd571 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -228,6 +228,7 @@ NTSTATUS cli_session_creds_prepare_krb5(struct cli_state *cli, const char *pass = NULL; const char *target_hostname = NULL; const DATA_BLOB *server_blob = NULL; + bool got_kerberos_mechanism = false; enum credentials_use_kerberos krb5_state; bool try_kerberos = false; bool need_kinit = false; @@ -235,9 +236,7 @@ NTSTATUS cli_session_creds_prepare_krb5(struct cli_state *cli, int ret; target_hostname = smbXcli_conn_remote_name(cli->conn); - if (!cli->got_kerberos_mechanism) { - server_blob = smbXcli_conn_server_gss_blob(cli->conn); - } + server_blob = smbXcli_conn_server_gss_blob(cli->conn); /* the server might not even do spnego */ if (server_blob != NULL && server_blob->length != 0) { @@ -275,7 +274,7 @@ NTSTATUS cli_session_creds_prepare_krb5(struct cli_state *cli, if (strcmp(OIDs[i], OID_KERBEROS5_OLD) == 0 || strcmp(OIDs[i], OID_KERBEROS5) == 0) { - cli->got_kerberos_mechanism = true; + got_kerberos_mechanism = true; break; } } @@ -324,7 +323,7 @@ NTSTATUS cli_session_creds_prepare_krb5(struct cli_state *cli, need_kinit = false; } else if (krb5_state == CRED_MUST_USE_KERBEROS) { need_kinit = try_kerberos; - } else if (!cli->got_kerberos_mechanism) { + } else if (!got_kerberos_mechanism) { /* * Most likely the server doesn't support * Kerberos, don't waste time doing a kinit |