/usr/lib/python3.9/site-packages/tuned/utils/__pycache__
Edit: /usr/lib/python3.9/site-packages/tuned/utils/__pycache__/polkit.cpython-39.pyc (1747B)
a
Á]›i˜ ã @ s, d dl Z d dlZej ¡ ZG dd„ dƒZdS )é Nc @ s e Zd Zdd„ Zdd„ ZdS )Úpolkitc C s4 t ¡ | _| jjdddd�| _t j| jdd�| _d S )Nzorg.freedesktop.PolicyKit1z%/org/freedesktop/PolicyKit1/AuthorityT)Zfollow_name_owner_changesz$org.freedesktop.PolicyKit1.Authority)Zdbus_interface)ÚdbusZ SystemBusÚ_busZ
get_objectÚ_proxyZ InterfaceÚ
_authority)Úself© r ú6/usr/lib/python3.9/site-packages/tuned/utils/polkit.pyÚ__init__ s
zpolkit.__init__c
C s |du s|du rdS i }d}d}dd|if}z| j |||||¡d }W n´ tjjtf� yü } z’t d| ¡ z| j |¡} W nB tjjy } z&t d | ¡ W Y d}~W Y d}~d
S d}~0 0 | dkrÚW Y d}~dS W Y d}~dS W Y d}~n
d}~0 0 |�rdS dS )
zÿCheck authorization, return codes:
1 - authorized
2 - polkit error, but authorized with fallback method
0 - unauthorized
-1 - polkit error and unauthorized by the fallback method
-2 - polkit error and unable to use the fallback method
NFé Ú zsystem-bus-nameÚnamer zerror querying polkit: %sz-error using fallback authorization method: %séþÿÿÿé éÿÿÿÿ)
r ZCheckAuthorizationr Ú
exceptionsZ
DBusExceptionÚ
ValueErrorÚlogÚerrorr Z
get_unix_user)
r ZsenderZ action_idÚdetailsÚflagsZcancellation_idZsubjectÚretÚeÚuidr r r Úcheck_authorization s&