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 a6aa89122d
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).
This commit is contained in:
Daan De Meyer
2024-10-09 11:44:34 +02:00
parent ec9fd0d4f5
commit a339495b1d

View File

@@ -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)