summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog41
-rw-r--r--configure.ac2
-rw-r--r--doc/manual.html5
-rw-r--r--doc/rsyslog_conf_templates.html3
-rw-r--r--doc/status.html21
-rw-r--r--runtime/atomic.h9
-rw-r--r--runtime/glbl.c27
-rw-r--r--runtime/glbl.h1
-rw-r--r--runtime/msg.c22
-rw-r--r--runtime/msg.h1
-rw-r--r--runtime/net.c29
-rw-r--r--tools/omfile.c41
-rw-r--r--tools/rsyslogd.818
-rw-r--r--tools/syslogd.c19
14 files changed, 182 insertions, 57 deletions
diff --git a/ChangeLog b/ChangeLog
index acd3df4d..02ef2eb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,16 @@ Version 4.1.5 [DEVEL] (rgerhards), 2009-02-??
"last message repeated n times" messages, if generated, may
have an alternate format that contains the message that is being repeated
---------------------------------------------------------------------------
+Version 4.1.4 [DEVEL] (rgerhards), 2009-01-29
+- bugfix: inconsistent use of mutex/atomic operations could cause segfault
+ details are too many, for full analysis see blog post at:
+ http://blog.gerhards.net/2009/01/rsyslog-data-race-analysis.html
+- bugfix: unitialized mutex was used in msg.c:getPRI
+ This was subtle, because getPRI is called as part of the debugging code
+ (always executed) in syslogd.c:logmsg.
+- bufgix: $PreserveFQDN was not properly handled for locally emitted
+ messages
+---------------------------------------------------------------------------
Version 4.1.3 [DEVEL] (rgerhards), 2008-12-17
- added $InputTCPServerAddtlFrameDelimiter config directive, which
enables to specify an additional, non-standard message delimiter
@@ -81,6 +91,11 @@ version before switching to this one.
Thanks to Ken for providing the patch
---------------------------------------------------------------------------
Version 3.21.10 [BETA] (rgerhards), 2008-12-??
+- bugfix: inconsistent use of mutex/atomic operations could cause segfault
+ details are too many, for full analysis see blog post at:
+ http://blog.gerhards.net/2009/01/rsyslog-data-race-analysis.html
+- the string "Do Die" was accidently emited upon exit in non-debug mode
+ This has now been corrected. Thanks to varmojfekoj for the patch.
- some legacy options were not correctly processed.
Thanks to varmojfekoj for the patch.
- doc bugfix: v3-compatiblity document had typo in config directive
@@ -225,6 +240,20 @@ Version 3.21.0 [DEVEL] (rgerhards), 2008-07-18
- imported all changes from 3.18.1 until today (some quite important,
see below)
---------------------------------------------------------------------------
+Version 3.20.4 [v3-stable] (rgerhards), 2009-02-??
+- bugfix: inconsistent use of mutex/atomic operations could cause segfault
+ details are too many, for full analysis see blog post at:
+ http://blog.gerhards.net/2009/01/rsyslog-data-race-analysis.html
+- bugfix: invalid mutex access in msg.c
+---------------------------------------------------------------------------
+Version 3.20.3 [v3-stable] (rgerhards), 2009-01-19
+- doc bugfix: v3-compatiblity document had typo in config directive
+ thanks to Andrej for reporting this
+- fixed a potential segfault condition with $AllowedSender directive
+ On HUP, the root pointers were not properly cleaned up. Thanks to
+ Michael Biebel, olgoat, and Juha Koho for reporting and analyzing
+ the bug.
+---------------------------------------------------------------------------
Version 3.20.2 [v3-stable] (rgerhards), 2008-12-04
- re-release of 3.20.1 with an additional fix, that could also lead
to DoS; 3.20.1 has been removed from the official download archives
@@ -433,8 +462,15 @@ Version 3.19.0 (rgerhards), 2008-05-06
for the patch
---------------------------------------------------------------------------
Version 3.18.7 (rgerhards), 2008-12-??
+=======
+- fixed a potential segfault condition with $AllowedSender directive
+ On HUP, the root pointers were not properly cleaned up. Thanks to
+ Michael Biebel, olgoat, and Juha Koho for reporting and analyzing
+ the bug.
- some legacy options were not correctly processed.
Thanks to varmojfekoj for the patch.
+- doc bugfix: some spelling errors in man pages corrected. Thanks to
+ Geoff Simmons for the patch.
---------------------------------------------------------------------------
Version 3.18.6 (rgerhards), 2008-12-08
- security bugfix: $AllowedSender was not honored, all senders were
@@ -1113,10 +1149,13 @@ Version 3.10.0 (rgerhards), 2008-01-07
mode
---------------------------------------------------------------------------
Version 2.0.7 V2-STABLE (rgerhards), 2008-??-??
+- bugfix: "$CreateDirs off" also disabled file creation
+ Thanks to William Tisater for analyzing this bug and providing a patch.
+ The actual code change is heavily based on William's patch.
- bugfix: memory leak in ompgsql
Thanks to Ken for providing the patch
---------------------------------------------------------------------------
-Version 2.0.6 V2-STABLE (rgerhards), 2008-??-??
+Version 2.0.6 V2-STABLE (rgerhards), 2008-08-07
- bugfix: memory leaks in rsyslogd, primarily in singlethread mode
Thanks to Frederico Nunez for providing the fix
- bugfix: copy&paste error lead to dangling if - this caused a very minor
diff --git a/configure.ac b/configure.ac
index d204b7fd..1bf460ad 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],[4.1.3],[rsyslog@lists.adiscon.com])
+AC_INIT([rsyslog],[4.1.4],[rsyslog@lists.adiscon.com])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([ChangeLog])
AC_CONFIG_HEADERS([config.h])
diff --git a/doc/manual.html b/doc/manual.html
index e8842de6..bd927d78 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -19,7 +19,7 @@ rsyslog support</a> available directly from the source!</p>
<p><b>Please visit the <a href="http://www.rsyslog.com/sponsors">rsyslog sponsor's page</a>
to honor the project sponsors or become one yourself!</b> We are very grateful for any help towards the
project goals.</p>
-<p><b>This documentation is for version 4.1.3 (devel branch) of rsyslog.</b>
+<p><b>This documentation is for version 4.1.4 (devel branch) of rsyslog.</b>
Visit the <i> <a href="http://www.rsyslog.com/doc-status.html">rsyslog status page</a></i></b> to obtain current
version information and project status.
</p><p><b>If you like rsyslog, you might
@@ -36,9 +36,8 @@ the links below for the</b><br></p><ul>
<li><a href="troubleshoot.html">troubleshooting rsyslog problems</a></li>
<li><a href="rsyslog_conf.html">configuration file syntax (rsyslog.conf)</a></li>
-<li><a href="/tool-regex">a regular expression checker/generator tool for rsyslog</a></li>
-<li> <a href="property_replacer.html">property replacer, an important core component</a></li>
<li><a href="http://www.rsyslog.com/tool-regex">a regular expression checker/generator tool for rsyslog</a></li>
+<li> <a href="property_replacer.html">property replacer, an important core component</a></li>
<li>a commented <a href="sample.conf.html">sample rsyslog.conf</a> </li>
<li><a href="bugs.html">rsyslog bug list</a></li>
<li><a href="rsyslog_packages.html"> rsyslog packages</a></li>
diff --git a/doc/rsyslog_conf_templates.html b/doc/rsyslog_conf_templates.html
index 90b5fafe..6c68b801 100644
--- a/doc/rsyslog_conf_templates.html
+++ b/doc/rsyslog_conf_templates.html
@@ -33,7 +33,8 @@ bit restricted currently.
<p>All text in the template is used literally, except for things
within percent signs. These are properties and allow you access to the
contents of the syslog message. Properties are accessed via the
-property replacer (nice name, huh) and it can do cool things, too. For
+<a href="property_replacer.html">property replacer</a>
+(nice name, huh) and it can do cool things, too. For
example, it can pick a substring or do date-specific formatting. More
on this is below, on some lines of the property replacer.<br>
<br>
diff --git a/doc/status.html b/doc/status.html
index c1a42963..f9e5852c 100644
--- a/doc/status.html
+++ b/doc/status.html
@@ -2,19 +2,19 @@
<html><head><title>rsyslog status page</title></head>
<body>
<h2>rsyslog status page</h2>
-<p>This page reflects the status as of 2008-11-26.</p>
+<p>This page reflects the status as of 2009-02-02.</p>
<h2>Current Releases</h2>
-<p><b>development:</b> 4.1.3 [2008-12-17] -
-<a href="http://www.rsyslog.com/Article335.phtml">change log</a> -
-<a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-145.phtml">download</a>
+<p><b>development:</b> 4.1.4 [2009-01-29] -
+<a href="http://www.rsyslog.com/Article341.phtml">change log</a> -
+<a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-147.phtml">download</a>
-<br><b>beta:</b> 3.21.9 [2008-12-04] -
-<a href="http://www.rsyslog.com/Article330.phtml">change log</a> -
-<a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-142.phtml">download</a></p>
+<br><b>beta:</b> 3.21.10 [2009-02-02] -
+<a href="http://www.rsyslog.com/Article344.phtml">change log</a> -
+<a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-148.phtml">download</a></p>
-<p><b>v3 stable:</b> 3.20.2 [2008-12-04] - <a href="http://www.rsyslog.com/Article329.phtml">change log</a> -
-<a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-141.phtml">download</a>
+<p><b>v3 stable:</b> 3.20.3 [2009-01-19] - <a href="http://www.rsyslog.com/Article339.phtml">change log</a> -
+<a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-146.phtml">download</a>
<br><b>v2 stable:</b> 2.0.6 [2008-08-07] - <a href="http://www.rsyslog.com/Article266.phtml">change log</a> -
<a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-125.phtml">download</a>
@@ -24,7 +24,8 @@ upgrade, you may consider purchasing a
out that it is really not a good idea to still run a v0 version.
<p><a href="v3compatibility.html">If you updgrade from version 2, be sure to read the rsyslog v3
-compatibility document.</a></p>
+compatibility document.</a> There are no additional compatibility concerns at this time for
+upgrading from v3 to v4. If some occur, we will post an additional compatiblity document.</p>
<p>(<a href="version_naming.html">How are versions named?</a>)</p>
<h2>Platforms</h2>
diff --git a/runtime/atomic.h b/runtime/atomic.h
index 7ad8e2e4..fdf64214 100644
--- a/runtime/atomic.h
+++ b/runtime/atomic.h
@@ -47,7 +47,14 @@
# define ATOMIC_FETCH_32BIT(data) ((unsigned) __sync_fetch_and_and(&(data), 0xffffffff))
# define ATOMIC_STORE_1_TO_32BIT(data) __sync_lock_test_and_set(&(data), 1)
#else
-# warning "atomic builtins not available, using nul operations"
+ /* note that we gained parctical proof that theoretical problems DO occur
+ * if we do not properly address them. See this blog post for details:
+ * http://blog.gerhards.net/2009/01/rsyslog-data-race-analysis.html
+ * The bottom line is that if there are no atomics available, we should NOT
+ * simply go ahead and do without them - use mutexes or other things. The
+ * code needs to be checked against all those cases. -- rgerhards, 2009-01-30
+ */
+# warning "atomic builtins not available, using nul operations - rsyslogd will probably be racy!"
# define ATOMIC_INC(data) (++(data))
# define ATOMIC_DEC(data) (--(data))
# define ATOMIC_DEC_AND_FETCH(data) (--(data))
diff --git a/runtime/glbl.c b/runtime/glbl.c
index d06c88ff..28f14320 100644
--- a/runtime/glbl.c
+++ b/runtime/glbl.c
@@ -60,6 +60,7 @@ static int bDropMalPTRMsgs = 0;/* Drop messages which have malicious PTR records
static int option_DisallowWarning = 1; /* complain if message from disallowed sender is received */
static int bDisableDNS = 0; /* don't look up IP addresses of remote messages */
static uchar *LocalHostName = NULL;/* our hostname - read-only after startup */
+static uchar *LocalFQDNName = NULL;/* our hostname as FQDN - read-only after startup */
static uchar *LocalDomain; /* our local domain name - read-only after startup */
static char **StripDomains = NULL;/* these domains may be stripped before writing logs - r/o after s.u., never touched by init */
static char **LocalHosts = NULL;/* these hosts are logged with their hostname - read-only after startup, never touched by init */
@@ -100,6 +101,7 @@ SIMP_PROP(LocalDomain, LocalDomain, uchar*)
SIMP_PROP(StripDomains, StripDomains, char**)
SIMP_PROP(LocalHosts, LocalHosts, char**)
+SIMP_PROP_SET(LocalFQDNName, LocalFQDNName, uchar*)
SIMP_PROP_SET(LocalHostName, LocalHostName, uchar*)
SIMP_PROP_SET(DfltNetstrmDrvr, pszDfltNetstrmDrvr, uchar*) /* TODO: use custom function which frees existing value */
SIMP_PROP_SET(DfltNetstrmDrvrCAF, pszDfltNetstrmDrvrCAF, uchar*) /* TODO: use custom function which frees existing value */
@@ -116,7 +118,27 @@ SIMP_PROP_SET(DfltNetstrmDrvrCertFile, pszDfltNetstrmDrvrCertFile, uchar*) /* TO
static uchar*
GetLocalHostName(void)
{
- return(LocalHostName == NULL ? (uchar*) "[localhost]" : LocalHostName);
+ uchar *pszRet;
+
+ if(LocalHostName == NULL)
+ pszRet = (uchar*) "[localhost]";
+ else {
+ if(GetPreserveFQDN() == 1)
+ pszRet = LocalFQDNName;
+ else
+ pszRet = LocalHostName;
+ }
+ return(pszRet);
+}
+
+
+/* return the current localhost name as FQDN (requires FQDN to be set)
+ * TODO: we should set the FQDN ourselfs in here!
+ */
+static uchar*
+GetLocalFQDNName(void)
+{
+ return(LocalFQDNName == NULL ? (uchar*) "[localhost]" : LocalFQDNName);
}
@@ -186,6 +208,7 @@ CODESTARTobjQueryInterface(glbl)
SIMP_PROP(DropMalPTRMsgs);
SIMP_PROP(Option_DisallowWarning);
SIMP_PROP(DisableDNS);
+ SIMP_PROP(LocalFQDNName)
SIMP_PROP(LocalHostName)
SIMP_PROP(LocalDomain)
SIMP_PROP(StripDomains)
@@ -270,6 +293,8 @@ BEGINObjClassExit(glbl, OBJ_IS_CORE_MODULE) /* class, version */
free(pszWorkDir);
if(LocalHostName != NULL)
free(LocalHostName);
+ if(LocalFQDNName != NULL)
+ free(LocalFQDNName);
ENDObjClassExit(glbl)
/* vi:set ai:
diff --git a/runtime/glbl.h b/runtime/glbl.h
index 205a5212..5bdf4f57 100644
--- a/runtime/glbl.h
+++ b/runtime/glbl.h
@@ -48,6 +48,7 @@ BEGINinterface(glbl) /* name must also be changed in ENDinterface macro! */
SIMP_PROP(DropMalPTRMsgs, int)
SIMP_PROP(Option_DisallowWarning, int)
SIMP_PROP(DisableDNS, int)
+ SIMP_PROP(LocalFQDNName, uchar*)
SIMP_PROP(LocalHostName, uchar*)
SIMP_PROP(LocalDomain, uchar*)
SIMP_PROP(StripDomains, char**)
diff --git a/runtime/msg.c b/runtime/msg.c
index 2e2d41ad..9aa2ce84 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -190,6 +190,7 @@ static void MsgPrepareEnqueueLockingCase(msg_t *pThis)
* rgerhards, 2008-07-14
*/
pthread_mutexattr_destroy(&pThis->mutAttr);
+ pThis->bDoLock = 1;
ENDfunc
}
@@ -199,14 +200,16 @@ static void MsgLockLockingCase(msg_t *pThis)
{
/* DEV debug only! dbgprintf("MsgLock(0x%lx)\n", (unsigned long) pThis); */
assert(pThis != NULL);
- pthread_mutex_lock(&pThis->mut);
+ if(pThis->bDoLock == 1) /* TODO: this is a testing hack, we should find a way with better performance! -- rgerhards, 2009-01-27 */
+ pthread_mutex_lock(&pThis->mut);
}
static void MsgUnlockLockingCase(msg_t *pThis)
{
/* DEV debug only! dbgprintf("MsgUnlock(0x%lx)\n", (unsigned long) pThis); */
assert(pThis != NULL);
- pthread_mutex_unlock(&pThis->mut);
+ if(pThis->bDoLock == 1) /* TODO: this is a testing hack, we should find a way with better performance! -- rgerhards, 2009-01-27 */
+ pthread_mutex_unlock(&pThis->mut);
}
/* delete the mutex object on message destruction (locking case)
@@ -328,14 +331,13 @@ finalize_it:
BEGINobjDestruct(msg) /* be sure to specify the object type also in END and CODESTART macros! */
int currRefCount;
CODESTARTobjDestruct(msg)
- /* DEV Debugging only ! dbgprintf("msgDestruct\t0x%lx, Ref now: %d\n", (unsigned long)pM, pM->iRefCount - 1); */
-//# ifdef DO_HAVE_ATOMICS
-// currRefCount = ATOMIC_DEC_AND_FETCH(pThis->iRefCount);
-//# else
+ /* DEV Debugging only ! dbgprintf("msgDestruct\t0x%lx, Ref now: %d\n", (unsigned long)pThis, pThis->iRefCount - 1); */
+# ifdef HAVE_ATOMIC_BUILTINS
+ currRefCount = ATOMIC_DEC_AND_FETCH(pThis->iRefCount);
+# else
MsgLock(pThis);
currRefCount = --pThis->iRefCount;
-//# endif
-// we need a mutex, because we may be suspended after getting the refcount but before
+# endif
if(currRefCount == 0)
{
/* DEV Debugging Only! dbgprintf("msgDestruct\t0x%lx, RefCount now 0, doing DESTROY\n", (unsigned long)pThis); */
@@ -395,7 +397,9 @@ CODESTARTobjDestruct(msg)
rsCStrDestruct(&pThis->pCSPROCID);
if(pThis->pCSMSGID != NULL)
rsCStrDestruct(&pThis->pCSMSGID);
+# ifndef HAVE_ATOMIC_BUILTINS
MsgUnlock(pThis);
+# endif
funcDeleteMutex(pThis);
} else {
MsgUnlock(pThis);
@@ -745,6 +749,7 @@ char *getMSG(msg_t *pM)
char *getPRI(msg_t *pM)
{
int pri;
+ BEGINfunc
if(pM == NULL)
return "";
@@ -764,6 +769,7 @@ char *getPRI(msg_t *pM)
}
MsgUnlock(pM);
+ ENDfunc
return (char*)pM->pszPRI;
}
diff --git a/runtime/msg.h b/runtime/msg.h
index d98111a8..c8350626 100644
--- a/runtime/msg.h
+++ b/runtime/msg.h
@@ -51,6 +51,7 @@
struct msg {
BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */
pthread_mutexattr_t mutAttr;
+short bDoLock; /* use the mutex? */
pthread_mutex_t mut;
flowControl_t flowCtlType; /**< type of flow control we can apply, for enqueueing, needs not to be persisted because
once data has entered the queue, this property is no longer needed. */
diff --git a/runtime/net.c b/runtime/net.c
index 6fa27658..4e6d54a1 100644
--- a/runtime/net.c
+++ b/runtime/net.c
@@ -116,6 +116,30 @@ setAllowRoot(struct AllowedSenders **ppAllowRoot, uchar *pszType)
finalize_it:
RETiRet;
}
+/* re-initializes (sets to NULL) the correct allow root pointer
+ * rgerhards, 2009-01-12
+ */
+static inline rsRetVal
+reinitAllowRoot(uchar *pszType)
+{
+ DEFiRet;
+
+ if(!strcmp((char*)pszType, "UDP"))
+ pAllowedSenders_UDP = NULL;
+ else if(!strcmp((char*)pszType, "TCP"))
+ pAllowedSenders_TCP = NULL;
+#ifdef USE_GSSAPI
+ else if(!strcmp((char*)pszType, "GSS"))
+ pAllowedSenders_GSS = NULL;
+#endif
+ else {
+ dbgprintf("program error: invalid allowed sender ID '%s', denying...\n", pszType);
+ ABORT_FINALIZE(RS_RET_CODE_ERR); /* everything is invalid for an invalid type */
+ }
+
+finalize_it:
+ RETiRet;
+}
/* add a wildcard entry to this permitted peer. Entries are always
@@ -556,6 +580,11 @@ clearAllowedSenders(uchar *pszType)
free(pPrev->allowedSender.addr.NetAddr);
free(pPrev);
}
+
+ /* indicate root pointer is de-init (was forgotten previously, resulting in
+ * all kinds of interesting things) -- rgerhards, 2009-01-12
+ */
+ reinitAllowRoot(pszType);
}
diff --git a/tools/omfile.c b/tools/omfile.c
index 00a82933..1539ae19 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -405,25 +405,30 @@ static void prepareFile(instanceData *pData, uchar *newFileName)
*/
if(makeFileParentDirs(newFileName, strlen((char*)newFileName),
pData->fDirCreateMode, pData->dirUID,
- pData->dirGID, pData->bFailOnChown) == 0) {
- pData->fd = open((char*) newFileName, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY,
- pData->fCreateMode);
- if(pData->fd != -1) {
- /* check and set uid/gid */
- if(pData->fileUID != (uid_t)-1 || pData->fileGID != (gid_t) -1) {
- /* we need to set owner/group */
- if(fchown(pData->fd, pData->fileUID, pData->fileGID) != 0) {
- if(pData->bFailOnChown) {
- int eSave = errno;
- close(pData->fd);
- pData->fd = -1;
- errno = eSave;
- }
- /* we will silently ignore the chown() failure
- * if configured to do so.
- */
- }
+ pData->dirGID, pData->bFailOnChown) != 0) {
+ return; /* we give up */
+ }
+ }
+ /* no matter if we needed to create directories or not, we now try to create
+ * the file. -- rgerhards, 2008-12-18 (based on patch from William Tisater)
+ */
+ pData->fd = open((char*) newFileName, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY,
+ pData->fCreateMode);
+ if(pData->fd != -1) {
+ /* check and set uid/gid */
+ if(pData->fileUID != (uid_t)-1 || pData->fileGID != (gid_t) -1) {
+ /* we need to set owner/group */
+ if(fchown(pData->fd, pData->fileUID,
+ pData->fileGID) != 0) {
+ if(pData->bFailOnChown) {
+ int eSave = errno;
+ close(pData->fd);
+ pData->fd = -1;
+ errno = eSave;
}
+ /* we will silently ignore the chown() failure
+ * if configured to do so.
+ */
}
}
}
diff --git a/tools/rsyslogd.8 b/tools/rsyslogd.8
index 86c4bf66..7abcf97a 100644
--- a/tools/rsyslogd.8
+++ b/tools/rsyslogd.8
@@ -74,7 +74,7 @@ are in order. First of all there has been a systematic attempt to
ensure that rsyslogd follows its default, standard BSD behavior. Of course,
some configuration file changes are necessary in order to support the
template system. However, rsyslogd should be able to use a standard
-syslog.conf and act like the orginal syslogd. However, an original syslogd
+syslog.conf and act like the original syslogd. However, an original syslogd
will not work correctly with a rsyslog-enhanced configuration file. At
best, it will generate funny looking file names.
The second important concept to note is that this version of rsyslogd
@@ -98,13 +98,13 @@ the error element is ignored. It is tried to parse the rest of the line.
.B -c option controls the backward compatibility mode in use.
.TP
.BI "\-A"
-When sending UDP messages, there are potentially multiple pathes to
+When sending UDP messages, there are potentially multiple paths to
the target destination. By default,
.B rsyslogd
only sends to the first target it can successfully send to. If -A
is given, messages are sent to all targets. This may improve
-reliability, but may also cause message duplicaton. This option
-should enabled only if it is fully understood.
+reliability, but may also cause message duplication. This option
+should be enabled only if it is fully understood.
.TP
.BI "\-4"
Causes
@@ -135,7 +135,7 @@ to sysklogd, which is the default if -c is not given.
.B Please note that rsyslogd issues warning messages if the -c3
.B command line option is not given.
This is to alert you that your are running in compatibility
-mode. Compatibility mode interfers with you rsyslog.conf commands and
+mode. Compatibility mode interferes with your rsyslog.conf commands and
may cause some undesired side-effects. It is meant to be used with a
plain old rsyslog.conf - if you use new features, things become
messy. So the best advice is to work through this document, convert
@@ -186,7 +186,7 @@ is started and controlled by
.BR init (8).
.TP
.BI "\-q " "add hostname if DNS fails during ACL processing"
-During ACL processing, hostnames are resolved to IP addreses for
+During ACL processing, hostnames are resolved to IP addresses for
performance reasons. If DNS fails during that process, the hostname
is added as wildcard text, which results in proper, but somewhat
slower operation once DNS is up again.
@@ -221,7 +221,7 @@ an -u option, make sure you really understand what you do and why you do it.
Print version and exit.
.TP
.B "\-w"
-Supress warnings issued when messages are received from non-authorized
+Suppress warnings issued when messages are received from non-authorized
machines (those, that are in no AllowedSender list).
.TP
.B "\-x"
@@ -375,7 +375,7 @@ you can't access the documentation...
.TP
.B RSYSLOG_DEBUGLOG
-If set, writes (allmost) all debug message to the specified log file
+If set, writes (almost) all debug message to the specified log file
in addition to stdout.
.TP
.B RSYSLOG_MODDIR
@@ -383,7 +383,7 @@ Provides the default directory in which loadable modules reside.
.PD
.SH BUGS
Please review the file BUGS for up-to-date information on known
-bugs and annouyances.
+bugs and annoyances.
.SH Further Information
Please visit
.BR http://www.rsyslog.com/doc
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 138bdfd8..9ced4562 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -1648,7 +1648,7 @@ logmsg(msg_t *pMsg, int flags)
assert(pMsg != NULL);
assert(pMsg->pszUxTradMsg != NULL);
msg = (char*) pMsg->pszUxTradMsg;
- dbgprintf("logmsg: flags %x, pri %s, from '%s', msg %s\n", flags, getPRI(pMsg), getRcvFrom(pMsg), msg);
+ dbgprintf("logmsg: flags %x, from '%s', msg %s\n", flags, getRcvFrom(pMsg), msg);
/* rger 2005-11-24 (happy thanksgiving!): we now need to check if we have
* a traditional syslog message or one formatted according to syslog-protocol.
@@ -1903,9 +1903,11 @@ static void doDie(int sig)
# define MSG1 "DoDie called.\n"
# define MSG2 "DoDie called 5 times - unconditional exit\n"
static int iRetries = 0; /* debug aid */
- write(1, MSG1, sizeof(MSG1));
+ if(Debug || NoFork)
+ write(1, MSG1, sizeof(MSG1) - 1);
if(iRetries++ == 4) {
- write(1, MSG2, sizeof(MSG2));
+ if(Debug || NoFork)
+ write(1, MSG2, sizeof(MSG2) - 1);
abort();
}
bFinished = sig;
@@ -2431,6 +2433,7 @@ init(void)
ABORT_FINALIZE(RS_RET_VALIDATION_RUN);
/* switch the message object to threaded operation, if necessary */
+/* TODO:XXX: I think we must do this also if we have action queues! -- rgerhards, 2009-01-26 */
if(MainMsgQueType == QUEUETYPE_DIRECT || iMainMsgQueueNumWorkers > 1) {
MsgEnableThreadSafety();
}
@@ -2907,6 +2910,11 @@ static void printVersion(void)
#else
printf("\tFEATURE_DEBUG (debug build, slow code):\tNo\n");
#endif
+#ifdef HAVE_ATOMIC_BUILTINS
+ printf("\tAtomic operations supported:\t\tYes\n");
+#else
+ printf("\tAtomic operations supported:\t\tNo\n");
+#endif
#ifdef RTINST
printf("\tRuntime Instrumentation (slow code):\tYes\n");
#else
@@ -3288,6 +3296,7 @@ int realMain(int argc, char **argv)
uchar legacyConfLine[80];
uchar *LocalHostName;
uchar *LocalDomain;
+ uchar *LocalFQDNName;
/* first, parse the command line options. We do not carry out any actual work, just
* see what we should do. This relieves us from certain anomalies and we can process
@@ -3392,7 +3401,9 @@ int realMain(int argc, char **argv)
/* get our host and domain names - we need to do this early as we may emit
* error log messages, which need the correct hostname. -- rgerhards, 2008-04-04
*/
- net.getLocalHostname(&LocalHostName);
+ net.getLocalHostname(&LocalFQDNName);
+ CHKmalloc(LocalHostName = (uchar*) strdup((char*)LocalFQDNName));
+ glbl.SetLocalFQDNName(LocalFQDNName); /* set the FQDN before we modify it */
if((p = (uchar*)strchr((char*)LocalHostName, '.'))) {
*p++ = '\0';
LocalDomain = p;