Bug 477056 - Support the use case of requiring authenticate to restart/shut down etc.
Summary: Support the use case of requiring authenticate to restart/shut down etc.
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Session Management (other bugs)
Version First Reported In: 5.27.5
Platform: Debian stable Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-15 17:07 UTC by Michael Tsang
Modified: 2024-09-08 20:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Tsang 2023-11-15 17:07:30 UTC
SUMMARY
Restart button does not prompt for authentication even if I set PolicyKit to require admin authentication to restart, and freezes at a black screen after using it.


STEPS TO REPRODUCE
1. Install the following PolicyKit rules:

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.login1.power-off" ||
        action.id == "org.freedesktop.login1.power-off-ignore-inhibit" ||
        action.id == "org.freedesktop.login1.power-off-multiple-sessions" ||
        action.id == "org.freedesktop.login1.reboot" ||
        action.id == "org.freedesktop.login1.reboot-ignore-inhibit" ||
        action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
        action.id == "org.freedesktop.login1.set-reboot-parameter" ||
        action.id == "org.freedesktop.login1.set-reboot-to-firmware-setup" ||
        action.id == "org.freedesktop.login1.set-reboot-to-boot-loader-menu" ||
        action.id == "org.freedesktop.login1.set-reboot-to-boot-loader-entry" ||
        action.id == "org.freedesktop.login1.suspend" ||
        action.id == "org.freedesktop.login1.suspend-ignore-inhibit" ||
        action.id == "org.freedesktop.login1.suspend-multiple-sessions" ||
        action.id == "org.freedesktop.login1.hibernate" ||
        action.id == "org.freedesktop.login1.hibernate-ignore-inhibit" ||
        action.id == "org.freedesktop.login1.hibernate-multiple-sessions"
    ) {
        return polkit.Result.AUTH_ADMIN;
    }
});

2. Verify that it works by issuing `pkcheck -u -p $$ -a org.freedesktop.login1.reboot; echo $?` in bash in a terminal in the Plasma desktop environment. It should prompt for an authentication.

3. Restart the system from the start menu

OBSERVED RESULT
It does not prompt for authentication. After choosing the option, the screen goes black and freezes. It only regains responsiveness by signing into another terminal and kill plasma-shutdown process.

EXPECTED RESULT
It prompts for authentication, if succeed it restarts the system.


SOFTWARE/OS VERSIONS
Debian GNU/Linux 12
Linux Version: 6.1.0-13-amd64
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Graphics Platform: X11

ADDITIONAL INFORMATION