Browse Source

config: fix allow_all parsing — accept yes/1/true like other bool options

- config_parser.c: allowed_keys_allow_all now uses strcasecmp(yes/1/true) instead of atoi()
- node_config.cpp: keep allow_all=yes
topo_upd
Evgeny 3 months ago
parent
commit
d0af503d01
  1. 2
      src/config_parser.c

2
src/config_parser.c

@ -931,7 +931,7 @@ static struct utun_config* parse_config_internal(FILE *fp, const char *filename)
break;
case SECTION_ALLOWED_KEYS:
if (strcmp(key, "allow_all") == 0) {
cfg->global.allowed_keys_allow_all = atoi(value) ? 1 : 0;
cfg->global.allowed_keys_allow_all = strcasecmp(value, "yes") == 0 || strcasecmp(value, "1") == 0 || strcasecmp(value, "true") == 0;
} else if (strcmp(key, "key") == 0) {
struct CFG_ALLOWED_KEY *new_key = u_calloc(1, sizeof(struct CFG_ALLOWED_KEY));
if (!new_key) {

Loading…
Cancel
Save