Description of problem: Cockpit is unable to cancel a scheduled reboot via DBus with the following error: Failed to cancel shutdown Interactive authentication required Cockpit calls the following dbus command, but via it cockpit itself. busctl call org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager CancelScheduledShutdown Version-Release number of selected component (if applicable): The last known good version is v250.3-6.fc37, the first v251 version breaks. How reproducible: Always Steps to Reproduce: 1. Schedule a reboot in cockpit as administrator (with adminstrative access). (Click reboot => shows a dialog schedule for X minutes) 2. Notice that the "Health card" has a cancel shutdown button 3. Click the cancel shutdown button Actual results: Failed to cancel shutdown Interactive authentication required Expected results: No error, reboot cancelled. Additional info: Monitoring with: busctl monitor org.freedesktop.login1.Manager Shows the following: ‣ Type=method_return Endian=l Flags=1 Version=1 Cookie=-1 ReplyCookie=2009 Timestamp="Mon 2022-05-02 13:37:13.555384 UTC" Sender=org.freedesktop.DBus Destination=:1.46 MESSAGE "u" { UINT32 1782; }; ‣ Type=method_return Endian=l Flags=1 Version=1 Cookie=2010 ReplyCookie=360 Timestamp="Mon 2022-05-02 13:37:13.556330 UTC" Sender=:1.46 Destination=:1.4 UniqueName=:1.46 MESSAGE "(bba{ss})" { STRUCT "bba{ss}" { BOOLEAN false; BOOLEAN true; ARRAY "{ss}" { DICT_ENTRY "ss" { STRING "polkit.retains_authorization_after_challenge"; STRING "1"; }; }; }; }; ‣ Type=error Endian=l Flags=1 Version=1 Cookie=361 ReplyCookie=1339 Timestamp="Mon 2022-05-02 13:37:13.557643 UTC" Sender=:1.4 Destination=:1.41 ErrorName=org.freedesktop.DBus.Error.InteractiveAuthorizationRequired ErrorMessage="Interactive authentication required." UniqueName=:1.4 MESSAGE "s" { STRING "Interactive authentication required."; };
At first sight this is cockpit's bug. cancelShutdownAction() does not connect to the system bus as root, it's missing a { superuser: "try" }.
Seems this was an intended, not an accidental change: https://github.com/systemd/systemd/commit/ec14fba91c94f38f3 (part of https://github.com/systemd/systemd/pull/21838)
Fixing in https://github.com/cockpit-project/cockpit/pull/17302
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle. Changing version to 37.
This was fixed long ago in Cockpit 269.