HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/__pycache__/test_spwd.cpython-37.pyc
B

��g�
�@s�ddlZddlZddlmZe�d�Ze�eed�o>e��dkd�Gdd�dej	��Z
e�eed�one��dkd�Gd	d
�d
ej	��Zedkr�e�
�dS)�N)�support�spwd�geteuidzroot privileges requiredc@seZdZdd�Zdd�ZdS)�TestSpwdRootcCs4t��}|�|t�x|D]}|�|tj�qWdS)N)r�getspall�assertIsInstance�list�struct_spwd)�self�entries�entry�r
�*/usr/local/lib/python3.7/test/test_spwd.py�
test_getspalls
zTestSpwdRoot.test_getspallc	Cst��}|s|�d�|dj}t�|�}|�|tj�|�|j|�|�|j|d�|�|j|j�|�|j	t
�|�|j	|d�|�|j	|j�|�|jt
�|�|j|d�|�|jt
�|�|j|d�|�|jt
�|�|j|d�|�|jt
�|�|j|d�|�|jt
�|�|j|d�|�|jt
�|�|j|d	�|�|jt
�|�|j|d
�|�t��}t�d�WdQRX|�t
|j�d�|�ttj�|�ttjd�|�ttj|d�yt�|�}Wntk
�r�YnX|�ttj|�dS)
Nzempty shadow password databaser��������zinvalid user namez'getspnam(): name not found')rr�skipTestZsp_namp�getspnamrr	ZassertEqualZsp_namZsp_pwdp�strZsp_pwdZ	sp_lstchg�intZsp_minZsp_maxZsp_warnZsp_inactZ	sp_expireZsp_flag�assertRaises�KeyErrorZ	exception�	TypeError�os�fsencode�UnicodeEncodeError)r
rZrandom_namerZcxZ
bytes_namer
r
r�
test_getspnamsJ


zTestSpwdRoot.test_getspnamN)�__name__�
__module__�__qualname__rr"r
r
r
rrsrznon-root user requiredc@seZdZdd�ZdS)�TestSpwdNonRootc
Csbd}y$|�t��}t�|�WdQRXWn4tk
r\}z|�d||f�Wdd}~XYnXdS)N�binzspwd entry %r doesn't exist: %s)r�PermissionErrorrrrr)r
�name�cm�excr
r
r�test_getspnam_exception?sz'TestSpwdNonRoot.test_getspnam_exceptionN)r#r$r%r,r
r
r
rr&;sr&�__main__)rZunittestZtestr�
import_modulerZ
skipUnless�hasattrrZTestCaserr&r#�mainr
r
r
r�<module>s

1