File 0005-library-add-adcli_conn_is_writeable.patch of Package adcli.14142
From f5eb8fdcfe9d66328cd152ef77a73698e6230c59 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose@redhat.com>
Date: Wed, 1 Nov 2017 16:29:19 +0100
Subject: [PATCH 05/25] library: add adcli_conn_is_writeable()
---
library/adconn.c | 11 +++++++++++
library/adconn.h | 2 ++
2 files changed, 13 insertions(+)
diff --git a/library/adconn.c b/library/adconn.c
index a294dfd..0786ed4 100644
--- a/library/adconn.c
+++ b/library/adconn.c
@@ -1528,3 +1528,14 @@ adcli_conn_server_has_capability (adcli_conn *conn,
return 0;
}
+
+bool adcli_conn_is_writeable (adcli_conn *conn)
+{
+ disco_dance_if_necessary (conn);
+
+ if (conn->domain_disco == NULL) {
+ return false;
+ }
+
+ return ( (conn->domain_disco->flags & ADCLI_DISCO_WRITABLE) != 0);
+}
diff --git a/library/adconn.h b/library/adconn.h
index a0cb1f8..ed1cc58 100644
--- a/library/adconn.h
+++ b/library/adconn.h
@@ -144,4 +144,6 @@ void adcli_conn_set_krb5_conf_dir (adcli_conn *conn,
int adcli_conn_server_has_capability (adcli_conn *conn,
const char *capability);
+bool adcli_conn_is_writeable (adcli_conn *conn);
+
#endif /* ADCONN_H_ */
--
2.16.4