Bug 1085073 - Shutdown privileges not respected
Summary: Shutdown privileges not respected
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: kde-settings
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-07 18:12 UTC by Germano Massullo (Thetra)
Modified: 2014-05-29 22:44 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-04-24 08:26:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
settings screenshot (46.72 KB, image/png)
2014-04-07 22:25 UTC, Germano Massullo (Thetra)
no flags Details


Links
System ID Private Priority Status Summary Last Updated
KDE Software Compilation 333171 0 None None None Never

Description Germano Massullo (Thetra) 2014-04-07 18:12:52 UTC
Description of problem:
I have setted that only root can poweroff/restart the system, but the system ignores that option 

Version-Release number of selected component (if applicable):
KDE Version 4.12.3

Comment 1 Kevin Kofler 2014-04-07 18:26:20 UTC
There are 2 ways to shutdown/restart the machine as non-root:
* the traditional KDE way, through KDM (still the default when KDM is in use) and
* the new way, through systemd (used by KDE when you aren't using KDM, and by pretty much everything else in the distro).

They use different policy settings to decide who is allowed to do it. KDM (which runs as root, which is why it can perform the shutdown/restart in the first place) uses the setting from KDE System Settings. On the other hand, systemd uses PolicyKit.

The setting in KDE's System Settings only affects KDM, not systemd.

Comment 2 Germano Massullo (Thetra) 2014-04-07 18:35:16 UTC
What is affected when someone clicks onto Exit->Poweroff?

Comment 3 Kevin Kofler 2014-04-07 18:41:48 UTC
If you're running KDM, it will do the shutdown through KDM, and so the settings should be respected. If you're running some other display manager (SDDM, GDM, LightDM etc.) or none at all (i.e. if you use "startx startkde" or something like that), it uses systemd, so the settings used will be the PolicyKit ones.

Eventually, KDM will be phased out entirely and only the PolicyKit setting will be relevant.

Comment 4 Germano Massullo (Thetra) 2014-04-07 20:28:33 UTC
Ok it is defenitely a bug

Comment 5 Germano Massullo (Thetra) 2014-04-07 22:25:14 UTC
Created attachment 883777 [details]
settings screenshot

Comment 6 Martin Bříza 2014-04-24 08:26:31 UTC
Tried this setting. When switched to KDM, it did ask me for root's password when I tried to shut the system down.

Comment 7 Martin Bříza 2014-04-24 08:28:36 UTC
Please note that the option you're pointing out as wrong affects only KDM's (the login screen) shutdown dialog. You need to set PolicyKit rules if you want to prevent users from using any other way of shutting the system down (e. g. the Exit->Poweroff menu entry in Kickoff).

Comment 8 Germano Massullo (Thetra) 2014-04-24 09:03:31 UTC
The setting I opened the bugreport about, prevented for more than a year, the system from people trying to powering it off from Exit->Poweroff menu entry in Kickoff.
Now I am going to upgrade the system to lastest KDE version and I will try again.

Comment 9 Martin Bříza 2014-04-24 09:06:50 UTC
It won't help. Kickoff's Poweroff does respect the systemwide policies. KDM does not. Actually, to behave consistently with the rest of the system, there should be no such option in System Settings.

Comment 10 Germano Massullo (Thetra) 2014-05-18 16:32:50 UTC
I think I have been misunderstood, but I solved the problem on two diffent machines by simply removing and by applying again the settings. I think an "n" config file had some troubles and applying again the settings overwritten the config file.
Now if anybody tries to poweroff the computer, the user session ends, but KDM asks for root password. If the user does not enter root password, KDM will bring him into a KDM login screen. That is what I needed and what got broken in past.

Comment 11 Kevin Kofler 2014-05-29 22:44:46 UTC
> It won't help. Kickoff's Poweroff does respect the systemwide policies. KDM
> does not.

It's actually more complicated than that.

Kickoff's Poweroff uses ksmserver. The logic in ksmserver is:
* if KDM is running, ask KDM to do the shutdown,
* otherwise, ask systemd to do the shutdown.
(There are actually more methods, but those 2 are the relevant ones in Fedora.)

So which settings are applied depends on what login manager KDE was started from. (And yes, in principle, we could just always use systemd. But then the setting in System Settings would not be applied anymore.)


Note You need to log in before you can comment on or make changes to this bug.