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

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