summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons
diff options
context:
space:
mode:
authorOleksandr Kravchuk <open.source@oleksandr-kravchuk.com>2019-05-19 22:12:33 +0200
committerKhem Raj <raj.khem@gmail.com>2019-05-20 22:23:04 -0700
commit7ada285f29217201abfa7de3e7376af11320480b (patch)
treea12ac2374fc5e13c3945dcc43641dfbb21e09242 /meta-networking/recipes-daemons
parent74aeba20e5b5a47de4bdf7c3851f8f141364aeaa (diff)
downloadmeta-openembedded-7ada285f29217201abfa7de3e7376af11320480b.tar.gz
opensaf: update to 5.19.03
Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-daemons')
-rw-r--r--meta-networking/recipes-daemons/opensaf/opensaf/0001-Catch-std-ifstream-failure-by-reference.patch67
-rw-r--r--meta-networking/recipes-daemons/opensaf/opensaf/0001-Fix-string-overflow-in-snprintf.patch76
-rw-r--r--meta-networking/recipes-daemons/opensaf/opensaf/0002-Fix-format-truncation-errors.patch100
-rw-r--r--meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch33
-rw-r--r--meta-networking/recipes-daemons/opensaf/opensaf_5.19.03.bb (renamed from meta-networking/recipes-daemons/opensaf/opensaf_5.19.01.bb)8
5 files changed, 2 insertions, 282 deletions
diff --git a/meta-networking/recipes-daemons/opensaf/opensaf/0001-Catch-std-ifstream-failure-by-reference.patch b/meta-networking/recipes-daemons/opensaf/opensaf/0001-Catch-std-ifstream-failure-by-reference.patch
deleted file mode 100644
index 30fdb8bf1..000000000
--- a/meta-networking/recipes-daemons/opensaf/opensaf/0001-Catch-std-ifstream-failure-by-reference.patch
+++ /dev/null
@@ -1,67 +0,0 @@
1From 38c5343f84799fc5041575f3ec808f7476b6eea3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 16 Apr 2018 14:33:35 -0700
4Subject: [PATCH] Catch std::ifstream::failure by reference
5
6Fixes
7error: catching polymorphic type 'class std::ios_base::failure' by value
8[-Werror=catch-value=]
9 } catch (std::ofstream::failure) {
10 ^~~~~~~
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13
14---
15 src/base/conf.cc | 4 ++--
16 src/dtm/dtmnd/dtm_main.cc | 2 +-
17 src/dtm/dtmnd/multicast.cc | 2 +-
18 3 files changed, 4 insertions(+), 4 deletions(-)
19
20diff --git a/src/base/conf.cc b/src/base/conf.cc
21index d5755a1..4820357 100644
22--- a/src/base/conf.cc
23+++ b/src/base/conf.cc
24@@ -189,7 +189,7 @@ std::string Conf::ReadFile(const std::string& path_name,
25 try {
26 str.open(path_name);
27 str >> contents;
28- } catch (std::ifstream::failure) {
29+ } catch (std::ifstream::failure& e) {
30 contents.clear();
31 }
32 return (str.fail() || contents.empty()) ? default_contents : contents;
33@@ -203,7 +203,7 @@ void Conf::WriteFileAtomically(const std::string& path_name,
34 try {
35 str.open(tmp_file, std::ofstream::out | std::ofstream::trunc);
36 str << contents << std::endl;
37- } catch (std::ofstream::failure) {
38+ } catch (std::ofstream::failure& e) {
39 success = false;
40 }
41 str.close();
42diff --git a/src/dtm/dtmnd/dtm_main.cc b/src/dtm/dtmnd/dtm_main.cc
43index 585e11e..5cf6ad7 100644
44--- a/src/dtm/dtmnd/dtm_main.cc
45+++ b/src/dtm/dtmnd/dtm_main.cc
46@@ -367,7 +367,7 @@ void UpdateNodeIdFile(DTM_INTERNODE_CB *cb) {
47 try {
48 str.open(PKGLOCALSTATEDIR "/node_id", std::ofstream::out);
49 str << std::hex << node_id << std::endl;
50- } catch (std::ofstream::failure) {
51+ } catch (std::ofstream::failure& e) {
52 }
53 str.close();
54 }
55diff --git a/src/dtm/dtmnd/multicast.cc b/src/dtm/dtmnd/multicast.cc
56index cadc002..7c25fea 100644
57--- a/src/dtm/dtmnd/multicast.cc
58+++ b/src/dtm/dtmnd/multicast.cc
59@@ -199,7 +199,7 @@ bool Multicast::GetPeersFromFile(const std::string &path_name) {
60 }
61 }
62 }
63- } catch (std::ifstream::failure) {
64+ } catch (std::ifstream::failure& e) {
65 LOG_ER("Caught std::ifstream::failure when reading file '%s', peers=%zu",
66 path_name.c_str(), static_cast<size_t>(peers_.size()));
67 peers_.clear();
diff --git a/meta-networking/recipes-daemons/opensaf/opensaf/0001-Fix-string-overflow-in-snprintf.patch b/meta-networking/recipes-daemons/opensaf/opensaf/0001-Fix-string-overflow-in-snprintf.patch
deleted file mode 100644
index 93c75777f..000000000
--- a/meta-networking/recipes-daemons/opensaf/opensaf/0001-Fix-string-overflow-in-snprintf.patch
+++ /dev/null
@@ -1,76 +0,0 @@
1From 88661a60629894353512c53ed32f2b901f64149c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 16 Apr 2018 18:29:17 -0700
4Subject: [PATCH] Fix string overflow in snprintf
5
6Fixes errors like
7error: '%s' dir
8ective output may be truncated writing up to 255 bytes into a region of size 32 [-Werror=forma
9t-truncation=]
10 snprintf(reinterpret_cast<char *>(Healthy.key), sizeof(Healthy.key), "%s",
11 ^~~~
12 hlth_str);
13 ~~~~~~~~
14
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16
17---
18 src/log/logd/lgs_util.cc | 4 ++--
19 src/rde/rded/rde_amf.cc | 2 +-
20 src/smf/smfd/SmfUpgradeCampaign.cc | 4 ++--
21 3 files changed, 5 insertions(+), 5 deletions(-)
22
23diff --git a/src/log/logd/lgs_util.cc b/src/log/logd/lgs_util.cc
24index ac93d5a..cce80f3 100644
25--- a/src/log/logd/lgs_util.cc
26+++ b/src/log/logd/lgs_util.cc
27@@ -200,12 +200,12 @@ char *lgs_get_time(time_t *time_in) {
28
29 stringSize = 5 * sizeof(char);
30 snprintf(srcString, (size_t)stringSize, "%d",
31- (timeStampData->tm_year + START_YEAR));
32+ (timeStampData->tm_year + START_YEAR) & 0x4dU);
33
34 strncpy(timeStampString, srcString, stringSize);
35
36 stringSize = 3 * sizeof(char);
37- snprintf(srcString, (size_t)stringSize, "%02d", (timeStampData->tm_mon + 1));
38+ snprintf(srcString, (size_t)stringSize, "%02d", (timeStampData->tm_mon + 1) & 0x2dU);
39
40 strncat(timeStampString, srcString, stringSize);
41
42diff --git a/src/rde/rded/rde_amf.cc b/src/rde/rded/rde_amf.cc
43index 81e521e..d53cc48 100644
44--- a/src/rde/rded/rde_amf.cc
45+++ b/src/rde/rded/rde_amf.cc
46@@ -102,7 +102,7 @@ static uint32_t rde_amf_healthcheck_start(RDE_AMF_CB *rde_amf_cb) {
47 SaAmfHealthcheckKeyT Healthy;
48 SaNameT SaCompName;
49 char *phlth_ptr;
50- char hlth_str[256];
51+ char hlth_str[32];
52
53 TRACE_ENTER();
54
55diff --git a/src/smf/smfd/SmfUpgradeCampaign.cc b/src/smf/smfd/SmfUpgradeCampaign.cc
56index c30ea14..098f17a 100644
57--- a/src/smf/smfd/SmfUpgradeCampaign.cc
58+++ b/src/smf/smfd/SmfUpgradeCampaign.cc
59@@ -447,7 +447,7 @@ SaAisErrorT SmfUpgradeCampaign::tooManyRestarts(bool *o_result) {
60 TRACE_ENTER();
61 SaAisErrorT rc = SA_AIS_OK;
62 SaImmAttrValuesT_2 **attributes;
63- int curCnt = 0;
64+ short int curCnt = 0;
65
66 /* Read the SmfCampRestartInfo object smfCampRestartCnt attr */
67 std::string obj = "smfRestartInfo=info," +
68@@ -473,7 +473,7 @@ SaAisErrorT SmfUpgradeCampaign::tooManyRestarts(bool *o_result) {
69 attrsmfCampRestartCnt.SetAttributeName("smfCampRestartCnt");
70 attrsmfCampRestartCnt.SetAttributeType("SA_IMM_ATTR_SAUINT32T");
71 char buf[5];
72- snprintf(buf, 4, "%d", curCnt);
73+ snprintf(buf, 4, "%hd", curCnt);
74 attrsmfCampRestartCnt.AddAttributeValue(buf);
75 imoCampRestartInfo.AddValue(attrsmfCampRestartCnt);
76
diff --git a/meta-networking/recipes-daemons/opensaf/opensaf/0002-Fix-format-truncation-errors.patch b/meta-networking/recipes-daemons/opensaf/opensaf/0002-Fix-format-truncation-errors.patch
deleted file mode 100644
index f98e28da9..000000000
--- a/meta-networking/recipes-daemons/opensaf/opensaf/0002-Fix-format-truncation-errors.patch
+++ /dev/null
@@ -1,100 +0,0 @@
1From c5034fe42df8923bcefc10e163151997d70b6241 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 16 Apr 2018 14:56:47 -0700
4Subject: [PATCH] Fix format-truncation errors
5
6Fixes errors with gcc8 eg.
7error: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size between 0 and 254 [-Werror=format-truncation=]
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11---
12 src/base/daemon.c | 4 ++--
13 src/mds/mds_c_db.c | 8 ++++----
14 src/mds/mds_core.h | 4 ++--
15 src/mds/mds_dt2c.h | 2 +-
16 4 files changed, 9 insertions(+), 9 deletions(-)
17
18diff --git a/src/base/daemon.c b/src/base/daemon.c
19index 361dd8d..4001b73 100644
20--- a/src/base/daemon.c
21+++ b/src/base/daemon.c
22@@ -95,11 +95,11 @@ static int __create_pidfile(const char *pidfile)
23 {
24 FILE *file = NULL;
25 int fd, rc = 0;
26- char pidfiletmp[NAME_MAX] = {0};
27+ char pidfiletmp[NAME_MAX+12] = {0};
28 pid_t pid;
29
30 pid = getpid();
31- snprintf(pidfiletmp, NAME_MAX, "%s.%u.tmp", pidfile, pid);
32+ snprintf(pidfiletmp, NAME_MAX+12, "%s.%u.tmp", pidfile, pid);
33
34 /* open the file and associate a stream with it */
35 if (((fd = open(pidfiletmp, O_RDWR | O_CREAT, 0644)) == -1) ||
36diff --git a/src/mds/mds_c_db.c b/src/mds/mds_c_db.c
37index e6b95cd..3d4a222 100644
38--- a/src/mds/mds_c_db.c
39+++ b/src/mds/mds_c_db.c
40@@ -124,10 +124,10 @@ void get_adest_details(MDS_DEST adest, char *adest_details)
41 }
42
43 if (remote == true)
44- snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN,
45+ snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN+24,
46 "<rem_nodeid[0x%" PRIx32 "]:%s>", ncs_node_id, process_name);
47 else
48- snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN,
49+ snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN+24,
50 "<nodeid[0x%" PRIx32 "]:%s>", ncs_node_id, process_name);
51
52 m_MDS_LOG_DBG("MDS:DB: adest_details: %s ", adest_details);
53@@ -207,10 +207,10 @@ void get_subtn_adest_details(MDS_PWE_HDL pwe_hdl, MDS_SVC_ID svc_id,
54 }
55
56 if (remote == true)
57- snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN,
58+ snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN+24,
59 "<rem_node[0x%" PRIx32 "]:%s>", ncs_node_id, process_name);
60 else
61- snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN,
62+ snprintf(adest_details, MDS_MAX_PROCESS_NAME_LEN+24,
63 "<node[0x%" PRIx32 "]:%s>", ncs_node_id, process_name);
64 done:
65 m_MDS_LOG_DBG("MDS:DB: adest_details: %s ", adest_details);
66diff --git a/src/mds/mds_core.h b/src/mds/mds_core.h
67index 37696d4..7f5225d 100644
68--- a/src/mds/mds_core.h
69+++ b/src/mds/mds_core.h
70@@ -163,7 +163,7 @@ typedef struct mds_subscription_results_info {
71 uint32_t msg_snd_cnt; /* Message send count to this destination */
72 uint32_t msg_rcv_cnt; /* Message rcv count from this destination */
73 char sub_adest_details
74- [MDS_MAX_PROCESS_NAME_LEN]; /* <node[slotno]:processname[pid]> */
75+ [MDS_MAX_PROCESS_NAME_LEN+24]; /* <node[slotno]:processname[pid]> */
76
77 } MDS_SUBSCRIPTION_RESULTS_INFO;
78
79@@ -194,7 +194,7 @@ typedef struct mds_subscription_info {
80 count is grater than ZERO bcast (multi-unicast) */
81 uint32_t prev_ver_sub_count;
82 char sub_adest_details
83- [MDS_MAX_PROCESS_NAME_LEN]; /* <node[slotno]:processname[pid]> */
84+ [MDS_MAX_PROCESS_NAME_LEN+24]; /* <node[slotno]:processname[pid]> */
85
86 } MDS_SUBSCRIPTION_INFO;
87
88diff --git a/src/mds/mds_dt2c.h b/src/mds/mds_dt2c.h
89index 012999c..006b722 100644
90--- a/src/mds/mds_dt2c.h
91+++ b/src/mds/mds_dt2c.h
92@@ -143,7 +143,7 @@ typedef struct mdtm_send_req {
93 */
94 MDS_DEST adest; /* MDTM to do local/remote routing, destination adest */
95 char sub_adest_details
96- [MDS_MAX_PROCESS_NAME_LEN]; /* <node[nodeid]:processname[pid]> */
97+ [MDS_MAX_PROCESS_NAME_LEN+24]; /* <node[nodeid]:processname[pid]> */
98 MDS_SEND_PRIORITY_TYPE pri;
99 MDS_CLIENT_MSG_FORMAT_VER
100 msg_fmt_ver; /* message format version specification */
diff --git a/meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch b/meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch
deleted file mode 100644
index 497bb07d8..000000000
--- a/meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From 29510dd81e3a5e96151afdb0702863cbfd640766 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 22 Jun 2018 18:58:59 -0700
4Subject: [PATCH] check for size before using strncpy
5
6ensures that size is never execeding the string length
7that execPath can hold
8
9Fixes
10error: '__builtin___strncpy_chk' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
11
12Upstream-Status: Pending
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 src/imm/immnd/immnd_proc.c | 4 ++++
17 1 file changed, 4 insertions(+)
18
19diff --git a/src/imm/immnd/immnd_proc.c b/src/imm/immnd/immnd_proc.c
20index 015932a..c8f115e 100644
21--- a/src/imm/immnd/immnd_proc.c
22+++ b/src/imm/immnd/immnd_proc.c
23@@ -1902,6 +1902,10 @@ static int immnd_forkPbe(IMMND_CB *cb)
24 LOG_ER("Pathname too long: %u max is 1023", newLen);
25 return -1;
26 }
27+ if (execDirLen > 1023 || execDirLen < 0) {
28+ LOG_ER("Execdir name too long: %u max is 1023", execDirLen);
29+ return -1;
30+ }
31
32 strncpy(execPath, cb->mProgName, execDirLen);
33 execPath[execDirLen] = 0;
diff --git a/meta-networking/recipes-daemons/opensaf/opensaf_5.19.01.bb b/meta-networking/recipes-daemons/opensaf/opensaf_5.19.03.bb
index 3e4d33e00..0cccebdfc 100644
--- a/meta-networking/recipes-daemons/opensaf/opensaf_5.19.01.bb
+++ b/meta-networking/recipes-daemons/opensaf/opensaf_5.19.03.bb
@@ -24,13 +24,9 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \
24 file://0001-configure-Disable-format-overflow-if-supported-by-gc.patch \ 24 file://0001-configure-Disable-format-overflow-if-supported-by-gc.patch \
25 file://0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch \ 25 file://0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch \
26 file://0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch \ 26 file://0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch \
27 file://0001-Catch-std-ifstream-failure-by-reference.patch \
28 file://0002-Fix-format-truncation-errors.patch \
29 file://0001-Fix-string-overflow-in-snprintf.patch \
30 file://0008-check-for-size-before-using-strncpy.patch \
31 " 27 "
32SRC_URI[md5sum] = "d9f44f778e23cf739085f74c5ff793b1" 28SRC_URI[md5sum] = "4dd1497ccd82d275735853bf0db5c510"
33SRC_URI[sha256sum] = "5713fbe21c557c9a992af6805bc44521f2cf6cf950ae873036d9a81c73364b60" 29SRC_URI[sha256sum] = "de42c8dd850990716ca494ca598165cc7a23b5b7f2bc21af5d71a3d971ddd595"
34 30
35inherit autotools useradd systemd pkgconfig 31inherit autotools useradd systemd pkgconfig
36 32