From 60b8ce14bf33e76237cf82dd1f68acc750e64316 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 8 Dec 2008 15:42:47 +0100 Subject: added $PreserveFQDN config file directive Enables to use FQDNs in sender names where the legacy default --- runtime/net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/net.c') diff --git a/runtime/net.c b/runtime/net.c index 1472b4db..30c923fe 100644 --- a/runtime/net.c +++ b/runtime/net.c @@ -1204,7 +1204,9 @@ rsRetVal cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN * make this in option in the long term. (rgerhards, 2007-09-11) */ strcpy((char*)pszHost, (char*)pszHostFQDN); - if ((p = (uchar*) strchr((char*)pszHost, '.'))) { /* find start of domain name "machine.example.com" */ + if( (glbl.GetPreserveFQDN() == 0) + && (p = (uchar*) strchr((char*)pszHost, '.'))) { /* find start of domain name "machine.example.com" */ + strcmp((char*)(p + 1), (char*)glbl.GetLocalDomain())); if(strcmp((char*)(p + 1), (char*)glbl.GetLocalDomain()) == 0) { *p = '\0'; /* simply terminate the string */ } else { -- cgit v1.2.3 From a10bc421fffbeaa872ae0cdcb651f0a7e613ee7f Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 8 Dec 2008 19:55:27 +0100 Subject: resolved compile problem, e.g. on FreeBSD I commented out some debug code that is only useful in some testing scenarios and re-enabled the old code. This solved a FreeBSD compile issue. Also, I fixed some other syntax error, which somehow went into the tree (I am still puzzled about that, especially as some have already and successfully build from that tree... anyhow ;)). --- runtime/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/net.c') diff --git a/runtime/net.c b/runtime/net.c index 30c923fe..6fa27658 100644 --- a/runtime/net.c +++ b/runtime/net.c @@ -1206,7 +1206,7 @@ rsRetVal cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN strcpy((char*)pszHost, (char*)pszHostFQDN); if( (glbl.GetPreserveFQDN() == 0) && (p = (uchar*) strchr((char*)pszHost, '.'))) { /* find start of domain name "machine.example.com" */ - strcmp((char*)(p + 1), (char*)glbl.GetLocalDomain())); + strcmp((char*)(p + 1), (char*)glbl.GetLocalDomain()); if(strcmp((char*)(p + 1), (char*)glbl.GetLocalDomain()) == 0) { *p = '\0'; /* simply terminate the string */ } else { -- cgit v1.2.3 From 2e388db9ac91eae35ac836b329c8bcadd319a409 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 5 Mar 2009 11:10:43 +0100 Subject: integrated various patches for solaris Unfortunatley, I do not have the full list of contributors available. The patch set was compiled by Ben Taylor, and I made some further changes to adopt it to the news rsyslog branch. Others provided much of the base work, but I can not find the names of the original authors. If you happen to be one of them, please let me know so that I can give proper credits. --- runtime/net.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/net.c') diff --git a/runtime/net.c b/runtime/net.c index 4e6d54a1..db2d7e37 100644 --- a/runtime/net.c +++ b/runtime/net.c @@ -63,6 +63,11 @@ #include "errmsg.h" #include "net.h" +#ifdef OS_SOLARIS +# define s6_addr32 _S6_un._S6_u32 + typedef unsigned int u_int32_t; +#endif + MODULE_TYPE_LIB /* static data */ -- cgit v1.2.3