From 6f106a0a4ce15fe0678d4ffefd572e6978c72597 Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Thu, 26 Aug 2021 13:18:00 -0700 Subject: Update to internal 0.70 Signed-off-by: Jason M. Bills --- .../0002-Skip-decoding-some-dbus-identifiers.patch | 66 ++++++++++++++++++++++ .../sdbusplus/sdbusplus_%.bbappend | 1 + 2 files changed, 67 insertions(+) create mode 100644 meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0002-Skip-decoding-some-dbus-identifiers.patch (limited to 'meta-openbmc-mods/meta-common/recipes-extended/sdbusplus') diff --git a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0002-Skip-decoding-some-dbus-identifiers.patch b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0002-Skip-decoding-some-dbus-identifiers.patch new file mode 100644 index 000000000..3f65cd16f --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0002-Skip-decoding-some-dbus-identifiers.patch @@ -0,0 +1,66 @@ +From 2765f7fe7e01f3bbf30b008d0aea5c4260c2bbb9 Mon Sep 17 00:00:00 2001 +From: Nidhin MS +Date: Tue, 22 Jun 2021 19:49:28 +0530 +Subject: [PATCH] Skip decoding some dbus identifiers + +Dbus identifiers starting with _ and having length less than 3 and also +those having incorrect encoding can be skipped from decoding in +filename() method. Services like user manager accepts usernames +starting with _ and does not restrict accepted usernames. +Ignore those dbus identifiers while decoding. + +Tested: +Small identifiers decoded correctly + +Change-Id: I11aea22060a789dcf756142ee02637dfe7d77c14 +Signed-off-by: Nidhin MS +--- + src/message/native_types.cpp | 7 +++++-- + test/message/types.cpp | 8 ++++---- + 2 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/src/message/native_types.cpp b/src/message/native_types.cpp +index f0a7747..118d829 100644 +--- a/src/message/native_types.cpp ++++ b/src/message/native_types.cpp +@@ -79,13 +79,16 @@ std::string string_path_wrapper::filename() const + } + if (i + 2 >= filename.size()) + { +- return ""; ++ out.append(1, filename[i]); ++ continue; + } ++ + auto ch = unhex[filename[i + 1]]; + auto cl = unhex[filename[i + 2]]; + if (ch == -1 || cl == -1) + { +- return ""; ++ out.append(1, filename[i]); ++ continue; + } + out.append(1, (ch << 4) | cl); + i += 2; +diff --git a/test/message/types.cpp b/test/message/types.cpp +index d666008..2c639f5 100644 +--- a/test/message/types.cpp ++++ b/test/message/types.cpp +@@ -53,10 +53,10 @@ TEST(MessageTypes, ObjectPathFilename) + EXPECT_EQ(sdbusplus::message::object_path("/_2d").filename(), "-"); + EXPECT_EQ(sdbusplus::message::object_path("/_20").filename(), " "); + EXPECT_EQ(sdbusplus::message::object_path("/_2F").filename(), "/"); +- EXPECT_EQ(sdbusplus::message::object_path("/_").filename(), ""); +- EXPECT_EQ(sdbusplus::message::object_path("/_2").filename(), ""); +- EXPECT_EQ(sdbusplus::message::object_path("/_2y").filename(), ""); +- EXPECT_EQ(sdbusplus::message::object_path("/_y2").filename(), ""); ++ EXPECT_EQ(sdbusplus::message::object_path("/_").filename(), "_"); ++ EXPECT_EQ(sdbusplus::message::object_path("/_2").filename(), "_2"); ++ EXPECT_EQ(sdbusplus::message::object_path("/_2y").filename(), "_2y"); ++ EXPECT_EQ(sdbusplus::message::object_path("/_y2").filename(), "_y2"); + EXPECT_EQ(sdbusplus::message::object_path("/bios_active").filename(), + "bios_active"); + } +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend index 6d16fe190..cea571f08 100644 --- a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend @@ -2,4 +2,5 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += " \ file://0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch \ + file://0002-Skip-decoding-some-dbus-identifiers.patch \ " -- cgit v1.2.3