From efc1d38b32cc35f51e0a6bf05e1e45b45dbc9abf Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 3 Mar 2011 17:48:43 +0100 Subject: s3:idmap: simply call idmap_init_named_domain for "*" in idmap_init_default_domain The default domain "*" is now treated exactly the same as other explicitly configured domains. --- source3/winbindd/idmap.c | 55 ++++++++++++------------------------------------ 1 file changed, 14 insertions(+), 41 deletions(-) (limited to 'source3') diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index 00ba7da505..1c4e25ad33 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -294,47 +294,6 @@ fail: return NULL; } -/** - * Initialize the default domain structure - * @param[in] mem_ctx memory context for the result - * @result The default domain structure - * - * This routine takes the module name from the "idmap backend" parameter, - * passing a possible parameter like ldap:ldap://ldap-url/ to the module. - */ - -static struct idmap_domain *idmap_init_default_domain(TALLOC_CTX *mem_ctx) -{ - struct idmap_domain *result; - char *modulename; - char *params; - - idmap_init(); - - if (!parse_idmap_module(talloc_tos(), lp_idmap_backend(), &modulename, - ¶ms)) { - DEBUG(1, ("parse_idmap_module failed\n")); - return NULL; - } - - DEBUG(3, ("idmap_init: using '%s' as remote backend\n", modulename)); - - result = idmap_init_domain(mem_ctx, "*", modulename, true); - if (result == NULL) { - goto fail; - } - - TALLOC_FREE(modulename); - TALLOC_FREE(params); - return result; - -fail: - TALLOC_FREE(modulename); - TALLOC_FREE(params); - TALLOC_FREE(result); - return NULL; -} - /** * Initialize a named domain structure * @param[in] mem_ctx memory context for the result @@ -379,6 +338,20 @@ fail: return NULL; } +/** + * Initialize the default domain structure + * @param[in] mem_ctx memory context for the result + * @result The default domain structure + * + * This routine takes the module name from the "idmap backend" parameter, + * passing a possible parameter like ldap:ldap://ldap-url/ to the module. + */ + +static struct idmap_domain *idmap_init_default_domain(TALLOC_CTX *mem_ctx) +{ + return idmap_init_named_domain(mem_ctx, "*"); +} + /** * Initialize the passdb domain structure * @param[in] mem_ctx memory context for the result -- cgit