summaryrefslogtreecommitdiffstats
path: root/src/responder/ifp/ifp_groups.c
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2015-02-09 12:02:33 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-05-22 15:57:14 +0200
commita1e4113a5388e34c08459c5b69679c82ac2bddc9 (patch)
treede092388bfceb31b3038ce3cfb056cff6f31bf65 /src/responder/ifp/ifp_groups.c
parentc747b0c875785ce693f70b50bdda0237c4b04e35 (diff)
downloadsssd-a1e4113a5388e34c08459c5b69679c82ac2bddc9.tar.gz
sssd-a1e4113a5388e34c08459c5b69679c82ac2bddc9.tar.xz
sssd-a1e4113a5388e34c08459c5b69679c82ac2bddc9.zip
IFP: add org.freedesktop.sssd.infopipe.Users.User
Example calls: dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe /org/freedesktop/sssd/infopipe/Users/LDAP_2ePB/10001 org.freedesktop.DBus.Properties.Get string:org.freedesktop.sssd.infopipe.Users.User string:name method return sender=:1.159 -> dest=:1.165 reply_serial=2 variant string "user-1" Resolves: https://fedorahosted.org/sssd/ticket/2150 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/responder/ifp/ifp_groups.c')
-rw-r--r--src/responder/ifp/ifp_groups.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/responder/ifp/ifp_groups.c b/src/responder/ifp/ifp_groups.c
new file mode 100644
index 000000000..533e6806d
--- /dev/null
+++ b/src/responder/ifp/ifp_groups.c
@@ -0,0 +1,39 @@
+/*
+ Authors:
+ Pavel Březina <pbrezina@redhat.com>
+
+ Copyright (C) 2015 Red Hat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <talloc.h>
+
+#include "db/sysdb.h"
+#include "responder/ifp/ifp_groups.h"
+
+char * ifp_groups_build_path_from_msg(TALLOC_CTX *mem_ctx,
+ struct sss_domain_info *domain,
+ struct ldb_message *msg)
+{
+ const char *gid;
+
+ gid = ldb_msg_find_attr_as_string(msg, SYSDB_GIDNUM, NULL);
+
+ if (gid == NULL) {
+ return NULL;
+ }
+
+ return sbus_opath_compose(mem_ctx, IFP_PATH_GROUPS, domain->name, gid);
+}