summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2013-03-05 17:35:26 +0100
committerMichael Biebl <biebl@debian.org>2013-03-05 17:35:26 +0100
commitac1a840d0afd724fa614eed5d64112a9ecf097f8 (patch)
tree29fc7cd1a00820ae3bda8e5b08e32da89c055e60 /runtime
parent3793efd744861415cbb0e10df6ac9eab7b21e78e (diff)
downloadrsyslog-ac1a840d0afd724fa614eed5d64112a9ecf097f8.tar.gz
Imported Upstream version 7.2.6upstream/7.2.6
Diffstat (limited to 'runtime')
-rw-r--r--runtime/datetime.c4
-rw-r--r--runtime/msg.c7
-rw-r--r--runtime/net.c4
-rw-r--r--runtime/srutils.c3
4 files changed, 16 insertions, 2 deletions
diff --git a/runtime/datetime.c b/runtime/datetime.c
index 7d97447..e839bf1 100644
--- a/runtime/datetime.c
+++ b/runtime/datetime.c
@@ -305,8 +305,10 @@ ParseTIMESTAMP3339(struct syslogTime *pTime, uchar** ppszTS, int *pLenStr)
if(OffsetHour < 0 || OffsetHour > 23)
ABORT_FINALIZE(RS_RET_INVLD_TIME);
- if(lenStr == 0 || *pszTS++ != ':')
+ if(lenStr == 0 || *pszTS != ':')
ABORT_FINALIZE(RS_RET_INVLD_TIME);
+ --lenStr;
+ pszTS++;
OffsetMinute = srSLMGParseInt32(&pszTS, &lenStr);
if(OffsetMinute < 0 || OffsetMinute > 59)
ABORT_FINALIZE(RS_RET_INVLD_TIME);
diff --git a/runtime/msg.c b/runtime/msg.c
index 10605ba..32a0242 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -36,7 +36,9 @@
#include <assert.h>
#include <ctype.h>
#include <sys/socket.h>
+#if HAVE_SYSINFO_UPTIME
#include <sys/sysinfo.h>
+#endif
#include <netdb.h>
#include <libestr.h>
#include <json/json.h>
@@ -2773,7 +2775,10 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
*pbMustBeFreed = 0;
break;
case PROP_SYS_UPTIME:
-# ifndef HAVE_SYSINFO
+# ifndef HAVE_SYSINFO_UPTIME
+ /* An alternative on some systems (eg Solaris) is to scan
+ * /var/adm/utmpx for last boot time.
+ */
pRes = (uchar*) "UPTIME NOT available on this system";
*pbMustBeFreed = 0;
# else
diff --git a/runtime/net.c b/runtime/net.c
index dcf9cb5..1a8f243 100644
--- a/runtime/net.c
+++ b/runtime/net.c
@@ -54,7 +54,11 @@
#include <fnmatch.h>
#include <fcntl.h>
#include <unistd.h>
+#if HAVE_GETIFADDRS
#include <ifaddrs.h>
+#else
+#include "compat/ifaddrs.h"
+#endif /* HAVE_GETIFADDRS */
#include <sys/types.h>
#include <arpa/inet.h>
diff --git a/runtime/srutils.c b/runtime/srutils.c
index f420c0f..4ce6196 100644
--- a/runtime/srutils.c
+++ b/runtime/srutils.c
@@ -92,6 +92,9 @@ syslogName_t syslogFacNames[] = {
#if defined(LOG_FTP)
{"ftp", LOG_FTP},
#endif
+#if defined(LOG_AUDIT)
+ {"audit", LOG_AUDIT},
+#endif
{"local0", LOG_LOCAL0},
{"local1", LOG_LOCAL1},
{"local2", LOG_LOCAL2},