%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__/rodc.cpython-312.pyc

�

�I�d�����ddlmZmZmZmZddlmZddlm	Z	ddl
mZddlZddl
mZmZddlmZddlZGd�de�ZGd	�d
e�ZGd�de�ZGd
�de�ZGd�de�Zy)�)�Command�CommandError�Option�SuperCommandN)�SamDB)�system_session)�misc�drsuapi)�
drs_Replicatec��eZdZd�Zd�Zy)�
RODCExceptionc��||_y)N)�value)�selfrs  �3/usr/lib/python3/dist-packages/samba/netcmd/rodc.py�__init__zRODCException.__init__s	����
�c�L�|jj�d|j��S)Nz: )�	__class__�__name__r)rs r�__str__zRODCException.__str__!s���>�>�2�2�D�J�J�?�?rN)r�
__module__�__qualname__rr�rrr
r
s
���@rr
c��eZdZy)�NamingErrorN�rrrrrrrr%���rrc��eZdZy)�ReplicationErrorNrrrrr r )rrr c��eZdZdZdZejejejd�Z	e
dde��e
dde��e
d	d
d��gZd
gZ
d�Zd�Zy)�cmd_rodc_preloadzBPreload accounts for an RODC.  Multiple accounts may be requested.z/%prog (<SID>|<DN>|<accountname>)+ ... [options])�	sambaopts�versionopts�credoptsz--serverz	DC to use)�help�typez--filez<Read account list from a file, or - for stdin (one per line)z--ignore-errorsz<When preloading multiple accounts, skip any failing accounts�
store_true)r&�actionzaccount*c��|dddk(r'|jd|zdtjg��}np|jd�dk\r$|j|dtjg��}n8|jdtj|�ztj
g�	�}t
|�d
k7rtd|z��t|dd�S)
zwork out what DN they meantr�zS-z<SID=%s>zobjectclass=user)�base�
expression�scope�attrs�=z((&(samAccountName=%s)(objectclass=user)))r-r.r/�zFailed to find account '%s'�dn)	�search�ldb�
SCOPE_BASE�find�
binary_encode�
SCOPE_SUBTREE�lenr�str)r�samdb�account�ress    r�get_dnzcmd_rodc_preload.get_dn@s����1�Q�<�4���,�,�J��$8�*<�%(�^�^�2��?�C��\�\�#�
�!�
#��,�,�G�*<�%(�^�^�2��?�C��,�,�*T�WZ�Wh�Wh�ip�Wq�*q�%(�%6�%6�b��B�C��s�8�q�=��;�g�E�F�F��3�q�6�$�<� � rc�L�|jd�}|jd�}|jd�}|jd�}|jd�}|�td��|�lg}|dk(r5tjD]!}|j	|j���#n0t
|d�D]!}|j	|j���#|j�}	|j|	d	�
�}
td|zt�|
|	��}tdt�|
|	��}tj|j��}
d
}|	j�dk\r|dz
}td|�d|�d�|	|
||
�}g}|D]�}|j!�}|j#|t$j&dg��}tj|j)d|ddd��}	|j+||�}|j2j5d|z�|j7�	|j9|||
t:j<d	��|jC���tE|�dkDr-|jGd�|D]}|jGd|z��yy#t,$r2}|st/t1|���|j	|�Yd}~��Nd}~wwxYw#t$rH}|j?�|st/d|z��|j	tAd|z��Yd}~���d}~wwxYw)Nr#r%�server�file�
ignore_errorszYou must supply a server�-�rT)�fallback_machinez	ldap://%s)�url�session_info�credentials�lp�seal�	z,printz
ncacn_ip_tcp:�[�]�invocationId)r,r.r/�
objectGUIDrzReplicating DN %s
)�exop�rodczError replicating DN %sz'
Preload encountered problematic users:z    %s)$�get�	Exception�sys�stdin�append�strip�open�get_loadparm�get_credentialsrrr	�GUID�
get_ntds_GUID�	log_levelr�get_dsServiceNamer3r4r5�schema_format_valuer>r
rr:�outf�write�transaction_start�	replicater
�DRSUAPI_EXOP_REPL_SECRET�transaction_cancelr �transaction_commitr9�message)r�accounts�kwargsr#r%r@�
accounts_filerB�linerI�credsr;�local_samdb�destination_dsa_guid�binding_options�repl�errorsr<�
dc_ntds_dnr=�source_dsa_invocation_idr2�e�errors                        r�runzcmd_rodc_preload.runSs���J�J�{�+�	��:�:�j�)�����H�%���
�
�6�*�
��
�
�?�3�
��>��6�7�7��$��H���#��I�I�2�D��O�O�D�J�J�L�1�2�!���4�2�D��O�O�D�J�J�L�1�2��
#�
#�
%���(�(��d�(�C���+��.�#1�#3�"'�B�0����>�3C�(-�"�6�� $�y�y��)B�)B�)D�E�� ��
�<�<�>�Q���x�'�O��f�o�N���(�*>�@�����	-�G��0�0�2�J��,�,�J�c�n�n�^�L\�,�]�C�'+�y�y��1P�1P�Q]�_b�cd�_e�ft�_u�vw�_x�1y�'z�$�
��[�[���0��
�I�I�O�O�1�B�6�7��)�)�+�
����r�#;�=Q�$+�$D�$D�4��Q�
�*�*�,�7	-�:�v�;��?��L�L�C�D��
/�����X��-�.�
/���+!�
�$�&�s�1�v�.�.��
�
�a� ���	
���
��.�.�0�$�&�'@�2�'E�F�F��
�
�.�/H�2�/M�N�O���
�s0�!J�"$K�	K�'K
�
K�	L#�=L�L#N)rrr�__doc__�synopsis�options�SambaOptions�VersionOptions�CredentialsOptions�takes_optiongroupsrr:�
takes_options�
takes_argsr>rvrrrr"r"-su��L�@�H��)�)��-�-��.�.���	�z��#�6��x�\�cf�g�� �'e�nz�{��M���J�!�&I/rr"c�(�eZdZdZiZe�ed<y)�cmd_rodcz.Read-Only Domain Controller (RODC) management.�preloadN)rrrrw�subcommandsr"rrrr�r��s��8��K�-�/�K�	�rr�)�samba.netcmdrrrr�samba.getopt�getoptry�samba.samdbr�
samba.authrr4�samba.dcerpcr	r
�samba.drs_utilsrrTrSr
rr r"r�rrr�<module>r�sd��&E�D���%�
�&�)�
�@�I�@�	�-�	�	�}�	�o/�w�o/�d0�|�0r

Zerion Mini Shell 1.0