mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 13:58:05 +00:00
Flag settings have a NULL value so we can't use that to test whether
an entry in struct early_default is set or not. Add a "set" member and use that instead.
This commit is contained in:
@@ -82,7 +82,8 @@ static struct strmap priorities[] = {
|
||||
struct early_default {
|
||||
const char *var;
|
||||
const char *val;
|
||||
int op;
|
||||
short op;
|
||||
short set;
|
||||
};
|
||||
|
||||
static struct early_default early_defaults[] = {
|
||||
@@ -681,6 +682,7 @@ store_early_default(struct defaults *def, int what)
|
||||
default_binding_matches(def, what)) {
|
||||
early->val = def->val;
|
||||
early->op = def->op;
|
||||
early->set = true;
|
||||
}
|
||||
debug_return_bool(true);
|
||||
}
|
||||
@@ -696,10 +698,10 @@ apply_early_defaults(bool quiet)
|
||||
debug_decl(apply_early_defaults, SUDOERS_DEBUG_DEFAULTS)
|
||||
|
||||
for (early = early_defaults; early->var != NULL; early++) {
|
||||
if (early->val != NULL) {
|
||||
if (early->set) {
|
||||
if (!set_default(early->var, early->val, early->op, quiet))
|
||||
rc = false;
|
||||
early->val = NULL; /* clean state for next run */
|
||||
early->set = false; /* clean state for next run */
|
||||
}
|
||||
}
|
||||
debug_return_bool(rc);
|
||||
|
Reference in New Issue
Block a user