systemd/backport-hostname-Make-sure-we-pass-error-to-bus_verify_polki.patch
2023-12-18 17:29:00 +08:00

45 lines
1.4 KiB
Diff

From b56ee692334231f0312c2fd142b9f2a84da14ac9 Mon Sep 17 00:00:00 2001
From: Daan De Meyer <daan.j.demeyer@gmail.com>
Date: Thu, 24 Aug 2023 09:00:04 +0200
Subject: [PATCH] hostname: Make sure we pass error to
bus_verify_polkit_async()
Fixes #28943
Conflict:NA
Reference:https://github.com/systemd/systemd-stable/commit/b56ee692334231f0312c2fd142b9f2a84da14ac9
---
src/hostname/hostnamed.c | 2 +-
src/shared/bus-polkit.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
index 9ef45f8e75..85904aabe9 100644
--- a/src/hostname/hostnamed.c
+++ b/src/hostname/hostnamed.c
@@ -1318,7 +1318,7 @@ static int method_describe(sd_bus_message *m, void *userdata, sd_bus_error *erro
false,
UID_INVALID,
&c->polkit_registry,
- NULL);
+ error);
if (r == 0)
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
diff --git a/src/shared/bus-polkit.c b/src/shared/bus-polkit.c
index 3ff2726d4a..904b897984 100644
--- a/src/shared/bus-polkit.c
+++ b/src/shared/bus-polkit.c
@@ -480,6 +480,7 @@ int bus_verify_polkit_async(
assert(call);
assert(action);
assert(registry);
+ assert(ret_error);
r = check_good_user(call, good_user);
if (r != 0)
--
2.39.1