]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
idmap_ldap: Use idmap_config_const_string
authorVolker Lendecke <vl@samba.org>
Sat, 18 Mar 2017 17:40:28 +0000 (18:40 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 20 Mar 2017 18:36:21 +0000 (19:36 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/winbindd/idmap_ldap.c

index a7fe17eb5ce3bd7119f5803b2bed20476f501a87..041152cc1fbc550ac998b2a66c8ddfaff58eee9a 100644 (file)
@@ -416,7 +416,6 @@ static NTSTATUS idmap_ldap_db_init(struct idmap_domain *dom)
 {
        NTSTATUS ret;
        struct idmap_ldap_context *ctx = NULL;
-       char *config_option = NULL;
        const char *tmp = NULL;
 
        /* Only do init if we are online */
@@ -430,14 +429,7 @@ static NTSTATUS idmap_ldap_db_init(struct idmap_domain *dom)
                return NT_STATUS_NO_MEMORY;
        }
 
-       config_option = talloc_asprintf(ctx, "idmap config %s", dom->name);
-       if (!config_option) {
-               DEBUG(0, ("Out of memory!\n"));
-               ret = NT_STATUS_NO_MEMORY;
-               goto done;
-       }
-
-       tmp = lp_parm_const_string(-1, config_option, "ldap_url", NULL);
+       tmp = idmap_config_const_string(dom->name, "ldap_url", NULL);
 
        if ( ! tmp) {
                DEBUG(1, ("ERROR: missing idmap ldap url\n"));
@@ -449,7 +441,7 @@ static NTSTATUS idmap_ldap_db_init(struct idmap_domain *dom)
 
        trim_char(ctx->url, '\"', '\"');
 
-       tmp = lp_parm_const_string(-1, config_option, "ldap_base_dn", NULL);
+       tmp = idmap_config_const_string(dom->name, "ldap_base_dn", NULL);
        if ( ! tmp || ! *tmp) {
                tmp = lp_ldap_idmap_suffix(talloc_tos());
                if ( ! tmp) {
@@ -500,7 +492,6 @@ static NTSTATUS idmap_ldap_db_init(struct idmap_domain *dom)
                goto done;
        }
 
-       talloc_free(config_option);
        return NT_STATUS_OK;
 
 /*failed */