Skip to content

Conversation

bazsi
Copy link
Collaborator

@bazsi bazsi commented Sep 2, 2023

In patterndb, you can add extra name-value pairs following a match with the tags. But the actual value of these name-value pairs were never validated against their types, meaning that an incorrect value could be set using this construct. This patch adds this validation as an extra step in "pdbtool test"

This fixes #4599

In patterndb, you can add extra name-value pairs following a match with
the <value> tags. But the actual value of these name-value pairs were
never validated against their types, meaning that an incorrect value
could be set using this construct. This patch adds this validation as
an extra step in "pdbtool test"

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
@bazsi
Copy link
Collaborator Author

bazsi commented Sep 2, 2023

This fixes #4599

@OverOrion OverOrion self-requested a review September 19, 2023 09:03
@OverOrion OverOrion added this to the syslog-ng 4.4 milestone Sep 19, 2023
Copy link
Collaborator

@OverOrion OverOrion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, checked it and works as expected!

Previously:

Setting value; name='more', value='foobar', type='int', msg='0x55ecd9502910', rcptid='0'
$ echo $?
0

Now:

Setting value; name='more', value='foobar', type='int', msg='0x561aaccae910', rcptid='0'
 Value type validation failed, ${more} did not validate: int64(foobar)
$ echo $?
2

@OverOrion OverOrion merged commit 371fe6e into syslog-ng:master Sep 19, 2023
OverOrion added a commit to OverOrion/syslog-ng that referenced this pull request Sep 19, 2023
Signed-off-by: Szilard Parrag <szilard.parrag@axoflow.com>
MrAnno added a commit that referenced this pull request Sep 20, 2023
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.

ptbtool fails to validate data type of added values
2 participants