]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: cfgparse: Always check the section position
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 18 Nov 2022 14:46:06 +0000 (15:46 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 18 Nov 2022 15:03:45 +0000 (16:03 +0100)
commit037e3f87359dcf0e00c012748d5377690acfbdcc
treec6683ba9fae870c41feeb4cbdc5d736d3472bc55
parent0909f62266df1f023c2c373f0984a68acacba2a3
MINOR: cfgparse: Always check the section position

In diag mode, the section position is checked and a warning is emitted if a
global section is defined after any non-global one. Now, this check is
always performed. But the warning is still only emitted in diag mode. In
addition, the result of this check is now stored in a global variable, to be
used from anywhere.

The aim of this patch is to be able to restrict usage of some global
directives to the very first global sections. It will be useful to avoid
undefined behaviors. Indeed, some config parts may depend on global settings
and it is a problem if these settings are changed after.
include/haproxy/cfgparse.h
src/cfgparse.c