diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-04-07 19:25:48 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-04-08 10:55:03 -0400 |
commit | 6b5d45693f01eec55128eb3508266cda73071d93 (patch) | |
tree | c51ca00f2fb243e5eaf06128e8092583fba1bd8c /server/infopipe/infopipe.c | |
parent | e8a7526b06acf4af322fdab593c8bafbd9f4a103 (diff) | |
download | sssd-6b5d45693f01eec55128eb3508266cda73071d93.tar.gz sssd-6b5d45693f01eec55128eb3508266cda73071d93.tar.bz2 sssd-6b5d45693f01eec55128eb3508266cda73071d93.zip |
Change the way we retrieve domains
To be able to correctly filter out duplicate names when multiple non-fully
qualified domains are in use we need to be able to specify the domains order.
This is now accomplished by the configuration paramets 'domains' in the
config/domains entry. 'domains' is a comma separated list of domain names.
This paramter allows also to have disbaled domains in the configuration without
requiring to completely delete them.
The domains list is now kept in a linked list of sss_domain_info objects.
The first domain is also the "default" domain.
Diffstat (limited to 'server/infopipe/infopipe.c')
-rw-r--r-- | server/infopipe/infopipe.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/server/infopipe/infopipe.c b/server/infopipe/infopipe.c index 535d41e3..72998301 100644 --- a/server/infopipe/infopipe.c +++ b/server/infopipe/infopipe.c @@ -36,8 +36,6 @@ #define INFP_CONF_ENTRY "config/services/info" -struct infp_ctx; - static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn) { dbus_uint16_t version = INFOPIPE_VERSION; @@ -366,23 +364,13 @@ static int infp_process_init(TALLOC_CTX *mem_ctx, } /* Read in the domain map */ - ret = confdb_get_domains(cdb, infp_ctx, &infp_ctx->domain_map); + ret = confdb_get_domains(cdb, infp_ctx, &infp_ctx->domains); if (ret != EOK) { DEBUG(0, ("Failed to populate the domain map\n")); talloc_free(infp_ctx); return EIO; } - if (infp_ctx->domain_map == NULL) { - /* No domains configured! - * Note: this should never happen, since LOCAL - * should always be configured - */ - DEBUG(0, ("No domains configured on this client!\n")); - talloc_free(infp_ctx); - return EIO; - } - infp_ctx->cache_timeout = 600; /* FIXME: read from confdb */ /* Add the infp_ctx to the sbus_conn_ctx private data @@ -482,9 +470,15 @@ bool infp_get_permissions(const char *caller, return false; } -struct sss_domain_info *infp_get_domain_obj(struct infp_ctx *infp, const char *domain_name) +struct sss_domain_info *infp_get_domain_obj(struct infp_ctx *infp, + const char *domain_name) { - return talloc_get_type(btreemap_get_value(infp->domain_map, (const void *) domain_name), struct sss_domain_info); + struct sss_domain_info *dom; + + for (dom = infp->domains; dom; dom = dom->next) { + if (strcasecmp(dom->name, domain_name) == 0) break; + } + return dom; } /* CheckPermissions(STRING domain, STRING object, STRING instance |