summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2015-08-17 17:51:18 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2015-08-24 13:58:18 +0200
commitdb83394a6bcfe6a8e720f1dde9cb803aa918d2b4 (patch)
tree25ca370e96a21c0532a614694bd6e9fe66c3daf3
parentaa89c5154a816ff26017f1abbfdbd41827c0569c (diff)
downloadmeta-openembedded-db83394a6bcfe6a8e720f1dde9cb803aa918d2b4.tar.gz
rsyslog: upgrade to 7.6.1
1. remove two backport patch: 0001-bugfix-potential-abort-during-HUP.patch and 0001-remove-memleak-introduced-by-GenerateLocalHostName-H.patch 2. update the patch json-0.12-fix.patch 3. remove a obsolete patch rsyslog-use-serial-tests-config-needed-by-ptest.patch 4. update the Dependence 5. update the checksum Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/0001-bugfix-potential-abort-during-HUP.patch91
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/0001-remove-memleak-introduced-by-GenerateLocalHostName-H.patch103
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/json-0.12-fix.patch18
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-use-serial-tests-config-needed-by-ptest.patch28
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog_7.6.1.bb (renamed from meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb)11
5 files changed, 14 insertions, 237 deletions
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/0001-bugfix-potential-abort-during-HUP.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/0001-bugfix-potential-abort-during-HUP.patch
deleted file mode 100644
index 14e8b3f5a..000000000
--- a/meta-oe/recipes-extended/rsyslog/rsyslog/0001-bugfix-potential-abort-during-HUP.patch
+++ /dev/null
@@ -1,91 +0,0 @@
1From 9a775051f7373176c6e54bee1110965342dd41ad Mon Sep 17 00:00:00 2001
2From: Rainer Gerhards <rgerhards@adiscon.com>
3Date: Mon, 28 Oct 2013 12:56:02 +0100
4Subject: [PATCH] bugfix: potential abort during HUP
5
6This could happen when one of imklog, imzmq3, imkmsg, impstats,
7imjournal, or imuxsock were under heavy load during a HUP.
8closes: http://bugzilla.adiscon.com/show_bug.cgi?id=489
9Thanks to Guy Rozendorn for reporting the problem and Peval Levhshin for
10his analysis.
11
12Upstream-Status: backport
13
14Signed-off-by: Li Zhou <li.zhou@windriver.com>
15---
16 ChangeLog | 6 ++++++
17 runtime/glbl.c | 25 ++++++++++++++++++-------
18 2 files changed, 24 insertions(+), 7 deletions(-)
19
20Index: rsyslog-7.4.4/ChangeLog
21===================================================================
22--- rsyslog-7.4.4.orig/ChangeLog
23+++ rsyslog-7.4.4/ChangeLog
24@@ -1,5 +1,11 @@
25 ---------------------------------------------------------------------------
26 Version 7.4.4 [v7.4-stable] 2013-09-03
27+- bugfix: potential abort during HUP
28+ This could happen when one of imklog, imzmq3, imkmsg, impstats,
29+ imjournal, or imuxsock were under heavy load during a HUP.
30+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=489
31+ Thanks to Guy Rozendorn for reporting the problem and Peval Levhshin for
32+ his analysis.
33 - better error messages in GuardTime signature provider
34 Thanks to Ahto Truu for providing the patch.
35 - make rsyslog use the new json-c pkgconfig file if available
36Index: rsyslog-7.4.4/runtime/glbl.c
37===================================================================
38--- rsyslog-7.4.4.orig/runtime/glbl.c
39+++ rsyslog-7.4.4/runtime/glbl.c
40@@ -32,6 +32,7 @@
41 #include <sys/types.h>
42 #include <sys/stat.h>
43 #include <unistd.h>
44+#include <pthread.h>
45 #include <assert.h>
46
47 #include "rsyslog.h"
48@@ -379,17 +380,24 @@ GetLocalDomain(void)
49 /* generate the local hostname property. This must be done after the hostname info
50 * has been set as well as PreserveFQDN.
51 * rgerhards, 2009-06-30
52+ * NOTE: This function DELIBERATELY introduces a small memory leak in order to gain
53+ * speed. Each time it is called when a property name already exists, a new one is
54+ * allocated but the previous one is NOT freed. This is so that current readers can
55+ * continue to use the previous name. Otherwise, we would need to use read/write locks
56+ * to protect the update process. As this function is called extremely infrequently and
57+ * the memory leak is very small, this is totally accessible. Think that otherwise we
58+ * would need to place a read look each time the property is read, which is much more
59+ * frequent (once per message for the modules that use this local hostname!).
60+ * rgerhards, 2013-10-28
61 */
62 static rsRetVal
63 GenerateLocalHostNameProperty(void)
64 {
65- DEFiRet;
66+ prop_t *hostnameNew;
67 uchar *pszName;
68+ DEFiRet;
69
70- if(propLocalHostName != NULL)
71- prop.Destruct(&propLocalHostName);
72-
73- CHKiRet(prop.Construct(&propLocalHostName));
74+ CHKiRet(prop.Construct(&hostnameNew));
75 if(LocalHostNameOverride == NULL) {
76 if(LocalHostName == NULL)
77 pszName = (uchar*) "[localhost]";
78@@ -403,8 +411,11 @@ GenerateLocalHostNameProperty(void)
79 pszName = LocalHostNameOverride;
80 }
81 DBGPRINTF("GenerateLocalHostName uses '%s'\n", pszName);
82- CHKiRet(prop.SetString(propLocalHostName, pszName, ustrlen(pszName)));
83- CHKiRet(prop.ConstructFinalize(propLocalHostName));
84+ CHKiRet(prop.SetString(hostnameNew, pszName, ustrlen(pszName)));
85+ CHKiRet(prop.ConstructFinalize(hostnameNew));
86+
87+ propLocalHostName = hostnameNew;
88+ /* inititional MEM LEAK for old value -- see function hdr comment! */
89
90 finalize_it:
91 RETiRet;
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/0001-remove-memleak-introduced-by-GenerateLocalHostName-H.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/0001-remove-memleak-introduced-by-GenerateLocalHostName-H.patch
deleted file mode 100644
index fcc5d8ebf..000000000
--- a/meta-oe/recipes-extended/rsyslog/rsyslog/0001-remove-memleak-introduced-by-GenerateLocalHostName-H.patch
+++ /dev/null
@@ -1,103 +0,0 @@
1From 17e1ee2539cea6bac16832b488afd52b20a348ac Mon Sep 17 00:00:00 2001
2From: Rainer Gerhards <rgerhards@adiscon.com>
3Date: Mon, 28 Oct 2013 14:17:56 +0100
4Subject: [PATCH] remove memleak introduced by GenerateLocalHostName HUP
5 bugfix
6
7Upstream-Status: backport
8
9Signed-off-by: Li Zhou <li.zhou@windriver.com>
10---
11 runtime/glbl.c | 45 ++++++++++++++++++++++++++++++++-------------
12 1 file changed, 32 insertions(+), 13 deletions(-)
13
14diff --git a/runtime/glbl.c b/runtime/glbl.c
15index bcb3795..41d56c2 100644
16--- a/runtime/glbl.c
17+++ b/runtime/glbl.c
18@@ -72,6 +72,7 @@ static int option_DisallowWarning = 1; /* complain if message from disallowed se
19 static int bDisableDNS = 0; /* don't look up IP addresses of remote messages */
20 static prop_t *propLocalIPIF = NULL;/* IP address to report for the local host (default is 127.0.0.1) */
21 static prop_t *propLocalHostName = NULL;/* our hostname as FQDN - read-only after startup */
22+static prop_t *propLocalHostNameToDelete = NULL;/* see GenerateLocalHostName function hdr comment! */
23 static uchar *LocalHostName = NULL;/* our hostname - read-only after startup, except HUP */
24 static uchar *LocalHostNameOverride = NULL;/* user-overridden hostname - read-only after startup */
25 static uchar *LocalFQDNName = NULL;/* our hostname as FQDN - read-only after startup, except HUP */
26@@ -380,24 +381,31 @@ GetLocalDomain(void)
27 /* generate the local hostname property. This must be done after the hostname info
28 * has been set as well as PreserveFQDN.
29 * rgerhards, 2009-06-30
30- * NOTE: This function DELIBERATELY introduces a small memory leak in order to gain
31- * speed. Each time it is called when a property name already exists, a new one is
32- * allocated but the previous one is NOT freed. This is so that current readers can
33- * continue to use the previous name. Otherwise, we would need to use read/write locks
34- * to protect the update process. As this function is called extremely infrequently and
35- * the memory leak is very small, this is totally accessible. Think that otherwise we
36- * would need to place a read look each time the property is read, which is much more
37- * frequent (once per message for the modules that use this local hostname!).
38+ * NOTE: This function tries to avoid locking by not destructing the previous value
39+ * immediately. This is so that current readers can continue to use the previous name.
40+ * Otherwise, we would need to use read/write locks to protect the update process.
41+ * In order to do so, we save the previous value and delete it when we are called again
42+ * the next time. Note that this in theory is racy and can lead to a double-free.
43+ * In practice, however, the window of exposure to trigger this is extremely short
44+ * and as this functions is very infrequently being called (on HUP), the trigger
45+ * condition for this bug is so highly unlikely that it never occurs in practice.
46+ * Probably if you HUP rsyslog every few milliseconds, but who does that...
47+ * To further reduce risk potential, we do only update the property when there
48+ * actually is a hostname change, which makes it even less likely.
49 * rgerhards, 2013-10-28
50 */
51 static rsRetVal
52 GenerateLocalHostNameProperty(void)
53 {
54+ uchar *pszPrev;
55+ int lenPrev;
56 prop_t *hostnameNew;
57 uchar *pszName;
58 DEFiRet;
59
60- CHKiRet(prop.Construct(&hostnameNew));
61+ if(propLocalHostNameToDelete != NULL)
62+ prop.Destruct(&propLocalHostNameToDelete);
63+
64 if(LocalHostNameOverride == NULL) {
65 if(LocalHostName == NULL)
66 pszName = (uchar*) "[localhost]";
67@@ -411,11 +419,20 @@ GenerateLocalHostNameProperty(void)
68 pszName = LocalHostNameOverride;
69 }
70 DBGPRINTF("GenerateLocalHostName uses '%s'\n", pszName);
71- CHKiRet(prop.SetString(hostnameNew, pszName, ustrlen(pszName)));
72- CHKiRet(prop.ConstructFinalize(hostnameNew));
73
74- propLocalHostName = hostnameNew;
75- /* inititional MEM LEAK for old value -- see function hdr comment! */
76+ if(propLocalHostName == NULL)
77+ pszPrev = (uchar*)""; /* make sure strcmp() below does not match */
78+ else
79+ prop.GetString(propLocalHostName, &pszPrev, &lenPrev);
80+
81+ if(ustrcmp(pszPrev, pszName)) {
82+ /* we need to update */
83+ CHKiRet(prop.Construct(&hostnameNew));
84+ CHKiRet(prop.SetString(hostnameNew, pszName, ustrlen(pszName)));
85+ CHKiRet(prop.ConstructFinalize(hostnameNew));
86+ propLocalHostNameToDelete = propLocalHostName;
87+ propLocalHostName = hostnameNew;
88+ }
89
90 finalize_it:
91 RETiRet;
92@@ -678,6 +695,8 @@ BEGINObjClassExit(glbl, OBJ_IS_CORE_MODULE) /* class, version */
93 free(LocalHostNameOverride);
94 free(LocalFQDNName);
95 objRelease(prop, CORE_COMPONENT);
96+ if(propLocalHostNameToDelete != NULL)
97+ prop.Destruct(&propLocalHostNameToDelete);
98 DESTROY_ATOMIC_HELPER_MUT(mutTerminateInputs);
99 ENDObjClassExit(glbl)
100
101--
1021.7.9.5
103
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/json-0.12-fix.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/json-0.12-fix.patch
index 7390a7f54..3dd85a7bb 100644
--- a/meta-oe/recipes-extended/rsyslog/rsyslog/json-0.12-fix.patch
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog/json-0.12-fix.patch
@@ -13,9 +13,10 @@ json-c-0.12 unlike 0.11 doesn't install json -> json-c symlink in include
13Upstream-Status: Backport 13Upstream-Status: Backport
14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> 14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
15 15
16diff -uNr rsyslog-7.4.4.orig/plugins/ommongodb/ommongodb.c rsyslog-7.4.4/plugins/ommongodb/ommongodb.c 16diff --git a/plugins/ommongodb/ommongodb.c b/plugins/ommongodb/ommongodb.c
17--- rsyslog-7.4.4.orig/plugins/ommongodb/ommongodb.c 2013-09-03 11:54:20.000000000 +0200 17index 41c0d76..682c40e 100644
18+++ rsyslog-7.4.4/plugins/ommongodb/ommongodb.c 2015-01-12 16:11:51.542591825 +0100 18--- a/plugins/ommongodb/ommongodb.c
19+++ b/plugins/ommongodb/ommongodb.c
19@@ -33,9 +33,9 @@ 20@@ -33,9 +33,9 @@
20 #include <stdint.h> 21 #include <stdint.h>
21 #include <time.h> 22 #include <time.h>
@@ -23,14 +24,15 @@ diff -uNr rsyslog-7.4.4.orig/plugins/ommongodb/ommongodb.c rsyslog-7.4.4/plugins
23-#include <json.h> 24-#include <json.h>
24+#include <json-c/json.h> 25+#include <json-c/json.h>
25 /* For struct json_object_iter, should not be necessary in future versions */ 26 /* For struct json_object_iter, should not be necessary in future versions */
26-#include <json/json_object_private.h> 27-#include <json_object_private.h>
27+#include <json-c/json_object_private.h> 28+#include <json-c/json_object_private.h>
28 29
29 #include "rsyslog.h" 30 #include "rsyslog.h"
30 #include "conf.h" 31 #include "conf.h"
31diff -uNr rsyslog-7.4.4.orig/runtime/msg.c rsyslog-7.4.4/runtime/msg.c 32diff --git a/runtime/msg.c b/runtime/msg.c
32--- rsyslog-7.4.4.orig/runtime/msg.c 2013-09-03 12:31:42.000000000 +0200 33index d04ce7b..b367e1f 100644
33+++ rsyslog-7.4.4/runtime/msg.c 2015-01-12 16:12:00.403592142 +0100 34--- a/runtime/msg.c
35+++ b/runtime/msg.c
34@@ -41,9 +41,9 @@ 36@@ -41,9 +41,9 @@
35 #endif 37 #endif
36 #include <netdb.h> 38 #include <netdb.h>
@@ -38,7 +40,7 @@ diff -uNr rsyslog-7.4.4.orig/runtime/msg.c rsyslog-7.4.4/runtime/msg.c
38-#include <json.h> 40-#include <json.h>
39+#include <json-c/json.h> 41+#include <json-c/json.h>
40 /* For struct json_object_iter, should not be necessary in future versions */ 42 /* For struct json_object_iter, should not be necessary in future versions */
41-#include <json/json_object_private.h> 43-#include <json_object_private.h>
42+#include <json-c/json_object_private.h> 44+#include <json-c/json_object_private.h>
43 #if HAVE_MALLOC_H 45 #if HAVE_MALLOC_H
44 # include <malloc.h> 46 # include <malloc.h>
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-use-serial-tests-config-needed-by-ptest.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-use-serial-tests-config-needed-by-ptest.patch
deleted file mode 100644
index 3a16f2649..000000000
--- a/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-use-serial-tests-config-needed-by-ptest.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1Subject: [PATCH] rsyslog: use serial-tests config needed by ptest
2
3ptest needs buildtest-TESTS and runtest-TESTS targets.
4serial-tests is required to generate those targets.
5
6Upstream-Status: Inappropriate [default automake behavior incompatible with ptest]
7
8Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
9---
10 configure.ac | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/configure.ac b/configure.ac
14index 1b880f8..0e29742 100644
15--- a/configure.ac
16+++ b/configure.ac
17@@ -3,7 +3,7 @@
18
19 AC_PREREQ(2.61)
20 AC_INIT([rsyslog],[7.4.4],[rsyslog@lists.adiscon.com])
21-AM_INIT_AUTOMAKE
22+AM_INIT_AUTOMAKE([serial-tests])
23
24 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
25
26--
272.0.0
28
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb b/meta-oe/recipes-extended/rsyslog/rsyslog_7.6.1.bb
index 9c85a41e4..15b0f291d 100644
--- a/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog_7.6.1.bb
@@ -9,7 +9,7 @@ Rsyslog is an enhanced syslogd supporting, among others, MySQL,\
9 encryption protected syslog relay chains while at the same time being\ 9 encryption protected syslog relay chains while at the same time being\
10 very easy to setup for the novice user." 10 very easy to setup for the novice user."
11 11
12DEPENDS = "zlib libestr json-c bison-native flex-native" 12DEPENDS = "zlib libestr json-c bison-native flex-native liblogging"
13HOMEPAGE = "http://www.rsyslog.com/" 13HOMEPAGE = "http://www.rsyslog.com/"
14LICENSE = "GPLv3 & LGPLv3 & Apache-2.0" 14LICENSE = "GPLv3 & LGPLv3 & Apache-2.0"
15LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \ 15LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \
@@ -17,21 +17,18 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \
17 file://COPYING.ASL20;md5=052f8a09206615ab07326ff8ce2d9d32\ 17 file://COPYING.ASL20;md5=052f8a09206615ab07326ff8ce2d9d32\
18" 18"
19 19
20SRC_URI = "http://www.rsyslog.com/files/download/rsyslog/${BPN}-${PV}.tar.gz \ 20SRC_URI = "http://www.rsyslog.com/download/files/download/rsyslog/${BPN}-${PV}.tar.gz \
21 file://initscript \ 21 file://initscript \
22 file://rsyslog.conf \ 22 file://rsyslog.conf \
23 file://rsyslog.logrotate \ 23 file://rsyslog.logrotate \
24 file://use-pkgconfig-to-check-libgcrypt.patch \ 24 file://use-pkgconfig-to-check-libgcrypt.patch \
25 file://run-ptest \ 25 file://run-ptest \
26 file://rsyslog-fix-ptest-not-finish.patch \ 26 file://rsyslog-fix-ptest-not-finish.patch \
27 file://rsyslog-use-serial-tests-config-needed-by-ptest.patch \
28 file://json-0.12-fix.patch \ 27 file://json-0.12-fix.patch \
29 file://0001-bugfix-potential-abort-during-HUP.patch \
30 file://0001-remove-memleak-introduced-by-GenerateLocalHostName-H.patch \
31" 28"
32 29
33SRC_URI[md5sum] = "ebcc010a6205c28eb505c0fe862f32c6" 30SRC_URI[md5sum] = "093c462a5245012bd9e7b82dd8aedffb"
34SRC_URI[sha256sum] = "276d094d1e4c62c770ec8a72723667f119eee038912b79cf3337d439bc2f9087" 31SRC_URI[sha256sum] = "357f089d866c351d5fe5b7139fa85b010223d77b3c21f29b2a1baa8688926111"
35 32
36inherit autotools pkgconfig systemd update-rc.d update-alternatives ptest 33inherit autotools pkgconfig systemd update-rc.d update-alternatives ptest
37 34