%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/aptdaemon/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/aptdaemon/__pycache__/policykit1.cpython-312.pyc

�

��kd�����dZdZdZddlZddlmZmZmZddlm	Z	m
Z
dZd	Zd
Z
dZdZd
ZdZdZdZdZdZdZdZdZdZ		dd�Z		dd�Zdd�Zdd�Zedd��Zedd��Zy)zHProvides access to PolicyKit privilege mangement using gdefer Deferreds.z%Sebastian Heinlein <devel@glatzor.de>)�check_authorization_by_name�check_authorization_by_pid�get_pid_from_dbus_name�get_uid_from_dbus_name�!CHECK_AUTH_ALLOW_USER_INTERACTION�CHECK_AUTH_NONE�PK_ACTION_ADD_REMOVE_VENDOR_KEY�PK_ACTION_CANCEL_FOREIGN�PK_ACTION_CHANGE_REPOSITORY�PK_ACTION_CHANGE_CONIFG�!PK_ACTION_GET_TRUSTED_VENDOR_KEYS�PK_ACTION_INSTALL_FILE�$PK_ACTION_INSTALL_OR_REMOVE_PACKAGES�(PK_ACTION_INSTALL_PACKAGES_FROM_NEW_REPO�/PK_ACTION_INSTALL_PACKAGES_FROM_HIGH_TRUST_REPO�$PK_ACTION_INSTALL_PURCHASED_PACKAGES�PK_ACTION_UPDATE_CACHE�PK_ACTION_UPGRADE_PACKAGES�PK_ACTION_SET_PROXY�PK_ACTION_CLEAN�N)�Deferred�inline_callbacks�return_value�)�NotAuthorizedError�AuthorizationFailedz)org.debian.apt.install-or-remove-packagesz)org.debian.apt.install-purchased-packagesz-org.debian.apt.install-packages-from-new-repoz/org.debian.apt.install-packages.high-trust-repozorg.debian.apt.install-filezorg.debian.apt.upgrade-packageszorg.debian.apt.update-cachezorg.debian.apt.cancel-foreignz&org.debian.apt.get-trusted-vendor-keysz org.debian.apt.change-repositoryzorg.debian.apt.change-configzorg.debian.apt.set-proxyzorg.debian.apt.cleanc�,�dd|if}t|||||�S)a�Check if the given sender is authorized for the specified action.

    If the sender is not authorized raise NotAuthorizedError.

    Keyword arguments:
    dbus_name -- D-Bus name of the subject
    action_id -- the PolicyKit policy name of the action
    timeout -- time in seconds for the user to authenticate
    bus -- the D-Bus connection (defaults to the system bus)
    flags -- optional flags to control the authentication process
    zsystem-bus-name�name��_check_authorization)�	dbus_name�	action_id�timeout�bus�flags�subjects      �6/usr/lib/python3/dist-packages/aptdaemon/policykit1.pyrr@s&��!�6�9�"5�6�G����G�S�%�H�H�c�,�dd|if}t|||||�S)a�Check if the given process is authorized for the specified action.

    If the sender is not authorized raise NotAuthorizedError.

    Keyword arguments:
    pid -- id of the process
    action_id -- the PolicyKit policy name of the action
    timeout -- time in seconds for the user to authenticate
    bus -- the D-Bus connection (defaults to the system bus)
    flags -- optional flags to control the authentication process
    zunix-process�pidr)r*r"r#r$r%r&s      r'rrQs%����s�|�,�G����G�S�%�H�Hr(c���������fd�}|stj�}|�t}t��|j	dd�}i}|j��||dd||�j��	�S)Nc���|\}}}|r�j|�y|r�jt����y�jt����y�N)�callback�errbackrr)�xxx_todo_changeme�
authorized�
challenged�auth_detailsr"�deferredr&s    ���r'�policykit_donez,_check_authorization.<locals>.policykit_donecsO���1B�.��Z������l�+�
����0��)�D�E����/���C�Dr(zorg.freedesktop.PolicyKit1z%/org/freedesktop/PolicyKit1/Authority�z$org.freedesktop.PolicyKit1.Authority)�dbus_interfacer#�
reply_handler�
error_handler)�dbus�	SystemBusrr�
get_object�CheckAuthorizationr/)	r&r"r#r$r%r5�pk�detailsr4s	``      @r'r r bs|���E���n�n����}�1���z�H�	���4�?�
A�B��G������G�U�B�=��$��&�&��(��Or(c��|stj�}t�}|jdd�}|j	|d|j
|j��|S)zZReturn a deferred that gets the id of process owning the given
    system D-Bus name.
    zorg.freedesktop.DBusz/org/freedesktop/DBus/Bus)r7r8r9)r:r;rr<�GetConnectionUnixProcessIDr.r/)r!r$r4�bus_objs    r'rr}s`����n�n����z�H��n�n�3�8�:�G��&�&�y�6L�5=�5F�5F�5=�5E�5E�'�G��Or(c#�VK�|stj�}t||���}td|z�5}|j	�D�cgc]}|jd�s�|��}}ddd�t
dj�d�}t|�ycc}w#1swY�9xYw�w)z\Return a deferred that gets the uid of the user owning the given
    system D-Bus name.
    �/proc/%s/status�Uid:Nrr)	r:r;r�open�	readlines�
startswith�int�splitr)r!r$r*�proc�v�values�uids       r'rr�s�����
��n�n���&�y�#�6�
6�C�	
��#�%�	&�G�$�!�^�^�-�F�����f�1E�!�F��F�G�

�f�Q�i�o�o���"�
#�C�����G�G�G�s4�3B)�B�B�B�#B�%3B)�B�B&�"B)c#�rK�|stj�}t||���}td|z�5}|j	�}|D�cgc]}|jd�s�|��}}|D�cgc]}|jd�s�|��}}ddd�td|zd�5}|j
�jd�}	ddd�tdj�d	�}
tdj�d	�}t||
|	f�ycc}wcc}w#1swY��xYw#1swY�mxYw�w)
zzReturn a deferred that gets the pid, the uid of the user owning the
    given system D-Bus name and its command line.
    rDrEzGid:Nz/proc/%s/cmdline�rbzutf-8rr)r:r;rrFrGrH�read�decoderIrJr)r!r$r*rK�linesrL�
uid_values�
gid_values�cmdline_file�cmdlinerN�gids            r'�get_proc_info_from_dbus_namerY�s*����
��n�n���&�y�#�6�
6�C�	
��#�%�	&�@�$���� ��!&�?�A�!�,�,�v�*>�a�?�
�?�!&�?�A�!�,�,�v�*>�a�?�
�?�@�
� �3�&��	-�6���#�#�%�,�,�W�5��6�

�j��m�!�!�#�A�&�
'�C�

�j��m�!�!�#�A�&�
'�C��#�s�C��)�*��@��?�@�@��6�6�s_�3D7�D�
D�!D�%D�+D�D�D�D7� D+�?AD7�
D�D(�$D7�+D4�0D7)i�QNNr-) �__doc__�
__author__�__all__r:�deferrrr�errorsrrrrrrr
rrr	rr
�PK_ACTION_CHANGE_CONFIGrrrrrrr rrrY�r(r'�<module>ras���O�"5�
�
5���:�:�;�0�%�0�%�4�)�6�0�6��>��6��:��$L�!�@��8��0��(����$%�!�JN�&*�I�"CG�%)�I�"�6
� �
��
��+��+r(

Zerion Mini Shell 1.0