mirror of
https://anongit.gentoo.org/git/repo/gentoo.git
synced 2025-06-09 06:35:19 +02:00
Closes: https://bugs.gentoo.org/953624 Signed-off-by: Sebastian Pipping <sping@gentoo.org>
86 lines
4 KiB
Diff
86 lines
4 KiB
Diff
From 2838890f097fb2f5419523801e71e54905a7d1dd Mon Sep 17 00:00:00 2001
|
|
From: Christian Heusel <christian@heusel.eu>
|
|
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
|
|
|
|
Link: https://protobuf.dev/support/migration/
|
|
Signed-off-by: Christian Heusel <christian@heusel.eu>
|
|
---
|
|
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 6aa52013..452ecd41 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 d92a1d47..a33022e2 100644
|
|
--- a/src/Library/IPCClientPrivate.hpp
|
|
+++ b/src/Library/IPCClientPrivate.hpp
|
|
@@ -84,7 +84,7 @@ namespace usbguard
|
|
template<class T>
|
|
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<T>(*this, method));
|
|
}
|
|
|
|
diff --git a/src/Library/IPCServerPrivate.cpp b/src/Library/IPCServerPrivate.cpp
|
|
index 548a7261..b976f025 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 25f9ac38..3b3dcc51 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<T>(*this, method, section, privilege));
|
|
}
|
|
|