From 187d74d9c08d4ccd1d964af22f73e85a39a0fd0e Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Tue, 5 Sep 2023 15:37:14 +1200 Subject: [PATCH] =?UTF-8?q?lib:krb5=5Fwrap:=20Remove=20Heimdal=E2=80=90onl?= =?UTF-8?q?y=20krb5=5Fprinc=5Fcomponent()=20implementation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This implementation is no longer called: using a variable of static storage duration as a conduit for return values is only asking for trouble. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- lib/krb5_wrap/krb5_samba.c | 15 --------------- source4/auth/kerberos/kerberos.h | 4 ---- 2 files changed, 19 deletions(-) diff --git a/lib/krb5_wrap/krb5_samba.c b/lib/krb5_wrap/krb5_samba.c index 6f9ae4d822b..a1884853c61 100644 --- a/lib/krb5_wrap/krb5_samba.c +++ b/lib/krb5_wrap/krb5_samba.c @@ -126,21 +126,6 @@ void krb5_free_string(krb5_context context, char *val) { } #endif -#if defined(HAVE_KRB5_PRINCIPAL_GET_COMP_STRING) && !defined(HAVE_KRB5_PRINC_COMPONENT) -const krb5_data *krb5_princ_component(krb5_context context, - krb5_principal principal, int i); - -const krb5_data *krb5_princ_component(krb5_context context, - krb5_principal principal, int i) -{ - static krb5_data kdata; - - kdata.data = discard_const_p(char, krb5_principal_get_comp_string(context, principal, i)); - kdata.length = strlen((const char *)kdata.data); - return &kdata; -} -#endif - krb5_error_code smb_krb5_princ_component(krb5_context context, krb5_const_principal principal, int i, diff --git a/source4/auth/kerberos/kerberos.h b/source4/auth/kerberos/kerberos.h index 41c9b048aaf..5b13f567a00 100644 --- a/source4/auth/kerberos/kerberos.h +++ b/source4/auth/kerberos/kerberos.h @@ -61,10 +61,6 @@ krb5_error_code krb5_set_default_tgs_ktypes(krb5_context ctx, const krb5_enctype krb5_error_code krb5_auth_con_setuseruserkey(krb5_context context, krb5_auth_context auth_context, krb5_keyblock *keyblock); #endif -#if defined(HAVE_KRB5_PRINCIPAL_GET_COMP_STRING) && !defined(HAVE_KRB5_PRINC_COMPONENT) -const krb5_data *krb5_princ_component(krb5_context context, krb5_principal principal, int i ); -#endif - krb5_error_code smb_krb5_princ_component(krb5_context context, krb5_const_principal principal, int i,