Files
pmaports-rtwo/extra-repos/systemd/systemd/41483.patch
T
Clayton Craft 40a5c82049 systemd/systemd: add patches to fix sysupdate issues
These patches are merged (or submitted) upstream and not in a release
yet.

Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8261>
2026-04-02 13:31:46 -07:00

56 lines
2.2 KiB
Diff

From bfb0bfeff0cc38c8b5803437c7f413199fda043d Mon Sep 17 00:00:00 2001
From: Clayton Craft <clayton@craftyguy.net>
Date: Thu, 2 Apr 2026 10:06:51 -0700
Subject: [PATCH] updatectl: fix unexpected polkit prompt on update
When running `updatectl update` since f0b2ea63, Install() was called
with the version resolved by Acquire() rather than the originally
requested (empty) version, causing the stricter update-to-version polkit
action to be used instead of the update polkit action.
---
src/sysupdate/updatectl.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/sysupdate/updatectl.c b/src/sysupdate/updatectl.c
index 86561cf1c734d..636a3f064b94f 100644
--- a/src/sysupdate/updatectl.c
+++ b/src/sysupdate/updatectl.c
@@ -75,6 +75,8 @@ typedef struct Operation {
/* Only used for Acquire()/Install() operations: */
char *acquired_version;
+ /* The version the user requested, possibly empty */
+ char *requested_version;
} Operation;
static Operation* operation_free(Operation *p) {
@@ -90,6 +92,7 @@ static Operation* operation_free(Operation *p) {
free(p->job_path);
free(p->acquired_version);
+ free(p->requested_version);
sd_event_source_disable_unref(p->job_interrupt_source);
sd_bus_slot_unref(p->job_properties_slot);
@@ -1068,7 +1071,7 @@ static int update_acquire_finished(sd_bus_message *m, void *userdata, sd_bus_err
update_install_started,
op,
"st",
- op->acquired_version,
+ op->requested_version,
0LU);
if (r < 0)
return log_bus_error(r, NULL, op->target_id, "call Install");
@@ -1246,6 +1249,11 @@ static int do_update(sd_bus *bus, char **targets) {
0LU);
if (r < 0)
return log_bus_error(r, NULL, targets[i], "call Acquire");
+
+ op->requested_version = strdup(versions[i]);
+ if (!op->requested_version)
+ return log_oom();
+
TAKE_PTR(op);
remaining++;