HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/samba/tests/__pycache__/ntlm_auth_base.cpython-310.pyc
o

�/a"�@s<dZddlZddlZddlZddlmZGdd�de�ZdS)z�Test ntlm_auth
This test program will start ntlm_auth with the given command line switches and
see if it will get the expected results.
�N)�BlackboxTestCasecsPeZdZ�fdd�Zdd�Zdd�Z										
				d
dd�Z�ZS)�NTLMAuthTestCasecsPtt|���tj�t�dd��}tj�|d�|_t	j
��|_|j�
d�|_dS)N�BINDIRz./bin�	ntlm_authzwinbind separator)�superr�setUp�os�path�normpath�getenv�join�ntlm_auth_path�samba�tests�env_loadparm�lp�get�winbind_separator)�self�bindir��	__class__��</usr/lib/python3/dist-packages/samba/tests/ntlm_auth_base.pyrs
zNTLMAuthTestCase.setUpcCs.|��}|�d�}|dkrtd��|d|�S)N�
���zFailed to read line)�readline�find�	Exception)r�text_stream�buf�newlinerrr�readLine&s

zNTLMAuthTestCase.readLinecCs|�|�|�d�dS)Nr)�write)rrr rrr�	writeLine-s
zNTLMAuthTestCase.writeLineNF�ntlmssp-client-1�squid-2.5-ntlmsspcCs^|�t�|jtj��|durtd��g}|�|j�|�d|�|�d|�|r2|�d|�|r:|�d�n|durBtd��|�d|�|
rR|�d|
�|r[|�d	|�|�d
|jj�g}|�|j�|�d|	�|�d
|jj�|
s�|dus�|dus�|dur�td��|�d|�|�d|�|�d|�|dur�td��n|dur�|�d
|�d}t	j
|t	jt	jddd�}t	j
|t	jt	jddd�}�z�|dk�r6|	dk�r6|�|j
d�|�|j�}|�|�d��|�|j
|�|�|j�}|�|�d��|�|j
|�|�|j�}|�|�d��|�ddd�}|�|j
|�|�|j�}|�d�}n�|dk�r�|	dk�r�|�|j
d�|�|j�}|�|�d��|�|j
|�|�|j�}|�|�d��|�|j
|�|�|j�}|�|�d��|�ddd�}|�|j
|�|�|j�}|�d�}nw|dk�r|	dk�r|�|j
d�|�|j�}	|�d��r�d}nP|�|�d��p�|�d��|�|j
|�|�|j�}|�d��r�d}n,|�|�d��p�|�d��p�|�d��|�|j
|�|�|j�}|�d��rd}n�q�n|�d �|du�rD|dk�rD|�|j
d!�|�|j�}|�|�d"��|�|j
d#�|�|j�}|�|�d$��|du�rx|	dk�rx|�|j
d!�|�|j�}|�|�d"��|�|j
d#�|�|j�}|�|�d$��|j
��|��|�|jd�|j
��|��|�|jd�|WS|��|��|��|���)%Nzclient_username requiredz--helper-protocol=%sz
--username=%sz--domain=%sz--use-cached-credszclient_password requiredz
--password=%sz--target-service=%sz--target-hostname=%sz--configfile=%sz0Server credentials required if not using winbindz6Server must be using winbind for require-membership-ofz--require-membership-of=%sFrT)�stdout�stdin�bufsize�universal_newlinesr%r&�YRzYR zTT zAF �AF�KK�z
gss-spnegozAF * zgss-spnego-clientzNA * zKK zHelper protocols not handled�GKzGK �GFzGF )�
assertTruer�accessr
�X_OKr�appendr�
configfile�
subprocess�Popen�PIPEr$r(r"r'�
startswith�replace�fail�close�wait�assertEqual�
returncode�kill)r�client_username�client_password�
client_domain�client_use_cached_creds�server_username�server_password�
server_domain�
client_helper�
server_helper�server_use_winbind�require_membership�target_hostname�target_service�client_args�server_args�result�server_proc�client_procr rrr�
run_helper1s��(��


zNTLMAuthTestCase.run_helper)
NNNFNNNr%r&FNNN)�__name__�
__module__�__qualname__rr"r$rS�
__classcell__rrrrrs$�r)�__doc__rrr6�samba.testsrrrrrr�<module>s