summaryrefslogtreecommitdiffstats
path: root/src/responder/ifp/ifpsrv.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2015-06-17 13:39:43 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-07-15 17:32:49 +0200
commitbdf32fbb3c947dd1b2c54d1c21d8028a1ddc80e6 (patch)
tree69f3d6854385099e016e4e96aaf25f5530f6c583 /src/responder/ifp/ifpsrv.c
parentb9e74a747b8f1012bba3575f3e4289ef4877d64a (diff)
downloadsssd-bdf32fbb3c947dd1b2c54d1c21d8028a1ddc80e6.tar.gz
sssd-bdf32fbb3c947dd1b2c54d1c21d8028a1ddc80e6.tar.xz
sssd-bdf32fbb3c947dd1b2c54d1c21d8028a1ddc80e6.zip
IFP: Add wildcard requests
Resolves: https://fedorahosted.org/sssd/ticket/2553 Can be used as: dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe \ /org/freedesktop/sssd/infopipe/Users \ org.freedesktop.sssd.infopipe.Users.ListByName \ string:r\* uint32:10 dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe \ /org/freedesktop/sssd/infopipe/Groups \ org.freedesktop.sssd.infopipe.Groups.ListByName \ string:r\* uint32:10 dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe \ /org/freedesktop/sssd/infopipe/Users \ org.freedesktop.sssd.infopipe.Users.ListByDomainAndName \ string:ipaldap string:r\* uint32:10 dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe \ /org/freedesktop/sssd/infopipe/Groups \ org.freedesktop.sssd.infopipe.Groups.ListByDomainAndName \ string:ipaldap string:r\* uint32:10 By default the wildcard_limit is unset, that is, the request will return all cached entries that match. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Diffstat (limited to 'src/responder/ifp/ifpsrv.c')
-rw-r--r--src/responder/ifp/ifpsrv.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/responder/ifp/ifpsrv.c b/src/responder/ifp/ifpsrv.c
index 631bcd266..cdc411faa 100644
--- a/src/responder/ifp/ifpsrv.c
+++ b/src/responder/ifp/ifpsrv.c
@@ -34,6 +34,7 @@
#include <dbus/dbus.h>
#include "util/util.h"
+#include "util/strtonum.h"
#include "sbus/sssd_dbus.h"
#include "monitor/monitor_interfaces.h"
#include "confdb/confdb.h"
@@ -228,6 +229,7 @@ int ifp_process_init(TALLOC_CTX *mem_ctx,
int max_retries;
char *uid_str;
char *attr_list_str;
+ char *wildcard_limit_str;
ifp_cmds = get_ifp_cmds();
ret = sss_process_init(mem_ctx, ev, cdb,
@@ -321,6 +323,27 @@ int ifp_process_init(TALLOC_CTX *mem_ctx,
goto fail;
}
+ /* A bit convoluted way until we have a confdb_get_uint32 */
+ ret = confdb_get_string(ifp_ctx->rctx->cdb,
+ ifp_ctx->rctx,
+ CONFDB_IFP_CONF_ENTRY,
+ CONFDB_IFP_WILDCARD_LIMIT,
+ NULL, /* no limit by default */
+ &wildcard_limit_str);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_FATAL_FAILURE,
+ "Failed to retrieve limit for a wildcard search\n");
+ goto fail;
+ }
+
+ if (wildcard_limit_str) {
+ ifp_ctx->wildcard_limit = strtouint32(wildcard_limit_str, NULL, 10);
+ if (errno != 0) {
+ ret = errno;
+ goto fail;
+ }
+ }
+
for (iter = ifp_ctx->rctx->be_conns; iter; iter = iter->next) {
sbus_reconnect_init(iter->conn, max_retries,
ifp_dp_reconnect_init, iter);