mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
winbind: Use idmap_config_const_string in domain_has_idmap_config
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
parent
1c34166c12
commit
b8e00f0183
@ -196,7 +196,6 @@ const char *idmap_config_const_string(const char *domname, const char *option,
|
||||
bool domain_has_idmap_config(const char *domname)
|
||||
{
|
||||
int i;
|
||||
char *config_option;
|
||||
const char *range = NULL;
|
||||
const char *backend = NULL;
|
||||
bool ok;
|
||||
@ -214,23 +213,14 @@ bool domain_has_idmap_config(const char *domname)
|
||||
|
||||
/* fallback: also check loadparm */
|
||||
|
||||
config_option = talloc_asprintf(talloc_tos(), "idmap config %s",
|
||||
domname);
|
||||
if (config_option == NULL) {
|
||||
DEBUG(0, ("out of memory\n"));
|
||||
return false;
|
||||
}
|
||||
|
||||
range = lp_parm_const_string(-1, config_option, "range", NULL);
|
||||
backend = lp_parm_const_string(-1, config_option, "backend", NULL);
|
||||
range = idmap_config_const_string(domname, "range", NULL);
|
||||
backend = idmap_config_const_string(domname, "backend", NULL);
|
||||
if (range != NULL && backend != NULL) {
|
||||
DEBUG(5, ("idmap configuration specified for domain '%s'\n",
|
||||
domname));
|
||||
TALLOC_FREE(config_option);
|
||||
return true;
|
||||
}
|
||||
|
||||
TALLOC_FREE(config_option);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user