File syslog-ng-afunix_no_hostname.dif of Package syslog-ng
--- src/afsocket.c
+++ src/afsocket.c 2008/02/26 17:27:05
@@ -224,7 +224,7 @@ afsocket_sc_init(LogPipe *s, GlobalConfi
AFSocketSourceConnection *self = (AFSocketSourceConnection *) s;
self->reader = log_reader_new(fd_read_new(self->sock, (self->owner->flags & AFSOCKET_DGRAM) ? FR_RECV : 0),
- ((self->owner->flags & AFSOCKET_LOCAL) ? LR_LOCAL : 0) |
+ ((self->owner->flags & AFSOCKET_LOCAL) ? (LR_LOCAL|LR_NO_HOSTNAME) : 0) |
((self->owner->flags & AFSOCKET_DGRAM) ? LR_PKTTERM : 0),
s, &self->owner->reader_options);
log_pipe_append(self->reader, s);
--- src/logmsg.c
+++ src/logmsg.c 2008/02/26 17:08:11
@@ -429,6 +429,7 @@ log_msg_parse(LogMessage *self, gchar *d
oldsrc = src;
oldleft = left;
+ if(!(flags & LP_NO_HOSTNAME)) {
while (left && *src != ' ' && *src != ':' && *src != '[' && dst < sizeof(hostname_buf) - 1)
{
if (flags & LP_CHECK_HOSTNAME &&
@@ -463,6 +464,7 @@ log_msg_parse(LogMessage *self, gchar *d
src = oldsrc;
left = oldleft;
}
+ }
/* Skip whitespace. */
while (left && *src == ' ')
--- src/logmsg.h
+++ src/logmsg.h 2008/02/26 16:58:53
@@ -39,6 +39,7 @@
#define LP_CHECK_HOSTNAME 0x0008
#define LP_STRICT 0x0010
#define LP_KERNEL 0x0020
+#define LP_NO_HOSTNAME 0x0040
#define LF_UNPARSED 0x0001
#define LF_INTERNAL 0x0002
--- src/logreader.c
+++ src/logreader.c 2008/02/26 17:22:59
@@ -245,7 +245,9 @@ log_reader_iterate_buf(LogReader *self,
if (self->flags & LR_INTERNAL)
parse_flags |= LP_INTERNAL;
if (self->flags & LR_LOCAL)
- parse_flags |= LF_LOCAL;
+ parse_flags |= LP_LOCAL;
+ if (self->flags & LR_NO_HOSTNAME)
+ parse_flags |= LP_NO_HOSTNAME;
if ((self->flags & LR_PKTTERM) ||
(!eol && (self->ofs == self->options->msg_size)) ||
--- src/logreader.h
+++ src/logreader.h 2008/02/26 17:29:31
@@ -36,6 +36,7 @@
#define LR_NOMREAD 0x0008
#define LR_FOLLOW 0x0010
#define LR_STRICT 0x0020
+#define LR_NO_HOSTNAME 0x0040
#define LR_COMPLETE_LINE 0x0100