s3:idmap: simply call idmap_init_named_domain for "*" in idmap_init_default_domain
authorMichael Adam <obnox@samba.org>
Thu, 3 Mar 2011 16:48:43 +0000 (17:48 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 22 Mar 2011 21:49:57 +0000 (22:49 +0100)
The default domain "*" is now treated exactly the same as other explicitly
configured domains.

source3/winbindd/idmap.c

index 00ba7da50538636e8831c928dd721ed674d1020e..1c4e25ad33663c21a7f4de71062696664bad770d 100644 (file)
@@ -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,
-                               &params)) {
-               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