| Server IP : 23.254.227.96 / Your IP : 216.73.216.21 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.6/site-packages/tuned/utils/__pycache__/ |
Upload File : |
3
��c� � @ s, d dl Z d dlZejj� ZG dd� d�ZdS )� Nc @ s e Zd Zdd� Zdd� ZdS )�polkitc C s4 t j� | _| 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 �/usr/lib/python3.6/polkit.py�__init__ s
zpolkit.__init__c
C s� |dks|dkrdS i }d}d}dd|if}y| j j|||||�d }W n� tjjtfk
r� } zhtjd| � y| jj |�} W n2 tjjk
r� } ztjd | � dS d}~X nX | dkr�d
S dS W Y dd}~X nX |r�dS 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_idZdetails�flagsZcancellation_idZsubject�ret�eZuidr r r �check_authorization s&