1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

winbind: Add idmap_config_bool()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Volker Lendecke 2017-01-07 15:10:05 +00:00 committed by Michael Adam
parent 644a997144
commit 66f5e7dbda
2 changed files with 16 additions and 0 deletions

View File

@ -193,6 +193,21 @@ const char *idmap_config_const_string(const char *domname, const char *option,
}
}
bool idmap_config_bool(const char *domname, const char *option, bool def)
{
int len = snprintf(NULL, 0, "idmap config %s", domname);
if (len == -1) {
return def;
}
{
char config_option[len+1];
snprintf(config_option, sizeof(config_option),
"idmap config %s", domname);
return lp_parm_bool(-1, config_option, option, def);
}
}
bool domain_has_idmap_config(const char *domname)
{
int i;

View File

@ -380,6 +380,7 @@ struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
const struct dom_sid *sid);
const char *idmap_config_const_string(const char *domname, const char *option,
const char *def);
bool idmap_config_bool(const char *domname, const char *option, bool def);
bool domain_has_idmap_config(const char *domname);
bool lp_scan_idmap_domains(bool (*fn)(const char *domname,
void *private_data),