From: Stefan Metzmacher Date: Wed, 6 Mar 2024 22:05:00 +0000 (+0100) Subject: s3:libsmb: explicitly use the default krb5 ccache in cli_session_creds_init() without... X-Git-Tag: tdb-1.4.11~793 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb7e19826afab4fce33769eb7aef16a1c650b23a;p=thirdparty%2Fsamba.git s3:libsmb: explicitly use the default krb5 ccache in cli_session_creds_init() without a password This happened implicitly as the gse_krb5 module always used the default krb5 ccache, but that will change soon. If kerberos is requested without a fallback to ntlm AND the caller doesn't provide a password we'll use the default ccache. This will keep our the following tests happy once the gse_krb5 module changes the behavior: samba3.blackbox.krbsmbspool samba3.blackbox.smbget Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 7e5c199b2d2..82e5ad1ad14 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -224,6 +224,21 @@ struct cli_credentials *cli_session_creds_init(TALLOC_CTX *mem_ctx, goto fail; } } + } else if (use_kerberos && !fallback_after_kerberos) { + const char *error_string = NULL; + int rc; + + rc = cli_credentials_set_ccache(creds, + lp_ctx, + NULL, + CRED_SPECIFIED, + &error_string); + if (rc != 0) { + fprintf(stderr, + "Warning reading default " + "krb5 credentials cache: %s\n", + error_string); + } } return creds;