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
This commit is contained in:
1 parent
1eb54b722a
commit
fc9aa79e20
1 file changed
+1
-1
+1
-1
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user