Handle parsing boolean options that have no explicit value.
This commit is contained in:
@@ -731,12 +731,16 @@ ldif_store_options(struct ldif_str_list *options)
|
|||||||
TAILQ_INIT(d->binding);
|
TAILQ_INIT(d->binding);
|
||||||
d->type = DEFAULTS;
|
d->type = DEFAULTS;
|
||||||
d->op = sudo_ldap_parse_option(ls->str, &var, &val);
|
d->op = sudo_ldap_parse_option(ls->str, &var, &val);
|
||||||
d->var = strdup(var);
|
if ((d->var = strdup(var)) == NULL) {
|
||||||
d->val = strdup(val);
|
|
||||||
if (d->var == NULL || d->val == NULL) {
|
|
||||||
sudo_fatalx(U_("%s: %s"), __func__,
|
sudo_fatalx(U_("%s: %s"), __func__,
|
||||||
U_("unable to allocate memory"));
|
U_("unable to allocate memory"));
|
||||||
}
|
}
|
||||||
|
if (val != NULL) {
|
||||||
|
if ((d->val = strdup(val)) == NULL) {
|
||||||
|
sudo_fatalx(U_("%s: %s"), __func__,
|
||||||
|
U_("unable to allocate memory"));
|
||||||
|
}
|
||||||
|
}
|
||||||
TAILQ_INSERT_TAIL(&defaults, d, entries);
|
TAILQ_INSERT_TAIL(&defaults, d, entries);
|
||||||
}
|
}
|
||||||
debug_return;
|
debug_return;
|
||||||
|
Reference in New Issue
Block a user