+
    4SsiQ                        ^ RI t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
HtHtHtHt ^Kt^Yt^KR^LR^MR	^NR
^OR^PR^QR^RR^SR^TR^UR^VR^WR^XR^YR/t]
^J]^M]^Q]^Q]^Y/t]
^]^]^	]^
]^/t. t ! R R]4      t ! R R]4      tR# )    N)	b64encode)sd_utils)security)'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_2016z$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-43f731e9a5cdc                       ] tR t^WtRtR# )DomainUpdateException N)__name__
__module____qualname____firstlineno____static_attributes__r       5/usr/lib/python3/dist-packages/samba/domain_update.pyr   r   W   s    r   r   c                      a  ] tR t^[t o RtRR ltRR ltR tRR ltR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )DomainUpdatez2Check and update a SAM database for domain updatesc                   Wn         W n        W0n        W@n        RV n        V P                   P                  4       V n        V P                   P                  4       V n        V P                   P                  4       V n	        \        P                  ! V4      V n
        \        P                  ! VP                  4       4      V n        V P                   P!                  4       V n         V P"                  P%                  R4       T P                   P!                  4       T n         T P,                  P%                  R4       R#   \&        P(                   d    \+        R4      hi ; i  \&        P(                   d    \+        R4      hi ; i)a  
:param samdb: LDB database
:param fix: Apply the update if the container is missing
:param new_install: Apply the update as per a new install (see op 88)
: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new_install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   r   r   r   s   &&&&&r   __init__DomainUpdate.__init__^   s2    
&$8!$)!557--/557 ((/"**5+?+?+AB&*jj&@&@&B#	W''112\]  $zz99;	O  **+`a || 	W'(UVV	W || 	O'(MNN	Os   !D9 E 9!E!E>Nc                2   V P                   P                  V P                  R.\        P                  R7      p\
        V,          pV'       d   \
        V,          pV^,          pM\        pV P                  We4       \        V,          p\        V^ ,          R,          ^ ,          4      pV'       dh   W8  d`   V P                  '       g   \        RVV3,          4      hV P                   P                  R\        V P                  4      V3,          4       R# R# R# )z
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scopezERevision is not high enough. Fix is set to False.
Expected: %dGot: %dz9dn: %s
changetype: modify
replace: revision
revision: %d
N)r   searchr,   r*   
SCOPE_BASEfunctional_level_to_max_update
MIN_UPDATEcheck_updates_rangefunctional_level_to_versionintr   r   modify_ldifstr)	r-   functional_levelold_functional_levelupdate_revisionresexpected_update
min_updateexpected_versionfound_versions	   &&&&     r   check_updates_functional_level+DomainUpdate.check_updates_functional_level   s    jjT%9%9'1l#..   J 99IJ78LMJ!OJ#J  =67GHCF:.q12}?888+ -DGWGTGV-V W W JJ"" $ 4 "23	$4 5  @?r   c                    V F=  pV\         8  g   V\        8  d   \        R4      h\        V RV,          4      ! V4       K?  	  R# )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)r8   
MAX_UPDATEr   getattr)r-   iteratorops   && r   check_updates_iterator#DomainUpdate.check_updates_iterator   s=     BJ"z/+,DEE D.2-.r2 r   c                    TpV\         8  g   W8  g   V\        8  d   \        R4      hW28:  d0   V\        9  d   \	        V RV,          4      ! V4       V^,          pK5  R# )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:
rI   rJ   N)r8   rK   r   missing_updatesrL   )r-   startendrN   s   &&& r   r9    DomainUpdate.check_updates_range   sW     :j0@'(@AAi(nr1226!GB r   c                   R\         V,          : RV P                  : 2p V P                  P                  V\        P
                  . R7      p\        T4      ^8X  g   Q h\        RT\         T,          3,          4       R#   \        P                   d0   pTP                  w  rVT\        P                  8w  d   h  Rp?R# Rp?ii ; i)zL
:param op: Integer update number
:return: True if update exists else False
zCN=,)r2   r4   r3   NFzSkip Domain Update %u: %sT)
update_mapr(   r   r5   r*   r6   r+   argsERR_NO_SUCH_OBJECTlenprint)r-   rN   	update_dnrA   enummsgs   &&     r   update_existsDomainUpdate.update_exists   s    
 #-R..$2M2MN		**##*-..*, $ .C 3x1}})RB,@@A || 	JSc,,,		s   ,B   C$B??Cc                    V P                   P                  R\        V,          : R\        V P                  4      : R24       \        RV\        V,          3,          4       R# )zW
Add the corresponding container object for the given update
:param op: Integer update
zdn: CN=rW   z
objectClass: container
zApplied Domain Update %u: %sN)r   add_ldifrX   r=   r(   r\   r-   rN   s   &&r   
update_addDomainUpdate.update_add   sJ    
 	

"~~s46679 	: 	,JrN/CCDr   c                N    V P                   '       g   \        RV,          4      hR# )zc
Raises an exception if not set to fix.
:param op: Integer operation
:raise DomainUpdateException:
z3Missing operation %d. Fix is currently set to FalseN)r   r   re   s   &&r   raise_if_not_fixDomainUpdate.raise_if_not_fix   s$     xxx'(]`b(bcc r   c                   V P                  V4      '       d   R # V P                  V4       V P                  P                  RV P                  ,          RR.R7       V P
                  '       d   V P                  V4       R # R # )NzVdn: CN=TPM Devices,%s
objectClass: top
objectClass: msTPM-InformationObjectsContainer
relax:0provision:0controls)ra   ri   r   rd   r    r   rf   re   s   &&r   operation_78DomainUpdate.operation_78   sx    b!!b!

  nn '0%?	 	 	A $$$OOB %r   c                    V P                  V4      '       d   R # V P                  V4       RpV P                  P                  V P                  V.R7       V P
                  '       d   V P                  V4       R # R # )NzY(OA;CIIO;WP;ea1b7b93-5e48-46d5-bc6c-4df4fda78a35;bf967a86-0de6-11d0-a285-00aa003049e2;PS)add_acesra   ri   r   update_aces_in_daclr    r   rf   r-   rN   aces   && r   operation_79DomainUpdate.operation_79   sc    b!!b!i))$..C5)I$$$OOB %r   c                    V P                  V4      '       d   R # V P                  V4       RpV P                  P                  V P                  V.R7       V P
                  '       d   V P                  V4       R # R # )Nz1(OA;;CR;3e0f7e18-2c7a-4c10-ba82-4d926db99a3e;;CN)rs   ru   rw   s   && r   operation_80DomainUpdate.operation_80  sc    b!!b!A))$..C5)I$$$OOB %r   c                    V P                  V4      '       d   R # V P                  V4       RpV P                  P                  V P                  V.R7       V P
                  '       d   V P                  V4       R # R # )Nz7(OA;CIOI;RPWP;3f78c3e5-f79a-46bd-a0b8-9d18116ddc79;;PS)rs   ru   rw   s   && r   operation_81DomainUpdate.operation_81  sc    b!!b!G))$..C5)I$$$OOB %r   c                   V P                  V4      '       d   R # V P                  V4       \        V P                  4      p\	        V4      P                  R4      pR\        V P                  4      ,          pV P                  P                  RV: RV: 2RR.R7       V P                  '       d   V P                  V4       R # R # )Nutf8CN=Managed Service Accounts,%sdn: z
changetype: add
objectClass: container
description: Default container for managed service accounts
showInAdvancedViewOnly: FALSE
nTSecurityDescriptor:: rl   rm   rn   )ra   ri   r   r&   r   decoder=   r    r   r<   r   rf   )r-   rN   
descriptormanagedservice_descrmanaged_service_dns   &&   r   operation_75DomainUpdate.operation_75'  s    b!!b!<T__M
(4;;FC=  	


 !34H J *3M(B 	 	D $$$OOB %r   c                R   V P                  V4      '       d   R # V P                  V4       R\        V P                  4      ,          pV P                  P                  R\        V P                  4      : RV: R2RR.R7       V P                  '       d   V P                  V4       R # R # )Nr   r   zl
changetype: modify
add: otherWellKnownObjects
otherWellKnownObjects: B:32:1EB93889E40C45DF9F0C64D23BBB6237:
rl   rm   rn   ra   ri   r=   r    r   r<   r   rf   )r-   rN   r   s   && r   operation_76DomainUpdate.operation_76=  s    b!!b!=  	

 4>>.	 0 <E;H;J	 	 	K $$$OOB %r   c                   V P                  V4      '       d   R # V P                  V4       V P                  P                  R\	        V P
                  4      ,          RR.R7       V P                  '       d   V P                  V4       R # R # )NzFdn: CN=PSPs,CN=System,%s
objectClass: top
objectClass: msImaging-PSPs
rl   rm   rn   )ra   ri   r   rd   r=   r    r   rf   re   s   &&r   operation_77DomainUpdate.operation_77P  s}    b!!b!

  
$.. &/$> 	 	@
 $$$OOB %r   c                   V P                  V4      '       d   R # V P                  V4       R\        V P                  4      ,          pRpVR,          pVR,          pVR,          pVR,          pVR,          pVR,          pR	V: R
V: R2pV P                  P                  V4       V P                  '       d   V P                  V4       R # R # )N
CN=Keys,%szO:DAzD: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   )ra   ri   r=   r    r   rd   r   rf   )r-   rN   keys_dnsddlldifs   &&   r   operation_82DomainUpdate.operation_82r  s    b!!b!T^^!448888888888  	

D!$$$OOB %r   c                .   V P                  V4      '       d   R # V P                  V4       R\        V P                  4      ,          pR.pVR.,          pV P                  P                  W#R7       V P                  '       d   V P                  V4       R # R # )Nr   z&(A;CI;RPWPCRLCLOCCDCRCWDWOSDDTSW;;;KA)&(A;CI;RPWPCRLCLOCCDCRCWDWOSDDTSW;;;EK)rs   )ra   ri   r=   r    r   rv   r   rf   )r-   rN   r   acess   &&  r   operation_83DomainUpdate.operation_83  s    b!!b!T^^!449:9::))')A$$$OOB %r   c                N   V P                  V4      '       d   R # V P                  V4       R\        V P                  4      ,          pR\        V P                  4      : RV: R2pV P                  P                  V4       V P                  '       d   V P                  V4       R # R # )Nr   r   zl
changetype: modify
add: otherWellKnownObjects
otherWellKnownObjects: B:32:683A24E2E8164BD3AF86AC3C2CF3F981:r   r   )r-   rN   r   r   s   &&  r   operation_84DomainUpdate.operation_84  s    b!!b!T^^!44 4>>G% 	

t$$$$OOB %r   c                @   V P                  V4      '       d   R # V P                  V4       R.pVR\        V P                  4      ,          .,          pV P                  P                  V P                  VR7       V P                  '       d   V P                  V4       R # R # )Nz5(OA;CI;RPWP;5b47d60f-6090-40b2-9f37-2a4de88f3063;;KA)z9(OA;CI;RPWP;5b47d60f-6090-40b2-9f37-2a4de88f3063;;%s-527)rs   	ra   ri   r=   r&   r   rv   r    r   rf   r-   rN   r   s   && r   operation_85DomainUpdate.operation_85  s    b!!b!HILT__%& ' 	' 	))$..4)H$$$OOB %r   c                   V P                  V4      '       d   R # V P                  V4       R.pVR.,          pV P                  P                  V P                  VR7       V P
                  '       d   V P                  V4       R # R # )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)rs   ru   r   s   && r   operation_86DomainUpdate.operation_86  sr    b!!b!lmlmm))$..4)H$$$OOB %r   c                4   V P                  V4      '       d   R # V P                  V4       R\        V P                  4      ,          .pR.pV P                  P                  V P                  VVR7       V P                  '       d   V P                  V4       R # R # )Nz*(A;CI;RPWPCRLCLOCCDCRCWDWOSDDTSW;;;%s-527)r   del_acesrt   r   r-   rN   r   rt   s   &&  r   operation_87DomainUpdate.operation_87  s    b!!b! A() *<=))$..3;3; 	* 	= $$$OOB %r   c                .   V P                  V4      '       d   R # V P                  V4       V P                  '       d   RpMRpRV P                   RV R2pV P                  P                  V4       V P                  '       d   V P                  V4       R # R # )NTRUEFALSEr   zr
changetype: modify
add: msDS-ExpirePasswordsOnSmartCardOnlyAccounts
msDS-ExpirePasswordsOnSmartCardOnlyAccounts: r   )ra   ri   r   r    r   r<   r   rf   )r-   rN   expire_valuer   s   &&  r   operation_88DomainUpdate.operation_88  s    b!!b!!L"L	^^ . /;^ <	 	

t$$$$OOB %r   c                    V P                  V4      '       d   R # V P                  V4       R.pR.pV P                  P                  V P                  VVR7       V P
                  '       d   V P                  V4       R # R # )Nr   z5(OA;CI;RPWP;5b47d60f-6090-40b2-9f37-2a4de88f3063;;EK)r   ru   r   s   &&  r   operation_89DomainUpdate.operation_89:  sx    b!!b!
 ==KL))$..3;3; 	* 	= $$$OOB %r   )r   r   r   r    r&   r(   r   r   r,   r   r"   r   )FFT)NF)r   r   )r   r   r   r   __doc__r.   rF   rO   r9   ra   rf   ri   rp   ry   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   __classdictcell__)__classdict__s   @r   r   r   [   s     <"OH"5H3"(Ed 
 
 
 " , & D H * > . , > H   r   r   )r*   base64r   sambar   samba.dcerpcr   samba.descriptorr   
samba.dsdbr   r   r	   r
   r   r8   rK   rX   r7   r:   rR   	Exceptionr   objectr   r   r   r   <module>r      s   &    !  

 ....... . .......5
> RRR"  QQR  	I 	o 6 o r   