]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
auth:creds: Always store the ccache name
authorAndreas Schneider <asn@samba.org>
Fri, 4 Apr 2025 11:32:41 +0000 (13:32 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 5 Aug 2025 10:49:34 +0000 (10:49 +0000)
This will allow us to specify the cache as one to fill with credentials.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
auth/credentials/credentials_internal.h
auth/credentials/credentials_krb5.c

index cda361e1dd03612c80b3b158eb12af1ac77ae9fb..72ec390ad7ec73823203d3938dcbf2994f49a067 100644 (file)
@@ -74,6 +74,7 @@ struct cli_credentials {
        DATA_BLOB nt_response;
        DATA_BLOB nt_session_key;
 
+       const char *ccache_name;
        struct ccache_container *ccache;
        struct gssapi_creds_container *client_gss_creds;
        struct keytab_container *keytab;
index f905fe736ccdc3491578de8144909293dba9ab12..e5d16bebd3a0515b601d5d7a10b0531840a38841 100644 (file)
@@ -293,6 +293,14 @@ _PUBLIC_ int cli_credentials_set_ccache(struct cli_credentials *cred,
                return 0;
        }
 
+       if (name != NULL) {
+               cred->ccache_name = talloc_strdup(cred, name);
+               if (cred->ccache_name == NULL) {
+                       (*error_string) = error_message(ENOMEM);
+                       return ENOMEM;
+               }
+       }
+
        ccc = talloc(cred, struct ccache_container);
        if (!ccc) {
                (*error_string) = error_message(ENOMEM);