Menu

#51 Hostname Truncated - Ver 1.10

open
nobody
None
5
2003-10-13
2003-10-13
Bob Perkins
No

Following was posted to the msyslog-users list on 7/9/2003:

I found a situation in Ver 1.10 where messages received
via im_tcp had the originating hostname truncated when
the message was written to a file via
om_classic. This results from a situation in
src/modules/im_tcp.c (HEAD, Rev 1.50) where the
originating hostname is stored in m->host, but its
length is not stored in m->hlen. The following patch
resolves this problem.

Bob

===========================
--- src/modules/im_tcp.c.orig Mon Jun 16 15:18:40 2003
+++ src/modules/im_tcp.c Tue Jul 8 23:16:34 2003
@@ -305,9 +305,9 @@
m->fields |= M_FIELD_FLAGS;

if (!(c->flags & M_USEMSGHOST)) {
-
strncpy(m->host, con->name, sizeof
(m->host) - 1);
m->host[sizeof (m->host) - 1] = '\0';
+ m->hlen = strlen(m->host);
m->fields |= M_FIELD_HOST;
}

===========================

Discussion


Log in to post a comment.