diff options
author | Andreas Schneider <asn@samba.org> | 2016-12-13 11:38:13 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2018-01-03 14:37:12 +0100 |
commit | 11239f0759601a9db22dfe1e99d3de7f2348a1e5 (patch) | |
tree | 07745bf65b4da66bed8d48ebfcfe395b7e5dc8e9 /auth | |
parent | 7277590f6d746113ff347c7fce3d8ef4d01cc715 (diff) | |
download | samba-11239f0759601a9db22dfe1e99d3de7f2348a1e5.tar.gz |
credentials: Simplify cli_credentials_get_server_gss_creds()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan 3 14:37:12 CET 2018 on sn-devel-144
Diffstat (limited to 'auth')
-rw-r--r-- | auth/credentials/credentials_krb5.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c index b88497dcace..585203a640d 100644 --- a/auth/credentials/credentials_krb5.c +++ b/auth/credentials/credentials_krb5.c @@ -1151,16 +1151,17 @@ _PUBLIC_ int cli_credentials_get_server_gss_creds(struct cli_credentials *cred, } if (ktc->password_based || obtained < CRED_SPECIFIED) { - /* This creates a GSSAPI cred_id_t for match-by-key with only the keytab set */ - maj_stat = smb_gss_krb5_import_cred(&min_stat, smb_krb5_context->krb5_context, - NULL, NULL, ktc->keytab, - &gcc->creds); - } else { - /* This creates a GSSAPI cred_id_t with the principal and keytab set, matching by name */ - maj_stat = smb_gss_krb5_import_cred(&min_stat, smb_krb5_context->krb5_context, - NULL, princ, ktc->keytab, - &gcc->creds); + /* + * This creates a GSSAPI cred_id_t for match-by-key with only + * the keytab set + */ + princ = NULL; } + maj_stat = smb_gss_krb5_import_cred(&min_stat, + smb_krb5_context->krb5_context, + NULL, princ, + ktc->keytab, + &gcc->creds); if (maj_stat) { if (min_stat) { ret = min_stat; |