From: Daan De Meyer Date: Wed, 9 Oct 2024 09:44:34 +0000 (+0200) Subject: bus-util: Drop fallback to system/user bus if manager bus doesn't work X-Git-Tag: v257-rc1~256^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a339495b1d67f69f49ffffdd96002164a28f1c93;p=thirdparty%2Fsystemd.git bus-util: Drop fallback to system/user bus if manager bus doesn't work We have various callsites that explicitly need the manager bus and won't work with the system bus, like daemon-reexec and friends which can't properly wait until the operation has finished unless using the manager bus. If we silently fall back to the system bus for these operations, we can end up with rather hard to debug issues so let's remove the fallback as it was added back in 2013 in a6aa89122d2fa5e811a72200773068c13bfffea2 without a clear explanation of why it was needed (I expect as a fallback if kdbus wasn't available but that's not a thing anymore these days). --- diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index f4c4eed7070..44ed617da8d 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -245,7 +245,7 @@ int bus_connect_system_systemd(sd_bus **ret_bus) { r = sd_bus_start(bus); if (r < 0) - return sd_bus_default_system(ret_bus); + return r; r = bus_check_peercred(bus); if (r < 0) @@ -265,7 +265,7 @@ int bus_connect_user_systemd(sd_bus **ret_bus) { e = secure_getenv("XDG_RUNTIME_DIR"); if (!e) - return sd_bus_default_user(ret_bus); + return -ENXIO; ee = bus_address_escape(e); if (!ee) @@ -281,7 +281,7 @@ int bus_connect_user_systemd(sd_bus **ret_bus) { r = sd_bus_start(bus); if (r < 0) - return sd_bus_default_user(ret_bus); + return r; r = bus_check_peercred(bus); if (r < 0)