From: Volker Lendecke Date: Sat, 7 Jan 2017 14:55:41 +0000 (+0000) Subject: winbind: Use idmap_config_const_string in idmap_init_named_domain X-Git-Tag: tdb-1.3.13~431 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3f4b391daf94a7760a9f91cbeeb16cd567ee2426;p=thirdparty%2Fsamba.git winbind: Use idmap_config_const_string in idmap_init_named_domain Signed-off-by: Volker Lendecke Reviewed-by: Michael Adam --- diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index 9978e10b499..8971e7ffcf3 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -454,7 +454,6 @@ static struct idmap_domain *idmap_init_named_domain(TALLOC_CTX *mem_ctx, const char *domname) { struct idmap_domain *result = NULL; - char *config_option; const char *backend; bool ok; @@ -463,14 +462,7 @@ static struct idmap_domain *idmap_init_named_domain(TALLOC_CTX *mem_ctx, return NULL; } - config_option = talloc_asprintf(talloc_tos(), "idmap config %s", - domname); - if (config_option == NULL) { - DEBUG(0, ("talloc failed\n")); - goto fail; - } - - backend = lp_parm_const_string(-1, config_option, "backend", NULL); + backend = idmap_config_const_string(domname, "backend", NULL); if (backend == NULL) { DEBUG(10, ("no idmap backend configured for domain '%s'\n", domname)); @@ -482,11 +474,9 @@ static struct idmap_domain *idmap_init_named_domain(TALLOC_CTX *mem_ctx, goto fail; } - TALLOC_FREE(config_option); return result; fail: - TALLOC_FREE(config_option); TALLOC_FREE(result); return NULL; }