]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:libsmb: explicitly use the default krb5 ccache in cli_session_creds_init() without...
authorStefan Metzmacher <metze@samba.org>
Wed, 6 Mar 2024 22:05:00 +0000 (23:05 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 14 May 2024 10:18:31 +0000 (10:18 +0000)
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 <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libsmb/cliconnect.c

index 7e5c199b2d2a63039305aaf094448c0082d63031..82e5ad1ad1469659078465d197e5d1d3265e5703 100644 (file)
@@ -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;