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,
|
r = regcomp (directives[i].cre,
|
||||||
directives[i].re,
|
directives[i].re,
|
||||||
REG_EXTENDED | REG_ICASE | REG_NEWLINE);
|
REG_EXTENDED | REG_NEWLINE);
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -11,16 +11,16 @@
|
|||||||
#define SPACE "[ \\t]"
|
#define SPACE "[ \\t]"
|
||||||
#define WS SPACE "+"
|
#define WS SPACE "+"
|
||||||
#define STR "\"([^\"]+)\""
|
#define STR "\"([^\"]+)\""
|
||||||
#define BOOL "(yes|on|no|off)"
|
#define BOOL "([Yy][Ee][Ss]|[Oo][Nn]|[Nn][Oo]|[Oo][Ff][Ff])"
|
||||||
#define INT "(" DIGIT "+)"
|
#define INT "(" DIGIT "+)"
|
||||||
#define ALNUM "([-a-z0-9._]+)"
|
#define ALNUM "([-A-Za-z0-9._]+)"
|
||||||
#define USERNAME "([^:]*)"
|
#define USERNAME "([^:]*)"
|
||||||
#define PASSWORD "([^@]*)"
|
#define PASSWORD "([^@]*)"
|
||||||
#define IP "((([0-9]{1,3})\\.){3}[0-9]{1,3})"
|
#define IP "((([0-9]{1,3})\\.){3}[0-9]{1,3})"
|
||||||
#define IPMASK "(" IP "(/" DIGIT "+)?)"
|
#define IPMASK "(" IP "(/" DIGIT "+)?)"
|
||||||
#define IPV6 "(" \
|
#define IPV6 "(" \
|
||||||
"(([0-9a-f:]{2,39}))|" \
|
"(([0-9a-fA-F:]{2,39}))|" \
|
||||||
"(([0-9a-f:]{0,29}:" IP "))" \
|
"(([0-9a-fA-F:]{0,29}:" IP "))" \
|
||||||
")"
|
")"
|
||||||
|
|
||||||
#define IPV6MASK "(" IPV6 "(/" DIGIT "+)?)"
|
#define IPV6MASK "(" IPV6 "(/" DIGIT "+)?)"
|
||||||
@ -88,6 +88,6 @@ STDCONF (upstream,
|
|||||||
":" INT "(" WS STR ")?" ")", handle_upstream),
|
":" INT "(" WS STR ")?" ")", handle_upstream),
|
||||||
#endif
|
#endif
|
||||||
/* loglevel */
|
/* 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)
|
handle_loglevel)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user