1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

krb5_wrap: add smb_force_krb5_cc_default[_name]() wrappers

If we touch the global krb5_ccache we want to make that explicit,
so calling krb5_cc_default[_name] will result in an error during
the next patches.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Stefan Metzmacher 2024-05-11 02:38:21 +02:00
parent d49de77710
commit f850bcfc0b
2 changed files with 29 additions and 0 deletions

View File

@ -4114,6 +4114,24 @@ krb5_error_code smb_krb5_init_context_common(krb5_context *_krb5_context)
return 0;
}
/*
* This should only be used in code that
* really wants to touch the global default ccache!
*/
krb5_error_code smb_force_krb5_cc_default(krb5_context ctx, krb5_ccache *id)
{
return krb5_cc_default(ctx, id);
}
/*
* This should only be used in code that
* really wants to touch the global default ccache!
*/
const char *smb_force_krb5_cc_default_name(krb5_context ctx)
{
return krb5_cc_default_name(ctx);
}
#else /* HAVE_KRB5 */
/* This saves a few linking headaches */
int ads_krb5_cli_get_ticket(TALLOC_CTX *mem_ctx,

View File

@ -191,6 +191,17 @@ krb5_error_code smb_krb5_unparse_name(TALLOC_CTX *mem_ctx,
krb5_error_code smb_krb5_init_context_common(krb5_context *_krb5_context);
/*
* This should only be used in code that
* really wants to touch the global default ccache!
*/
krb5_error_code smb_force_krb5_cc_default(krb5_context ctx, krb5_ccache *id);
/*
* This should only be used in code that
* really wants to touch the global default ccache!
*/
const char *smb_force_krb5_cc_default_name(krb5_context ctx);
krb5_error_code krb5_set_default_tgs_ktypes(krb5_context ctx, const krb5_enctype *enc);
#if defined(HAVE_KRB5_AUTH_CON_SETKEY) && !defined(HAVE_KRB5_AUTH_CON_SETUSERUSERKEY)