From 5ae539828197f032d3e2ccb27e87ccf2a1d94996 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Thu, 25 Sep 2014 15:34:20 -0400 Subject: krb5: make get_primary() a public call This patch changes get_primary() into sss_krb5_get_primary() so it can be used by the AD provider to get the sAMAccountName from the hostname. Reviewed-by: Jakub Hrozek --- src/util/sss_krb5.c | 10 +++++++--- src/util/sss_krb5.h | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c index a7f1bf37c..b4012593d 100644 --- a/src/util/sss_krb5.c +++ b/src/util/sss_krb5.c @@ -26,8 +26,10 @@ #include "util/util.h" #include "util/sss_krb5.h" -static char * -get_primary(TALLOC_CTX *mem_ctx, const char *pattern, const char *hostname) +char * +sss_krb5_get_primary(TALLOC_CTX *mem_ctx, + const char *pattern, + const char *hostname) { char *primary; char *dot; @@ -132,7 +134,9 @@ errno_t select_principal_from_keytab(TALLOC_CTX *mem_ctx, do { if (primary_patterns[i]) { - primary = get_primary(tmp_ctx, primary_patterns[i], hostname); + primary = sss_krb5_get_primary(tmp_ctx, + primary_patterns[i], + hostname); if (primary == NULL) { ret = ENOMEM; goto done; diff --git a/src/util/sss_krb5.h b/src/util/sss_krb5.h index ee43f2983..83c720975 100644 --- a/src/util/sss_krb5.h +++ b/src/util/sss_krb5.h @@ -184,4 +184,10 @@ char * sss_get_ccache_name_for_principal(TALLOC_CTX *mem_ctx, krb5_context ctx, krb5_principal principal, const char *location); + +char * +sss_krb5_get_primary(TALLOC_CTX *mem_ctx, + const char *pattern, + const char *hostname); + #endif /* __SSS_KRB5_H__ */ -- cgit