summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-06-19 10:54:44 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-06-19 10:54:44 +0000
commitf74255db2dbaf79fb3f43a23c4f6f19eb4fca87e (patch)
tree3dcb497874e1decc7f775d13fdc4ec14c51cfb4a
parent986309c531395d55f703dffa1af03d1e8d936fb0 (diff)
downloadrsyslog-f74255db2dbaf79fb3f43a23c4f6f19eb4fca87e.tar.gz
rsyslog-f74255db2dbaf79fb3f43a23c4f6f19eb4fca87e.tar.xz
rsyslog-f74255db2dbaf79fb3f43a23c4f6f19eb4fca87e.zip
fixed a bug that caused the tag to be missing on internal message (like
startup)
-rw-r--r--syslogd.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/syslogd.c b/syslogd.c
index 101df479..f6f8f4ff 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -435,7 +435,7 @@ int funix[MAXFUNIX] = { -1, }; /* read-only after startup */
/* Flags to logmsg().
*/
-/* NO LONGER NEEDED: #define IGN_CONS 0x001 * don't print on console */
+#define INTERNAL_MSG 0x001 /* msg generated by logmsgInternal() --> special handling */
#define SYNC_FILE 0x002 /* do fsync on file after printing */
#define ADDDATE 0x004 /* add a date to the message */
#define MARK 0x008 /* this message is a mark */
@@ -4176,7 +4176,7 @@ static void logmsgInternal(int pri, char * msg, char* from, int flags)
pMsg->bParseHOSTNAME = 0;
getCurrTime(&(pMsg->tTIMESTAMP)); /* use the current time! */
- logmsg(pri, pMsg, flags);
+ logmsg(pri, pMsg, flags | INTERNAL_MSG);
MsgDestruct(pMsg);
}
@@ -4870,7 +4870,7 @@ static int parseLegacySyslogMsg(struct msg *pMsg, int flags)
* is meant to be an interim solution, but for now it is in the code.
*/
- if(bParseHOSTNAMEandTAG) {
+ if(bParseHOSTNAMEandTAG && !(flags & INTERNAL_MSG)) {
/* parse HOSTNAME - but only if this is network-received!
* rger, 2005-11-14: we still have a problem with BSD messages. These messages
* do NOT include a host name. In most cases, this leads to the TAG to be treated
@@ -4975,8 +4975,11 @@ static int parseLegacySyslogMsg(struct msg *pMsg, int flags)
/* we enter this code area when the user has instructed rsyslog NOT
* to parse HOSTNAME and TAG - rgerhards, 2006-03-13
*/
- dprintf("HOSTNAME and TAG not parsed by user configuraton.\n");
- MsgSetHOSTNAME(pMsg, getRcvFrom(pMsg));
+ if(!(flags & INTERNAL_MSG))
+ {
+ dprintf("HOSTNAME and TAG not parsed by user configuraton.\n");
+ MsgSetHOSTNAME(pMsg, getRcvFrom(pMsg));
+ }
}
/* The rest is the actual MSG */