Bug 625880

Summary: respect PolicyKit privileges in can_{suspend,hibernate}
Product: Red Hat Enterprise Linux 6 Reporter: ritz <rkhadgar>
Component: DeviceKit-powerAssignee: Richard Hughes <rhughes>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: azelinka, cww, djast, haruo.tomita, mishu, pkovar, rdassen, spurrier
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: DeviceKit-power-014-2 Doc Type: Bug Fix
Doc Text:
To allow administrators easily disable the suspend and hibernate actions on the system, DeviceKit-power now checks the PolicyKit authorization before deciding whether an action can be completed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-07 13:05:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 662543    
Attachments:
Description Flags
patch based on upstream code none

Description ritz 2010-08-20 17:12:12 UTC
Created attachment 439995 [details]
patch based on upstream code

Description of problem:
to disable suspend/hibernate. Obviously this isn't a very clean approach. It
would be much better if upower would actually take the policykit privileges
into account for reporting the values to clients, so that gnome-power-prefs,
gnome-session, and other clients would do the right thing and hide the
suspend/hibernate options if the admin (or an OEM) disables those privileges
through a .pkla file, or if the defaults simply change in the future.


Version-Release number of selected component (if applicable):
DeviceKit-power-014-1.el6

How reproducible:
always

Steps to Reproduce:
1. $ cat /var/lib/polkit-1/localauthority/10-vendor.d/20-hibernate.pkla 
[Disable suspend]
Identity=unix-group:*
Action=org.freedesktop.devicekit.power.hibernate
ResultAny=no
ResultInactive=no
ResultActive=no

2. Login as a regulare user
3. Select Shutdown from gnome application menu.
  
Actual results:
Hibernate option is listed

Expected results:
Hibernate should not be listed


Additional info:
upstream bz - http://bugs.freedesktop.org/show_bug.cgi?id=26473
patch attached.

Comment 1 Ray Strode [halfline] 2010-10-21 16:33:32 UTC
*** Bug 645462 has been marked as a duplicate of this bug. ***

Comment 2 Suzanne Logcher 2011-01-05 19:43:33 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated 
in the current release, Red Hat is unfortunately unable to 
address this request at this time.  This request has been 
proposed for the next release of Red Hat Enterprise Linux.
If you would like it considered as an exception in the 
current release, please ask your support representative.

Comment 7 Petr Kovar 2011-07-26 16:02:40 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
To allow administrators easily disable the suspend and hibernate actions on the system, DeviceKit-power now checks the PolicyKit authorization before deciding whether an action can be completed.

Comment 10 errata-xmlrpc 2011-09-07 13:05:10 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-1276.html