%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/samba/netcmd/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/samba/netcmd/__pycache__/testparm.cpython-312.pyc

�

�fb$��R�ddlZddlZddlZddlmZddlmZmZm	Z	Gd�de�Z
y)�N)�Command�CommandError�Optionc
��eZdZdZdZejejd�Ze	de
d��e	de
d��e	d	e
d
��e	de
d��e	d
ddd��e	ddddd��e	de
d��e	dddd��gZgZ				dd�Z
d�Zd�Zd�Zd�Zy) �cmd_testparmz$Syntax check the configuration file.z%prog [options])�	sambaopts�versionoptsz--section-namez!Limit testparm to a named section)�type�helpz--parameter-namez#Limit testparm to a named parameterz
--client-namezHClient DNS name for 'hosts allow' checking (should match reverse lookup)z--client-ipz,Client IP address for 'hosts allow' checkingz--suppress-prompt�
store_trueFzSuppress prompt for enter)�action�defaultrz-vz	--verbosezShow default options tooz--serverzSet %L macro to servernamez--show-all-parametersz*Show the parameters, type, possible valuesNc��|
rtd��|	rtd��|�
|�td��	|j�}t	j
d�|j
d�}
|
jd|j�|
jd�|j||
�}|xr|j||
�}|�|�|j||
||�n�|�|�9|�#	||}|j|j|�n`	|j!||�nL|s9|j"j%d
�t&j(j+�|j|�|rytd��#t$r}t|��d}~wwxYw#t$r&|dvr|j�ntd	|����Y�XwxYw#t$r}t|��d}~wwxYw)Nz--server not yet implementedz)--show-all-parameters not yet implementedzHBoth a DNS name and an IP address are required for the host access check��testparmzLoaded smb config files from %szLoaded services file OK.)�global�globalszUnknown section z6Press enter to see a dump of your service definitions
zInvalid smb.conf)�NotImplementedErrorr�get_loadparm�RuntimeError�samba�set_debug_level�
get_logger�info�
configfile�do_global_checks�do_share_checks�check_client_access�dump�default_service�KeyError�dump_globals�dump_a_parameter�outf�write�sys�stdin�readline)�selfrr	�section_name�parameter_name�	client_ip�client_name�verbose�suppress_prompt�show_all_parameters�server�lp�err�logger�valid�section�es                 �7/usr/lib/python3/dist-packages/samba/netcmd/testparm.py�runzcmd_testparm.runJs����%�&D�E�E��%�&Q�R�R��"�y�'8�� D�E�
E�	$��'�'�)�B�
	���a� �����,�����5�r�}�}�E����.�/��%�%�b�&�1���:�$�.�.�r�6�:���"�y�'<��$�$�R���i�H��'�>�+E�!�)�B�"$�\�"2�� ���R�%7�%7��A�.��+�+�N�L�I�'��I�I�O�O�$]�^��I�I�&�&�(����� ����1�2�2��Q�	$��s�#�#��	$��($�R�'�+@�@��O�O�-�".�1A�,��/P�"Q�Q�.�R��(�.�*�1�o�-��.�sA�E&�F�9F4�&	E?�/E:�:E?�,F1�0F1�4	G
�=G�G
c��d}|jd�}tj|�s|jd|�d}|jd�}tj|�s|jd|�d}|jd�}tj
j
|�s|jd|�|jd	�}tj
j
|�s|jd
|�|jd�}t|�dk7r|jd
�d}|dk(r|jd�d}|jd�}	|	dvrj|jd�j�}
|
dvr|jd�|jd�}|r#dD]}||vs�|jd|zdz�� |S)NTznetbios namez+netbios name %s is not a valid netbios nameF�	workgroupz-workgroup name %s is not a valid netbios name�lockdirz lock directory %s does not existz
pid directoryzpid directory %s does not existzwinbind separator�z=the 'winbind separator' parameter must be a single character.�+zC'winbind separator = +' might cause problems with group membership.zserver role)z"active directory domain controllerzdomain controller�dczunix charset)zUTF-8�UTF8zXWhen acting as Active Directory domain controller, unix charset is expected to be UTF-8.zvfs objects)�
dfs_samba4�	acl_xattrz3When acting as Active Directory domain controller, z should be in vfs objects.)
�getr�valid_netbios_name�error�os�path�isdir�warning�len�upper)
r)r2r4r5�netbios_namer;r<�piddir�winbind_separator�role�charset�
vfsobjects�entrys
             r8rzcmd_testparm.do_global_checks�s������v�v�n�-���'�'��5��L�L�F�%�
'��E��F�F�;�'�	��'�'�	�2��L�L�H�"�
$��E��&�&��#���w�w�}�}�W�%��N�N�=�w�G�����(���w�w�}�}�V�$��N�N�<�f�E��F�F�#6�7��� �!�Q�&��L�L�&�
'��E���#��L�L��
��E��v�v�m�$���T�T��f�f�^�,�2�2�4�G��/�/����<�=����
�.�J��8�B�E��J�.����Q�!�"�$@�A�B�B���c�,�t|j��)N)r�allow_access)r)�	deny_list�
allow_list�cname�caddrs     r8rUzcmd_testparm.allow_access�s��!�$�"3�"3�4�4rSc��d}|j�D]#}t|�dkDs�|jd�n|j�D]u}|jd|�}|jd|�}|r%|D] }d|vsd|vs�|j	d||�d	}�"|s�Q|D] }d|vsd|vs�|j	d
||�d	}�"�w|S)NT�z�You have some share names that are longer than 12 characters. These may not be accessible to some older clients. (Eg. Windows9x, WindowsMe, and not listed in smbclient in Samba 3.0.)�
hosts deny�hosts allow�*�?zBInvalid character (* or ?) in hosts deny list (%s) for service %s.FzCInvalid character (* or ?) in hosts allow list (%s) for service %s.)�servicesrJrIrCrE)r)r2r4r5�srVrWrRs        r8rzcmd_testparm.do_share_checks�s���������	�A��1�v��{����/�0�
�	�����	&�A����|�Q�/�I����
�q�1�J��&�&�E��e�|�s�e�|����&A�BG��L� %��	&��'�&�E��e�|�s�e�|����&A�BG��L� %��	&�	&� �rSc�L�|j�D]�}|j|jd�|jd�||�rI|j|jd|�|jd|�||�r|jd|||��~|jd|||���y)Nr\r]z#Allow connection from %s (%s) to %sz"Deny connection from %s (%s) to %s)r`rUrCr)r)r2r4rXrYras      r8rz cmd_testparm.check_client_access�s�������	S�A��!�!�"�&�&��"6����}�8M�u�"'�)��!�!�"�&�&��q�"9�2�6�6�-�QR�;S�"'��0����A�5�%�QR�S����@�%��PQ�R�	SrS)NNNNFNFN)�__name__�
__module__�__qualname__�__doc__�synopsis�options�SambaOptions�VersionOptions�takes_optiongroupsr�str�
takes_options�
takes_argsr9rrUrr�rSr8rr)s���.� �H��)�)��-�-���	��c�7�	9��!��9�	;���S�4�	5�	�}�3�B�	D��"�<��/�	1��t�[���#=�	?�	�z��*F�G��&�|�U�@�	B�#�M�*�J�7;�=A�EJ��63�p6�p5��:	SrSr)rFr&r�samba.getopt�getoptrh�samba.netcmdrrrrrorSr8�<module>rss*��B
�
���6�6�zS�7�zSrS

Zerion Mini Shell 1.0