%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/hplip/base/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/hplip/base/__pycache__/validation.cpython-312.pyc

�

=	f����ddlZddlZddlZddl�ddl�ddlmZddlmZddl�ddl	m
Z
mZGd�de�Z
Gd�d	e
�Zy)
�N)�*)�utils)�os_utils)�Popen�PIPEc��eZdZd�Zd�Zy)�DigiSign_Verificationc��y�N���selfs �#/usr/share/hplip/base/validation.py�__init__zDigiSign_Verification.__init__$����c��yrrr
s r�validatezDigiSign_Verification.validate'rrN)�__name__�
__module__�__qualname__rrrrrr	r	#s��
�
rr	c�,�eZdZd�Zdd�Zd�Zd�Zd�Zy)�GPG_Verificationc���tjdd�|_tj�\}|_tjj|j
d�|_	tjj|j�s!	t
j|jd�|j�y#t$r%tjd|jz�Y�>wxYw)N�gpgTz.gnupgi�zFailed to create %s)r�which�_GPG_Verification__gpgr�getHPLIPDir�_GPG_Verification__hplipdir�os�path�join�_GPG_Verification__gpg_dir�exists�mkdir�OSError�log�error�_GPG_Verification__change_owner)r�stss  rrzGPG_Verification.__init__,s����[�[��t�,��
�'�3�3�5���T�_������d�o�o�x�@���
�w�w�~�~�d�n�n�-�
B��������/�	
������
B��	�	�/�$�.�.�@�A�
B�s� C�+C0�/C0c�X�	tjd�tj|j�}t	j
|j|tj|tj|�y#t$r%tjd|jz�YywxYw)Nrz Failed to Change ownership of %s)r �umask�statrr�changeOwnerr#�ST_UID�ST_GIDr&r'r()r�	Recursive�ss   r�__change_ownerzGPG_Verification.__change_owner;su��	J��H�H�Q�K�������(�A�� � �����4�;�;���4�;�;��QZ�[���	J��I�I�8�$�.�.�H�I�	J�s�A8A;�;+B)�(B)c��|j�d|j�d|�d|��}tjd|�d|�d��t	j
|�\}}tjd|j||fz�|S)N� --homedir z! -no-permission-warning --verify � zVerifying file z
 : cmd = [�]z%s status: %d  output:%s)rr#r'�debugr�run)r�
hplip_package�hplip_digsig�cmd�status�outputs      r�__gpg_checkzGPG_Verification.__gpg_checkDsh��IM���UY�Uc�Uc�eq�tA�B���	�	�m�C�H�I����3������	�	�,��
�
�F�6�/J�J�K��
rc���|j�d|j�dd��}tjd�t	j
|�\}}tj
|�|jd�|S)Nr5z" --no-permission-warning --import z /usr/share/hplip/signing-key.asczImporting digital keyT)rr#r'�inforr9r8r))rr<r=r>s    r�__acquire_gpg_keyz"GPG_Verification.__acquire_gpg_keyQs[�����T�^�^�-O�Q��	���(�)����3������	�	�&�����D�!��
rc��tjd|�d|�d��|jstt	t�fSt
jj|�stt	td|�fSt
jj|�stt	td|�fS|j�}|dk7rtt	t�fS|j||�}|dk7rtt	td|�fStdfS)NzValidating z with z signature filer�)r'r8r�ERROR_GPG_CMD_NOT_FOUND�queryStringr r!r$�ERROR_FILE_NOT_FOUND�ERROR_DIGITAL_SIGN_NOT_FOUND�"_GPG_Verification__acquire_gpg_key�ERROR_UNABLE_TO_RECV_KEYS�_GPG_Verification__gpg_check�ERROR_DIGITAL_SIGN_BAD�
ERROR_SUCCESS)rr:r;r=s    rrzGPG_Verification.validate_s����	�	�=�,�W�X��z�z�*�K�8O�,P�P�P��w�w�~�~�m�,�'��5I�1�m�)\�\�\��w�w�~�~�l�+�/��=Y�[\�^j�1k�k�k��'�'�)���Q�;�,�k�:S�.T�T�T��!�!�-��>���Q�;�)�;�7M�q�R_�+`�`�`� �"�$�$rN)F)rrrrr)rKrIrrrrrr+s���J�
��%rr)r r-�datetime�
base.codes�base.strings�baserr�base.g�
subprocessrr�objectr	rrrr�<module>rUs?��,
��������"�
�F�
�H%�,�H%r

Zerion Mini Shell 1.0