%PDF- %PDF-
Mini Shell

Mini Shell

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

�

�I�dAO���ddlZddlZddlmZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZmZmZd	Zd
Zddd
ddddddddddddd�Zededededed
iZededed ed!ed"iZgZGd#�d$e�ZGd%�d&e�Zy)'�N)�	b64encode)�sd_utils)�
ndr_unpack�ndr_pack)�security)�SECINFO_DACL)�'get_managed_service_accounts_descriptor)�DS_DOMAIN_FUNCTION_2008�DS_DOMAIN_FUNCTION_2008_R2�DS_DOMAIN_FUNCTION_2012�DS_DOMAIN_FUNCTION_2012_R2�DS_DOMAIN_FUNCTION_2016�K�Yz$5e1574f6-55df-493e-a671-aaeffca6a100z$d262aae8-41f7-48ed-9f35-56bbb677573dz$82112ba0-7e4c-4a44-89d9-d46c9612bf91z$c3c927a6-cc1d-47c0-966b-be8f9b63d991z$54afcfb9-637a-4251-9f47-4d50e7021211z$f4728883-84dd-483c-9897-274f2ebcf11ez$ff4f9d27-7157-4cb0-80a9-5d6f2b14c8ffz$83c53da7-427e-47a4-a07a-a324598b88f7z$c81fc9cc-0130-4fd1-b272-634d74818133z$e5f9e791-d96d-4fc9-93c9-d53e1dc439baz$e6d5fd00-385d-4e65-b02d-9da3493ed850z$3a6b3fbf-3168-4312-a10d-dd5b3393952dz$7f950403-0ab3-47f9-9730-5d7b0269f9bdz$434bb40d-dbc9-4fe7-81d4-d57229f7b080z$a0c238ba-9e30-4ee6-80a6-43f731e9a5cd)r�L�M�N�O�P�Q�R�S�T�U�V�W�Xr�Jrr���	�
�c��eZdZy)�DomainUpdateExceptionN)�__name__�
__module__�__qualname__���5/usr/lib/python3/dist-packages/samba/domain_update.pyr%r%Zs��r*r%c��eZdZdZ		dd�Z		dd�Zd�Zdd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�DomainUpdatez2Check and update a SAM database for domain updatesc���||_||_||_d|_|jj	�|_|jj
�|_|jj�|_tj|�|_	tj|j��|_|jj�|_	|j j#d�|jj�|_	|j*j#d�y#t$j&$rt)d��wxYw#t$j&$rt)d��wxYw)z�
        :param samdb: LDB database
        :param fix: Apply the update if the container is missing
        :param add_update_container: Add the container at the end of the change
        :raise DomainUpdateException:
        Fz(CN=Operations,CN=DomainUpdates,CN=Systemz+Failed to add domain update container childz3CN=ActiveDirectoryUpdate,CN=DomainUpdates,CN=Systemz#Failed to add revision object childN)�samdb�fix�add_update_container�check_update_applied�get_config_basedn�	config_dn�	domain_dn�get_schema_basedn�	schema_dnr�SDUtilsr�dom_sid�get_domain_sid�
domain_sid�get_root_basedn�domainupdate_container�	add_child�ldb�LdbErrorr%�revision_object)�selfr/r0r1s    r+�__init__zDomainUpdate.__init__as2����
����$8��!�$)��!����5�5�7������-�-�/������5�5�7��� �(�(��/��
�"�*�*�5�+?�+?�+A�B���&*�j�j�&@�&@�&B��#�	W��'�'�1�1�2\�]� $�z�z�9�9�;���	O�� � �*�*�+`�a���|�|�	W�'�(U�V�V�	W���|�|�	O�'�(M�N�N�	O�s�D3�E�3E�E4Nc��|jj|jdgtj��}t
|}|rt
|}|dz
}nt}|j||�t|}t|ddd�}|rV||krP|jstd||fz��|jjdt|j�|fz�yyy)a
        Apply all updates for a given old and new functional level
        :param functional_level: constant
        :param old_functional_level: constant
        :param update_revision: modify the stored version
        :raise DomainUpdateException:
        �revision)�base�attrs�scope�rzERevision is not high enough. Fix is set to False.
Expected: %dGot: %dz9dn: %s
changetype: modify
replace: revision
revision: %d
N)r/�searchrAr?�
SCOPE_BASE�functional_level_to_max_update�
MIN_UPDATE�check_updates_range�functional_level_to_version�intr0r%�modify_ldif�str)	rB�functional_level�old_functional_level�update_revision�res�expected_update�
min_update�expected_version�
found_versions	         r+�check_updates_functional_levelz+DomainUpdate.check_updates_functional_level�s���j�j���T�%9�%9�'1�l�#�.�.� �J��9�9I�J���7�8L�M�J��!�O�J�#�J�� � ��_�=�6�7G�H���C��F�:�.�q�1�2�
��}�/?�?��8�8�+�-D�GW�GT�GV�-V�W�W�
�J�J�"�"�$��4��� �"2�3�	$4�
5� @�?r*c�v�|D]4}|tks	|tkDrtd��t|d|z�|��6y)z�
        Apply a list of updates which must be within the valid range of updates
        :param iterator: Iterable specifying integer update numbers to apply
        :raise DomainUpdateException:
        �Update number invalid.�operation_%dN)rM�
MAX_UPDATEr%�getattr)rB�iterator�ops   r+�check_updates_iteratorz#DomainUpdate.check_updates_iterator�sD���	3�B��J��"�z�/�+�,D�E�E�
/�G�D�.�2�-�.�r�2�	3r*c��|}|tks||kDs	|tkDrtd��||kr)|tvrt	|d|z�|�|dz
}||kr�(yy)z�
        Apply a range of updates which must be within the valid range of updates
        :param start: integer update to begin
        :param end: integer update to end (inclusive)
        :raise DomainUpdateException:
        r]r^rIN)rMr_r%�missing_updatesr`)rB�start�endrbs    r+rNz DomainUpdate.check_updates_range�sa�����:������j�0@�'�(@�A�A��C�i���(�2���n�r�1�2�2�6��!�G�B��C�ir*c�d�dt|�d|j��}	|jj|tj
g��}t|�dk(sJ�td|t|fz�y#tj$r-}|j\}}|tjk7r�Yd}~yd}~wwxYw)	zd
        :param op: Integer update number
        :return: True if update exists else False
        zCN=�,)rFrHrGNFrIzSkip Domain Update %u: %sT)�
update_mapr=r/rJr?rKr@�args�ERR_NO_SUCH_OBJECT�len�print)rBrb�	update_dnrV�e�num�msgs       r+�
update_existszDomainUpdate.update_exists�s���
#-�R�.�$�2M�2M�N�	�	��*�*�#�#��*-�.�.�*,�$�.�C��3�x�1�}��}�
�)�R��B��,@�@�A����|�|�	����J�S�#��c�,�,�,����		�s�,A/�/B/�#B*�*B/c��|jjdt|�dt|j��d��td|t|fz�y)zo
        Add the corresponding container object for the given update
        :param op: Integer update
        zdn: CN=riz
objectClass: container
zApplied Domain Update %u: %sN)r/�add_ldifrjrRr=rn�rBrbs  r+�
update_addzDomainUpdate.update_add�sH��
	
�
�
����"�~�s�4�6�6�7�9�	:�	�,��J�r�N�/C�C�Dr*c�8�|jstd|z��y)z�
        Raises an exception if not set to fix.
        :param op: Integer operation
        :raise DomainUpdateException:
        z3Missing operation %d. Fix is currently set to FalseN)r0r%rvs  r+�raise_if_not_fixzDomainUpdate.raise_if_not_fix�s"���x�x�'�(]�`b�(b�c�c�r*c���|j|�ry|j|�|jjd|jzddg��|j
r|j
|�yy)NzVdn: CN=TPM Devices,%s
objectClass: top
objectClass: msTPM-InformationObjectsContainer
�relax:0�provision:0��controls)rsryr/rur5r1rwrvs  r+�operation_78zDomainUpdate.operation_78�sr�����b�!�����b�!��
�
�����n�n��'0��%?�		�	A��$�$��O�O�B��%r*c���|j|�ry|j|�d}|jj|j|g��|j
r|j
|�yy)NzY(OA;CIIO;WP;ea1b7b93-5e48-46d5-bc6c-4df4fda78a35;bf967a86-0de6-11d0-a285-00aa003049e2;PS)��add_aces�rsryr�update_aces_in_daclr5r1rw�rBrb�aces   r+�operation_79zDomainUpdate.operation_79�s]�����b�!�����b�!�i���
�
�)�)�$�.�.�C�5�)�I��$�$��O�O�B��%r*c���|j|�ry|j|�d}|jj|j|g��|j
r|j
|�yy)Nz1(OA;;CR;3e0f7e18-2c7a-4c10-ba82-4d926db99a3e;;CN)r�r�r�s   r+�operation_80zDomainUpdate.operation_80s]�����b�!�����b�!�A���
�
�)�)�$�.�.�C�5�)�I��$�$��O�O�B��%r*c���|j|�ry|j|�d}|jj|j|g��|j
r|j
|�yy)Nz7(OA;CIOI;RPWP;3f78c3e5-f79a-46bd-a0b8-9d18116ddc79;;PS)r�r�r�s   r+�operation_81zDomainUpdate.operation_81s]�����b�!�����b�!�G���
�
�)�)�$�.�.�C�5�)�I��$�$��O�O�B��%r*c�^�|j|�ry|j|�t|j�}t	|�jd�}dt
|j�z}|jjd|�d|��ddg��|jr|j|�yy)N�utf8�CN=Managed Service Accounts,%s�dn: z�
changetype: add
objectClass: container
description: Default container for managed service accounts
showInAdvancedViewOnly: FALSE
nTSecurityDescriptor:: r{r|r})rsryr	r;r�decoderRr5r/rQr1rw)rBrb�
descriptor�managedservice_descr�managed_service_dns     r+�operation_75zDomainUpdate.operation_75's������b�!�����b�!�<�T�_�_�M�
�(��4�;�;�F�C��=������ ��	
�
�
���
!3�4H� J�*3�M�(B�
	�	D��$�$��O�O�B��%r*c�(�|j|�ry|j|�dt|j�z}|jjdt|j��d|�d�ddg��|jr|j|�yy)Nr�r�zl
changetype: modify
add: otherWellKnownObjects
otherWellKnownObjects: B:32:1EB93889E40C45DF9F0C64D23BBB6237:�
r{r|r}�rsryrRr5r/rQr1rw)rBrbr�s   r+�operation_76zDomainUpdate.operation_76=s������b�!�����b�!�=������ ��	
�
�
����4�>�>��.�	 0�<E�;H�;J�		�	K��$�$��O�O�B��%r*c���|j|�ry|j|�|jjdt	|j
�zddg��|jr|j|�yy)NzFdn: CN=PSPs,CN=System,%s
objectClass: top
objectClass: msImaging-PSPs
r{r|r})rsryr/rurRr5r1rwrvs  r+�operation_77zDomainUpdate.operation_77Psw�����b�!�����b�!��
�
����
�$�.�.���&/�
�$>�	�	@�
�$�$��O�O�B��%r*c�>�|j|�ry|j|�dt|j�z}d}|dz
}|dz
}|dz
}|dz
}|dz
}|dz
}d	|�d
|�d�}|jj|�|jr|j|�yy)N�
CN=Keys,%szO:DAzD:z&(A;CI;RPWPCRLCLOCCDCRCWDWOSDDTSW;;;EA)z&(A;CI;RPWPCRLCLOCCDCRCWDWOSDDTSW;;;DA)z&(A;CI;RPWPCRLCLOCCDCRCWDWOSDDTSW;;;SY)z&(A;CI;RPWPCRLCLOCCDCRCWDWOSDDTSW;;;DD)z&(A;CI;RPWPCRLCLOCCDCRCWDWOSDDTSW;;;ED)�
dn: z�
objectClass: container
description: Default container for key credential objects
ShowInAdvancedViewOnly: TRUE
nTSecurityDescriptor: r�)rsryrRr5r/rur1rw)rBrb�keys_dn�sddl�ldifs     r+�operation_82zDomainUpdate.operation_82rs������b�!�����b�!���T�^�^�!4�4���������8�8���8�8���8�8���8�8���8�8����
��	
�
�
���D�!��$�$��O�O�B��%r*c��|j|�ry|j|�dt|j�z}dg}|dgz
}|jj||��|jr|j|�yy)Nr�z&(A;CI;RPWPCRLCLOCCDCRCWDWOSDDTSW;;;KA)�&(A;CI;RPWPCRLCLOCCDCRCWDWOSDDTSW;;;EK)r�)rsryrRr5rr�r1rw)rBrbr��acess    r+�operation_83zDomainUpdate.operation_83�s{�����b�!�����b�!���T�^�^�!4�4��9�:���9�:�:���
�
�)�)�'�D�)�A��$�$��O�O�B��%r*c�$�|j|�ry|j|�dt|j�z}dt|j��d|�d�}|jj|�|jr|j|�yy)Nr�r�zl
changetype: modify
add: otherWellKnownObjects
otherWellKnownObjects: B:32:683A24E2E8164BD3AF86AC3C2CF3F981:r�r�)rBrbr�r�s    r+�operation_84zDomainUpdate.operation_84�sy�����b�!�����b�!���T�^�^�!4�4���4�>�>��G�%��	
�
�
���t�$��$�$��O�O�B��%r*c��|j|�ry|j|�dg}|dt|j�zgz
}|jj|j|��|jr|j|�yy)Nz5(OA;CI;RPWP;5b47d60f-6090-40b2-9f37-2a4de88f3063;;KA)z9(OA;CI;RPWP;5b47d60f-6090-40b2-9f37-2a4de88f3063;;%s-527)r��	rsryrRr;rr�r5r1rw�rBrbr�s   r+�operation_85zDomainUpdate.operation_85�s������b�!�����b�!�H�I���L��T�_�_�%�&�'�	'��	
�
�
�)�)�$�.�.�4�)�H��$�$��O�O�B��%r*c���|j|�ry|j|�dg}|dgz
}|jj|j|��|j
r|j
|�yy)NzY(OA;CIIO;SW;9b026da6-0d3c-465c-8bee-5199d7165cba;bf967a86-0de6-11d0-a285-00aa003049e2;PS)zY(OA;CIIO;SW;9b026da6-0d3c-465c-8bee-5199d7165cba;bf967a86-0de6-11d0-a285-00aa003049e2;CO)r�r�r�s   r+�operation_86zDomainUpdate.operation_86�sl�����b�!�����b�!�l�m���l�m�m���
�
�)�)�$�.�.�4�)�H��$�$��O�O�B��%r*c��|j|�ry|j|�dt|j�zg}dg}|jj|j||��|jr|j|�yy)Nz*(A;CI;RPWPCRLCLOCCDCRCWDWOSDDTSW;;;%s-527)r���del_acesr�r��rBrbr�r�s    r+�operation_87zDomainUpdate.operation_87�s������b�!�����b�!�A�����(�)�*��<�=���
�
�)�)�$�.�.�3;�3;�	*�	=��$�$��O�O�B��%r*c���|j|�ry|j|�dt|j�z}|jj|�|jr|j|�yy)Nz
dn: %s
changetype: modify
add: msDS-ExpirePasswordsOnSmartCardOnlyAccounts
msDS-ExpirePasswordsOnSmartCardOnlyAccounts: FALSE
r�)rBrbr�s   r+�operation_88zDomainUpdate.operation_88si�����b�!�����b�!��

�$�.�.����	
�
�
���t�$��$�$��O�O�B��%r*c���|j|�ry|j|�dg}dg}|jj|j||��|j
r|j
|�yy)Nr�z5(OA;CI;RPWP;5b47d60f-6090-40b2-9f37-2a4de88f3063;;EK)r�r�r�s    r+�operation_89zDomainUpdate.operation_890sr�����b�!�����b�!�
=�=��K�L���
�
�)�)�$�.�.�3;�3;�	*�	=��$�$��O�O�B��%r*)FT)NF)rr)r&r'r(�__doc__rCr[rcrNrsrwryrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r)r*r+r-r-^s���<�"'�&*�O�D=A�7<�"5�H3��"�(E�d� �
 �
 �
 �" �, �& �D �H
 �* �>
 �. �, �4 �> r*r-)r?�samba�base64rr�	samba.ndrrr�samba.dcerpcr�samba.dcerpc.securityr�samba.descriptorr	�
samba.dsdbr
rrr
rrMr_rjrLrOre�	Exceptionr%�objectr-r)r*r+�<module>r�s���&����*�!�.�����
�
�
�	/�.�.�.�.�.�.�	/�	/�.�.�.�.�.�.�5�
�>�R����R����R�"���Q����Q����R�����	�I�	�b �6�b r*

Zerion Mini Shell 1.0