summaryrefslogtreecommitdiff
path: root/dev-libs/liblognorm/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-libs/liblognorm/files
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-libs/liblognorm/files')
-rw-r--r--dev-libs/liblognorm/files/liblognorm-1.1.0-fix-enable-docs.patch41
-rw-r--r--dev-libs/liblognorm/files/liblognorm-1.1.2-issue_135.patch110
-rw-r--r--dev-libs/liblognorm/files/respect_CFLAGS.patch11
3 files changed, 162 insertions, 0 deletions
diff --git a/dev-libs/liblognorm/files/liblognorm-1.1.0-fix-enable-docs.patch b/dev-libs/liblognorm/files/liblognorm-1.1.0-fix-enable-docs.patch
new file mode 100644
index 000000000000..3bffe5ec74f0
--- /dev/null
+++ b/dev-libs/liblognorm/files/liblognorm-1.1.0-fix-enable-docs.patch
@@ -0,0 +1,41 @@
+[PATCH] Turn --disable-docs into --enable-docs and make it work
+
+See upstream issue #16 for more details.
+---
+ configure.ac | 22 ++++++++++++++--------
+ 1 file changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 547908c..26a2f96 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -96,15 +96,21 @@ fi
+
+ # docs (html) build settings
+ AC_ARG_ENABLE(docs,
+- [AS_HELP_STRING([--disable-docs],[Disable building HTML docs (requires Sphinx)])],
+- [enable_docs="no"],
+- [enable_docs="yes"]
++ [AS_HELP_STRING([--enable-docs],[Enable building HTML docs (requires Sphinx) @<:@default=no@:>@])],
++ [case "${enableval}" in
++ yes) enable_docs="yes" ;;
++ no) enable_docs="no" ;;
++ *) AC_MSG_ERROR(bad value ${enableval} for --enable-docs) ;;
++ esac],
++ [enable_docs="no"]
+ )
+-AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build sphinx-build3 sphinx-build2], [no])
+-AS_IF([test "$enable_docs" = "yes" -a "x$SPHINXBUILD" = xno],
+- [AC_MSG_ERROR([sphinx-build is required to build documentation, install it or try --disable-docs])]
+-)
+-AM_CONDITIONAL([ENABLE_DOCS], [test "$enable_docs" = yes])
++if test "$enable_docs" = "yes"; then
++ AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build sphinx-build3 sphinx-build2], [no])
++ if test "$SPHINXBUILD" = "no"; then
++ AC_MSG_ERROR([sphinx-build is required to build documentation, install it or try --disable-docs])
++ fi
++fi
++AM_CONDITIONAL([ENABLE_DOCS], [test "$enable_docs" = "yes"])
+
+ AC_ARG_ENABLE(testbench,
+ [AS_HELP_STRING([--enable-testbench],[testbench enabled @<:@default=no@:>@])],
diff --git a/dev-libs/liblognorm/files/liblognorm-1.1.2-issue_135.patch b/dev-libs/liblognorm/files/liblognorm-1.1.2-issue_135.patch
new file mode 100644
index 000000000000..4b4a063cf180
--- /dev/null
+++ b/dev-libs/liblognorm/files/liblognorm-1.1.2-issue_135.patch
@@ -0,0 +1,110 @@
+From 4b35ca1e6fff50f47eb5419b879b287f49dcf1d8 Mon Sep 17 00:00:00 2001
+From: Rainer Gerhards <rgerhards@adiscon.com>
+Date: Mon, 24 Aug 2015 09:05:52 +0200
+Subject: [PATCH] "fix": process last line if it misses the terminating LF
+
+This problem occurs with the very last line of a rulebase (at EOF).
+If it is not properly terminated (LF missing), it is silently ignored.
+Previous versions did obviously process lines in this case. While
+technically this is invalid input, we can't outrule that such rulebases
+exist. For example, they do in the rsyslog testbench, which made
+us aware of the problem (see https://github.com/rsyslog/rsyslog/issues/489 ).
+
+I think the proper way of addressing this is to process such lines without
+termination, as many other tools do as well.
+
+closes https://github.com/rsyslog/liblognorm/issues/135
+---
+ src/samp.c | 5 ++++-
+ tests/Makefile.am | 2 ++
+ tests/field_mac48.sh | 1 -
+ tests/missing_line_ending.rb | 1 +
+ tests/missing_line_ending.sh | 25 +++++++++++++++++++++++++
+ 5 files changed, 32 insertions(+), 2 deletions(-)
+ create mode 100644 tests/missing_line_ending.rb
+ create mode 100755 tests/missing_line_ending.sh
+
+diff --git a/src/samp.c b/src/samp.c
+index ef57047..0a9ae0a 100644
+--- a/src/samp.c
++++ b/src/samp.c
+@@ -801,7 +801,10 @@ ln_sampRead(ln_ctx ctx, FILE *const __restrict__ repo, int *const __restrict__ i
+ int c = fgetc(repo);
+ if(c == EOF) {
+ *isEof = 1;
+- goto done;
++ if(i == 0)
++ goto done;
++ else
++ done = 1; /* last line missing LF, still process it! */
+ } else if(c == '\n') {
+ ++linenbr;
+ if(!inParser && i != 0)
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index a3a3842..cfcf010 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -13,6 +13,7 @@ user_test_LDFLAGS = -no-install
+ TESTS_SHELLSCRIPTS = \
+ parser_whitespace.sh \
+ parser_LF.sh \
++ missing_line_ending.sh \
+ field_hexnumber.sh \
+ field_mac48.sh \
+ field_name_value.sh \
+@@ -54,6 +55,7 @@ REGEXP_TESTS = \
+ field_regex_while_regex_support_is_disabled.sh
+
+ EXTRA_DIST = exec.sh \
++ missing_line_ending.rb \
+ $(TESTS_SHELLSCRIPTS) \
+ $(REGEXP_TESTS) \
+ $(json_eq_self_sources) \
+diff --git a/tests/field_mac48.sh b/tests/field_mac48.sh
+index bd2898e..0f17166 100755
+--- a/tests/field_mac48.sh
++++ b/tests/field_mac48.sh
+@@ -21,4 +21,3 @@ assert_output_json_eq '{ "originalmsg": "f0:f6:1c:xf:cc:a2", "unparsed-data": "f
+
+
+ cleanup_tmp_files
+-
+diff --git a/tests/missing_line_ending.rb b/tests/missing_line_ending.rb
+new file mode 100644
+index 0000000..b252483
+--- /dev/null
++++ b/tests/missing_line_ending.rb
+@@ -0,0 +1 @@
++rule=:%field:mac48%
+\ No newline at end of file
+diff --git a/tests/missing_line_ending.sh b/tests/missing_line_ending.sh
+new file mode 100755
+index 0000000..18f4d2c
+--- /dev/null
++++ b/tests/missing_line_ending.sh
+@@ -0,0 +1,25 @@
++# added 2015-05-05 by Rainer Gerhards
++# This file is part of the liblognorm project, released under ASL 2.0
++. $srcdir/exec.sh
++
++test_def $0 "dmac48 syntax"
++# we need to use a canned file, as we cannot easily reproduce the
++# malformed lines
++cp missing_line_ending.rb $(rulebase_file_name)
++
++execute 'f0:f6:1c:5f:cc:a2'
++assert_output_json_eq '{"field": "f0:f6:1c:5f:cc:a2"}'
++
++execute 'f0-f6-1c-5f-cc-a2'
++assert_output_json_eq '{"field": "f0-f6-1c-5f-cc-a2"}'
++
++# things that need to NOT match
++
++execute 'f0-f6:1c:5f:cc-a2'
++assert_output_json_eq '{ "originalmsg": "f0-f6:1c:5f:cc-a2", "unparsed-data": "f0-f6:1c:5f:cc-a2" }'
++
++execute 'f0:f6:1c:xf:cc:a2'
++assert_output_json_eq '{ "originalmsg": "f0:f6:1c:xf:cc:a2", "unparsed-data": "f0:f6:1c:xf:cc:a2" }'
++
++
++#cleanup_tmp_files
diff --git a/dev-libs/liblognorm/files/respect_CFLAGS.patch b/dev-libs/liblognorm/files/respect_CFLAGS.patch
new file mode 100644
index 000000000000..6e8d28099ee9
--- /dev/null
+++ b/dev-libs/liblognorm/files/respect_CFLAGS.patch
@@ -0,0 +1,11 @@
+--- configure.ac.new 2014-03-20 10:56:14.777901140 +0200
++++ configure.ac 2014-03-20 10:56:50.154143106 +0200
+@@ -12,7 +12,7 @@
+ AC_PROG_CC
+ AM_PROG_CC_C_O
+ if test "$GCC" = "yes"
+-then CFLAGS="$CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g"
++then CFLAGS="$CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute"
+ fi
+
+ AC_PROG_LIBTOOL