Skip to content
Snippets Groups Projects
Commit 903b99aa authored by Zbigniew Bodek's avatar Zbigniew Bodek
Browse files

Update softbus revision to align with the latest tree state


The patch for the missing mq_open() argument has been merged
so it is possible to remove the patch from here.

Signed-off-by: default avatarZbigniew Bodek <zbigniew.bodek@huawei.com>
parent 027a078c
No related branches found
No related tags found
No related merge requests found
From d1b564ce1c294be4752204bad8261316b8e56ba1 Mon Sep 17 00:00:00 2001
From: Zbigniew Bodek <zbigniew.bodek@huawei.com>
Date: Thu, 31 Dec 2020 16:24:24 +0000
Subject: [PATCH] Fix incorrect number of arguments to mq_open()
Related issue:
https://gitee.com/openharmony/communication_services_softbus_lite/issues/I2BBKX
According to man:
If O_CREAT is specified in oflag, then two additional arguments
must be supplied.
os_adapter.c is missing "mode" parameter in mq_open(). It will compile
for MUSL, which does not check the number of arguments passed through
variadic argument but it doesn't mean it works as designed.
Fix this issue as well as build for other libraries with built-in
checks by introducing missing "mode" argument.
File mode has been selected to 0600 (RW for owner) but is a subject
to change if needed.
Signed-off-by: Zbigniew Bodek <zbigniew.bodek@huawei.com>
---
os_adapter/source/L1/os_adapter.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/os_adapter/source/L1/os_adapter.c b/os_adapter/source/L1/os_adapter.c
index 98f91c9..9eb693a 100755
--- a/os_adapter/source/L1/os_adapter.c
+++ b/os_adapter/source/L1/os_adapter.c
@@ -79,7 +79,9 @@ int CreateMsgQue(const char *queueName,
newAttr.mq_flags = flags;
newAttr.mq_maxmsg = len;
newAttr.mq_msgsize = maxMsgSize;
- int mqd = mq_open(queueName, O_RDWR | O_CREAT, &newAttr);
+ /* Owner read and write permission - 0600 */
+ mode_t mode = (S_IRUSR | S_IWUSR);
+ int mqd = mq_open(queueName, O_RDWR | O_CREAT, mode, &newAttr);
if (mqd < 0) {
return -1;
}
...@@ -5,15 +5,13 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=98c2e72b17fae6c40fb14fd5e43b29ec" ...@@ -5,15 +5,13 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=98c2e72b17fae6c40fb14fd5e43b29ec"
DEPENDS += "cjson libsec samgr softbus-kits iam-kits hichainsdk hichainsdk-innerkits mbedtls" DEPENDS += "cjson libsec samgr softbus-kits iam-kits hichainsdk hichainsdk-innerkits mbedtls"
SRC_URI = "git://gitee.com/openharmony/communication_services_softbus_lite.git;protocol=https \ SRC_URI = "git://gitee.com/openharmony/communication_services_softbus_lite.git;protocol=https"
file://0001-Fix-incorrect-number-of-arguments-to-mq_open.patch \
"
PV = "1.0+git${SRCPV}" PV = "1.0+git${SRCPV}"
PVSHORT = '${@d.getVar("PV", False).split("+")[0]}' PVSHORT = '${@d.getVar("PV", False).split("+")[0]}'
PVMAJOR = '${@d.getVar("PV", False).split(".")[0]}' PVMAJOR = '${@d.getVar("PV", False).split(".")[0]}'
SRCREV = "b3f7261e31d0be165979446fef4a6c415cc03f65" SRCREV = "d110d2cd61806efc89d7eaa651d2c36fce66df97"
S = "${WORKDIR}/git" S = "${WORKDIR}/git"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment