From fc05019734d976e3dde36e614222d36d89f10991 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 12 Mar 2025 09:08:03 -0700 Subject: usbguard: Patch for protobuf 30.0 API changes Signed-off-by: Khem Raj --- .../0001-Adapt-for-protobuf-30.0-API-changes.patch | 89 ++++++++++++++++++++++ .../recipes-security/usbguard/usbguard_1.1.3.bb | 4 +- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-security/usbguard/usbguard/0001-Adapt-for-protobuf-30.0-API-changes.patch (limited to 'meta-oe') diff --git a/meta-oe/recipes-security/usbguard/usbguard/0001-Adapt-for-protobuf-30.0-API-changes.patch b/meta-oe/recipes-security/usbguard/usbguard/0001-Adapt-for-protobuf-30.0-API-changes.patch new file mode 100644 index 0000000000..b7c5b10acd --- /dev/null +++ b/meta-oe/recipes-security/usbguard/usbguard/0001-Adapt-for-protobuf-30.0-API-changes.patch @@ -0,0 +1,89 @@ +From 06ec6473c2ed1920a1d98d40fe992dea9f60b103 Mon Sep 17 00:00:00 2001 +From: Christian Heusel +Date: Tue, 11 Mar 2025 21:43:51 +0100 +Subject: [PATCH] Adapt for protobuf 30.0 API changes + +Fixes https://github.com/USBGuard/usbguard/issues/649 + +Upstream-Status: Submitted [https://github.com/USBGuard/usbguard/pull/650] + +Link: https://protobuf.dev/support/migration/ +Signed-off-by: Christian Heusel +Signed-off-by: Khem Raj +--- + src/Library/IPCClientPrivate.cpp | 2 +- + src/Library/IPCClientPrivate.hpp | 2 +- + src/Library/IPCServerPrivate.cpp | 6 +++--- + src/Library/IPCServerPrivate.hpp | 2 +- + 4 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/Library/IPCClientPrivate.cpp b/src/Library/IPCClientPrivate.cpp +index 6aa5201..452ecd4 100644 +--- a/src/Library/IPCClientPrivate.cpp ++++ b/src/Library/IPCClientPrivate.cpp +@@ -225,7 +225,7 @@ namespace usbguard + std::string payload; + message.SerializeToString(&payload); + struct qb_ipc_request_header hdr; +- hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(message.GetTypeName()); ++ hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(std::string(message.GetTypeName())); + hdr.size = sizeof hdr + payload.size(); + struct iovec iov[2]; + iov[0].iov_base = &hdr; +diff --git a/src/Library/IPCClientPrivate.hpp b/src/Library/IPCClientPrivate.hpp +index d92a1d4..a33022e 100644 +--- a/src/Library/IPCClientPrivate.hpp ++++ b/src/Library/IPCClientPrivate.hpp +@@ -84,7 +84,7 @@ namespace usbguard + template + void registerHandler(MessageHandler::HandlerType method) + { +- const uint32_t type_number = IPC::messageTypeNameToNumber(T::default_instance().GetTypeName()); ++ const uint32_t type_number = IPC::messageTypeNameToNumber(std::string(T::default_instance().GetTypeName())); + _handlers.emplace(type_number, MessageHandler::create(*this, method)); + } + +diff --git a/src/Library/IPCServerPrivate.cpp b/src/Library/IPCServerPrivate.cpp +index 548a726..b976f02 100644 +--- a/src/Library/IPCServerPrivate.cpp ++++ b/src/Library/IPCServerPrivate.cpp +@@ -311,7 +311,7 @@ namespace usbguard + message->SerializeToString(&payload); + struct qb_ipc_response_header hdr; + struct iovec iov[2]; +- hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(message->GetTypeName()); ++ hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(std::string(message->GetTypeName())); + hdr.size = sizeof hdr + payload.size(); + hdr.error = 0; + iov[0].iov_base = &hdr; +@@ -555,7 +555,7 @@ namespace usbguard + std::string payload; + message->SerializeToString(&payload); + struct qb_ipc_response_header hdr = { }; +- hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(message->GetTypeName()); ++ hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(std::string(message->GetTypeName())); + hdr.size = sizeof hdr + payload.size(); + hdr.error = 0; + struct iovec iov[2]; +@@ -563,7 +563,7 @@ namespace usbguard + iov[0].iov_len = sizeof hdr; + iov[1].iov_base = (void*)payload.data(); + iov[1].iov_len = payload.size(); +- qbIPCBroadcastData(iov, 2, messageTypeNameToAccessControlSection(message->GetTypeName())); ++ qbIPCBroadcastData(iov, 2, messageTypeNameToAccessControlSection(std::string(message->GetTypeName()))); + iov[0].iov_base = nullptr; + iov[1].iov_base = nullptr; + } +diff --git a/src/Library/IPCServerPrivate.hpp b/src/Library/IPCServerPrivate.hpp +index 25f9ac3..3b3dcc5 100644 +--- a/src/Library/IPCServerPrivate.hpp ++++ b/src/Library/IPCServerPrivate.hpp +@@ -134,7 +134,7 @@ namespace usbguard + void registerHandler(MessageHandler::HandlerType method, IPCServer::AccessControl::Section section, + IPCServer::AccessControl::Privilege privilege) + { +- const uint32_t type_number = IPC::messageTypeNameToNumber(T::default_instance().GetTypeName()); ++ const uint32_t type_number = IPC::messageTypeNameToNumber(std::string(T::default_instance().GetTypeName())); + _handlers.emplace(type_number, MessageHandler::create(*this, method, section, privilege)); + } + diff --git a/meta-oe/recipes-security/usbguard/usbguard_1.1.3.bb b/meta-oe/recipes-security/usbguard/usbguard_1.1.3.bb index ede9a5f058..558f4347b6 100644 --- a/meta-oe/recipes-security/usbguard/usbguard_1.1.3.bb +++ b/meta-oe/recipes-security/usbguard/usbguard_1.1.3.bb @@ -12,7 +12,9 @@ LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" SRC_URI = "https://github.com/USBGuard/usbguard/releases/download/${BPN}-${PV}/${BPN}-${PV}.tar.gz \ - file://0001-Add-and-use-pkgconfig-instead-of-libgcrypt-config.patch" + file://0001-Add-and-use-pkgconfig-instead-of-libgcrypt-config.patch \ + file://0001-Adapt-for-protobuf-30.0-API-changes.patch \ + " SRC_URI[sha256sum] = "707dad2938923202697f636c2b4e0be80f192242039a2af3fc7ac35d03f78551" -- cgit v1.2.3-54-g00ecf