1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

s3:winbindd:idmap: check loadparm in domain_has_idmap_config() helper as well.

Guenther

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11786

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Günther Deschner 2016-03-10 12:21:52 +01:00 committed by Karolin Seeger
parent 87fcc70eea
commit 8bd67a1ef2

View File

@ -123,6 +123,9 @@ static bool idmap_init(void)
bool domain_has_idmap_config(const char *domname)
{
int i;
char *config_option;
const char *range = NULL;
const char *backend = NULL;
idmap_init();
@ -132,6 +135,25 @@ 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);
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;
}