diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2014-05-02 19:17:38 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-06-03 13:37:06 +0200 |
commit | 64f5e4b48926c9c14994e73c5a950a5ac876ec8e (patch) | |
tree | b17e73ca49261a0be00b41d5e05d8076413e17d8 /src/responder/ifp/ifp_iface_generated.c | |
parent | bd8cf980dc2e7035a8ce893df4a8ccaf9bbf11ad (diff) | |
download | sssd-64f5e4b48926c9c14994e73c5a950a5ac876ec8e.tar.gz sssd-64f5e4b48926c9c14994e73c5a950a5ac876ec8e.tar.xz sssd-64f5e4b48926c9c14994e73c5a950a5ac876ec8e.zip |
IFP: Add a GetGroupsList method
This patch adds a new method on the bus with the following synopsis:
<method name="GetUserGroups">
<arg name="user" type="s" direction="in" />
<arg name="values" type="as" direction="out"/>
</method>
Its purpose is to return names of groups the user is a member of as a
list of strings.
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
(cherry picked from commit 3fe339bcba0e211cc666bb3afe34e5c8fce85f4f)
Diffstat (limited to 'src/responder/ifp/ifp_iface_generated.c')
-rw-r--r-- | src/responder/ifp/ifp_iface_generated.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/responder/ifp/ifp_iface_generated.c b/src/responder/ifp/ifp_iface_generated.c index ed8d65187..d3cb4990c 100644 --- a/src/responder/ifp/ifp_iface_generated.c +++ b/src/responder/ifp/ifp_iface_generated.c @@ -5,6 +5,9 @@ #include "sbus/sssd_dbus_meta.h" #include "ifp_iface_generated.h" +/* invokes a handler with a 's' DBus signature */ +static int invoke_s_method(struct sbus_request *dbus_req, void *function_ptr); + /* arguments for org.freedesktop.sssd.infopipe.GetUserAttr */ const struct sbus_arg_meta infopipe_iface_GetUserAttr__in[] = { { "user", "s" }, @@ -18,6 +21,25 @@ const struct sbus_arg_meta infopipe_iface_GetUserAttr__out[] = { { NULL, } }; +/* arguments for org.freedesktop.sssd.infopipe.GetUserGroups */ +const struct sbus_arg_meta infopipe_iface_GetUserGroups__in[] = { + { "user", "s" }, + { NULL, } +}; + +/* arguments for org.freedesktop.sssd.infopipe.GetUserGroups */ +const struct sbus_arg_meta infopipe_iface_GetUserGroups__out[] = { + { "values", "as" }, + { NULL, } +}; + +int infopipe_iface_GetUserGroups_finish(struct sbus_request *req, const char *arg_values[], int len_values) +{ + return sbus_request_return_and_finish(req, + DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &arg_values, len_values, + DBUS_TYPE_INVALID); +} + /* methods for org.freedesktop.sssd.infopipe */ const struct sbus_method_meta infopipe_iface__methods[] = { { @@ -34,6 +56,13 @@ const struct sbus_method_meta infopipe_iface__methods[] = { offsetof(struct infopipe_iface, GetUserAttr), NULL, /* no invoker */ }, + { + "GetUserGroups", /* name */ + infopipe_iface_GetUserGroups__in, + infopipe_iface_GetUserGroups__out, + offsetof(struct infopipe_iface, GetUserGroups), + invoke_s_method, + }, { NULL, } }; @@ -44,3 +73,19 @@ const struct sbus_interface_meta infopipe_iface_meta = { NULL, /* no signals */ NULL, /* no propetries */ }; + +/* invokes a handler with a 's' DBus signature */ +static int invoke_s_method(struct sbus_request *dbus_req, void *function_ptr) +{ + const char * arg_0; + int (*handler)(struct sbus_request *, void *, const char *) = function_ptr; + + if (!sbus_request_parse_or_finish(dbus_req, + DBUS_TYPE_STRING, &arg_0, + DBUS_TYPE_INVALID)) { + return EOK; /* request handled */ + } + + return (handler)(dbus_req, dbus_req->intf->instance_data, + arg_0); +} |