]> git.samba.org - samba.git/commitdiff
idmap_rfc2307: Use idmap_config_bool
authorVolker Lendecke <vl@samba.org>
Sat, 18 Mar 2017 17:57:03 +0000 (18:57 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 20 Mar 2017 18:36:22 +0000 (19:36 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/winbindd/idmap_rfc2307.c

index d59690e577f7ba20d032be2b9d03dcd3bbc08ce5..340757a55da1683fe280c870133d316b64e92a22 100644 (file)
@@ -763,7 +763,6 @@ static int idmap_rfc2307_context_destructor(struct idmap_rfc2307_context *ctx)
 static NTSTATUS idmap_rfc2307_initialize(struct idmap_domain *domain)
 {
        struct idmap_rfc2307_context *ctx;
-       char *cfg_opt;
        const char *bind_path_user, *bind_path_group, *ldap_server, *realm;
        NTSTATUS status;
 
@@ -773,12 +772,6 @@ static NTSTATUS idmap_rfc2307_initialize(struct idmap_domain *domain)
        }
        talloc_set_destructor(ctx, idmap_rfc2307_context_destructor);
 
-       cfg_opt = talloc_asprintf(ctx, "idmap config %s", domain->name);
-       if (cfg_opt == NULL) {
-               status = NT_STATUS_NO_MEMORY;
-               goto err;
-       }
-
        bind_path_user = idmap_config_const_string(
                domain->name, "bind_path_user", NULL);
        if (bind_path_user) {
@@ -835,14 +828,12 @@ static NTSTATUS idmap_rfc2307_initialize(struct idmap_domain *domain)
                }
        }
 
-       ctx->user_cn = lp_parm_bool(-1, cfg_opt, "user_cn", false);
+       ctx->user_cn = idmap_config_bool(domain->name, "user_cn", false);
 
        domain->private_data = ctx;
-       talloc_free(cfg_opt);
        return NT_STATUS_OK;
 
 err:
-       talloc_free(cfg_opt);
        talloc_free(ctx);
        return status;
 }