mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-14 02:22:03 +08:00
Exit when mandatory configuration options are not present
This commit is contained in:
@@ -58,6 +58,7 @@ static const char* cfg_file = DEFAULT_CFG_FILE;
|
|||||||
} \
|
} \
|
||||||
} else if (mand != 0) { \
|
} else if (mand != 0) { \
|
||||||
fprintf(stderr, "Configuration option %s is mandatory.\n", name); \
|
fprintf(stderr, "Configuration option %s is mandatory.\n", name); \
|
||||||
|
exit(1); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define READ_BOOLEAN(name, s_name, mand) \
|
#define READ_BOOLEAN(name, s_name, mand) \
|
||||||
@@ -66,6 +67,7 @@ static const char* cfg_file = DEFAULT_CFG_FILE;
|
|||||||
s_name = 1; \
|
s_name = 1; \
|
||||||
} else if (mand != 0) { \
|
} else if (mand != 0) { \
|
||||||
fprintf(stderr, "Configuration option %s is mandatory.\n", name); \
|
fprintf(stderr, "Configuration option %s is mandatory.\n", name); \
|
||||||
|
exit(1); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -75,6 +77,7 @@ static const char* cfg_file = DEFAULT_CFG_FILE;
|
|||||||
s_name = strdup(val->v.strVal); \
|
s_name = strdup(val->v.strVal); \
|
||||||
else if (mand != 0) { \
|
else if (mand != 0) { \
|
||||||
fprintf(stderr, "Configuration option %s is mandatory.\n", name); \
|
fprintf(stderr, "Configuration option %s is mandatory.\n", name); \
|
||||||
|
exit(1); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define READ_TF(name, s_name, mand, def) \
|
#define READ_TF(name, s_name, mand, def) \
|
||||||
@@ -98,6 +101,7 @@ static const char* cfg_file = DEFAULT_CFG_FILE;
|
|||||||
s_name = atoi(val->v.strVal); \
|
s_name = atoi(val->v.strVal); \
|
||||||
} else if (mand != 0) { \
|
} else if (mand != 0) { \
|
||||||
fprintf(stderr, "Configuration option %s is mandatory.\n", name); \
|
fprintf(stderr, "Configuration option %s is mandatory.\n", name); \
|
||||||
|
exit(1); \
|
||||||
}
|
}
|
||||||
|
|
||||||
static void parse_cfg_file(const char* file, struct cfg_st *config)
|
static void parse_cfg_file(const char* file, struct cfg_st *config)
|
||||||
|
|||||||
Reference in New Issue
Block a user