From c685e2c8e86f3541a94f09c3aa912a4022bd3056 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

(cherry picked from commit b56ee692334231f0312c2fd142b9f2a84da14ac9)
(cherry picked from commit d38ba62059c7d28dbd259699df224ec19a10f4aa)
(cherry picked from commit 6691b54958c27f0f0557b9a8a9d834e1d99c9465)

Conflict:NA
Reference:https://github.com/systemd/systemd-stable/commit/c685e2c8e86f3541a94f09c3aa912a4022bd3056
---
 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 3585ac1f47..0c798346e0 100644
--- a/src/hostname/hostnamed.c
+++ b/src/hostname/hostnamed.c
@@ -1194,7 +1194,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 85b907faa9..dc0a26eb43 100644
--- a/src/shared/bus-polkit.c
+++ b/src/shared/bus-polkit.c
@@ -263,6 +263,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.33.0

