summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2008-03-29 12:15:08 +0100
committerMichael Biebl <biebl@debian.org>2008-03-29 12:15:08 +0100
commit4f9e746bd83a363f2f66a1f31ed9fd92f614754e (patch)
tree241a95c2bdf42d1a6877412aaefa011d06e8316b
parent44dd4512fef92b75209fffd59795bb6f0957bb8f (diff)
downloadrsyslog-4f9e746bd83a363f2f66a1f31ed9fd92f614754e.tar.gz
Imported Upstream version 2.0.2upstream/2.0.2
-rw-r--r--ChangeLog19
-rw-r--r--config.h.in7
-rwxr-xr-xconfigure311
-rw-r--r--configure.ac5
-rw-r--r--doc/Makefile.am6
-rw-r--r--doc/Makefile.in6
-rw-r--r--doc/manual.html6
-rw-r--r--doc/rsconf1_actionexeconlywhenpreviousissuspended.html (renamed from doc/rsconf1_actionexeconlyifpreviousissuspended.html)2
-rw-r--r--doc/rsconf1_gssforwardservicename.html24
-rw-r--r--doc/rsconf1_gsslistenservicename.html22
-rw-r--r--doc/rsconf1_gssmode.html24
-rw-r--r--doc/rsyslog-example.conf163
-rw-r--r--doc/rsyslog_conf.html2
-rw-r--r--doc/status.html12
-rw-r--r--net.c2
-rw-r--r--omfwd.c2
-rw-r--r--pidfile.c19
-rw-r--r--rfc3195d.c6
-rw-r--r--rsyslogd.87
-rwxr-xr-xstringbuf.c22
-rw-r--r--syslogd.c59
-rw-r--r--syslogd.h1
-rw-r--r--tcpsyslog.c8
23 files changed, 652 insertions, 83 deletions
diff --git a/ChangeLog b/ChangeLog
index 1a28dbc..5e81354 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,23 @@
---------------------------------------------------------------------------
+Version 2.0.2 STABLE (rgerhards), 2008-02-12
+- fixed a bug that could cause invalid string handling via strerror_r
+ varmojfekoj provided the patch - many thanks!
+- added x-info field to rsyslogd startup/shutdown message. Hopefully
+ points users to right location for further info (many don't even know
+ they run rsyslog ;))
+- bugfix: suspended actions were not always properly resumed
+ varmojfekoj provided the patch - many thanks!
+- bugfix: errno could be changed during mark processing, leading to
+ invalid error messages when processing inputs. Thank to varmojfekoj for
+ pointing out this problem.
+- bugfix: trailing ":" of tag was lost while parsing legacy syslog messages
+ without timestamp - thanks to Anders Blomdell for providing a patch!
+- bugfix (doc): misspelled config directive, invalid signal info
+- applied some doc fixes from Michel Biebl and cleaned up some no longer
+ needed files suggested by him
+- cleaned up stringbuf.c to fix an annoyance reported by Anders Blomdell
+- fixed bug that caused invalid treatment of tabs (HT) in rsyslog.conf
+---------------------------------------------------------------------------
Version 2.0.1 STABLE (rgerhards), 2008-01-24
- fixed a bug in integer conversion - but this function was never called,
so it is not really a useful bug fix ;)
diff --git a/config.h.in b/config.h.in
index 61c5edd..0db6e5e 100644
--- a/config.h.in
+++ b/config.h.in
@@ -27,6 +27,10 @@
/* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRERROR_R
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@@ -266,6 +270,9 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Define to 1 if strerror_r returns char *. */
+#undef STRERROR_R_CHAR_P
+
/* network support is integrated. */
#undef SYSLOG_INET
diff --git a/configure b/configure
index d4772f1..3fc9ba5 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for rsyslog 2.0.1.
+# Generated by GNU Autoconf 2.61 for rsyslog 2.0.2.
#
# Report bugs to <rsyslog@lists.adiscon.com.>.
#
@@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='rsyslog'
PACKAGE_TARNAME='rsyslog'
-PACKAGE_VERSION='2.0.1'
-PACKAGE_STRING='rsyslog 2.0.1'
+PACKAGE_VERSION='2.0.2'
+PACKAGE_STRING='rsyslog 2.0.2'
PACKAGE_BUGREPORT='rsyslog@lists.adiscon.com.'
ac_unique_file="syslogd.c"
@@ -1409,7 +1409,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures rsyslog 2.0.1 to adapt to many kinds of systems.
+\`configure' configures rsyslog 2.0.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1479,7 +1479,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of rsyslog 2.0.1:";;
+ short | recursive ) echo "Configuration of rsyslog 2.0.2:";;
esac
cat <<\_ACEOF
@@ -1593,7 +1593,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-rsyslog configure 2.0.1
+rsyslog configure 2.0.2
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1607,7 +1607,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by rsyslog $as_me 2.0.1, which was
+It was created by rsyslog $as_me 2.0.2, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2297,7 +2297,7 @@ fi
# Define the identity of the package.
PACKAGE='rsyslog'
- VERSION='2.0.1'
+ VERSION='2.0.2'
cat >>confdefs.h <<_ACEOF
@@ -22806,6 +22806,294 @@ _ACEOF
fi
+{ echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5
+echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_strerror_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef strerror_r
+ (void) strerror_r;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_have_decl_strerror_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_have_decl_strerror_r=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5
+echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6; }
+if test $ac_cv_have_decl_strerror_r = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRERROR_R 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRERROR_R 0
+_ACEOF
+
+
+fi
+
+
+
+for ac_func in strerror_r
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+{ echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5
+echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6; }
+if test "${ac_cv_func_strerror_r_char_p+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ ac_cv_func_strerror_r_char_p=no
+ if test $ac_cv_have_decl_strerror_r = yes; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ char *p = strerror_r (0, buf, sizeof buf);
+ return !p || x;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_func_strerror_r_char_p=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ else
+ # strerror_r is not declared. Choose between
+ # systems that have relatively inaccessible declarations for the
+ # function. BeOS and DEC UNIX 4.0 fall in this category, but the
+ # former has a strerror_r that returns char*, while the latter
+ # has a strerror_r that returns `int'.
+ # This test should segfault on the DEC system.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ extern char *strerror_r ();
+int
+main ()
+{
+char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ return ! isalpha (x);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_strerror_r_char_p=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+ fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5
+echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6; }
+if test $ac_cv_func_strerror_r_char_p = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRERROR_R_CHAR_P 1
+_ACEOF
+
+fi
+
for ac_func in vprintf
do
@@ -23108,8 +23396,7 @@ fi
-
-for ac_func in alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strerror_r strndup strnlen strrchr strstr strtol strtoul uname ttyname_r
+for ac_func in alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -24997,7 +25284,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by rsyslog $as_me 2.0.1, which was
+This file was extended by rsyslog $as_me 2.0.2, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -25050,7 +25337,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-rsyslog config.status 2.0.1
+rsyslog config.status 2.0.2
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index c2fd803..bb66bfd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT([rsyslog],[2.0.1],[rsyslog@lists.adiscon.com.])
+AC_INIT([rsyslog],[2.0.2],[rsyslog@lists.adiscon.com.])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([syslogd.c])
AC_CONFIG_HEADERS([config.h])
@@ -81,9 +81,10 @@ AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_STAT
+AC_FUNC_STRERROR_R
AC_FUNC_VPRINTF
AC_FUNC_WAIT3
-AC_CHECK_FUNCS([alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strerror_r strndup strnlen strrchr strstr strtol strtoul uname ttyname_r])
+AC_CHECK_FUNCS([alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r])
# Large file support
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 74e1be6..1449a13 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -11,6 +11,7 @@ html_files = \
modules.html \
property_replacer.html \
rsyslog_conf.html \
+ rsyslog-example.conf \
rsyslog_mysql.html \
rsyslog_packages.html \
rsyslog_php_syslog_ng.html \
@@ -20,7 +21,7 @@ html_files = \
syslog-protocol.html \
version_naming.html \
contributors.html \
- rsconf1_actionexeconlyifpreviousissuspended.html \
+ rsconf1_actionexeconlywhenpreviousissuspended.html \
rsconf1_actionresumeinterval.html \
rsconf1_allowedsender.html \
rsconf1_controlcharacterescapeprefix.html \
@@ -38,6 +39,9 @@ html_files = \
rsconf1_filecreatemode.html \
rsconf1_filegroup.html \
rsconf1_fileowner.html \
+ rsconf1_gssforwardservicename.html \
+ rsconf1_gsslistenservicename.html \
+ rsconf1_gssmode.html \
rsconf1_includeconfig.html \
rsconf1_mainmsgqueuesize.html \
rsconf1_modload.html \
diff --git a/doc/Makefile.in b/doc/Makefile.in
index e239bb6..783c79e 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -174,6 +174,7 @@ html_files = \
modules.html \
property_replacer.html \
rsyslog_conf.html \
+ rsyslog-example.conf \
rsyslog_mysql.html \
rsyslog_packages.html \
rsyslog_php_syslog_ng.html \
@@ -183,7 +184,7 @@ html_files = \
syslog-protocol.html \
version_naming.html \
contributors.html \
- rsconf1_actionexeconlyifpreviousissuspended.html \
+ rsconf1_actionexeconlywhenpreviousissuspended.html \
rsconf1_actionresumeinterval.html \
rsconf1_allowedsender.html \
rsconf1_controlcharacterescapeprefix.html \
@@ -201,6 +202,9 @@ html_files = \
rsconf1_filecreatemode.html \
rsconf1_filegroup.html \
rsconf1_fileowner.html \
+ rsconf1_gssforwardservicename.html \
+ rsconf1_gsslistenservicename.html \
+ rsconf1_gssmode.html \
rsconf1_includeconfig.html \
rsconf1_mainmsgqueuesize.html \
rsconf1_modload.html \
diff --git a/doc/manual.html b/doc/manual.html
index 4c3c15a..aeddb04 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -72,12 +72,6 @@ of Fame&quot;</a> --><li><a href="modules.html">description of rsyslog modules</
</ul>
-<p>Also, there is an article from Dennis Olvany on
-
-<a href="rsyslog084-freebsd5.4.txt">Syslog-to-SQL with rsyslog-0.8.4 on FreeBSD 5.4</a>
-
-(which unfortunately is a bit outdated now).</p>
-
<p>Our <a href="history.html">rsyslog history</a> page is for you if you would like to learn a little more
on why there is an rsyslog at all. If you are interested why you should care
diff --git a/doc/rsconf1_actionexeconlyifpreviousissuspended.html b/doc/rsconf1_actionexeconlywhenpreviousissuspended.html
index 2568ccf..3f18e24 100644
--- a/doc/rsconf1_actionexeconlyifpreviousissuspended.html
+++ b/doc/rsconf1_actionexeconlywhenpreviousissuspended.html
@@ -3,7 +3,7 @@
<title>rsyslog.conf file</title>
</head>
<body>
-<h2>$ActionExecOnlyIfPreviousIsSuspended</h2>
+<h2>$ActionExecOnlyWhenPreviousIsSuspended</h2>
<p><b>Type:</b> global configuration directive</p>
<p><b>Default:</b> off</p>
<p><b>Description:</b></p>
diff --git a/doc/rsconf1_gssforwardservicename.html b/doc/rsconf1_gssforwardservicename.html
new file mode 100644
index 0000000..9d39dc2
--- /dev/null
+++ b/doc/rsconf1_gssforwardservicename.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<title>rsyslog.conf file</title>
+</head>
+<body>
+<h2>$GssForwardServiceName</h2>
+<p><b>Type:</b> global configuration directive</p>
+<p><b>Default:</b> host</p>
+<p><b>Provided by:</b> <i>omgssapi</i></p>
+<p><b>Description:</b></p>
+<p>Specifies the service name used by the client when forwarding GSS-API wrapped messages.</p>
+<p>The GSS-API service names are constructed by appending '@' and a hostname following "@@" in each selector.</p>
+<p><b>Sample:</b></p>
+<p><code><b>$GssForwardServiceName rsyslog</b></code></p>
+
+<p>[<a href="rsyslog_conf.html">rsyslog.conf overview</a>] [<a href="manual.html">manual
+index</a>] [<a href="http://www.rsyslog.com/">rsyslog site</a>]</p>
+<p><font size="2">This documentation is part of the
+<a href="http://www.rsyslog.com/">rsyslog</a> project.<br>
+Copyright &copy; 2007 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and
+<a href="http://www.adiscon.com/">Adiscon</a>. Released under the GNU GPL
+version 2 or higher.</font></p>
+</body>
+</html>
diff --git a/doc/rsconf1_gsslistenservicename.html b/doc/rsconf1_gsslistenservicename.html
new file mode 100644
index 0000000..cd03dc5
--- /dev/null
+++ b/doc/rsconf1_gsslistenservicename.html
@@ -0,0 +1,22 @@
+<html>
+<head>
+<title>rsyslog.conf file</title>
+</head>
+<body>
+<h2>$GssListenServiceName</h2>
+<p><b>Type:</b> global configuration directive</p>
+<p><b>Default:</b> host</p>
+<p><b>Description:</b></p>
+<p>Specifies the service name used by the server when listening for GSS-API wrapped messages.</p>
+<p><b>Sample:</b></p>
+<p><code><b>$GssForwardServiceName rsyslog</b></code></p>
+
+<p>[<a href="rsyslog_conf.html">rsyslog.conf overview</a>] [<a href="manual.html">manual
+index</a>] [<a href="http://www.rsyslog.com/">rsyslog site</a>]</p>
+<p><font size="2">This documentation is part of the
+<a href="http://www.rsyslog.com/">rsyslog</a> project.<br>
+Copyright &copy; 2007 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and
+<a href="http://www.adiscon.com/">Adiscon</a>. Released under the GNU GPL
+version 2 or higher.</font></p>
+</body>
+</html>
diff --git a/doc/rsconf1_gssmode.html b/doc/rsconf1_gssmode.html
new file mode 100644
index 0000000..71c5069
--- /dev/null
+++ b/doc/rsconf1_gssmode.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<title>rsyslog.conf file</title>
+</head>
+<body>
+<h2>$GssMode</h2>
+<p><b>Type:</b> global configuration directive</p>
+<p><b>Default:</b> encryption</p>
+<p><b>Provided by:</b> <i>omgssapi</i></p>
+<p><b>Description:</b></p>
+<p>Specifies GSS-API mode to use, which can be "<b>integrity</b>" - clients are authenticated and
+ messages are checked for integrity, "<b>encryption</b>" - same as
+ "integrity", but messages are also encrypted if both sides support it.<p><b>Sample:</b></p>
+<p><code><b>$GssMode Encryption</b></code></p>
+
+<p>[<a href="rsyslog_conf.html">rsyslog.conf overview</a>] [<a href="manual.html">manual
+index</a>] [<a href="http://www.rsyslog.com/">rsyslog site</a>]</p>
+<p><font size="2">This documentation is part of the
+<a href="http://www.rsyslog.com/">rsyslog</a> project.<br>
+Copyright &copy; 2007 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and
+<a href="http://www.adiscon.com/">Adiscon</a>. Released under the GNU GPL
+version 2 or higher.</font></p>
+</body>
+</html>
diff --git a/doc/rsyslog-example.conf b/doc/rsyslog-example.conf
new file mode 100644
index 0000000..495bc56
--- /dev/null
+++ b/doc/rsyslog-example.conf
@@ -0,0 +1,163 @@
+# A commented quick reference and sample configuration
+# WARNING: This is not a manual, the full manual of rsyslog configuration is in
+# rsyslog.conf (5) manpage
+#
+# "$" starts lines that contain new directives. The full list of directives
+# can be found in /usr/share/doc/rsyslog-1.19.6/doc/rsyslog_conf.html or online
+# at http://www.rsyslog.com/doc if you do not have (or find) a local copy.
+#
+# Set syslogd options
+
+# Some global directives
+# ----------------------
+
+# $AllowedSender - specifies which remote systems are allowed to send syslog messages to rsyslogd
+# --------------
+$AllowedSender UDP, 127.0.0.1, 192.0.2.0/24, [::1]/128, *.example.net, somehost.example.com
+
+# $UMASK - specifies the rsyslogd processes' umask
+# ------
+$umask 0000
+
+# $FileGroup - Set the group for dynaFiles newly created
+# ----------
+$FileGroup loggroup
+
+# $FileOwner - Set the file owner for dynaFiles newly created.
+# ----------
+$FileOwner loguser
+
+# $IncludeConfig - include other files into the main configuration file
+# --------------
+$IncludeConfig /etc/some-included-file.conf # one file
+$IncludeConfig /etc/rsyslog.d/ # whole directory (must contain the final slash)
+
+# $ModLoad - Dynamically loads a plug-in and activates it
+# --------
+$ModLoad MySQL # load MySQL functionality
+$ModLoad /rsyslog/modules/somemodule.so # load a module via absolute path
+
+
+
+# Templates
+# ---------
+
+# Templates allow to specify any format a user might want.
+# They MUST be defined BEFORE they are used.
+
+# A template consists of a template directive, a name, the actual template text
+# and optional options. A sample is:
+#
+$template MyTemplateName,"\7Text %property% some more text\n",
+
+# where:
+# * $template - tells rsyslog that this line contains a template.
+# * MyTemplateName - template name. All other config lines refer to this name.
+# * "\7Text %property% some more text\n" - templage text
+
+# The backslash is an escape character, i.e. \7 rings the bell, \n is a new line.
+# To escape:
+# % = \%
+# \ = \\
+
+# Template options are case-insensitive. Currently defined are:
+# sql format the string suitable for a SQL statement. This will replace single
+# quotes ("'") by two single quotes ("''") to prevent the SQL injection
+# (NO_BACKSLASH_ESCAPES turned off)
+# stdsql - format the string suitable for a SQL statement that is to
+# be sent to a standards-compliant sql server.
+# (NO_BACKSLASH_ESCAPES turned on)
+
+
+
+# Properties inside templates
+# ---------------------------
+
+# Properties can be modified by the property replacer. They are accessed
+# inside the template by putting them between percent signs. The full syntax is as follows:
+
+# %propname:fromChar:toChar:options%
+
+# FromChar and toChar are used to build substrings.
+# If you need to obtain the first 2 characters of the
+# message text, you can use this syntax:
+"%msg:1:2%".
+# If you do not whish to specify from and to, but you want to
+# specify options, you still need to include the colons.
+
+# For example, to convert the full message text to lower case only, use
+# "%msg:::lowercase%".
+
+# The full list of property options can be found in rsyslog.conf(5) manpage
+
+
+
+# Samples of template definitions
+# -------------------------------
+
+# A template that resambles traditional syslogd file output:
+$template TraditionalFormat,"%timegenerated% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n"
+
+# A more verbose template:
+$template precise,"%syslogpriority%,%syslogfacility%,%timegenerated::fulltime%,%HOSTNAME%,%syslogtag%,%msg%\n"
+
+# A template that resembles RFC 3164 on-the-wire format:
+# (yes, there is NO space betwen syslogtag and msg! that's important!)
+$template RFC3164fmt,"<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag%%msg%"
+
+# a template resembling traditional wallmessage format:
+$template wallmsg,"\r\n\7Message from syslogd@%HOSTNAME% at %timegenerated% ...\r\n %syslogtag%%msg%\n\r"
+
+# The template below emulates winsyslog format, but we need to check the time
+# stamps used. It is also a good sampleof the property replacer in action.
+$template WinSyslogFmt,"%HOSTNAME%,%timegenerated:1:10:date-rfc3339%,%timegenerated:12:19:date-rfc3339%,%timegenerated:1:10:date-rfc3339%,%timegenerated:12:19:date-rfc3339%,%syslogfacility%,%syslogpriority%,%syslogtag%%msg%\n"
+
+# A template used for database writing (notice it *is* an actual
+# sql-statement):
+$template dbFormat,"insert into SystemEvents (Message, Facility,FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%',%syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')",sql
+
+
+
+# Samples of rules
+# ----------------
+# Regular file
+# ------------
+*.* /var/log/traditionalfile.log;TraditionalFormat # log to a file in the traditional format
+
+# Forwarding to remote machine
+# ----------------------------
+*.* @172.19.2.16 # udp (standard for syslog)
+*.* @@172.19.2.17 # tcp
+
+# Database action
+# ---------------
+# (you must have rsyslog-mysql package installed)
+# !!! Don't forget to set permission of rsyslog.conf to 600 !!!
+*.* >hostname,dbname,userid,password # (default Monitorware schema, can be created by /usr/share/doc/rsyslog-mysql-1.19.6/createDB.sql)
+
+# And this one uses the template defined above:
+*.* >hostname,dbname,userid,password;dbFormat
+
+# Program to execute
+# ------------------
+*.* ^alsaunmute # set default volume to soundcard
+
+# Filter using regex
+# ------------------
+# if the user logges word rulez or rulezz or rulezzz or..., then we will shut down his pc
+# (note, that + have to be double backslashed...)
+:msg, regex, "rulez\\+" ^poweroff
+
+# A more complex example
+# ----------------------
+$template bla_logged,"%timegenerated% the BLA was logged"
+:msg, contains, "bla" ^logger;bla_logged
+
+# Pipes
+# -----
+# first we need to create pipe by # mkfifo /a_big_pipe
+*.* |/a_big_pipe
+
+# Discarding
+# ----------
+*.* ~ # discards everything
diff --git a/doc/rsyslog_conf.html b/doc/rsyslog_conf.html
index 3ee2ae6..bf878e8 100644
--- a/doc/rsyslog_conf.html
+++ b/doc/rsyslog_conf.html
@@ -25,7 +25,7 @@ to rsyslogd.</p>
start with a dollar-sign. Here is a list in alphabetical order. Follow links for
a description.</p>
<ul>
- <li><a href="rsconf1_actionexeconlyifpreviousissuspended.html">$ActionExecOnlyIfPreviousIsSuspended</a></li>
+ <li><a href="rsconf1_actionexeconlywhenpreviousissuspended.html">$ActionExecOnlyWhenPreviousIsSuspended</a></li>
<li><a href="rsconf1_actionresumeinterval.html">$ActionResumeInterval</a></li>
<li><a href="rsconf1_allowedsender.html">$AllowedSender</a></li>
<li><a href="rsconf1_controlcharacterescapeprefix.html">$ControlCharacterEscapePrefix</a></li>
diff --git a/doc/status.html b/doc/status.html
index f8b6c7a..503892b 100644
--- a/doc/status.html
+++ b/doc/status.html
@@ -4,17 +4,17 @@
</head>
<body>
<h2>rsyslog status page</h2>
-<p>This page reflects the status as of 2008-01-24.</p>
+<p>This page reflects the status as of 2008-02-12.</p>
<h2>Current Releases</h2>
-<p><b>development:</b> 3.10.2 -
-<a href="http://www.rsyslog.com/Article161.phtml">change log</a> -
-<a href="http://www.rsyslog.com/Downloads-index-req-getit-lid-73.phtml">download</a></p>
+<p><b>development:</b> 3.11.0 -
+<a href="http://www.rsyslog.com/Article169.phtml">change log</a> -
+<a href="http://www.rsyslog.com/Downloads-index-req-getit-lid-76.phtml">download</a></p>
<p><b><font color="#FF0000"><a href="v3compatibility.html">Be sure to read the
rsyslog v3 compatibility document!</a></font></b><br>
Documentation for 3.x is currently sparse. If you need assistance, please
<a href="http://www.rsyslog.com/PNphpBB2.phtml">post in the rsyslog forums</a>!</p>
-<p><b>stable:</b> 2.0.1 - <a href="http://www.rsyslog.com/Article165.phtml">change log</a> -
-<a href="http://www.rsyslog.com/Downloads-index-req-getit-lid-73.phtml">download</a></p>
+<p><b>stable:</b> 2.0.2 - <a href="http://www.rsyslog.com/Article171.phtml">change log</a> -
+<a href="http://www.rsyslog.com/Downloads-index-req-getit-lid-77.phtml">download</a></p>
<p>&nbsp;(<a href="version_naming.html">How are versions named?</a>)</p>
<h2>Platforms</h2>
<p>Thankfully, a number of folks have begin to build packages and help port
diff --git a/net.c b/net.c
index bf20b9e..a546e3f 100644
--- a/net.c
+++ b/net.c
@@ -66,7 +66,7 @@ int should_use_so_bsdcompat(void)
init_done = 1;
if (uname(&utsname) < 0) {
char errStr[1024];
- dbgprintf("uname: %s\r\n", strerror_r(errno, errStr, sizeof(errStr)));
+ dbgprintf("uname: %s\r\n", rs_strerror_r(errno, errStr, sizeof(errStr)));
return 1;
}
/* Format is <version>.<patchlevel>.<sublevel><extraversion>
diff --git a/omfwd.c b/omfwd.c
index 9b56acd..afa6030 100644
--- a/omfwd.c
+++ b/omfwd.c
@@ -441,7 +441,7 @@ CODESTARTdoAction
int eno = errno;
char errStr[1024];
dbgprintf("sendto() error: %d = %s.\n",
- eno, strerror_r(eno, errStr, sizeof(errStr)));
+ eno, rs_strerror_r(eno, errStr, sizeof(errStr)));
}
}
if (lsent == l && !send_to_all)
diff --git a/pidfile.c b/pidfile.c
index e153a4e..a0b4157 100644
--- a/pidfile.c
+++ b/pidfile.c
@@ -39,6 +39,21 @@
#include <fcntl.h>
#endif
+
+static char *rs_strerror_r(int errnum, char *buf, size_t buflen) {
+#ifdef STRERROR_R_CHAR_P
+ char *p = strerror_r(errnum, buf, buflen);
+ if (p != buf) {
+ strncpy(buf, p, buflen);
+ buf[buflen - 1] = '\0';
+ }
+#else
+ strerror_r(errnum, buf, buflen);
+#endif
+ return buf;
+}
+
+
/* read_pid
*
* Reads the specified pidfile and returns the read pid.
@@ -120,7 +135,7 @@ int write_pid (char *pidfile)
pid = getpid();
if (!fprintf(f,"%d\n", pid)) {
char errStr[1024];
- strerror_r(errno, errStr, sizeof(errStr));
+ rs_strerror_r(errno, errStr, sizeof(errStr));
printf("Can't write pid , %s.\n", errStr);
close(fd);
return 0;
@@ -130,7 +145,7 @@ int write_pid (char *pidfile)
#ifndef __sun
if (flock(fd, LOCK_UN) == -1) {
char errStr[1024];
- strerror_r(errno, errStr, sizeof(errStr));
+ rs_strerror_r(errno, errStr, sizeof(errStr));
printf("Can't unlock pidfile %s, %s.\n", pidfile, errStr);
close(fd);
return 0;
diff --git a/rfc3195d.c b/rfc3195d.c
index 7588fb9..e7d13e0 100644
--- a/rfc3195d.c
+++ b/rfc3195d.c
@@ -96,7 +96,7 @@ static void openlog()
if(LogFile < 0) {
char errStr[1024];
printf("error opening '%s': %s\n",
- pPathLogname, strerror_r(errno, errStr, sizeof(errStr)));
+ pPathLogname, rs_strerror_r(errno, errStr, sizeof(errStr)));
}
}
if (LogFile != -1 && !connected &&
@@ -106,7 +106,7 @@ static void openlog()
else {
char errStr[1024];
printf("error connecting '%s': %s\n",
- pPathLogname, strerror_r(errno, errStr, sizeof(errStr)));
+ pPathLogname, rs_strerror_r(errno, errStr, sizeof(errStr)));
}
}
@@ -162,7 +162,7 @@ void OnReceive(srAPIObj* pAPI, srSLMGObj* pSLMG)
if(nWritten < 0) {
/* error, recover! */
char errStr[1024];
- printf("error writing to domain socket: %s\r\n", strerror_r(errno, errStr, sizeof(errStr)));
+ printf("error writing to domain socket: %s\r\n", rs_strerror_r(errno, errStr, sizeof(errStr)));
closelog();
} else {
/* prepare for (potential) next write */
diff --git a/rsyslogd.8 b/rsyslogd.8
index 58aec52..1d44b8d 100644
--- a/rsyslogd.8
+++ b/rsyslogd.8
@@ -276,15 +276,10 @@ will be reread and the
.BR rsyslog (3)
facility is started again.
.TP
-.B SIGTERM
+.B SIGTERM "," SIGINT "," SIGQUIT
.B Rsyslogd
will die.
.TP
-.BR SIGINT ", " SIGQUIT
-If debugging is enabled these are ignored, otherwise
-.B rsyslogd
-will die.
-.TP
.B SIGUSR1
Switch debugging on/off. This option can only be used if
.B rsyslogd
diff --git a/stringbuf.c b/stringbuf.c
index 902831e..01467f4 100755
--- a/stringbuf.c
+++ b/stringbuf.c
@@ -380,28 +380,6 @@ finalize_it:
rsRetVal rsCStrFinish(rsCStrObj __attribute__((unused)) *pThis)
{
rsCHECKVALIDOBJECT(pThis, OIDrsCStr);
-
-# if STRINGBUF_TRIM_ALLOCSIZE == 1
- /* in this mode, we need to trim the string. To do
- * so, we must allocate a new buffer of the exact
- * string size, and then copy the old one over.
- * This new buffer is then to be returned.
- */
- if((pRetBuf = malloc((pThis->iBufSize) * sizeof(uchar))) == NULL)
- { /* OK, in this case we use the previous buffer. At least
- * we have it ;)
- */
- }
- else
- { /* got the new buffer, so let's use it */
- uchar* pBuf;
- memcpy(pBuf, pThis->pBuf, pThis->iBufPtr + 1);
- pThis->pBuf = pBuf;
- }
-# else
- /* here, we need to do ... nothing ;)
- */
-# endif
return RS_RET_OK;
}
diff --git a/syslogd.c b/syslogd.c
index 818f5f3..396a540 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -2491,10 +2491,12 @@ static rsRetVal callAction(msg_t *pMsg, action_t *pAction)
*/
if(pAction->f_pMsg != NULL) {
if(pAction->f_prevcount > 0)
- fprintlog(pAction);
- /* we do not care about iRet above - I think it's right but if we have
- * some troubles, you know where to look at ;) -- rgerhards, 2007-08-01
- */
+ CHKiRet(fprintlog(pAction));
+ /* if we run into trouble (most importantly a suspended
+ * action), we keep the old message (by virtue of not
+ * destructing it) and discard the new one (done
+ * automatically when we return.
+ */
MsgDestruct(pAction->f_pMsg);
}
pAction->f_pMsg = MsgAddRef(pMsg);
@@ -3111,7 +3113,9 @@ static int parseLegacySyslogMsg(msg_t *pMsg, int flags)
*/
if(*p2parse == ':') {
bTAGCharDetected = 1;
- ++p2parse;
+ /* We will move hostname to tag, so preserve ':' (otherwise we
+ * will needlessly change the message format) */
+ *pWork++ = *p2parse++;
} else if(*p2parse == ' ')
++p2parse;
*pWork = '\0';
@@ -3437,9 +3441,15 @@ DEFFUNC_llExecFunc(domarkActions)
dbgprintf("flush %s: repeated %d times, %d sec.\n",
modGetStateName(pAction->pMod), pAction->f_prevcount,
repeatinterval[pAction->f_repeatcount]);
+ if(actionIsSuspended(pAction) &&
+ (actionTryResume(pAction) != RS_RET_OK)) {
+ goto finalize_it;
+ }
fprintlog(pAction);
BACKOFF(pAction);
}
+
+finalize_it:
UnlockObj(pAction);
return RS_RET_OK; /* we ignore errors, we can not do anything either way */
@@ -3563,7 +3573,7 @@ void logerror(char *type)
if (errno == 0)
snprintf(buf, sizeof(buf), "%s", type);
else {
- strerror_r(errno, errStr, sizeof(errStr));
+ rs_strerror_r(errno, errStr, sizeof(errStr));
snprintf(buf, sizeof(buf), "%s: %s", type, errStr);
}
buf[sizeof(buf)/sizeof(char) - 1] = '\0'; /* just to be on the safe side... */
@@ -3605,7 +3615,7 @@ static void die(int sig)
dbgprintf(" exiting on signal %d\n", sig);
(void) snprintf(buf, sizeof(buf) / sizeof(char),
" [origin software=\"rsyslogd\" " "swVersion=\"" VERSION \
- "\" x-pid=\"%d\"]" " exiting on signal %d.",
+ "\" x-pid=\"%d\" x-info=\"http://www.rsyslog.com\"]" " exiting on signal %d.",
(int) myPid, sig);
errno = 0;
logmsgInternal(LOG_SYSLOG|LOG_INFO, buf, ADDDATE);
@@ -4109,9 +4119,14 @@ DEFFUNC_llExecFunc(freeSelectorsActions)
/* flush any pending output */
if(pAction->f_prevcount) {
+ if(actionIsSuspended(pAction) &&
+ (actionTryResume(pAction) != RS_RET_OK)) {
+ goto finalize_it;
+ }
fprintlog(pAction);
}
+finalize_it:
return RS_RET_OK; /* never fails ;) */
}
@@ -4349,7 +4364,7 @@ finalize_it:
if(fCurr != NULL)
selectorDestruct(fCurr);
- strerror_r(errno, errStr, sizeof(errStr));
+ rs_strerror_r(errno, errStr, sizeof(errStr));
dbgprintf("error %d processing config file '%s'; os error (if any): %s\n",
iRet, pConfFile, errStr);
}
@@ -4576,7 +4591,7 @@ static void init(void)
*/
snprintf(bufStartUpMsg, sizeof(bufStartUpMsg)/sizeof(char),
" [origin software=\"rsyslogd\" " "swVersion=\"" VERSION \
- "\" x-pid=\"%d\"][x-configInfo udpReception=\"%s\" " \
+ "\" x-pid=\"%d\" x-info=\"http://www.rsyslog.com\"][x-configInfo udpReception=\"%s\" " \
"udpPort=\"%s\" tcpReception=\"%s\" tcpPort=\"%s\"]" \
" restart",
(int) myPid,
@@ -5466,6 +5481,20 @@ void dbgprintf(char *fmt, ...)
}
+char *rs_strerror_r(int errnum, char *buf, size_t buflen) {
+#ifdef STRERROR_R_CHAR_P
+ char *p = strerror_r(errnum, buf, buflen);
+ if (p != buf) {
+ strncpy(buf, p, buflen);
+ buf[buflen - 1] = '\0';
+ }
+#else
+ strerror_r(errnum, buf, buflen);
+#endif
+ return buf;
+}
+
+
/*
* The following function is resposible for handling a SIGHUP signal. Since
* we are now doing mallocs/free as part of init we had better not being
@@ -5507,13 +5536,12 @@ int getSubString(uchar **ppSrc, char *pDst, size_t DstSize, char cSep)
{
uchar *pSrc = *ppSrc;
int iErr = 0; /* 0 = no error, >0 = error */
- while(*pSrc != cSep && *pSrc != '\n' && *pSrc != '\0' && DstSize>1) {
+ while((cSep == ' ' ? !isspace(*pSrc) : *pSrc != cSep) && *pSrc != '\n' && *pSrc != '\0' && DstSize>1) {
*pDst++ = *(pSrc)++;
DstSize--;
}
/* check if the Dst buffer was to small */
- if (*pSrc != cSep && *pSrc != '\n' && *pSrc != '\0')
- {
+ if ((cSep == ' ' ? !isspace(*pSrc) : *pSrc != cSep) && *pSrc != '\n' && *pSrc != '\0') {
dbgprintf("in getSubString, error Src buffer > Dst buffer\n");
iErr = 1;
}
@@ -5727,7 +5755,7 @@ static rsRetVal processSelectAfter(int maxfds, int nfds, fd_set *pReadfds, fd_se
printchopped(LocalHostName, line, iRcvd, fd, funixParseHost[i]);
} else if (iRcvd < 0 && errno != EINTR) {
char errStr[1024];
- strerror_r(errno, errStr, sizeof(errStr));
+ rs_strerror_r(errno, errStr, sizeof(errStr));
dbgprintf("UNIX socket error: %d = %s.\n", \
errno, errStr);
logerror("recvfrom UNIX");
@@ -5768,7 +5796,7 @@ static rsRetVal processSelectAfter(int maxfds, int nfds, fd_set *pReadfds, fd_se
}
} else if (l < 0 && errno != EINTR && errno != EAGAIN) {
char errStr[1024];
- strerror_r(errno, errStr, sizeof(errStr));
+ rs_strerror_r(errno, errStr, sizeof(errStr));
dbgprintf("INET socket error: %d = %s.\n", errno, errStr);
logerror("recvfrom inet");
/* should be harmless */
@@ -5871,6 +5899,7 @@ static void mainloop(void)
int i;
int maxfds;
int nfds;
+ int errnoSave;
#ifdef SYSLOG_INET
selectHelperWriteFDSInfo_t writeFDSInfo;
fd_set writefds;
@@ -6009,6 +6038,7 @@ static void mainloop(void)
#endif
nfds = select(maxfds+1, (fd_set *) &readfds, MAIN_SELECT_WRITEFDS,
(fd_set *) NULL, MAIN_SELECT_TIMEVAL);
+ errnoSave = errno; /* save errno for later reference */
if(bRequestDoMark) {
domark();
@@ -6029,6 +6059,7 @@ static void mainloop(void)
continue;
}
+ errno = errnoSave; /* restore errno to state right after select (which is what we need) -- rgerhards, 2008-02-11 */
processSelectAfter(maxfds, nfds, &readfds, MAIN_SELECT_WRITEFDS);
#undef MAIN_SELECT_TIMEVAL
diff --git a/syslogd.h b/syslogd.h
index aefe13b..e846c8e 100644
--- a/syslogd.h
+++ b/syslogd.h
@@ -48,6 +48,7 @@
#define MARK 0x008 /* this message is a mark */
void dbgprintf(char *, ...);
+char *rs_strerror_r(int errnum, char *buf, size_t buflen);
void logerror(char *type);
void logerrorSz(char *type, char *errMsg);
void logerrorInt(char *type, int iErr);
diff --git a/tcpsyslog.c b/tcpsyslog.c
index c769310..6b1c446 100644
--- a/tcpsyslog.c
+++ b/tcpsyslog.c
@@ -1020,8 +1020,8 @@ int TCPSendCreateSocket(struct addrinfo *addrDest)
return fd;
} else {
char errStr[1024];
- dbgprintf("create tcp connection failed, reason %s",
- strerror_r(errno, errStr, sizeof(errStr)));
+ dbgprintf("create tcp connection failed, reason %s\n",
+ rs_strerror_r(errno, errStr, sizeof(errStr)));
}
}
@@ -1032,12 +1032,12 @@ int TCPSendCreateSocket(struct addrinfo *addrDest)
}
else {
char errStr[1024];
- dbgprintf("couldn't create send socket, reason %s", strerror_r(errno, errStr, sizeof(errStr)));
+ dbgprintf("couldn't create send socket, reason %s\n", rs_strerror_r(errno, errStr, sizeof(errStr)));
}
r = r->ai_next;
}
- dbgprintf("no working socket could be obtained");
+ dbgprintf("no working socket could be obtained\n");
return -1;
}