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

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