mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
systemctl: certainly ignore ENOENT in checking inhibitors
Fixes a bug caused by804874d26a. Follow-up for084f361b50anda1417e5563. Note, ERRNO_IS_NEG_DISCONNECT() includes ENONET rather than ENOENT... So, ENOENT needs to be handled explicitly. Fixes #35757 and #35806.
This commit is contained in:
committed by
Luca Boccassi
parent
76d80cc343
commit
66f379b63d
@@ -152,7 +152,7 @@ int logind_check_inhibitors(enum action a) {
|
||||
return 0;
|
||||
|
||||
r = acquire_bus_full(BUS_FULL, /* graceful = */ true, &bus);
|
||||
if (ERRNO_IS_NEG_DISCONNECT(r) && geteuid() == 0)
|
||||
if ((ERRNO_IS_NEG_DISCONNECT(r) || r == -ENOENT) && geteuid() == 0)
|
||||
return 0; /* When D-Bus is not running (ECONNREFUSED) or D-Bus socket is not created (ENOENT),
|
||||
* allow root to force a shutdown. E.g. when running at the emergency console. */
|
||||
if (r < 0)
|
||||
|
||||
Reference in New Issue
Block a user