]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: config: check the proper variable when parsing log minlvl
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Jan 2013 23:31:24 +0000 (00:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2013 15:19:18 +0000 (16:19 +0100)
logsrv->minlvl gets the numeric log level from the equivalent string.
Upon error, ->level was checked due to a wrong copy-paste. The effect
is that a wrong name will silently be ignored and due to minlvl=-1,
will act as if the option was not set.

No backport is needed, this is 1.5-specific.

Reported-by: Dinko Korunic <dkorunic@reflected.net>
src/cfgparse.c

index 718664c0f5e3431774d5a224bc0542eae15f6c17..949114792faf97a07e8ae2acaca80dcba1304873 100644 (file)
@@ -4785,7 +4785,7 @@ stats_error_parsing:
                        logsrv->minlvl = 0; /* limit syslog level to this level (emerg) */
                        if (*(args[4])) {
                                logsrv->minlvl = get_log_level(args[4]);
-                               if (logsrv->level < 0) {
+                               if (logsrv->minlvl < 0) {
                                        Alert("parsing [%s:%d] : unknown optional minimum log level '%s'\n", file, linenum, args[4]);
                                        err_code |= ERR_ALERT | ERR_FATAL;
                                        goto out;