Skip to content

cfg: fix config-version incosistencies#5145

Merged
HofiOne merged 2 commits intosyslog-ng:masterfrom
HofiOne:fix-no-version-inconsistency
Sep 30, 2024
Merged

cfg: fix config-version incosistencies#5145
HofiOne merged 2 commits intosyslog-ng:masterfrom
HofiOne:fix-no-version-inconsistency

Conversation

@HofiOne
Copy link
Collaborator

@HofiOne HofiOne commented Sep 30, 2024

Template functions, for example, are constructed right when syslog-ng parses the configuration, so the @Version directive must be placed at the top of the config file to make it consistent.

This patch fixes the implicit "current version" mechanism (when no @Version is specified) by moving it back to the lexer, and warns the user about misplaced or redefined @Version directives.

Reproducer: Place a template("$(format-json asd=asd)" anywhere in the configuration without an explicit @Version declaration or place the @Version declaration after the config block containing the mentioned template. A compatibility warning will be produced and syslog-ng will operate in half-"compat mode".

Backport of #312 by @MrAnno

HofiOne pushed a commit to HofiOne/syslog-ng that referenced this pull request Sep 30, 2024
Signed-off-by: László Várady <[email protected]>
Signed-off-by: Hofi <[email protected]>
@HofiOne HofiOne force-pushed the fix-no-version-inconsistency branch from c17babf to 0652c93 Compare September 30, 2024 09:43
@HofiOne HofiOne marked this pull request as ready for review September 30, 2024 09:45
Template functions, for example, are constructed right when syslog-ng
parses the configuration, so the `@version` directive must be placed at
the top of the config file to make it consistent.

This patch fixes the implicit "current version" mechanism (when no
`@version` is specified) by moving it back to the lexer, and warns the
user about misplaced or redefined `@version` directives.

Signed-off-by: László Várady <[email protected]>
HofiOne pushed a commit to HofiOne/syslog-ng that referenced this pull request Sep 30, 2024
Signed-off-by: László Várady <[email protected]>
Signed-off-by: Hofi <[email protected]>
@HofiOne HofiOne force-pushed the fix-no-version-inconsistency branch from 0652c93 to b41348d Compare September 30, 2024 09:53
@HofiOne HofiOne force-pushed the fix-no-version-inconsistency branch from b41348d to e03bbe7 Compare September 30, 2024 10:22
@HofiOne HofiOne merged commit 9967654 into syslog-ng:master Sep 30, 2024
@HofiOne HofiOne deleted the fix-no-version-inconsistency branch September 30, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants