summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/sss_krb5.c19
-rw-r--r--src/util/sss_krb5.h6
2 files changed, 25 insertions, 0 deletions
diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c
index 5f36f7e9..c9b16107 100644
--- a/src/util/sss_krb5.c
+++ b/src/util/sss_krb5.c
@@ -1079,3 +1079,22 @@ done:
return NULL;
#endif /* HAVE_KRB5_CC_COLLECTION */
}
+
+krb5_error_code KRB5_CALLCONV
+sss_krb5_unparse_name_ext(krb5_context ctx,
+ krb5_const_principal principal,
+ char **name,
+ unsigned int *len)
+{
+ krb5_error_code kerr;
+
+#ifdef HAVE_KRB5_UNPARSE_NAME_EXT
+ kerr = krb5_unparse_name_ext(ctx, principal, name, len);
+#else
+ kerr = krb5_unparse_name(ctx, principal, name);
+ if (kerr == 0 && *name)
+ *len = strlen(*name);
+#endif /* HAVE_KRB5_UNPARSE_NAME_EXT */
+
+ return kerr;
+}
diff --git a/src/util/sss_krb5.h b/src/util/sss_krb5.h
index 43243735..c8f2d4d7 100644
--- a/src/util/sss_krb5.h
+++ b/src/util/sss_krb5.h
@@ -186,4 +186,10 @@ char * sss_get_ccache_name_for_principal(TALLOC_CTX *mem_ctx,
krb5_context ctx,
krb5_principal principal,
const char *location);
+
+krb5_error_code KRB5_CALLCONV
+sss_krb5_unparse_name_ext(krb5_context ctx,
+ krb5_const_principal principal,
+ char **name,
+ unsigned int *len);
#endif /* __SSS_KRB5_H__ */