AlkantarClanX12

Your IP : 3.147.62.5


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/__pycache__/pam.cpython-311.pyc

�

d��f��
�.�dZdgZdZdZdZddlZddlmZmZm	Z	m
Z
mZmZm
Z
ddlmZmZmZmZmZdd	lmZdd
lmZGd�de	��ZGd
�de	��ZGd�de	��Ze
eeeee����eee����e��ZGd�de	��ZdZdZdZdZdZeed����Z eed����Z!e j"Z"ee"_#eege"_$e%e!d��re!j&Z&ee&_#eege&_$e!j'Z'ee'_#eeee��ee��ge'_$e!j(Z(ee(_#eege(_$e!j)Z)ee)_#eege)_$e!j*Z*ee*_#eege*_$Gd�d��Z+d�Z,e-dkr|ddl.Z.ddl/Z/d�Z0e+��Z+e0de/j1����Z2e+�,e2e/j/����e3d�4e+j5e+j6����dSdS) z�
PAM module for python

Provides an authenticate function that will allow the caller to authenticate
a user against the Pluggable Authentication Modules (PAM) on the system.

Implemented using ctypes, so no compilation is necessary.
�pamz1.8.4z David Ford <david@blue-labs.org>z2018 June 15�N)�CDLL�POINTER�	Structure�	CFUNCTYPE�cast�byref�sizeof)�c_void_p�c_size_t�c_char_p�c_char�c_int)�memmove)�find_libraryc�"�eZdZdZdefgZd�ZdS)�	PamHandlez&wrapper class for pam_handle_t pointer�handlec�<�tj|��d|_dS)Nr)r�__init__r��selfs �c/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pam.pyrzPamHandle.__init__'s����4� � � ������N)�__name__�
__module__�__qualname__�__doc__r�_fields_r�rrrr#s6������0�0��H�%�'�H�����rrc�(�eZdZdZdefdefgZd�ZdS)�
PamMessagez'wrapper class for pam_message structure�	msg_style�msgc�$�d|j|jfzS)Nz<PamMessage %i '%s'>)r#r$rs r�__repr__zPamMessage.__repr__/s��%�����(B�B�BrN)rrrrrr
rr&r rrr"r"+sB������1�1��u�%��x�'8�:�H�C�C�C�C�Crr"c�(�eZdZdZdefdefgZd�ZdS)�PamResponsez(wrapper class for pam_response structure�resp�resp_retcodec�$�d|j|jfzS)Nz<PamResponse %i '%s'>)r*r)rs rr&zPamResponse.__repr__6s��&�$�*;�T�Y�)G�G�GrN)rrrrr
rrr&r rrr(r(2sB������2�2��(�#�n�e�%<�>�H�H�H�H�H�Hrr(c�"�eZdZdZdefdefgZdS)�PamConvz$wrapper class for pam_conv structure�conv�appdata_ptrN)rrrr�	conv_funcrrr rrr-r-;s(������.�.��)�$�}�h�&?�A�H�H�Hrr-������c�pam_endc�$�eZdZdZdZd�Zdd�ZdS)	rrNc��dS�Nr rs rrzpam.__init__gs���r�login�utf-8Tc����t��fd���}tjdkrt|t��r|�|��}t�t��r��|���t|t��r|�|��}n~t|t��r|�|��}t�t��r��|���t|t��r|�|��}d|vsd�vsd|vrd|_d|_dSt����t��}t|d��}t||t|��t|����}	|	dkr|	|_d|_dSt|d��}	|	dk}
|
r|rt|t ��}	|	|_t#||	��|_tjdkr|j�|��|_t't(d	��rt+||	��|
S)
a�username and password authentication for the given service.

           Returns True for success, or False for failure.

           self.code (integer) and self.reason (string) are always stored and may
           be referenced for the reason why authentication failed. 0/'Success' will
           be stored for success.

           Python3 expects bytes() for ctypes inputs.  This function will make
           necessary conversions using the supplied encoding.

        Inputs:
          username: username to authenticate
          password: password in plain text
          service:  PAM service to authenticate against, defaults to 'login'

        Returns:
          success:  True
          failure:  False
        c����t|tt����}t|t	t����}||d<t|��D]�}||jjtkrjtt�	��dztt����}t|�t�	����|||_d||_
��dS)zxSimple conversation function that responds to any
               prompt where the echo is off with the supplied passwordrr1)�callocr
r(rr�range�contentsr#�PAM_PROMPT_ECHO_OFF�lenrrr)r*)
�
n_messages�messages�
p_response�app_data�addr�response�i�dst�	cpassword�passwords
        ��r�my_convz!pam.authenticate.<locals>.my_conv�s����
�*�f�[�&9�&9�:�:�D��D�'�+�"6�"6�7�7�H�$�J�q�M��:�&�&�
1�
1���A�;�'�1�5H�H�H� ��X���q��&��.�.�A�A�C��C��C��M�M�:�:�:�'*�H�Q�K�$�/0�H�Q�K�,���1r�r3�r4zstrings may not contain NULFrzpam_start() failedr7)r0�sys�version_info�
isinstance�str�encode�unicode�code�reasonr
rr-�	pam_startr	�pam_authenticate�pam_setcred�PAM_REINITIALIZE_CRED�pam_strerror�decode�hasattr�libpamr7)r�usernamerM�service�encoding�
resetcredsrNrr.�retval�auth_successrLs  `        @r�authenticatezpam.authenticatejs<����,
�
	�
	�
	�
	�
	�
��
	� ��t�#�#��(�C�(�(�N�X�_�_�X�5N�5N�(��(�C�(�(�N�X�_�_�X�5N�5N�(��'�3�'�'�M�W�^�^�H�5M�5M�'���(�G�,�,�
5�#�?�?�8�4�4���(�G�,�,�
5�#�?�?�8�4�4���'�7�+�+�
4�"�>�>�(�3�3���h���'�X�"5�"5��G�9K�9K��D�I�7�D�K��5��X�&�&�	�������!�$�$���7�H�e�D�k�k�5��=�=�I�I���Q�;�;� �D�I�.�D�K��5�!�&�!�,�,����{���	A�J�	A� ��)>�?�?�F���	�"�6�6�2�2�����t�#�#��+�,�,�X�6�6�D�K��6�9�%�%�	$��F�F�#�#�#��r)r;r<T)rrrrWrXrrgr rrrrcsG������
�D�
�F�
�
�
�U�U�U�U�U�Urc�4�t��j|i|��S)zB
    Compatibility function for older versions of python-pam.
    )rrg)�vargs�dargss  rrgrg�s ���3�5�5��u�.��.�.�.r�__main__c����fd�}tj|��tjdkrt	|��}nt|��}tj��|S)Nc�V��tj���tj��dSr:)�readline�insert_text�	redisplay)�texts�r�hookz input_with_prefill.<locals>.hook�s)���� ��&�&�&��� � � � � rrO)rn�set_pre_input_hookrQrR�input�	raw_input)�promptrqrr�results `  r�input_with_prefillrx�sk���	!�	!�	!�	!�	!�	�#�D�)�)�)���t�#�#��6�]�]�F�F��v�&�&�F��#�%�%�%��
rz
Username: z{} {})7r�__all__�__version__�
__author__�__released__rQ�ctypesrrrrrr	r
rrr
rrr�ctypes.utilrrr"r(r0r-rB�PAM_PROMPT_ECHO_ON�
PAM_ERROR_MSG�
PAM_TEXT_INFOr\�libcr`r?�restype�argtypesr_r7rYr[r]rZrrgrrn�getpassrx�getuserra�print�formatrWrXr rr�<module>r�s������w����1�
���
�
�
�
�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�>�>�>�>�>�>�>�>�>�>�>�>�>�>�������$�$�$�$�$�$������	����C�C�C�C�C��C�C�C�H�H�H�H�H�)�H�H�H�
�I�e�U�G�G�G�G�J�,?�,?�$@�$@�'�'�'�'�R]�J^�J^�B_�B_�ai�j�j�	�B�B�B�B�B�i�B�B�B�
�����
��
��� �D���c�!2�!2�3�3�� �D���e�!4�!4�5�5�� �K��$���%�x�0����7�6�9���3� &��G� %�G�O�!*�E� 2�G��"�,�	�!�	��%�x����1A�1A�7�7�9�CU�CU�V�	��"�.��!���&��.���"�/��$���&��.���"�3��!���&��.���\�\�\�\�\�\�\�\�~/�/�/��z���������������#�%�%�C�!�!�,����0A�0A�B�B�H����X��w��0�0�1�1�1�	�E�'�.�.���3�:�
.�
.�/�/�/�/�/�/�r