Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cfg: fix config-version incosistencies #5145

Merged
merged 2 commits into from
Sep 30, 2024

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 <laszlo.varady@anno.io>
Signed-off-by: Hofi <hofione@gmail.com>
@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 <laszlo.varady@anno.io>
HofiOne pushed a commit to HofiOne/syslog-ng that referenced this pull request Sep 30, 2024
Signed-off-by: László Várady <laszlo.varady@anno.io>
Signed-off-by: Hofi <hofione@gmail.com>
@HofiOne HofiOne force-pushed the fix-no-version-inconsistency branch from 0652c93 to b41348d Compare September 30, 2024 09:53
Signed-off-by: Hofi <hofione@gmail.com>
@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
25 checks passed
@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