From 6b5d45693f01eec55128eb3508266cda73071d93 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 7 Apr 2009 19:25:48 -0400 Subject: 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. --- server/tools/sss_groupmod.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'server/tools/sss_groupmod.c') diff --git a/server/tools/sss_groupmod.c b/server/tools/sss_groupmod.c index ed16033a1..922555f0b 100644 --- a/server/tools/sss_groupmod.c +++ b/server/tools/sss_groupmod.c @@ -186,6 +186,7 @@ int main(int argc, const char **argv) POPT_TABLEEND }; poptContext pc = NULL; + struct sss_domain_info *dom; struct group_mod_ctx *group_ctx = NULL; struct tools_ctx *ctx = NULL; char *groups; @@ -246,12 +247,16 @@ int main(int argc, const char **argv) group_ctx->gid = pc_gid; /* arguments processed, go on to actual work */ - group_ctx->domain = btreemap_get_value(ctx->domains, "LOCAL"); - if (group_ctx->domain == NULL) { - DEBUG(0, ("Could not get the domain\n")); + + for (dom = ctx->domains; dom; dom = dom->next) { + if (strcasecmp(dom->name, "LOCAL") == 0) break; + } + if (dom == NULL) { + DEBUG(0, ("Could not get domain info\n")); ret = EXIT_FAILURE; goto fini; } + group_ctx->domain = dom; ret = sysdb_transaction(ctx, ctx->sysdb, mod_group, group_ctx); if (ret != EOK) { -- cgit