Blame SOURCES/0002-adconn-add-adcli_conn_set_krb5_context.patch

ee8dc1
From 2fc259a88be618871cea8ff8b8a13bd3e040aea4 Mon Sep 17 00:00:00 2001
ee8dc1
From: Sumit Bose <sbose@redhat.com>
ee8dc1
Date: Thu, 13 Jun 2019 17:23:47 +0200
ee8dc1
Subject: [PATCH 2/4] adconn: add adcli_conn_set_krb5_context
ee8dc1
ee8dc1
Related to https://gitlab.freedesktop.org/realmd/adcli/issues/3
ee8dc1
---
ee8dc1
 library/adconn.c | 13 +++++++++++++
ee8dc1
 library/adconn.h |  3 +++
ee8dc1
 2 files changed, 16 insertions(+)
ee8dc1
ee8dc1
diff --git a/library/adconn.c b/library/adconn.c
ee8dc1
index f6c23d3..bcaced8 100644
ee8dc1
--- a/library/adconn.c
ee8dc1
+++ b/library/adconn.c
ee8dc1
@@ -1406,6 +1406,19 @@ adcli_conn_get_krb5_context (adcli_conn *conn)
ee8dc1
 	return conn->k5;
ee8dc1
 }
ee8dc1
 
ee8dc1
+void
ee8dc1
+adcli_conn_set_krb5_context (adcli_conn *conn,
ee8dc1
+                             krb5_context k5)
ee8dc1
+{
ee8dc1
+	return_if_fail (conn != NULL);
ee8dc1
+
ee8dc1
+	if (conn->k5 != NULL) {
ee8dc1
+		krb5_free_context (conn->k5);
ee8dc1
+	}
ee8dc1
+
ee8dc1
+	conn->k5 = k5;
ee8dc1
+}
ee8dc1
+
ee8dc1
 const char *
ee8dc1
 adcli_conn_get_login_user (adcli_conn *conn)
ee8dc1
 {
ee8dc1
diff --git a/library/adconn.h b/library/adconn.h
ee8dc1
index 13cfd32..1ad5715 100644
ee8dc1
--- a/library/adconn.h
ee8dc1
+++ b/library/adconn.h
ee8dc1
@@ -97,6 +97,9 @@ LDAP *              adcli_conn_get_ldap_connection   (adcli_conn *conn);
ee8dc1
 
ee8dc1
 krb5_context        adcli_conn_get_krb5_context      (adcli_conn *conn);
ee8dc1
 
ee8dc1
+void                adcli_conn_set_krb5_context      (adcli_conn *conn,
ee8dc1
+                                                      krb5_context k5);
ee8dc1
+
ee8dc1
 const char *        adcli_conn_get_computer_name     (adcli_conn *conn);
ee8dc1
 
ee8dc1
 void                adcli_conn_set_computer_name     (adcli_conn *conn,
ee8dc1
-- 
ee8dc1
2.21.0
ee8dc1