Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sysutils/syslog-ng: Update to 3.37.1
Update to 3.37.1 and apply a number of other fixes supplied by our upstream that didn't make it into the release. Patch was created and tested by our upstream representative Peter Czanik. Submitted by: Peter Czanik (CzP) <peter.czanik@oneidentity.com> Balabit (a OneIdentity company) / syslog-ng upstream
- Loading branch information
Showing
10 changed files
with
150 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
TIMESTAMP = 1646416310 | ||
SHA256 (syslog-ng-3.36.1.tar.gz) = 90a25c9767fe749db50f118ddfc92ec71399763d2ecd5ad4f11ff5eea049e60b | ||
SIZE (syslog-ng-3.36.1.tar.gz) = 5968598 | ||
TIMESTAMP = 1654593377 | ||
SHA256 (syslog-ng-3.37.1.tar.gz) = d67a320cb896cd5d62f24d9e1bec138847fa4618ae13a3946cae2b75c528ee14 | ||
SIZE (syslog-ng-3.37.1.tar.gz) = 6033219 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- lib/logmatcher.c.orig 2022-06-03 13:40:38 UTC | ||
+++ lib/logmatcher.c | ||
@@ -30,14 +30,6 @@ | ||
#include "compat/string.h" | ||
#include "compat/pcre.h" | ||
|
||
-static gboolean | ||
-_shall_set_values_indirectly(NVHandle value_handle) | ||
-{ | ||
- return value_handle != LM_V_NONE && | ||
- !log_msg_is_handle_macro(value_handle) && | ||
- !log_msg_is_handle_match(value_handle); | ||
-} | ||
- | ||
static void | ||
log_matcher_store_pattern(LogMatcher *self, const gchar *pattern) | ||
{ | ||
@@ -416,7 +408,9 @@ log_matcher_pcre_re_feed_value(LogMatcherPcreRe *self, | ||
LogMatcherPcreMatchResult *result, | ||
gint begin_index, gint end_index) | ||
{ | ||
- gboolean indirect = _shall_set_values_indirectly(result->source_handle); | ||
+ gboolean indirect = result->source_handle != LM_V_NONE && | ||
+ log_msg_is_handle_settable_with_an_indirect_value(target_handle) && | ||
+ log_msg_is_handle_referencable_from_an_indirect_value(result->source_handle); | ||
|
||
if (target_handle == result->source_handle) | ||
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- lib/logmsg/logmsg.h.orig 2022-06-03 13:40:38 UTC | ||
+++ lib/logmsg/logmsg.h | ||
@@ -315,6 +315,25 @@ gboolean log_msg_is_handle_match(NVHandle handle); | ||
}) | ||
|
||
static inline gboolean | ||
+log_msg_is_handle_referencable_from_an_indirect_value(NVHandle handle) | ||
+{ | ||
+ if (handle == LM_V_NONE) | ||
+ return FALSE; | ||
+ | ||
+ /* macro values should not be referenced as they are dynamic, store the actual value instead */ | ||
+ if (log_msg_is_handle_macro(handle)) | ||
+ return FALSE; | ||
+ | ||
+ /* matches are pretty temporary, so we should not reference them, as the | ||
+ * next matching operation would overwrite them anyway */ | ||
+ | ||
+ if (log_msg_is_handle_match(handle)) | ||
+ return FALSE; | ||
+ | ||
+ return TRUE; | ||
+} | ||
+ | ||
+static inline gboolean | ||
log_msg_is_handle_settable_with_an_indirect_value(NVHandle handle) | ||
{ | ||
return (handle >= LM_V_MAX); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- libtest/msg_parse_lib.c.orig 2022-06-03 13:40:39 UTC | ||
+++ libtest/msg_parse_lib.c | ||
@@ -73,6 +73,20 @@ assert_log_message_value_unset_by_name(LogMessage *sel | ||
} | ||
|
||
void | ||
+assert_log_message_value_is_indirect(LogMessage *self, NVHandle handle) | ||
+{ | ||
+ NVEntry *entry = nv_table_get_entry(self->payload, handle, NULL, NULL); | ||
+ cr_assert(entry->indirect); | ||
+} | ||
+ | ||
+void | ||
+assert_log_message_value_is_direct(LogMessage *self, NVHandle handle) | ||
+{ | ||
+ NVEntry *entry = nv_table_get_entry(self->payload, handle, NULL, NULL); | ||
+ cr_assert(!entry->indirect); | ||
+} | ||
+ | ||
+void | ||
assert_log_message_value_and_type(LogMessage *self, NVHandle handle, | ||
const gchar *expected_value, LogMessageValueType expected_type) | ||
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- libtest/msg_parse_lib.h.orig 2022-06-03 13:40:39 UTC | ||
+++ libtest/msg_parse_lib.h | ||
@@ -34,6 +34,8 @@ void deinit_syslogformat_module(void); | ||
|
||
void assert_log_messages_equal(LogMessage *log_message_a, LogMessage *log_message_b); | ||
|
||
+void assert_log_message_value_is_direct(LogMessage *self, NVHandle handle); | ||
+void assert_log_message_value_is_indirect(LogMessage *self, NVHandle handle); | ||
void assert_log_message_value_unset(LogMessage *self, NVHandle handle); | ||
void assert_log_message_value_unset_by_name(LogMessage *self, const gchar *name); | ||
void assert_log_message_value(LogMessage *self, NVHandle handle, const gchar *expected_value); |
13 changes: 13 additions & 0 deletions
13
sysutils/syslog-ng/files/patch-modules_dbparser_pdbtool_pdbtool.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- modules/dbparser/pdbtool/pdbtool.c.orig 2022-06-03 13:40:39 UTC | ||
+++ modules/dbparser/pdbtool/pdbtool.c | ||
@@ -1282,9 +1282,9 @@ main(int argc, char *argv[]) | ||
ret = modes[mode].main(argc, argv); | ||
scratch_buffers_allocator_deinit(); | ||
scratch_buffers_global_deinit(); | ||
- stats_destroy(); | ||
log_tags_global_deinit(); | ||
log_msg_global_deinit(); | ||
+ stats_destroy(); | ||
|
||
cfg_free(configuration); | ||
configuration = NULL; |
25 changes: 25 additions & 0 deletions
25
sysutils/syslog-ng/files/patch-modules_regexp-parser_tests_test__regexp__parser.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- modules/regexp-parser/tests/test_regexp_parser.c.orig 2022-06-03 13:40:39 UTC | ||
+++ modules/regexp-parser/tests/test_regexp_parser.c | ||
@@ -84,6 +84,9 @@ ParameterizedTestParameters(regexp_parser, test_regexp | ||
{.msg = "foo", .pattern = "(?<key>foo)|(?<key>bar)", .prefix=".reg.", .expected_result = TRUE, .flags = LMF_DUPNAMES, .name = ".reg.key", .value = "foo"}, | ||
{.msg = "abc", .pattern = "Abc", .prefix="", .flags = 0, .expected_result = FALSE, .name = NULL, .value = NULL}, | ||
{.msg = "abc", .pattern = "(?<key>Abc)", .prefix="", .flags = LMF_ICASE, .expected_result = TRUE, .name = "key", .value = "abc"}, | ||
+ | ||
+ /* store into a builtin value */ | ||
+ {.msg = "abcdef", .pattern = "(?<PID>abc)", .prefix="", .flags = 0, .expected_result = TRUE, .name = "PID", .value = "abc"}, | ||
}; | ||
return cr_make_param_array(RegexpParserTestParam, parser_params, G_N_ELEMENTS(parser_params)); | ||
} | ||
@@ -92,9 +95,10 @@ ParameterizedTest(RegexpParserTestParam *parser_param, | ||
{ | ||
LogParser *p = _construct_regexp_parser(parser_param->prefix, parser_param->pattern, parser_param->flags); | ||
gboolean result; | ||
+ GError *e = NULL; | ||
|
||
- result = regexp_parser_compile(p, NULL); | ||
- cr_assert(result, "unexpected compiling failure; pattern=%s\n", parser_param->pattern); | ||
+ result = regexp_parser_compile(p, &e); | ||
+ cr_assert(result, "unexpected compiling failure; pattern=%s, error=%s\n", parser_param->pattern, e->message); | ||
|
||
LogMessage *msg = log_msg_new_empty(); | ||
log_msg_set_value(msg, LM_V_MESSAGE, parser_param->msg, -1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@version:3.36 | ||
@version:3.37 | ||
@include "scl.conf" | ||
|
||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters