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

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