<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
<e                 @   s,   d dl Z d dlZejj ZG dd dZdS )    Nc               @   s   e Zd Zdd Zdd ZdS )polkitc             C   s4   t j | _| jjdddd| _t j| jdd| _d S )Nzorg.freedesktop.PolicyKit1z%/org/freedesktop/PolicyKit1/AuthorityT)Zfollow_name_owner_changesz$org.freedesktop.PolicyKit1.Authority)Zdbus_interface)dbusZ	SystemBus_busZ
get_object_proxyZ	Interface
_authority)self r   /usr/lib/python3.6/polkit.py__init__   s    
zpolkit.__init__c       
      C   s   |dks|dkrdS i }d}d}dd|if}y| j j|||||d }W n tjjtfk
r } zhtjd|  y| jj	|}	W n2 tjjk
r } ztjd	|  dS d}~X nX |	dkrd
S dS W Y dd}~X nX |rdS dS )zCheck 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    zsystem-bus-namenamer   zerror querying polkit: %sz-error using fallback authorization method: %s   )
r   ZCheckAuthorizationr   
exceptionsZDBusException
ValueErrorlogerrorr   Zget_unix_user)
r   ZsenderZ	action_idZdetailsflagsZcancellation_idZsubjectreteZuidr   r   r	   check_authorization   s&    	zpolkit.check_authorizationN)__name__
__module____qualname__r
   r   r   r   r   r	   r      s   r   )r   Z
tuned.logsZtunedZlogsgetr   r   r   r   r   r	   <module>   s   
