Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8629f464db | ||
|
8108ce0d9d | ||
|
f552242505 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
syslog-ng_3.1.1.tar.gz
|
||||
/syslog-ng_3.1.4.tar.gz
|
||||
|
@ -1,6 +0,0 @@
|
||||
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
|
||||
sharedscripts
|
||||
postrotate
|
||||
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
|
||||
endscript
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
SYSLOGNG_PID="/var/run/syslog-ng.pid"
|
||||
SYSLOGNG_OPTIONS="-p $SYSLOGNG_PID"
|
||||
SYSLOGNG_COMPAT_PID="/var/run/rsyslogd.pid"
|
2
sources
2
sources
@ -1 +1 @@
|
||||
4fdc64ff0ad964dc811a746228609412 syslog-ng_3.1.1.tar.gz
|
||||
48e6646d12d30c655f4391b970d61f56 syslog-ng_3.1.4.tar.gz
|
||||
|
@ -1,7 +0,0 @@
|
||||
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
|
||||
sharedscripts
|
||||
postrotate
|
||||
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
|
||||
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
|
||||
endscript
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
|
||||
sharedscripts
|
||||
postrotate
|
||||
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
|
||||
endscript
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
SYSLOGNG_PID="/var/run/syslog-ng.pid"
|
||||
SYSLOGNG_OPTIONS="-p $SYSLOGNG_PID"
|
||||
SYSLOGNG_COMPAT_PID="/var/run/syslogd.pid"
|
@ -1,12 +0,0 @@
|
||||
diff -uNr syslog-ng-2.1.4.orig/configure.in syslog-ng-2.1.4/configure.in
|
||||
--- syslog-ng-2.1.4.orig/configure.in 2008-11-19 05:00:11.000000000 -0800
|
||||
+++ syslog-ng-2.1.4/configure.in 2009-08-20 19:27:52.000000000 -0700
|
||||
@@ -466,7 +466,7 @@
|
||||
elif test "x$enable_static_linking" = "xyes"; then
|
||||
DEPS_LIBS="-static $LIBS $LEXLIB $GLIB_LIBS $EVTLOG_LIBS $LIBNET_LIBS $LIBWRAP_LIBS $LIBDBI_LIBS"
|
||||
else
|
||||
- DEPS_LIBS="$LIBS $LD_START_STATIC $LEXLIB $GLIB_LIBS $EVTLOG_LIBS $LIBNET_LIBS $LIBWRAP_LIBS $LD_END_STATIC $LIBDBI_LIBS $DL_LIBS"
|
||||
+ DEPS_LIBS="$LIBS $LD_START_STATIC $LEXLIB $GLIB_LIBS $EVTLOG_LIBS $LIBWRAP_LIBS $LD_END_STATIC $LIBNET_LIBS $LIBDBI_LIBS $DL_LIBS"
|
||||
fi
|
||||
LIBS="$DEPS_LIBS"
|
||||
YFLAGS="-d"
|
19
syslog-ng-3.1.4-disable-sql-and-ssl-tests.patch
Normal file
19
syslog-ng-3.1.4-disable-sql-and-ssl-tests.patch
Normal file
@ -0,0 +1,19 @@
|
||||
diff -ruN syslog-ng-3.1.4/tests/functional/func_test.py syslog-ng-3.1.4-modified/tests/functional/func_test.py
|
||||
--- syslog-ng-3.1.4/tests/functional/func_test.py 2009-11-21 15:48:09.000000000 +0000
|
||||
+++ syslog-ng-3.1.4-modified/tests/functional/func_test.py 2011-06-17 03:44:18.057873606 +0100
|
||||
@@ -60,11 +60,12 @@
|
||||
# import test modules
|
||||
import test_file_source
|
||||
import test_filters
|
||||
-import test_input_drivers
|
||||
+#import test_input_drivers
|
||||
import test_performance
|
||||
-import test_sql
|
||||
+#import test_sql
|
||||
|
||||
-tests = (test_input_drivers, test_sql, test_file_source, test_filters, test_performance)
|
||||
+#tests = (test_input_drivers, test_sql, test_file_source, test_filters, test_performance)
|
||||
+tests = (test_file_source, test_filters, test_performance)
|
||||
|
||||
init_env()
|
||||
seed_rnd()
|
271
syslog-ng-3.1.4-pcre-dos.patch
Normal file
271
syslog-ng-3.1.4-pcre-dos.patch
Normal file
@ -0,0 +1,271 @@
|
||||
commit 35de55e53dd653c50c8da5daf41a99ab22e7e8aa
|
||||
Author: Balazs Scheidler <bazsi@balabit.hu>
|
||||
Date: Tue May 3 20:54:53 2011 +0200
|
||||
|
||||
pcre: fixed a potential resource hogging infinite loop when an error occurs
|
||||
|
||||
Any kind of PCRE error case would cause an infinite loop, when the
|
||||
"global" flag is present and pcre returns an error code.
|
||||
|
||||
The reported problem is that with PCRE 8.12 we indeed get such an error
|
||||
while doing a global replace.
|
||||
|
||||
This patch also reworks the way PCRE based replacements are made, that code
|
||||
was hairy, and I just hope this one is one bit less so. One performance
|
||||
related change also made it that improves the speed pcre replacements,
|
||||
which previously zeroed out a 3k array unconditionally in every invocation.
|
||||
|
||||
Also added some additional testcases to be sure I didn't break anything.
|
||||
|
||||
Reported-By: Micah Anderson <micah@riseup.net>
|
||||
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
|
||||
|
||||
diff --git a/src/logmatcher.c b/src/logmatcher.c
|
||||
index 67b6c1b..6b70f13 100644
|
||||
--- a/src/logmatcher.c
|
||||
+++ b/src/logmatcher.c
|
||||
@@ -504,7 +504,6 @@ typedef struct _LogMatcherPcreRe
|
||||
pcre *pattern;
|
||||
pcre_extra *extra;
|
||||
gint match_options;
|
||||
- int start_offset;
|
||||
} LogMatcherPcreRe;
|
||||
|
||||
static gboolean
|
||||
@@ -623,29 +622,37 @@ static gboolean
|
||||
log_matcher_pcre_re_match(LogMatcher *s, LogMessage *msg, gint value_handle, const gchar *value, gssize value_len)
|
||||
{
|
||||
LogMatcherPcreRe *self = (LogMatcherPcreRe *) s;
|
||||
- int matches[RE_MAX_MATCHES * 3];
|
||||
+ gint *matches;
|
||||
+ gsize matches_size;
|
||||
+ gint num_matches;
|
||||
gint rc;
|
||||
|
||||
- if(value_len == -1)
|
||||
+ if (value_len == -1)
|
||||
value_len = strlen(value);
|
||||
|
||||
- self->start_offset = 0;
|
||||
- rc = pcre_exec(self->pattern, self->extra, value, value_len, self->start_offset, self->match_options, matches, (RE_MAX_MATCHES * 3));
|
||||
+ if (pcre_fullinfo(self->pattern, self->extra, PCRE_INFO_CAPTURECOUNT, &num_matches) < 0)
|
||||
+ g_assert_not_reached();
|
||||
+ if (num_matches > RE_MAX_MATCHES)
|
||||
+ num_matches = RE_MAX_MATCHES;
|
||||
+
|
||||
+ matches_size = 3 * (num_matches + 1);
|
||||
+ matches = g_alloca(matches_size * sizeof(gint));
|
||||
+
|
||||
+ rc = pcre_exec(self->pattern, self->extra,
|
||||
+ value, value_len, 0, self->match_options, matches, matches_size);
|
||||
if (rc < 0)
|
||||
{
|
||||
switch (rc)
|
||||
{
|
||||
- case PCRE_ERROR_NOMATCH:
|
||||
- /*
|
||||
- msg_debug("No match", NULL);
|
||||
- */
|
||||
+ case PCRE_ERROR_NOMATCH:
|
||||
break;
|
||||
+
|
||||
+ default:
|
||||
/* Handle other special cases */
|
||||
- default:
|
||||
- msg_error("Error while matching regexp",
|
||||
- evt_tag_int("error_code",rc),
|
||||
- NULL);
|
||||
- break;
|
||||
+ msg_error("Error while matching regexp",
|
||||
+ evt_tag_int("error_code", rc),
|
||||
+ NULL);
|
||||
+ break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -668,78 +675,120 @@ static gchar *
|
||||
log_matcher_pcre_re_replace(LogMatcher *s, LogMessage *msg, gint value_handle, const gchar *value, gssize value_len, LogTemplate *replacement, gssize *new_length)
|
||||
{
|
||||
LogMatcherPcreRe *self = (LogMatcherPcreRe *) s;
|
||||
- int matches[RE_MAX_MATCHES * 3];
|
||||
- gint rc;
|
||||
- gboolean first_round = TRUE;
|
||||
GString *new_value = NULL;
|
||||
- gssize last_offset = 0;
|
||||
- gint options = 0;
|
||||
+ gint *matches;
|
||||
+ gsize matches_size;
|
||||
+ gint num_matches;
|
||||
+ gint rc;
|
||||
+ gint start_offset, last_offset;
|
||||
+ gint options;
|
||||
+ gboolean last_match_was_empty;
|
||||
+
|
||||
+ if (pcre_fullinfo(self->pattern, self->extra, PCRE_INFO_CAPTURECOUNT, &num_matches) < 0)
|
||||
+ g_assert_not_reached();
|
||||
+ if (num_matches > RE_MAX_MATCHES)
|
||||
+ num_matches = RE_MAX_MATCHES;
|
||||
+
|
||||
+ matches_size = 3 * (num_matches + 1);
|
||||
+ matches = g_alloca(matches_size * sizeof(gint));
|
||||
+
|
||||
+ /* we need zero initialized offsets for the last match as the
|
||||
+ * algorithm tries uses that as the base position */
|
||||
|
||||
- memset(matches, 0, sizeof(matches));
|
||||
+ matches[0] = matches[1] = matches[2] = 0;
|
||||
|
||||
if (value_len == -1)
|
||||
value_len = strlen(value);
|
||||
|
||||
+ last_offset = start_offset = 0;
|
||||
+ last_match_was_empty = FALSE;
|
||||
do
|
||||
{
|
||||
- options = 0;
|
||||
- self->start_offset = matches[1]; /* Start at end of previous match 0 on the first iteration*/
|
||||
-
|
||||
- /* If the previous match was for an empty string, we are finished if we are
|
||||
- at the end of the subject. Otherwise, arrange to run another match at the
|
||||
- same point to see if a non-empty match can be found.
|
||||
+ /* loop over the string, replacing one occurence at a time. */
|
||||
+
|
||||
+ /* NOTE: zero length matches need special care, as we could spin
|
||||
+ * forever otherwise (since the current position wouldn't be
|
||||
+ * advanced).
|
||||
+ *
|
||||
+ * A zero-length match can be as simple as "a*" which will be
|
||||
+ * returned unless PCRE_NOTEMPTY is specified.
|
||||
+ *
|
||||
+ * By supporting zero-length matches, we basically make it
|
||||
+ * possible to insert replacement between each incoming
|
||||
+ * character.
|
||||
+ *
|
||||
+ * For example:
|
||||
+ * pattern: a*
|
||||
+ * replacement: #
|
||||
+ * input: message
|
||||
+ * result: #m#e#s#s#a#g#e#
|
||||
+ *
|
||||
+ * This mimics Perl behaviour.
|
||||
*/
|
||||
|
||||
- if (matches[0] == matches[1] && !first_round)
|
||||
+ if (last_match_was_empty)
|
||||
{
|
||||
- if (matches[0] == value_len)
|
||||
- break;
|
||||
+ /* Otherwise, arrange to run another match at the same point
|
||||
+ * to see if a non-empty match can be found.
|
||||
+ */
|
||||
+
|
||||
options = PCRE_NOTEMPTY | PCRE_ANCHORED;
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
+ options = 0;
|
||||
+ }
|
||||
|
||||
- rc = pcre_exec(self->pattern, self->extra, value, value_len, self->start_offset/*start offset*/, (self->match_options | options) , matches, (RE_MAX_MATCHES * 3) );
|
||||
- if (rc < 0)
|
||||
+ rc = pcre_exec(self->pattern, self->extra,
|
||||
+ value, value_len,
|
||||
+ start_offset, (self->match_options | options), matches, matches_size);
|
||||
+ if (rc < 0 && rc != PCRE_ERROR_NOMATCH)
|
||||
{
|
||||
- if(rc == PCRE_ERROR_NOMATCH)
|
||||
- {
|
||||
- /* msg_debug("No match", NULL); */
|
||||
- if(!first_round)
|
||||
- {
|
||||
- if (options == 0)
|
||||
- break;
|
||||
- else
|
||||
- matches[1] = self->start_offset + 1;
|
||||
- continue; /* Go round the loop again */
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- /* Handle other special cases */
|
||||
- msg_error("Error while matching regexp",
|
||||
- evt_tag_int("error_code",rc),
|
||||
- NULL);
|
||||
- }
|
||||
+ msg_error("Error while matching regexp",
|
||||
+ evt_tag_int("error_code", rc),
|
||||
+ NULL);
|
||||
+ break;
|
||||
}
|
||||
- else if (rc == 0)
|
||||
+ else if (rc < 0)
|
||||
{
|
||||
- msg_error("Error while storing matching substrings", NULL);
|
||||
+ if ((options & PCRE_NOTEMPTY) == 0)
|
||||
+ {
|
||||
+ /* we didn't match, even when we permitted to match the
|
||||
+ * empty string. Nothing to find here, bail out */
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* we didn't match, quite possibly because the empty match
|
||||
+ * was not permitted. Skip one character in order to avoid
|
||||
+ * infinite loop over the same zero-length match. */
|
||||
+
|
||||
+ start_offset = start_offset + 1;
|
||||
+ /* FIXME: handle complex sequences like utf8 and newline characters */
|
||||
+ last_match_was_empty = FALSE;
|
||||
+ continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
+ /* if the output array was too small, truncate the number of
|
||||
+ captures to RE_MAX_MATCHES */
|
||||
+
|
||||
+ if (rc == 0)
|
||||
+ rc = matches_size / 3;
|
||||
+
|
||||
log_matcher_pcre_re_feed_backrefs(s, msg, value_handle, matches, rc, value);
|
||||
log_matcher_pcre_re_feed_named_substrings(s, msg, matches, value);
|
||||
|
||||
if (!new_value)
|
||||
new_value = g_string_sized_new(value_len);
|
||||
- /* literal */
|
||||
+ /* append non-matching portion */
|
||||
g_string_append_len(new_value, &value[last_offset], matches[0] - last_offset);
|
||||
/* replacement */
|
||||
log_template_append_format(replacement, msg, 0, TS_FMT_BSD, NULL, 0, 0, new_value);
|
||||
- last_offset = matches[1];
|
||||
+ last_match_was_empty = (matches[0] == matches[1]);
|
||||
+ start_offset = last_offset = matches[1];
|
||||
}
|
||||
- first_round = FALSE;
|
||||
}
|
||||
- while (TRUE && (self->super.flags & LMF_GLOBAL));
|
||||
+ while (self->super.flags & LMF_GLOBAL && start_offset < value_len);
|
||||
|
||||
if (new_value)
|
||||
{
|
||||
diff --git a/tests/unit/test_matcher.c b/tests/unit/test_matcher.c
|
||||
index 3df98e5..95866b3 100644
|
||||
--- a/tests/unit/test_matcher.c
|
||||
+++ b/tests/unit/test_matcher.c
|
||||
@@ -144,9 +144,18 @@ main()
|
||||
/* empty match with global flag*/
|
||||
testcase_replace("<155>2006-02-11T10:34:56+01:00 bzorp syslog-ng[23323]: aa bb", 0, "c*", "#", "#a#a# #b#b#", LMF_GLOBAL, log_matcher_pcre_re_new());
|
||||
testcase_replace("<155>2006-02-11T10:34:56+01:00 bzorp syslog-ng[23323]: aa bb", 0, "a*", "?", "?? ?b?b?", LMF_GLOBAL, log_matcher_pcre_re_new());
|
||||
+ testcase_replace("<155>2006-02-11T10:34:56+01:00 bzorp syslog-ng[23323]: aa", 0, "aa|b*", "@", "@@", LMF_GLOBAL, log_matcher_pcre_re_new());
|
||||
+ testcase_replace("<155>2006-02-11T10:34:56+01:00 bzorp syslog-ng[23323]: aa", 0, "aa|b*", "@", "@", 0, log_matcher_pcre_re_new());
|
||||
+ testcase_replace("<155>2006-02-11T10:34:56+01:00 bzorp syslog-ng[23323]: aa", 0, "b*|aa", "@", "@@@", LMF_GLOBAL, log_matcher_pcre_re_new());
|
||||
+ testcase_replace("<155>2006-02-11T10:34:56+01:00 bzorp syslog-ng[23323]: aa", 0, "b*|aa", "@", "@aa", 0, log_matcher_pcre_re_new());
|
||||
|
||||
testcase_replace("<155>2006-02-11T10:34:56+01:00 bzorp syslog-ng[23323]: wikiwiki", 0, "wi", "", "kiki", LMF_GLOBAL, log_matcher_pcre_re_new());
|
||||
testcase_replace("<155>2006-02-11T10:34:56+01:00 bzorp syslog-ng[23323]: wikiwiki", 0, "wi", "kuku", "kukukikukuki", LMF_GLOBAL, log_matcher_pcre_re_new());
|
||||
+
|
||||
+ /* this tests a pcre 8.12 incompatibility */
|
||||
+
|
||||
+ testcase_replace("<155>2006-02-11T10:34:56+01:00 bzorp syslog-ng[23323]: wikiwiki", 0, "([[:digit:]]{1,3}\\.){3}[[:digit:]]{1,3}", "foo", "wikiwiki", LMF_GLOBAL, log_matcher_pcre_re_new());
|
||||
+
|
||||
#endif
|
||||
|
||||
return 0;
|
158
syslog-ng.spec
158
syslog-ng.spec
@ -1,57 +1,40 @@
|
||||
%{?_with_spoofsource:%define spoofsource 1}
|
||||
%define evtlog_ver 0.2.7-2
|
||||
%define evtlog_ver 0.2.12
|
||||
|
||||
%define _sbindir /sbin
|
||||
%define _localstatedir /var/lib/syslog-ng
|
||||
|
||||
Name: syslog-ng
|
||||
Version: 3.1.1
|
||||
Release: 1%{?dist}
|
||||
Version: 3.1.4
|
||||
Release: 4%{?dist}
|
||||
Summary: Next-generation syslog server
|
||||
|
||||
Group: System Environment/Daemons
|
||||
License: GPLv2+
|
||||
Url: http://www.balabit.com/products/syslog_ng/
|
||||
Source0: http://www.balabit.com/downloads/files/syslog-ng/sources/3.1.1/src/%{name}_%{version}.tar.gz
|
||||
Source0: http://www.balabit.com/downloads/files?path=/syslog-ng/sources/%{version}/source/%{name}_%{version}.tar.gz
|
||||
Source1: syslog-ng.conf
|
||||
Source2: syslog-ng.init.d
|
||||
Source10: sysklogd-syslog-ng.sysconfig
|
||||
Source11: sysklogd-1.4.1-logrotate.d-syslog.log
|
||||
Source12: sysklogd-1.4.1-44-logrotate.d-syslog.log
|
||||
Source20: rsyslog-syslog-ng.sysconfig
|
||||
Source21: rsyslog-3.14.1-logrotate.d-rsyslog.log
|
||||
Source30: rsyslog-syslog-ng-fc10.sysconfig
|
||||
Source31: rsyslog-3.21.9-logrotate.d-rsyslog.log
|
||||
Source3: syslog-ng.sysconfig
|
||||
Source4: syslog-ng.logrotate
|
||||
|
||||
Patch0: syslog-ng-2.1.4-libnet.patch
|
||||
Patch0: syslog-ng-3.1.4-disable-sql-and-ssl-tests.patch
|
||||
Patch1: syslog-ng-3.1.4-pcre-dos.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildRequires: eventlog-devel >= %{evtlog_ver}
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: glib2-devel
|
||||
BuildRequires: pcre-devel
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: glib2-static
|
||||
%endif
|
||||
%if 0%{?rhel}
|
||||
BuildRequires: tcp_wrappers
|
||||
BuildRequires: eventlog-static >= %{evtlog_ver}
|
||||
BuildRequires: automake
|
||||
%else
|
||||
BuildRequires: eventlog-devel >= %{evtlog_ver}
|
||||
BuildRequires: glib2-devel >= 2.10.1
|
||||
BuildRequires: libnet-devel >= 1.1.4-3
|
||||
BuildRequires: pcre-devel >= 7.3
|
||||
BuildRequires: tcp_wrappers-devel
|
||||
%endif
|
||||
BuildRequires: libnet-devel
|
||||
|
||||
Requires: logrotate
|
||||
Requires(post): /sbin/chkconfig
|
||||
Requires(preun): /sbin/chkconfig
|
||||
Requires(preun): /sbin/service
|
||||
Requires(postun): /sbin/service
|
||||
|
||||
Provides: syslog
|
||||
%if 0%{?rhel} == 4
|
||||
# makes vixie-cron and initscripts happy
|
||||
Provides: sysklogd = 1.3.33-6
|
||||
%endif
|
||||
# merge separate syslog-vim package into one
|
||||
Provides: syslog-ng-vim = %{version}-%{release}
|
||||
Obsoletes: syslog-ng-vim < 2.0.8-1
|
||||
@ -68,56 +51,26 @@ ideal for firewalled environments.
|
||||
|
||||
|
||||
%prep
|
||||
%if 0%{?rhel}
|
||||
%patch0 -p1 -b .libnet
|
||||
%endif
|
||||
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
|
||||
# fix perl path
|
||||
%{__sed} -i 's|^#!/usr/local/bin/perl|#!%{__perl}|' contrib/relogger.pl
|
||||
|
||||
# force regeneration to avoid broken paths from upstream (#265221)
|
||||
touch src/cfg-grammar.c src/cfg-lex.c
|
||||
|
||||
%define logrotated_dst syslog
|
||||
%if 0%{?rhel}
|
||||
%if 0%{?rhel} <= 4
|
||||
%define sysconfig_src %{SOURCE10}
|
||||
%define logrotated_src %{SOURCE11}
|
||||
%endif
|
||||
%if 0%{?rhel} >= 5
|
||||
%define sysconfig_src %{SOURCE10}
|
||||
%define logrotated_src %{SOURCE12}
|
||||
%endif
|
||||
%endif
|
||||
%if 0%{?fedora}
|
||||
%if 0%{?fedora} <= 9
|
||||
%define sysconfig_src %{SOURCE20}
|
||||
%define logrotated_src %{SOURCE21}
|
||||
%endif
|
||||
%if 0%{?fedora} >= 10
|
||||
%define sysconfig_src %{SOURCE30}
|
||||
%define logrotated_src %{SOURCE31}
|
||||
%endif
|
||||
%endif
|
||||
# fix executable perms on contrib files
|
||||
%{__chmod} -c a-x contrib/syslog2ng
|
||||
|
||||
|
||||
%build
|
||||
%configure \
|
||||
--enable-ipv6 \
|
||||
--sysconfdir=%{_sysconfdir}/%{name} \
|
||||
--localstatedir=%{_sharedstatedir}/%{name} \
|
||||
--enable-ipv6 \
|
||||
--enable-tcp-wrapper \
|
||||
--enable-pcre \
|
||||
%if 0%{?spoofsource}
|
||||
--enable-spoof-source \
|
||||
%endif
|
||||
%if 0%{?rhel}
|
||||
--enable-mixed-linking
|
||||
%else
|
||||
--enable-dynamic-linking
|
||||
%endif
|
||||
|
||||
|
||||
make %{_smp_mflags}
|
||||
|
||||
@ -133,30 +86,27 @@ make DESTDIR=%{buildroot} install
|
||||
%{__install} -p -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/init.d/%{name}
|
||||
|
||||
%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
|
||||
%{__install} -p -m 644 %{sysconfig_src} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
|
||||
%{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
|
||||
|
||||
%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/logrotate.d
|
||||
%{__install} -p -m 644 %{logrotated_src} \
|
||||
%{buildroot}%{_sysconfdir}/logrotate.d/%{logrotated_dst}
|
||||
%{__install} -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/syslog
|
||||
|
||||
# make local state dir
|
||||
%{__install} -d -m 755 %{buildroot}/%{_localstatedir}
|
||||
%{__install} -d -m 755 %{buildroot}/%{_sharedstatedir}/%{name}
|
||||
|
||||
# create the patterndb.d configuration directory (should be fixed in 3.2.4)
|
||||
%{__install} -d -m 755 %{buildroot}/%{_sysconfdir}/%{name}/patterndb.d
|
||||
|
||||
|
||||
# fix authors file
|
||||
/usr/bin/iconv -f iso8859-1 -t utf-8 AUTHORS > AUTHORS.conv && \
|
||||
%{__mv} -f AUTHORS.conv AUTHORS
|
||||
|
||||
# fix executable perms on contrib files
|
||||
%{__chmod} -x contrib/relogger.pl
|
||||
%{__chmod} -x contrib/syslog2ng
|
||||
|
||||
# fix script interpreter
|
||||
sed -i 's/\/usr\/local\/bin\/perl/\/usr\/bin\/perl/' contrib/relogger.pl
|
||||
|
||||
# install vim files
|
||||
%{__install} -d -m 755 %{buildroot}%{_datadir}/%{name}
|
||||
%{__install} -p -m 644 contrib/syslog-ng.vim %{buildroot}%{_datadir}/%{name}
|
||||
for vimver in 63 64 70 71 ; do
|
||||
for vimver in 70 71 72 73 ; do
|
||||
%{__install} -d -m 755 %{buildroot}%{_datadir}/vim/vim$vimver/syntax
|
||||
cd %{buildroot}%{_datadir}/vim/vim$vimver/syntax
|
||||
ln -s ../../../%{name}/syslog-ng.vim .
|
||||
@ -164,6 +114,10 @@ for vimver in 63 64 70 71 ; do
|
||||
done
|
||||
|
||||
|
||||
%check
|
||||
make check
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
@ -173,14 +127,16 @@ rm -rf %{buildroot}
|
||||
|
||||
|
||||
%preun
|
||||
if [ "$1" = 0 ]; then
|
||||
if [ $1 -eq 0 ] ; then
|
||||
# Package removal, not upgrade
|
||||
/sbin/service %{name} stop > /dev/null 2>&1
|
||||
/sbin/chkconfig --del %{name}
|
||||
fi
|
||||
|
||||
|
||||
%postun
|
||||
if [ "$1" -ge 1 ]; then
|
||||
if [ $1 -ge 1 ] ; then
|
||||
# Package upgrade, not uninstall
|
||||
/sbin/service %{name} condrestart >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
@ -206,23 +162,24 @@ if [ $1 = 1 ]; then
|
||||
fi
|
||||
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%defattr(-,root,root,-)
|
||||
%doc AUTHORS COPYING README ChangeLog NEWS
|
||||
%doc doc/security/*.txt
|
||||
%doc doc/examples/syslog-ng.conf.sample
|
||||
%doc contrib/{relogger.pl,syslog2ng,syslog-ng.conf.doc}
|
||||
%dir %{_sysconfdir}/%{name}
|
||||
%dir %{_sysconfdir}/%{name}/patterndb.d
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/%{logrotated_dst}
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/syslog
|
||||
%{_sysconfdir}/init.d/%{name}
|
||||
%dir %{_localstatedir}
|
||||
%dir %{_sharedstatedir}/%{name}
|
||||
%{_sbindir}/%{name}
|
||||
%{_sbindir}/syslog-ng-ctl
|
||||
%{_bindir}/loggen
|
||||
%{_bindir}/pdbtool
|
||||
%{_bindir}/update-patterndb
|
||||
%{_datadir}/%{name}
|
||||
%{_mandir}/man1/*
|
||||
%{_mandir}/man5/*
|
||||
@ -231,6 +188,34 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Jun 17 2011 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.1.4-4
|
||||
- Patch for CVE-2011-1951: syslog-ng-3.1.4-pcre-dos.patch (#709088)
|
||||
- Enabled the test suite
|
||||
|
||||
* Mon May 9 2011 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.1.4-3
|
||||
- Bumped the eventlog version to match the latest upstream version (0.2.12)
|
||||
- Overrided the default _localstatedir value (configure --localstatedir)
|
||||
(value hardcoded in update-patterndb)
|
||||
- Manually created the patterndb.d configuration directory (update-patterndb)
|
||||
(see also https://bugzilla.balabit.com/show_bug.cgi?id=119 comments >= 4)
|
||||
- Minor modifications of the %%post, %%preun and %%postun scripts
|
||||
- Corrected a couple of macro references in changelog entries (rpmlint)
|
||||
- Expanded tabs to spaces (also added a vim modeline)
|
||||
|
||||
* Mon Apr 25 2011 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.1.4-2
|
||||
- cleans the sysconfig and logrotate file mess (#651823 comments 17, 20 and 21)
|
||||
- add support for vim versions 72 and 73; drop support for versions 6.2 and 6.3
|
||||
- clean the spoofsource conditional logical: libnet resides in /lib{,64}
|
||||
since 2009
|
||||
|
||||
* Wed Apr 13 2011 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.1.4-1
|
||||
- update for syslog-ng 3.1.4
|
||||
- updated the source URL
|
||||
- versioned some of the build requirements
|
||||
- dropped the libnet patch (syslog-ng-2.1.4-libnet.patch)
|
||||
- dropped support for EPEL-4 and EPEL-5 (syslog-ng 3.x requires pcre >= 7.3)
|
||||
- new file: update-patterndb
|
||||
|
||||
* Sat Jul 24 2010 Doug Warner <silfreed@fedoraproject.org> - 3.1.1-1
|
||||
- update for syslog-ng 3.1.1
|
||||
- supports the new syslog protocol standards
|
||||
@ -469,7 +454,7 @@ fi
|
||||
|
||||
* Wed Apr 21 2004 Jose Pedro Oliveira <jpo at di.uminho.pt> 0:1.6.2-0.fdr.3
|
||||
- removed Conflits:
|
||||
- changed the %post and %preun scripts
|
||||
- changed the %%post and %%preun scripts
|
||||
- splitted Requires( ... , ... ) into Requires( ... )
|
||||
|
||||
* Fri Mar 5 2004 Jose Pedro Oliveira <jpo at di.uminho.pt> 0:1.6.2-0.fdr.2
|
||||
@ -510,7 +495,7 @@ fi
|
||||
|
||||
* Sat Apr 12 2003 Jose Pedro Oliveira <jpo at di.uminho.pt> 1.6.0rc2 snapshot
|
||||
- Reorganized specfile
|
||||
- Corrected the scripts (%post, %postun, and %preun)
|
||||
- Corrected the scripts (%%post, %%postun, and %%preun)
|
||||
- Commented the mysql related lines; create an option for future inclusion
|
||||
|
||||
* Thu Feb 27 2003 Richard E. Perlotto II <richard@perlotto.com> 1.6.0rc1-1
|
||||
@ -529,3 +514,4 @@ fi
|
||||
* Sun Dec 08 2002 Richard E. Perlotto II <richard@perlotto.com> 1.5.23-1
|
||||
- Updated file with notes and PGP signatures
|
||||
|
||||
# vim:set ai ts=4 sw=4 sts=4 et:
|
||||
|
@ -1,52 +0,0 @@
|
||||
" Vim syntax file
|
||||
" Language: syslog-ng: syslog-ng main configuration file (1.5.5a)
|
||||
" Maintainer: --
|
||||
" Last change: 2001 Apr 13
|
||||
" URL: --
|
||||
" syslog-ng's home: http://www.balabit.hu
|
||||
" Something like this in filetype.vim would be helpful
|
||||
" au BufNewFile,BufRead syslog-ng.conf setf syslog-ng
|
||||
|
||||
|
||||
" Remove any old syntax stuff hanging around
|
||||
syn clear
|
||||
syn case match
|
||||
set iskeyword=a-z,A-Z,48-57,_,-,.
|
||||
|
||||
syn keyword sysngStatement source destination filter log options
|
||||
syn match sysngComment "#.*$"
|
||||
syn match sysngString +"[^"]*"+
|
||||
syn match sysngOctNumber "\<0\o\+\>"
|
||||
syn match sysngDecNumber "\<\d\+\>"
|
||||
syn match sysngHexNumber "\<0x\x\+\>"
|
||||
syn keyword sysngBool yes no on off
|
||||
syn match sysngIdentifier "\<[sdf]_\+\>"
|
||||
|
||||
syn keyword sysngDriver internal remote_control
|
||||
syn keyword sysngDriver file fifo pipe door
|
||||
syn keyword sysngDriver udp tcp udp6 tcp6
|
||||
syn keyword sysngDriver sun_stream sun_streams sun-stream sun-streams
|
||||
syn keyword sysngDriver unix_dgram unix_stream unix-dgram unix-stream
|
||||
syn keyword sysngDriver usertty program
|
||||
|
||||
syn keyword sysngFilter not and or .. level priority facility
|
||||
syn keyword sysngFilter program host match DEFAULT
|
||||
|
||||
if !exists("did_sysng_syntax_inits")
|
||||
let did_sysng_syntax_inits = 1
|
||||
|
||||
hi link sysngStatement Statement
|
||||
hi link sysngComment Comment
|
||||
hi link sysngString String
|
||||
hi link sysngOctNumber Number
|
||||
hi link sysngDecNumber Number
|
||||
hi link sysngHexNumber Number
|
||||
hi link sysngBool Constant
|
||||
hi link sysngIdentifier Identifier
|
||||
|
||||
hi link sysngDriver Type
|
||||
hi link sysngFilter Operator
|
||||
endif
|
||||
|
||||
let b:current_syntax = "syslog-ng"
|
||||
|
Loading…
Reference in New Issue
Block a user