diff options
| author | Mingli Yu <mingli.yu@windriver.com> | 2018-11-20 00:46:41 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2018-11-26 09:38:14 -0800 |
| commit | e54d1e86e48d6b0730393f1a1a5b5b831e3c21d6 (patch) | |
| tree | 904aa2fce4add11ec921ad55b04a90d533cfc2ed | |
| parent | f6e6519bb0d9d1357bdc2df736ec1aec24cc2e65 (diff) | |
| download | meta-openembedded-e54d1e86e48d6b0730393f1a1a5b5b831e3c21d6.tar.gz | |
librelp: Upgrade to 1.2.18
* Correct the homepage
* Remove two backported patches
* Backport 0001-testbench-improvements.patch
to fix the below error:
| ../../git/src/tcp.c:3072:57: error: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 1005 [-Werror=format-truncation=]
| snprintf(errmsg, sizeof(errmsg), "error connecting: '%s'", errStr);
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-extended/rsyslog/librelp/0001-src-tcp.c-fix-jump-misses-init-error.patch | 71 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/rsyslog/librelp/0001-src-tcp.c-increase-the-size-of-szHname.patch | 53 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/rsyslog/librelp/0001-testbench-improvements.patch | 164 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/rsyslog/librelp_1.2.18.bb (renamed from meta-oe/recipes-extended/rsyslog/librelp_1.2.16.bb) | 7 |
4 files changed, 167 insertions, 128 deletions
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-src-tcp.c-fix-jump-misses-init-error.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-src-tcp.c-fix-jump-misses-init-error.patch deleted file mode 100644 index 68b6863460..0000000000 --- a/meta-oe/recipes-extended/rsyslog/librelp/0001-src-tcp.c-fix-jump-misses-init-error.patch +++ /dev/null | |||
| @@ -1,71 +0,0 @@ | |||
| 1 | From 3e5a0cb440c788e2383e40ab23ac1cf01d96961b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
| 3 | Date: Tue, 24 Jul 2018 01:30:25 -0700 | ||
| 4 | Subject: [PATCH] src/tcp.c: fix jump-misses-init error | ||
| 5 | |||
| 6 | Fix below jump-misses-init error | ||
| 7 | |||
| 8 | | In file included from ../../git/src/tcp.c:51: | ||
| 9 | | ../../git/src/tcp.c: In function 'relpTcpConnect': | ||
| 10 | | ../../git/src/relp.h:220:3: error: jump skips variable initialization [-Werror=jump-misses-init] | ||
| 11 | | goto finalize_it; \ | ||
| 12 | | ^~~~ | ||
| 13 | | ../../git/src/tcp.c:1951:3: note: in expansion of macro 'ABORT_FINALIZE' | ||
| 14 | | ABORT_FINALIZE(RELP_RET_IO_ERR); | ||
| 15 | | ^~~~~~~~~~~~~~ | ||
| 16 | | ../../git/src/tcp.c:2005:1: note: label 'finalize_it' defined here | ||
| 17 | | finalize_it: | ||
| 18 | | ^~~~~~~~~~~ | ||
| 19 | | ../../git/src/tcp.c:1991:6: note: 'r' declared here | ||
| 20 | | int r = getsockopt(pThis->sock, SOL_SOCKET, SO_ERROR, &so_error, &len); | ||
| 21 | | ^ | ||
| 22 | | In file included from ../../git/src/tcp.c:51: | ||
| 23 | | ../../git/src/relp.h:220:3: error: jump skips variable initialization [-Werror=jump-misses-init] | ||
| 24 | | goto finalize_it; \ | ||
| 25 | | ^~~~ | ||
| 26 | | ../../git/src/tcp.c:1951:3: note: in expansion of macro 'ABORT_FINALIZE' | ||
| 27 | | ABORT_FINALIZE(RELP_RET_IO_ERR); | ||
| 28 | | ^~~~~~~~~~~~~~ | ||
| 29 | | ../../git/src/tcp.c:2005:1: note: label 'finalize_it' defined here | ||
| 30 | | finalize_it: | ||
| 31 | | ^~~~~~~~~~~ | ||
| 32 | | ../../git/src/tcp.c:1989:12: note: 'len' declared here | ||
| 33 | | socklen_t len = sizeof so_error; | ||
| 34 | | ^~~ | ||
| 35 | |||
| 36 | Upstream-Status: Submitted[https://github.com/rsyslog/librelp/pull/117] | ||
| 37 | |||
| 38 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
| 39 | --- | ||
| 40 | src/tcp.c | 7 ++++--- | ||
| 41 | 1 file changed, 4 insertions(+), 3 deletions(-) | ||
| 42 | |||
| 43 | diff --git a/src/tcp.c b/src/tcp.c | ||
| 44 | index f35eb84..fb34dc7 100644 | ||
| 45 | --- a/src/tcp.c | ||
| 46 | +++ b/src/tcp.c | ||
| 47 | @@ -1936,6 +1936,9 @@ relpTcpConnect(relpTcp_t *const pThis, | ||
| 48 | struct addrinfo hints; | ||
| 49 | struct addrinfo *reslocal = NULL; | ||
| 50 | struct pollfd pfd; | ||
| 51 | + int so_error; | ||
| 52 | + socklen_t len = sizeof so_error; | ||
| 53 | + int r; | ||
| 54 | |||
| 55 | ENTER_RELPFUNC; | ||
| 56 | RELPOBJ_assert(pThis, Tcp); | ||
| 57 | @@ -1985,10 +1988,8 @@ relpTcpConnect(relpTcp_t *const pThis, | ||
| 58 | ABORT_FINALIZE(RELP_RET_TIMED_OUT); | ||
| 59 | } | ||
| 60 | |||
| 61 | - int so_error; | ||
| 62 | - socklen_t len = sizeof so_error; | ||
| 63 | |||
| 64 | - int r = getsockopt(pThis->sock, SOL_SOCKET, SO_ERROR, &so_error, &len); | ||
| 65 | + r = getsockopt(pThis->sock, SOL_SOCKET, SO_ERROR, &so_error, &len); | ||
| 66 | if (r == -1 || so_error != 0) { | ||
| 67 | pThis->pEngine->dbgprint("socket has an error %d\n", so_error); | ||
| 68 | ABORT_FINALIZE(RELP_RET_IO_ERR); | ||
| 69 | -- | ||
| 70 | 2.17.1 | ||
| 71 | |||
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-src-tcp.c-increase-the-size-of-szHname.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-src-tcp.c-increase-the-size-of-szHname.patch deleted file mode 100644 index 5a62e1584d..0000000000 --- a/meta-oe/recipes-extended/rsyslog/librelp/0001-src-tcp.c-increase-the-size-of-szHname.patch +++ /dev/null | |||
| @@ -1,53 +0,0 @@ | |||
| 1 | From d8950ad273d79ec516468289adbd427e681dbc66 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
| 3 | Date: Mon, 30 Jul 2018 01:22:56 -0700 | ||
| 4 | Subject: [PATCH] src/tcp.c: increase the size of szHname | ||
| 5 | |||
| 6 | Increase the size of szHname to fix below | ||
| 7 | error: | ||
| 8 | | ../../git/src/tcp.c: In function 'relpTcpSetRemHost': | ||
| 9 | | ../../git/src/tcp.c:352:57: error: '%s' directive output may be truncated writing up to 1024 bytes into a region of size 1011 [-Werror=format-truncation=] | ||
| 10 | | snprintf((char*)szHname, NI_MAXHOST, "[MALICIOUS:IP=%s]", szIP); | ||
| 11 | | ^~ ~~~~ | ||
| 12 | | In file included from /poky-build/tmp/work/i586-poky-linux/librelp/1.2.16-r0/recipe-sysroot/usr/include/stdio.h:862, | ||
| 13 | | from ../../git/src/tcp.c:38: | ||
| 14 | | /poky-build/tmp/work/i586-poky-linux/librelp/1.2.16-r0/recipe-sysroot/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 16 and 1040 bytes into a destination of size 1025 | ||
| 15 | | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ||
| 16 | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 17 | | __bos (__s), __fmt, __va_arg_pack ()); | ||
| 18 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 19 | | cc1: all warnings being treated as errors | ||
| 20 | | Makefile:536: recipe for target 'librelp_la-tcp.lo' failed | ||
| 21 | |||
| 22 | Upstream-Status: Submitted[https://github.com/rsyslog/librelp/pull/118] | ||
| 23 | |||
| 24 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
| 25 | --- | ||
| 26 | src/tcp.c | 4 ++-- | ||
| 27 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 28 | |||
| 29 | diff --git a/src/tcp.c b/src/tcp.c | ||
| 30 | index fb34dc7..2c38b0b 100644 | ||
| 31 | --- a/src/tcp.c | ||
| 32 | +++ b/src/tcp.c | ||
| 33 | @@ -319,7 +319,7 @@ relpTcpSetRemHost(relpTcp_t *const pThis, struct sockaddr *pAddr) | ||
| 34 | relpEngine_t *pEngine; | ||
| 35 | int error; | ||
| 36 | unsigned char szIP[NI_MAXHOST] = ""; | ||
| 37 | - unsigned char szHname[NI_MAXHOST] = ""; | ||
| 38 | + unsigned char szHname[1045] = ""; | ||
| 39 | struct addrinfo hints, *res; | ||
| 40 | size_t len; | ||
| 41 | |||
| 42 | @@ -349,7 +349,7 @@ relpTcpSetRemHost(relpTcp_t *const pThis, struct sockaddr *pAddr) | ||
| 43 | if(getaddrinfo((char*)szHname, NULL, &hints, &res) == 0) { | ||
| 44 | freeaddrinfo (res); | ||
| 45 | /* OK, we know we have evil, so let's indicate this to our caller */ | ||
| 46 | - snprintf((char*)szHname, NI_MAXHOST, "[MALICIOUS:IP=%s]", szIP); | ||
| 47 | + snprintf((char*)szHname, sizeof(szHname), "[MALICIOUS:IP=%s]", szIP); | ||
| 48 | pEngine->dbgprint("Malicious PTR record, IP = \"%s\" HOST = \"%s\"", szIP, szHname); | ||
| 49 | iRet = RELP_RET_MALICIOUS_HNAME; | ||
| 50 | } | ||
| 51 | -- | ||
| 52 | 2.17.1 | ||
| 53 | |||
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-testbench-improvements.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-testbench-improvements.patch new file mode 100644 index 0000000000..6b60bd7486 --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-testbench-improvements.patch | |||
| @@ -0,0 +1,164 @@ | |||
| 1 | From 1e6be18ed243dc562ff2976b46850bfd2e576664 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Rainer Gerhards <rgerhards@adiscon.com> | ||
| 3 | Date: Thu, 15 Nov 2018 12:23:41 +0100 | ||
| 4 | Subject: [PATCH] testbench improvements | ||
| 5 | |||
| 6 | Most importantly, the test receiver process is now terminated | ||
| 7 | gracefully. Without that, gcov can never pick up correct | ||
| 8 | coverage data. | ||
| 9 | |||
| 10 | Upstream-Status: Backport[https://github.com/rsyslog/librelp/commit/1e6be18ed243dc562ff2976b46850bfd2e576664] | ||
| 11 | |||
| 12 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
| 13 | --- | ||
| 14 | src/tcp.c | 4 ++-- | ||
| 15 | tests/Makefile.am | 3 ++- | ||
| 16 | tests/receive.c | 29 +++++++++++++++++++++++++++-- | ||
| 17 | tests/selftest_receive_usage.sh | 5 +++++ | ||
| 18 | tests/test-framework.sh | 4 ++-- | ||
| 19 | 5 files changed, 38 insertions(+), 7 deletions(-) | ||
| 20 | create mode 100755 tests/selftest_receive_usage.sh | ||
| 21 | |||
| 22 | diff --git a/src/tcp.c b/src/tcp.c | ||
| 23 | index f10a720..0ea92ea 100644 | ||
| 24 | --- a/src/tcp.c | ||
| 25 | +++ b/src/tcp.c | ||
| 26 | @@ -3027,7 +3027,7 @@ relpTcpConnect(relpTcp_t *const pThis, | ||
| 27 | struct addrinfo hints; | ||
| 28 | struct addrinfo *reslocal = NULL; | ||
| 29 | struct pollfd pfd; | ||
| 30 | - char errmsg[1024]; | ||
| 31 | + char errmsg[1424]; | ||
| 32 | int so_error; | ||
| 33 | socklen_t len = sizeof so_error; | ||
| 34 | int r; | ||
| 35 | @@ -3067,7 +3067,7 @@ relpTcpConnect(relpTcp_t *const pThis, | ||
| 36 | } | ||
| 37 | if(connect(pThis->sock, res->ai_addr, res->ai_addrlen) == -1) { | ||
| 38 | if(errno != EINPROGRESS) { | ||
| 39 | - char errStr[1024]; | ||
| 40 | + char errStr[1200]; | ||
| 41 | _relpEngine_strerror_r(errno, errStr, sizeof(errStr)); | ||
| 42 | snprintf(errmsg, sizeof(errmsg), "error connecting: '%s'", errStr); | ||
| 43 | callOnErr(pThis, errmsg, RELP_RET_IO_ERR); | ||
| 44 | diff --git a/tests/Makefile.am b/tests/Makefile.am | ||
| 45 | index 64deb19..51fd78f 100644 | ||
| 46 | --- a/tests/Makefile.am | ||
| 47 | +++ b/tests/Makefile.am | ||
| 48 | @@ -25,7 +25,8 @@ TESTS= basic.sh \ | ||
| 49 | long-msg.sh \ | ||
| 50 | oversize-msg-abort-errmsg.sh \ | ||
| 51 | oversize-msg-accept-errmsg.sh \ | ||
| 52 | - truncate-oversize-msg.sh | ||
| 53 | + truncate-oversize-msg.sh \ | ||
| 54 | + selftest_receive_usage.sh | ||
| 55 | # OpenSSL tests only! | ||
| 56 | if ENABLE_TLS_OPENSSL | ||
| 57 | TESTS += tls-wrong-permittedPeer.sh \ | ||
| 58 | diff --git a/tests/receive.c b/tests/receive.c | ||
| 59 | index e56e59c..4b69c99 100644 | ||
| 60 | --- a/tests/receive.c | ||
| 61 | +++ b/tests/receive.c | ||
| 62 | @@ -1,6 +1,7 @@ | ||
| 63 | /* A minimal RELP receiver using librelp | ||
| 64 | * | ||
| 65 | * Copyright 2014 Mathias Nyman | ||
| 66 | + * Copyright 2018 Adiscon GmbH | ||
| 67 | * | ||
| 68 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 69 | * you may not use this file except in compliance with the License. | ||
| 70 | @@ -24,6 +25,7 @@ | ||
| 71 | #include <string.h> | ||
| 72 | #include <limits.h> | ||
| 73 | #include <errno.h> | ||
| 74 | +#include <signal.h> | ||
| 75 | #include "librelp.h" | ||
| 76 | |||
| 77 | #define TRY(f) if(f != RELP_RET_OK) { fprintf(stderr, "receive.c: FAILURE in '%s'\n", #f); ret = 1; goto done; } | ||
| 78 | @@ -31,6 +33,24 @@ | ||
| 79 | static FILE *errFile = NULL; | ||
| 80 | static relpEngine_t *pRelpEngine; | ||
| 81 | |||
| 82 | +static void | ||
| 83 | +hdlr_enable(int sig, void (*hdlr)()) | ||
| 84 | +{ | ||
| 85 | + struct sigaction sigAct; | ||
| 86 | + memset(&sigAct, 0, sizeof (sigAct)); | ||
| 87 | + sigemptyset(&sigAct.sa_mask); | ||
| 88 | + sigAct.sa_handler = hdlr; | ||
| 89 | + sigaction(sig, &sigAct, NULL); | ||
| 90 | +} | ||
| 91 | + | ||
| 92 | +void | ||
| 93 | +terminate(int sig) | ||
| 94 | +{ | ||
| 95 | + fprintf(stderr, "terminating on signal %d\n", sig); | ||
| 96 | + relpEngineSetStop(pRelpEngine); | ||
| 97 | +} | ||
| 98 | + | ||
| 99 | + | ||
| 100 | static void __attribute__((format(printf, 1, 2))) | ||
| 101 | dbgprintf(char *fmt, ...) | ||
| 102 | { | ||
| 103 | @@ -237,6 +257,8 @@ int main(int argc, char *argv[]) { | ||
| 104 | } | ||
| 105 | } | ||
| 106 | |||
| 107 | + hdlr_enable(SIGTERM, terminate); | ||
| 108 | + | ||
| 109 | TRY(relpEngineConstruct(&pRelpEngine)); | ||
| 110 | TRY(relpEngineSetDbgprint(pRelpEngine, verbose ? dbgprintf : NULL)); | ||
| 111 | TRY(relpEngineSetEnableCmd(pRelpEngine, (unsigned char*) "syslog", eRelpCmdState_Required)); | ||
| 112 | @@ -294,11 +316,14 @@ int main(int argc, char *argv[]) { | ||
| 113 | fclose(fp); | ||
| 114 | } | ||
| 115 | |||
| 116 | - TRY(relpEngineRun(pRelpEngine)); /* Abort with ctrl-c */ | ||
| 117 | + TRY(relpEngineRun(pRelpEngine)); /* Abort via SIGHUP */ | ||
| 118 | |||
| 119 | - TRY(relpEngineSetStop(pRelpEngine)); | ||
| 120 | TRY(relpEngineDestruct(&pRelpEngine)); | ||
| 121 | |||
| 122 | + if(pidFileName != NULL) { | ||
| 123 | + unlink(pidFileName); | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | done: | ||
| 127 | return ret; | ||
| 128 | } | ||
| 129 | diff --git a/tests/selftest_receive_usage.sh b/tests/selftest_receive_usage.sh | ||
| 130 | new file mode 100755 | ||
| 131 | index 0000000..c4ac8bb | ||
| 132 | --- /dev/null | ||
| 133 | +++ b/tests/selftest_receive_usage.sh | ||
| 134 | @@ -0,0 +1,5 @@ | ||
| 135 | +#!/bin/bash | ||
| 136 | +. ${srcdir:=$(pwd)}/test-framework.sh | ||
| 137 | +./receive &>librelp.out.log | ||
| 138 | +check_output "Port is missing" | ||
| 139 | +terminate | ||
| 140 | diff --git a/tests/test-framework.sh b/tests/test-framework.sh | ||
| 141 | index 6abdcf2..d4ab3ec 100644 | ||
| 142 | --- a/tests/test-framework.sh | ||
| 143 | +++ b/tests/test-framework.sh | ||
| 144 | @@ -32,7 +32,7 @@ function wait_process_startup_via_pidfile() { | ||
| 145 | # start receiver WITH valgrind, add receiver command line parameters after function name | ||
| 146 | function startup_receiver_valgrind() { | ||
| 147 | printf 'Starting Receiver...\n' | ||
| 148 | - $valgrind ./receive -p $TESTPORT -F receive.pid $OPT_VERBOSE $* 1>>librelp.out.log & | ||
| 149 | + $valgrind ./receive -p $TESTPORT -F receive.pid $OPT_VERBOSE $* 1>librelp.out.log & | ||
| 150 | export RECEIVE_PID=$! | ||
| 151 | printf "got receive pid $RECEIVE_PID\n" | ||
| 152 | wait_process_startup_via_pidfile receive.pid | ||
| 153 | @@ -43,7 +43,7 @@ function startup_receiver_valgrind() { | ||
| 154 | # start receiver, add receiver command line parameters after function name | ||
| 155 | function startup_receiver() { | ||
| 156 | printf 'Starting Receiver...\n' | ||
| 157 | - ./receive -p $TESTPORT -F receive.pid $OPT_VERBOSE $* 1>>librelp.out.log & | ||
| 158 | + ./receive -p $TESTPORT -F receive.pid $OPT_VERBOSE $* 1>librelp.out.log & | ||
| 159 | export RECEIVE_PID=$! | ||
| 160 | printf "got receive pid $RECEIVE_PID\n" | ||
| 161 | wait_process_startup_via_pidfile receive.pid | ||
| 162 | -- | ||
| 163 | 2.17.1 | ||
| 164 | |||
diff --git a/meta-oe/recipes-extended/rsyslog/librelp_1.2.16.bb b/meta-oe/recipes-extended/rsyslog/librelp_1.2.18.bb index 17478efe40..e4838fa5b9 100644 --- a/meta-oe/recipes-extended/rsyslog/librelp_1.2.16.bb +++ b/meta-oe/recipes-extended/rsyslog/librelp_1.2.18.bb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | SUMMARY = "A reliable logging library" | 1 | SUMMARY = "A reliable logging library" |
| 2 | HOMEPAGE = "https://github.com/rsyslog/libfastjson" | 2 | HOMEPAGE = "https://github.com/rsyslog/librelp" |
| 3 | 3 | ||
| 4 | LICENSE = "GPLv3" | 4 | LICENSE = "GPLv3" |
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=1fb9c10ed9fd6826757615455ca893a9" | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=1fb9c10ed9fd6826757615455ca893a9" |
| @@ -7,11 +7,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=1fb9c10ed9fd6826757615455ca893a9" | |||
| 7 | DEPENDS = "gmp nettle libidn zlib gnutls" | 7 | DEPENDS = "gmp nettle libidn zlib gnutls" |
| 8 | 8 | ||
| 9 | SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https \ | 9 | SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https \ |
| 10 | file://0001-src-tcp.c-fix-jump-misses-init-error.patch \ | 10 | file://0001-testbench-improvements.patch \ |
| 11 | file://0001-src-tcp.c-increase-the-size-of-szHname.patch \ | ||
| 12 | " | 11 | " |
| 13 | 12 | ||
| 14 | SRCREV = "5e849ff060be0c7dce972e194c54fdacfee0adc2" | 13 | SRCREV = "4b6a81061bccf68cba6fddd27f99fb5dc0d0c3a3" |
| 15 | 14 | ||
| 16 | S = "${WORKDIR}/git" | 15 | S = "${WORKDIR}/git" |
| 17 | 16 | ||
