1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

winbind: Add idmap_config_int

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Volker Lendecke 2017-01-08 11:52:56 +00:00 committed by Michael Adam
parent 0b05785de6
commit e190eaa30f
2 changed files with 16 additions and 0 deletions

View File

@ -208,6 +208,21 @@ bool idmap_config_bool(const char *domname, const char *option, bool def)
}
}
int idmap_config_int(const char *domname, const char *option, int 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_int(-1, config_option, option, def);
}
}
bool domain_has_idmap_config(const char *domname)
{
int i;

View File

@ -381,6 +381,7 @@ struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
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);
int idmap_config_int(const char *domname, const char *option, int def);
bool domain_has_idmap_config(const char *domname);
bool lp_scan_idmap_domains(bool (*fn)(const char *domname,
void *private_data),