diff options
author | Khem Raj <raj.khem@gmail.com> | 2025-03-12 09:08:03 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-03-13 09:50:12 -0700 |
commit | fc05019734d976e3dde36e614222d36d89f10991 (patch) | |
tree | 0a60d762227305b8dce3793a56140c01846a57ca /meta-oe | |
parent | f36fd07ecb0c0476163b5a647f085454abe123d7 (diff) | |
download | meta-openembedded-fc05019734d976e3dde36e614222d36d89f10991.tar.gz |
usbguard: Patch for protobuf 30.0 API changes
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r-- | meta-oe/recipes-security/usbguard/usbguard/0001-Adapt-for-protobuf-30.0-API-changes.patch | 89 | ||||
-rw-r--r-- | meta-oe/recipes-security/usbguard/usbguard_1.1.3.bb | 4 |
2 files changed, 92 insertions, 1 deletions
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 @@ | |||
1 | From 06ec6473c2ed1920a1d98d40fe992dea9f60b103 Mon Sep 17 00:00:00 2001 | ||
2 | From: Christian Heusel <christian@heusel.eu> | ||
3 | Date: Tue, 11 Mar 2025 21:43:51 +0100 | ||
4 | Subject: [PATCH] Adapt for protobuf 30.0 API changes | ||
5 | |||
6 | Fixes https://github.com/USBGuard/usbguard/issues/649 | ||
7 | |||
8 | Upstream-Status: Submitted [https://github.com/USBGuard/usbguard/pull/650] | ||
9 | |||
10 | Link: https://protobuf.dev/support/migration/ | ||
11 | Signed-off-by: Christian Heusel <christian@heusel.eu> | ||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | src/Library/IPCClientPrivate.cpp | 2 +- | ||
15 | src/Library/IPCClientPrivate.hpp | 2 +- | ||
16 | src/Library/IPCServerPrivate.cpp | 6 +++--- | ||
17 | src/Library/IPCServerPrivate.hpp | 2 +- | ||
18 | 4 files changed, 6 insertions(+), 6 deletions(-) | ||
19 | |||
20 | diff --git a/src/Library/IPCClientPrivate.cpp b/src/Library/IPCClientPrivate.cpp | ||
21 | index 6aa5201..452ecd4 100644 | ||
22 | --- a/src/Library/IPCClientPrivate.cpp | ||
23 | +++ b/src/Library/IPCClientPrivate.cpp | ||
24 | @@ -225,7 +225,7 @@ namespace usbguard | ||
25 | std::string payload; | ||
26 | message.SerializeToString(&payload); | ||
27 | struct qb_ipc_request_header hdr; | ||
28 | - hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(message.GetTypeName()); | ||
29 | + hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(std::string(message.GetTypeName())); | ||
30 | hdr.size = sizeof hdr + payload.size(); | ||
31 | struct iovec iov[2]; | ||
32 | iov[0].iov_base = &hdr; | ||
33 | diff --git a/src/Library/IPCClientPrivate.hpp b/src/Library/IPCClientPrivate.hpp | ||
34 | index d92a1d4..a33022e 100644 | ||
35 | --- a/src/Library/IPCClientPrivate.hpp | ||
36 | +++ b/src/Library/IPCClientPrivate.hpp | ||
37 | @@ -84,7 +84,7 @@ namespace usbguard | ||
38 | template<class T> | ||
39 | void registerHandler(MessageHandler::HandlerType method) | ||
40 | { | ||
41 | - const uint32_t type_number = IPC::messageTypeNameToNumber(T::default_instance().GetTypeName()); | ||
42 | + const uint32_t type_number = IPC::messageTypeNameToNumber(std::string(T::default_instance().GetTypeName())); | ||
43 | _handlers.emplace(type_number, MessageHandler::create<T>(*this, method)); | ||
44 | } | ||
45 | |||
46 | diff --git a/src/Library/IPCServerPrivate.cpp b/src/Library/IPCServerPrivate.cpp | ||
47 | index 548a726..b976f02 100644 | ||
48 | --- a/src/Library/IPCServerPrivate.cpp | ||
49 | +++ b/src/Library/IPCServerPrivate.cpp | ||
50 | @@ -311,7 +311,7 @@ namespace usbguard | ||
51 | message->SerializeToString(&payload); | ||
52 | struct qb_ipc_response_header hdr; | ||
53 | struct iovec iov[2]; | ||
54 | - hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(message->GetTypeName()); | ||
55 | + hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(std::string(message->GetTypeName())); | ||
56 | hdr.size = sizeof hdr + payload.size(); | ||
57 | hdr.error = 0; | ||
58 | iov[0].iov_base = &hdr; | ||
59 | @@ -555,7 +555,7 @@ namespace usbguard | ||
60 | std::string payload; | ||
61 | message->SerializeToString(&payload); | ||
62 | struct qb_ipc_response_header hdr = { }; | ||
63 | - hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(message->GetTypeName()); | ||
64 | + hdr.id = QB_IPC_MSG_USER_START + IPC::messageTypeNameToNumber(std::string(message->GetTypeName())); | ||
65 | hdr.size = sizeof hdr + payload.size(); | ||
66 | hdr.error = 0; | ||
67 | struct iovec iov[2]; | ||
68 | @@ -563,7 +563,7 @@ namespace usbguard | ||
69 | iov[0].iov_len = sizeof hdr; | ||
70 | iov[1].iov_base = (void*)payload.data(); | ||
71 | iov[1].iov_len = payload.size(); | ||
72 | - qbIPCBroadcastData(iov, 2, messageTypeNameToAccessControlSection(message->GetTypeName())); | ||
73 | + qbIPCBroadcastData(iov, 2, messageTypeNameToAccessControlSection(std::string(message->GetTypeName()))); | ||
74 | iov[0].iov_base = nullptr; | ||
75 | iov[1].iov_base = nullptr; | ||
76 | } | ||
77 | diff --git a/src/Library/IPCServerPrivate.hpp b/src/Library/IPCServerPrivate.hpp | ||
78 | index 25f9ac3..3b3dcc5 100644 | ||
79 | --- a/src/Library/IPCServerPrivate.hpp | ||
80 | +++ b/src/Library/IPCServerPrivate.hpp | ||
81 | @@ -134,7 +134,7 @@ namespace usbguard | ||
82 | void registerHandler(MessageHandler::HandlerType method, IPCServer::AccessControl::Section section, | ||
83 | IPCServer::AccessControl::Privilege privilege) | ||
84 | { | ||
85 | - const uint32_t type_number = IPC::messageTypeNameToNumber(T::default_instance().GetTypeName()); | ||
86 | + const uint32_t type_number = IPC::messageTypeNameToNumber(std::string(T::default_instance().GetTypeName())); | ||
87 | _handlers.emplace(type_number, MessageHandler::create<T>(*this, method, section, privilege)); | ||
88 | } | ||
89 | |||
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" | |||
12 | LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" | 12 | LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
13 | 13 | ||
14 | SRC_URI = "https://github.com/USBGuard/usbguard/releases/download/${BPN}-${PV}/${BPN}-${PV}.tar.gz \ | 14 | SRC_URI = "https://github.com/USBGuard/usbguard/releases/download/${BPN}-${PV}/${BPN}-${PV}.tar.gz \ |
15 | file://0001-Add-and-use-pkgconfig-instead-of-libgcrypt-config.patch" | 15 | file://0001-Add-and-use-pkgconfig-instead-of-libgcrypt-config.patch \ |
16 | file://0001-Adapt-for-protobuf-30.0-API-changes.patch \ | ||
17 | " | ||
16 | 18 | ||
17 | SRC_URI[sha256sum] = "707dad2938923202697f636c2b4e0be80f192242039a2af3fc7ac35d03f78551" | 19 | SRC_URI[sha256sum] = "707dad2938923202697f636c2b4e0be80f192242039a2af3fc7ac35d03f78551" |
18 | 20 | ||