From d0a10e530823d6d8eff31ef164eee9ba2fb71c63 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Sun, 22 Apr 2012 13:59:57 -0400 Subject: LDAP: Initialize ID mapping when configured --- src/providers/ldap/ldap_init.c | 7 +++++++ src/providers/ldap/sdap.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c index f55e94b74..92c966b17 100644 --- a/src/providers/ldap/ldap_init.c +++ b/src/providers/ldap/ldap_init.c @@ -28,6 +28,7 @@ #include "providers/ldap/sdap_access.h" #include "providers/ldap/sdap_sudo.h" #include "providers/ldap/sdap_autofs.h" +#include "providers/ldap/sdap_idmap.h" static void sdap_shutdown(struct be_req *req); @@ -153,6 +154,12 @@ int sssm_ldap_id_init(struct be_ctx *bectx, goto done; } + if (dp_opt_get_bool(ctx->opts->basic, SDAP_ID_MAPPING)) { + /* Set up the ID mapping object */ + ret = sdap_idmap_init(ctx, ctx, &ctx->opts->idmap_ctx); + if (ret != EOK) goto done; + } + ret = sdap_id_setup_tasks(ctx); if (ret != EOK) { goto done; diff --git a/src/providers/ldap/sdap.h b/src/providers/ldap/sdap.h index 71ae246d0..d72a0edd9 100644 --- a/src/providers/ldap/sdap.h +++ b/src/providers/ldap/sdap.h @@ -357,6 +357,9 @@ struct sdap_options { struct sdap_attr_map *netgroup_map; struct sdap_attr_map *service_map; + /* ID-mapping support */ + struct sdap_idmap_ctx *idmap_ctx; + /* FIXME - should this go to a special struct to avoid mixing with name-service-switch maps? */ struct sdap_attr_map *sudorule_map; struct sdap_attr_map *autofs_mobject_map; -- cgit