diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2014-09-25 15:34:20 -0400 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-09-29 18:15:40 +0200 |
commit | 5ae539828197f032d3e2ccb27e87ccf2a1d94996 (patch) | |
tree | 2a06062fdf60bd20228f0c608e28584abb44dc77 /src | |
parent | c683b8d730f4ec838244147d70a0275d53459aa5 (diff) | |
download | sssd-5ae539828197f032d3e2ccb27e87ccf2a1d94996.tar.gz sssd-5ae539828197f032d3e2ccb27e87ccf2a1d94996.tar.xz sssd-5ae539828197f032d3e2ccb27e87ccf2a1d94996.zip |
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 <jhrozek@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/util/sss_krb5.c | 10 | ||||
-rw-r--r-- | src/util/sss_krb5.h | 6 |
2 files changed, 13 insertions, 3 deletions
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__ */ |