Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_spwd.cpython-312.opt-2.pyc

�

'ΜgW���ddlZddlZddlmZddlZej
�5ejde�ejd�Z	ddd�ejeed�xrej�dk(d�Gd�dej��Zejeed�xrej�dk7d	�Gd
�dej��Zedk(rej"�yy#1swY��xYw)
�N)�
import_helper�ignore�spwd�geteuidzroot privileges requiredc��eZdZd�Zd�Zy)�TestSpwdRootc��tj�}|j|t�|D]"}|j|tj��$y)N)r�getspall�assertIsInstance�list�struct_spwd)�self�entries�entrys   �+/usr/local/lib/python3.12/test/test_spwd.py�
test_getspallzTestSpwdRoot.test_getspalls=���-�-�/�����g�t�,��E��!�!�%��)9�)9�:��c��tj�}|s|jd�|dj}tj	|�}|j|tj�|j|j|�|j|j|d�|j|j|j�|j|jt�|j|j|d�|j|j|j�|j|jt�|j|j|d�|j|jt�|j|j|d�|j|jt�|j|j|d�|j|j t�|j|j |d�|j|j"t�|j|j"|d�|j|j$t�|j|j$|d	�|j|j&t�|j|j&|d
�|j)t*�5}tj	d�ddd�|jtj,�d�|j)t.tj�|j)t.tjd�|j)t.tj|d�	t1j2|�}|j)t.tj|�y#1swY��xYw#t4$rYywxYw)
Nzempty shadow password databaser��������zinvalid user namez'getspnam(): name not found')rr
�skipTest�sp_namp�getspnamrr
�assertEqual�sp_nam�sp_pwdp�str�sp_pwd�	sp_lstchg�int�sp_min�sp_max�sp_warn�sp_inact�	sp_expire�sp_flag�assertRaises�KeyError�	exception�	TypeError�os�fsencode�UnicodeEncodeError)rr�random_namer�cx�
bytes_names      r�
test_getspnamzTestSpwdRoot.test_getspnams����-�-�/����M�M�:�;��a�j�(�(���
�
�k�*�����e�T�%5�%5�6��������4��������a��1����������5����e�m�m�S�1��������a��1����������5����e�o�o�s�3�������%��(�3����e�l�l�C�0�������u�Q�x�0����e�l�l�C�0�������u�Q�x�0����e�m�m�S�1��������a��1����e�n�n�c�2��������q��2����e�o�o�s�3�������%��(�3����e�m�m�S�1��������a��1�
�
�
�x�
(�B��M�M�-�.�)�����R�\�\�*�,J�K����)�T�]�]�3����)�T�]�]�A�6����)�T�]�]�K��C�	D����[�1�J�
���i����
�C�)�
(��"�	��	�s�O.�3O:�.O7�:	P�PN)�__name__�
__module__�__qualname__rr7�rrrrs
��;�&Drrznon-root user requiredc��eZdZd�Zy)�TestSpwdNonRootc���d}	|jt�5}tj|�ddd�y#1swYyxYw#t$r!}|jd|�d|���Yd}~yd}~wwxYw)N�binzspwd entry z doesn't exist: )r-�PermissionErrorrrr.r)r�name�cm�excs    r�test_getspnam_exceptionz'TestSpwdNonRoot.test_getspnam_exceptionCsZ����	K��"�"�?�3�r��
�
�d�#�4�3�3���	K��M�M�t�S�I�J�J��	K�s0�A�8�A�A�A�A�	A.�
A)�)A.N)r8r9r:rDr;rrr=r=?s��Krr=�__main__)r1�unittest�test.supportr�warnings�catch_warnings�simplefilter�DeprecationWarning�
import_moduler�
skipUnless�hasattrr�TestCaserr=r8�mainr;rr�<module>rQs��	��&���X�����H���(�$6�7�&�=�&�&�v�.�D��
����W�R��+�A�
��
�
���0A�/�1�.D�8�$�$�.D�1�.D�b����W�R��+�A�
��
�
���0A�-�/�K�h�'�'�K�/�K��z���H�M�M�O��K��s�&C:�:D

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists