mirror of
https://github.com/yrutschle/sslh.git
synced 2026-10-22 18:12:10 +03:00
sanity checks that regex options are only used with the right probe and with libpcre2 support compiled in
This commit is contained in:
1 parent
579baae363
commit
4d3aa6c6e0
1 file changed
+19
+19
@@ -220,6 +220,23 @@ static void config_protocols()
|
||||
}
|
||||
}
|
||||
|
||||
static void config_sanity_regex(const struct sslhcfg_protocols_item* prot)
|
||||
{
|
||||
if (prot->regex_patterns_len > 0) {
|
||||
if (strcmp(prot->name, "regex") != 0) {
|
||||
print_message(msg_config_error, "name: \"%s\"; host: \"%s\"; port: \"%s\": "
|
||||
"regex_patterns setting is only applicable to `regex' probe.\n"
|
||||
"This setting will be ignored\n",
|
||||
prot->name, prot->host, prot->port);
|
||||
}
|
||||
#ifndef ENABLE_REGEX
|
||||
print_message(msg_config_error, "name: \"%s\"; host: \"%s\"; port: \"%s\": "
|
||||
"Uses regex_patterns, but libpcre2 support was not compiled in.\n"
|
||||
"This setting will be ignored.\n",
|
||||
prot->name, prot->host, prot->port);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void config_sanity_check(struct sslhcfg_item* cfg)
|
||||
{
|
||||
@@ -249,6 +266,8 @@ void config_sanity_check(struct sslhcfg_item* cfg)
|
||||
}
|
||||
}
|
||||
|
||||
config_sanity_regex(&cfg->protocols[i]);
|
||||
|
||||
if (cfg->protocols[i].is_udp) {
|
||||
if (cfg->protocols[i].tfo_ok) {
|
||||
print_message(msg_config_error, "name: \"%s\"; host: \"%s\"; port: \"%s\": "
|
||||
|
||||
Reference in new issue
Block a user