conf: parse regexes case-sensitive
rather than treating everything as case insensitive, we explicitly allow upper/lowercase where it makes sense.
This commit is contained in:
parent
57f932a33b
commit
86379b4b66
@ -262,7 +262,7 @@ config_init (void)
|
||||
|
||||
r = regcomp (directives[i].cre,
|
||||
directives[i].re,
|
||||
REG_EXTENDED | REG_ICASE | REG_NEWLINE);
|
||||
REG_EXTENDED | REG_NEWLINE);
|
||||
if (r)
|
||||
return r;
|
||||
}
|
||||
|
@ -11,16 +11,16 @@
|
||||
#define SPACE "[ \\t]"
|
||||
#define WS SPACE "+"
|
||||
#define STR "\"([^\"]+)\""
|
||||
#define BOOL "(yes|on|no|off)"
|
||||
#define BOOL "([Yy][Ee][Ss]|[Oo][Nn]|[Nn][Oo]|[Oo][Ff][Ff])"
|
||||
#define INT "(" DIGIT "+)"
|
||||
#define ALNUM "([-a-z0-9._]+)"
|
||||
#define ALNUM "([-A-Za-z0-9._]+)"
|
||||
#define USERNAME "([^:]*)"
|
||||
#define PASSWORD "([^@]*)"
|
||||
#define IP "((([0-9]{1,3})\\.){3}[0-9]{1,3})"
|
||||
#define IPMASK "(" IP "(/" DIGIT "+)?)"
|
||||
#define IPV6 "(" \
|
||||
"(([0-9a-f:]{2,39}))|" \
|
||||
"(([0-9a-f:]{0,29}:" IP "))" \
|
||||
"(([0-9a-fA-F:]{2,39}))|" \
|
||||
"(([0-9a-fA-F:]{0,29}:" IP "))" \
|
||||
")"
|
||||
|
||||
#define IPV6MASK "(" IPV6 "(/" DIGIT "+)?)"
|
||||
@ -88,6 +88,6 @@ STDCONF (upstream,
|
||||
":" INT "(" WS STR ")?" ")", handle_upstream),
|
||||
#endif
|
||||
/* loglevel */
|
||||
STDCONF (loglevel, "(critical|error|warning|notice|connect|info)",
|
||||
STDCONF (loglevel, "([Cc]ritical|[Ee]rror|[Ww]arning|[Nn]otice|[Cc]onnect|[Ii]nfo)",
|
||||
handle_loglevel)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user