Blob Blame History Raw
From ec460578800d850e5a4f9d522920db1d79147dd6 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose@redhat.com>
Date: Fri, 1 Jul 2016 17:58:02 +0200
Subject: [PATCH 26/27] IPA: add ipa_init_get_krb5_auth_ctx()

Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
(cherry picked from commit 17dccc24e4490dfda2820d46b62a029b14ba2359)
---
 src/providers/ipa/ipa_common.h |  5 +++++
 src/providers/ipa/ipa_init.c   | 13 +++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/src/providers/ipa/ipa_common.h b/src/providers/ipa/ipa_common.h
index 939c898e1a690806abd37493aabfb7bdec3e87a9..add9df87692c732b3567eee5584e7698991c66ca 100644
--- a/src/providers/ipa/ipa_common.h
+++ b/src/providers/ipa/ipa_common.h
@@ -34,6 +34,8 @@ struct ipa_service {
     struct krb5_service *krb5_service;
 };
 
+struct ipa_init_ctx;
+
 enum ipa_basic_opt {
     IPA_DOMAIN = 0,
     IPA_SERVER,
@@ -287,4 +289,7 @@ errno_t ipa_idmap_get_ranges_from_sysdb(struct sdap_idmap_ctx *idmap_ctx,
 errno_t ipa_idmap_init(TALLOC_CTX *mem_ctx,
                        struct sdap_id_ctx *id_ctx,
                        struct sdap_idmap_ctx **_idmap_ctx);
+
+
+struct krb5_ctx *ipa_init_get_krb5_auth_ctx(void *data);
 #endif /* _IPA_COMMON_H_ */
diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c
index d3093b3b5d269e6acd29f35560cf8299017c72b5..959cdb4a7c40c1be03dd1e7c66dee6e65ca76607 100644
--- a/src/providers/ipa/ipa_init.c
+++ b/src/providers/ipa/ipa_init.c
@@ -58,6 +58,19 @@ struct ipa_init_ctx {
     struct ipa_auth_ctx *auth_ctx;
 };
 
+
+struct krb5_ctx *ipa_init_get_krb5_auth_ctx(void *data)
+{
+    struct ipa_init_ctx *ipa_init_ctx;
+
+    ipa_init_ctx = talloc_get_type(data, struct ipa_init_ctx);
+    if (ipa_init_ctx == NULL || ipa_init_ctx->auth_ctx == NULL) {
+        return NULL;
+    }
+
+    return ipa_init_ctx->auth_ctx->krb5_auth_ctx;
+}
+
 static bool srv_in_server_list(const char *servers)
 {
     TALLOC_CTX *tmp_ctx;
-- 
2.4.11