|
|
ced1f5 |
From 7de7fd7a9378461ce57f9b5174938af9440381ca Mon Sep 17 00:00:00 2001
|
|
|
ced1f5 |
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
|
|
|
ced1f5 |
Date: Thu, 2 Nov 2017 14:58:38 +0100
|
|
|
ced1f5 |
Subject: [PATCH 50/57] dp: add method to refresh access control rules
|
|
|
ced1f5 |
MIME-Version: 1.0
|
|
|
ced1f5 |
Content-Type: text/plain; charset=UTF-8
|
|
|
ced1f5 |
Content-Transfer-Encoding: 8bit
|
|
|
ced1f5 |
|
|
|
ced1f5 |
Related:
|
|
|
ced1f5 |
https://pagure.io/SSSD/sssd/issue/2840
|
|
|
ced1f5 |
|
|
|
ced1f5 |
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
|
|
|
ced1f5 |
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
ced1f5 |
(cherry picked from commit e737cdfa225e0d455c0e574bcb82c2cc16a17d9d)
|
|
|
ced1f5 |
---
|
|
|
ced1f5 |
src/providers/data_provider/dp.h | 2 ++
|
|
|
ced1f5 |
src/providers/data_provider/dp_iface.c | 6 ++++++
|
|
|
ced1f5 |
src/providers/data_provider/dp_iface.h | 4 ++++
|
|
|
ced1f5 |
src/providers/data_provider/dp_iface.xml | 6 ++++++
|
|
|
ced1f5 |
src/providers/data_provider/dp_iface_generated.c | 27 ++++++++++++++++++++++++
|
|
|
ced1f5 |
src/providers/data_provider/dp_iface_generated.h | 16 ++++++++++++++
|
|
|
ced1f5 |
src/providers/data_provider/dp_target_auth.c | 14 ++++++++++++
|
|
|
ced1f5 |
7 files changed, 75 insertions(+)
|
|
|
ced1f5 |
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp.h b/src/providers/data_provider/dp.h
|
|
|
ced1f5 |
index 9cdbe5b3a56ba159f9a10df6e010e616e4aefcac..aa5b781158c54545b26034602bb25db46b189e87 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp.h
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp.h
|
|
|
ced1f5 |
@@ -83,6 +83,8 @@ enum dp_methods {
|
|
|
ced1f5 |
DPM_DOMAINS_HANDLER,
|
|
|
ced1f5 |
DPM_SESSION_HANDLER,
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+ DPM_REFRESH_ACCESS_RULES,
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
DP_METHOD_SENTINEL
|
|
|
ced1f5 |
};
|
|
|
ced1f5 |
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_iface.c b/src/providers/data_provider/dp_iface.c
|
|
|
ced1f5 |
index 4b2b0ddca68be8899f7285b4d881a91444b99362..28d70e686f63a3572ac595f493aa1d59436c563f 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_iface.c
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_iface.c
|
|
|
ced1f5 |
@@ -48,10 +48,16 @@ struct iface_dp_failover iface_dp_failover = {
|
|
|
ced1f5 |
.ListServers = dp_failover_list_servers
|
|
|
ced1f5 |
};
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+struct iface_dp_access_control iface_dp_access_control = {
|
|
|
ced1f5 |
+ { &iface_dp_access_control_meta, 0 },
|
|
|
ced1f5 |
+ .RefreshRules = dp_access_control_refresh_rules_handler
|
|
|
ced1f5 |
+};
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
static struct sbus_iface_map dp_map[] = {
|
|
|
ced1f5 |
{ DP_PATH, &iface_dp.vtable },
|
|
|
ced1f5 |
{ DP_PATH, &iface_dp_backend.vtable },
|
|
|
ced1f5 |
{ DP_PATH, &iface_dp_failover.vtable },
|
|
|
ced1f5 |
+ { DP_PATH, &iface_dp_access_control.vtable },
|
|
|
ced1f5 |
{ NULL, NULL }
|
|
|
ced1f5 |
};
|
|
|
ced1f5 |
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_iface.h b/src/providers/data_provider/dp_iface.h
|
|
|
ced1f5 |
index 8ae7a2ad7a61f82b000493f3309926cd932211f6..759b9e6c9eb7f53836ae0b641b34e6c31e65779f 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_iface.h
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_iface.h
|
|
|
ced1f5 |
@@ -76,4 +76,8 @@ errno_t dp_failover_list_servers(struct sbus_request *sbus_req,
|
|
|
ced1f5 |
void *dp_cli,
|
|
|
ced1f5 |
const char *service_name);
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+/* org.freedesktop.sssd.DataProvider.AccessControl */
|
|
|
ced1f5 |
+errno_t dp_access_control_refresh_rules_handler(struct sbus_request *sbus_req,
|
|
|
ced1f5 |
+ void *dp_cli);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
#endif /* DP_IFACE_H_ */
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_iface.xml b/src/providers/data_provider/dp_iface.xml
|
|
|
ced1f5 |
index a3969873ad1660c71ebdcae7a951757f5254c865..2bfa9dfa7e9d02d2d12c3358967f6969438a97a2 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_iface.xml
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_iface.xml
|
|
|
ced1f5 |
@@ -32,6 +32,12 @@
|
|
|
ced1f5 |
</method>
|
|
|
ced1f5 |
</interface>
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+ <interface name="org.freedesktop.sssd.DataProvider.AccessControl">
|
|
|
ced1f5 |
+ <annotation value="iface_dp_access_control" name="org.freedesktop.DBus.GLib.CSymbol"/>
|
|
|
ced1f5 |
+ <method name="RefreshRules">
|
|
|
ced1f5 |
+ </method>
|
|
|
ced1f5 |
+ </interface>
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
<interface name="org.freedesktop.sssd.dataprovider">
|
|
|
ced1f5 |
<annotation value="iface_dp" name="org.freedesktop.DBus.GLib.CSymbol"/>
|
|
|
ced1f5 |
<method name="pamHandler">
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_iface_generated.c b/src/providers/data_provider/dp_iface_generated.c
|
|
|
ced1f5 |
index e2e0216bd98c498b2b34c524ba615b70564420a2..11ee2e24a69cc8d4d19fdbeed613e76081aef15d 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_iface_generated.c
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_iface_generated.c
|
|
|
ced1f5 |
@@ -187,6 +187,33 @@ const struct sbus_interface_meta iface_dp_failover_meta = {
|
|
|
ced1f5 |
sbus_invoke_get_all, /* GetAll invoker */
|
|
|
ced1f5 |
};
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+int iface_dp_access_control_RefreshRules_finish(struct sbus_request *req)
|
|
|
ced1f5 |
+{
|
|
|
ced1f5 |
+ return sbus_request_return_and_finish(req,
|
|
|
ced1f5 |
+ DBUS_TYPE_INVALID);
|
|
|
ced1f5 |
+}
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+/* methods for org.freedesktop.sssd.DataProvider.AccessControl */
|
|
|
ced1f5 |
+const struct sbus_method_meta iface_dp_access_control__methods[] = {
|
|
|
ced1f5 |
+ {
|
|
|
ced1f5 |
+ "RefreshRules", /* name */
|
|
|
ced1f5 |
+ NULL, /* no in_args */
|
|
|
ced1f5 |
+ NULL, /* no out_args */
|
|
|
ced1f5 |
+ offsetof(struct iface_dp_access_control, RefreshRules),
|
|
|
ced1f5 |
+ NULL, /* no invoker */
|
|
|
ced1f5 |
+ },
|
|
|
ced1f5 |
+ { NULL, }
|
|
|
ced1f5 |
+};
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+/* interface info for org.freedesktop.sssd.DataProvider.AccessControl */
|
|
|
ced1f5 |
+const struct sbus_interface_meta iface_dp_access_control_meta = {
|
|
|
ced1f5 |
+ "org.freedesktop.sssd.DataProvider.AccessControl", /* name */
|
|
|
ced1f5 |
+ iface_dp_access_control__methods,
|
|
|
ced1f5 |
+ NULL, /* no signals */
|
|
|
ced1f5 |
+ NULL, /* no properties */
|
|
|
ced1f5 |
+ sbus_invoke_get_all, /* GetAll invoker */
|
|
|
ced1f5 |
+};
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
/* arguments for org.freedesktop.sssd.dataprovider.autofsHandler */
|
|
|
ced1f5 |
const struct sbus_arg_meta iface_dp_autofsHandler__in[] = {
|
|
|
ced1f5 |
{ "dp_flags", "u" },
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_iface_generated.h b/src/providers/data_provider/dp_iface_generated.h
|
|
|
ced1f5 |
index b7f63fb438d7b3024a0f66de0a5d15cc3d426f44..541a90b0b5a5bc0a346cbd04974d33c8bb0983c5 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_iface_generated.h
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_iface_generated.h
|
|
|
ced1f5 |
@@ -26,6 +26,10 @@
|
|
|
ced1f5 |
#define IFACE_DP_FAILOVER_ACTIVESERVER "ActiveServer"
|
|
|
ced1f5 |
#define IFACE_DP_FAILOVER_LISTSERVERS "ListServers"
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+/* constants for org.freedesktop.sssd.DataProvider.AccessControl */
|
|
|
ced1f5 |
+#define IFACE_DP_ACCESS_CONTROL "org.freedesktop.sssd.DataProvider.AccessControl"
|
|
|
ced1f5 |
+#define IFACE_DP_ACCESS_CONTROL_REFRESHRULES "RefreshRules"
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
/* constants for org.freedesktop.sssd.dataprovider */
|
|
|
ced1f5 |
#define IFACE_DP "org.freedesktop.sssd.dataprovider"
|
|
|
ced1f5 |
#define IFACE_DP_PAMHANDLER "pamHandler"
|
|
|
ced1f5 |
@@ -88,6 +92,15 @@ int iface_dp_failover_ActiveServer_finish(struct sbus_request *req, const char *
|
|
|
ced1f5 |
/* finish function for ListServers */
|
|
|
ced1f5 |
int iface_dp_failover_ListServers_finish(struct sbus_request *req, const char *arg_servers[], int len_servers);
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+/* vtable for org.freedesktop.sssd.DataProvider.AccessControl */
|
|
|
ced1f5 |
+struct iface_dp_access_control {
|
|
|
ced1f5 |
+ struct sbus_vtable vtable; /* derive from sbus_vtable */
|
|
|
ced1f5 |
+ int (*RefreshRules)(struct sbus_request *req, void *data);
|
|
|
ced1f5 |
+};
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+/* finish function for RefreshRules */
|
|
|
ced1f5 |
+int iface_dp_access_control_RefreshRules_finish(struct sbus_request *req);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
/* vtable for org.freedesktop.sssd.dataprovider */
|
|
|
ced1f5 |
struct iface_dp {
|
|
|
ced1f5 |
struct sbus_vtable vtable; /* derive from sbus_vtable */
|
|
|
ced1f5 |
@@ -130,6 +143,9 @@ extern const struct sbus_interface_meta iface_dp_backend_meta;
|
|
|
ced1f5 |
/* interface info for org.freedesktop.sssd.DataProvider.Failover */
|
|
|
ced1f5 |
extern const struct sbus_interface_meta iface_dp_failover_meta;
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+/* interface info for org.freedesktop.sssd.DataProvider.AccessControl */
|
|
|
ced1f5 |
+extern const struct sbus_interface_meta iface_dp_access_control_meta;
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
/* interface info for org.freedesktop.sssd.dataprovider */
|
|
|
ced1f5 |
extern const struct sbus_interface_meta iface_dp_meta;
|
|
|
ced1f5 |
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_target_auth.c b/src/providers/data_provider/dp_target_auth.c
|
|
|
ced1f5 |
index 6bb3313b2de002466e5ca84464c962acd2412bfa..4b47975569a04a4d79aef4c16fcacf92c295de25 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_target_auth.c
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_target_auth.c
|
|
|
ced1f5 |
@@ -306,3 +306,17 @@ void dp_pam_handler_selinux_done(struct tevent_req *req)
|
|
|
ced1f5 |
dp_pam_reply(state->sbus_req, state->request_name, pd);
|
|
|
ced1f5 |
return;
|
|
|
ced1f5 |
}
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+errno_t dp_access_control_refresh_rules_handler(struct sbus_request *sbus_req,
|
|
|
ced1f5 |
+ void *dp_cli)
|
|
|
ced1f5 |
+{
|
|
|
ced1f5 |
+ const char *key;
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ key = "RefreshRules";
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ dp_req_with_reply(dp_cli, NULL, "Refresh Access Control Rules", key,
|
|
|
ced1f5 |
+ sbus_req, DPT_ACCESS, DPM_REFRESH_ACCESS_RULES, 0, NULL,
|
|
|
ced1f5 |
+ dp_req_reply_default, void *);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ return EOK;
|
|
|
ced1f5 |
+}
|
|
|
ced1f5 |
--
|
|
|
ced1f5 |
2.14.3
|
|
|
ced1f5 |
|