+
    4Ssi%                       ^ RI t ^ RIHt ^ RIt^ RIHt ^ RIt^ RIHtH	t	H
t
 ^ RIHt ^ RIHtHtHtHtHt ^ RIHt ^ RIHtHtHtHt ^ RIHt ^ R	IHtHt  ! R
 R]P>                  4      t  ! R R]4      t! ! R R]!4      t" ! R R]!4      t# ! R R]!4      t$ ! R R]!4      t% ! R R]!4      t& ! R R]!4      t' ! R R]!4      t( ! R R]4      t)R# )    N)getpass)NTSTATUSErrorntstatuswerror)system_session)drsblobslsanbtnetlogonsecurity)Net)CommandCommandErrorOptionSuperCommand)SamDB)OpenPolicyFallbackCreateTrustedDomainFallbackc                   &   a  ] tR t^(t o R tRtV tR# )LocalDCCredentialsOptionsc                H    \         P                  P                  WR R7       R# )zlocal-dc)special_nameN)optionsCredentialsOptions__init__)selfparsers   &&;/usr/lib/python3/dist-packages/samba/netcmd/domain/trust.pyr   "LocalDCCredentialsOptions.__init__)   s    ""++Dz+R     N__name__
__module____qualname____firstlineno__r   __static_attributes____classdictcell____classdict__s   @r   r   r   (   s     S Sr    r   c                     a  ] tR t^-t o RtR tR tR t ! R R]4      t	 ! R R]4      t
 ! R	 R
]4      tR tR$R ltR tR tR%R ltR$R ltR$R ltR tR tR tR tR tR tR tR&R ltR&R ltR tR tR tR tR  t R! t!R'R" lt"R#t#V t$R# )(DomainTrustCommandList domain trusts.c                    \         P                  ! V 4       R V n        R V n        R V n        R V n        R V n        R V n        R V n        R # N)	r   r   local_lplocal_serverlocal_binding_stringlocal_credsremote_serverremote_binding_stringremote_credsr   s   &r   r   DomainTrustCommand.__init__0   sG     $(!!%)" r    c                B    \         P                  ! V4      P                  # r/   )ctypesc_uint32value)r   vs   &&r   _uint32DomainTrustCommand._uint32<   s    q!'''r    c                f    Vf   R# V P                  VP                  ^ ,          4      pW28X  d   R# R# )NFT)r>   args)r   runtimevalerr32s   &&& r   check_runtime_error&DomainTrustCommand.check_runtime_error?   s+    ?W\\!_-<r    c                   &   a  ] tR t^It o R tRtV tR# )$DomainTrustCommand.LocalRuntimeErrorc                    VP                  VP                  ^ ,          4      pVP                  ^,          pRVP                  W4V3,          p\        P                  ! W4       R# )r   z%LOCAL_DC[%s]: %s - ERROR(0x%08X) - %sN)r>   rA   r1   r   r   exception_selfr   rB   messagerD   errstrmsgs   &&&&   r   r   -DomainTrustCommand.LocalRuntimeError.__init__J   sO    LLa1E\\!_F9##WV== =C!!.6r    r!   Nr"   r)   s   @r   LocalRuntimeErrorrH   I        	7 	7r    rP   c                   &   a  ] tR t^Qt o R tRtV tR# )%DomainTrustCommand.RemoteRuntimeErrorc                    VP                  VP                  ^ ,          4      pVP                  ^,          pRVP                  W4V3,          p\        P                  ! W4       R# )r   z&REMOTE_DC[%s]: %s - ERROR(0x%08X) - %sN)r>   rA   r4   r   r   rJ   s   &&&&   r   r   .DomainTrustCommand.RemoteRuntimeError.__init__R   sO    LLa1E\\!_F:$$gf>> >C!!.6r    r!   Nr"   r)   s   @r   RemoteRuntimeErrorrS   Q   rQ   r    rV   c                   &   a  ] tR t^Yt o R tRtV tR# ) DomainTrustCommand.LocalLdbErrorc                    VP                   ^ ,          pVP                   ^,          pRVP                  W4V3,          p\        P                  ! W4       R# )r   z!LOCAL_DC[%s]: %s - ERROR(%d) - %sN)rA   r1   r   r   )rK   r   	ldb_errorrL   errvalrM   rN   s   &&&&   r   r   )DomainTrustCommand.LocalLdbError.__init__Z   sH    ^^A&F^^A&F5##Wf9> >C!!.6r    r!   Nr"   r)   s   @r   LocalLdbErrorrX   Y   rQ   r    r]   c                   V P                   e   V P                   # VP                  4       pVP                  pVfM   VP                  4       pVR8w  d   \	        RV,          4      hVP                  R4      pRpRpVR,          pR pR p	MRpRpRV,          pVP                  V4      p	W0n        W@n         V: R	V: R
V: R2V n        Wn	        Wn
        V P                   # )NROLE_ACTIVE_DIRECTORY_DCzInvalid server_role %sznetbios namencalrpc z,auth_type=ncalrpc_as_systemncacn_npz	ldap://%s:[])r1   get_loadparm	ipaddressserver_roler   getget_credentialsr0   r2   local_ldap_urlr3   )
r   	sambaoptslocaldcoptslpr1   rh   local_transportlocal_binding_optionsrk   r3   s
   &&&       r   setup_local_server%DomainTrustCommand.setup_local_servera   s    ($$$##%",,..*K88"#;{#KLL66.1L'O$&!!%CC!!NK(O$&!(<7N%55b9K(3BLRg$h!,&   r    Nc                r    \         P                  ! V P                  V P                  V P                  VR 7      # )basis_connection)r	   lsarpcr2   r0   r3   r   ru   s   &&r   new_local_lsa_connection+DomainTrustCommand.new_local_lsa_connection   s/    zz%%MM-	
 	
r    c                n    \         P                   ! V P                  V P                  V P                  4      # r/   )r   r2   r0   r3   r7   s   &r   new_local_netlogon_connection0DomainTrustCommand.new_local_netlogon_connection   s'      !:!:DMM4K[K[\\r    c                l    \        V P                  \        4       V P                  V P                  R 7      # ))urlsession_infocredentialsrn   )r   rk   r   r3   r0   r7   s   &r   new_local_ldap_connection,DomainTrustCommand.new_local_ldap_connection   s-    ,,"0"2!%!1!1' 	'r    c           	     b   V'       d   V'       g   Q hV P                   e   V P                   # RV,          V n         V P                  f   Q hVP                  V P                  4      pVP                  pRp \        WPP                  VR7      p\        P                  \        P                  ,          p	V'       d   V	\        P                  ,          p	V'       d   V	\        P                  ,          p	VP                  WVR7      p
/ \        P                  Rb\        P                   R	b\        P                  R
b\        P                  Rb\        P"                  Rb\        P$                  Rb\        P&                  Rb\        P                  Rb\        P(                  Rb\        P*                  Rb\        P,                  Rb\        P.                  Rb\        P0                  Rb\        P2                  Rb\        P4                  Rb\        P6                  Rb\        P8                  Rb\        P:                  R\        P<                  R/CpT P?                  TT
P@                  RR7      pT PB                  PE                  RT
PF                  : RT
PH                  : RT: R 24       T
PH                  T n         R!T P                   : R"T: R#2T n%        YPn&        T P                   #   \         d*   p\        RT: RTP                  ^,          : 24      hR p?i\         d    \        RT,          4      hi ; i)$Nz__unknown__remote_server__.%sra   )server)flagsdomainaddressz*Failed to find a writeable DC for domain 'z': z-Failed to find a writeable DC for domain '%s'PDCGCLDAPDSKDCTIMESERVCLOSESTWRITABLEGOOD_TIMESERVNDNCSELECT_SECRET_DOMAIN_6FULL_SECRET_DOMAIN_6ADS_WEB_SERVICEDS_8DS_9DS_10HAS_DNS_NAMEIS_DEFAULT_NCFOREST_ROOTT
names_onlyzRemoteDC Netbios[] DNS[z] ServerType[]
z	ncacn_np:rd   re   )'r4   r1   rj   r0   rg   r   r
   NBT_SERVER_LDAPNBT_SERVER_DSNBT_SERVER_WRITABLENBT_SERVER_PDCfinddcr   r   rA   	ExceptionNBT_SERVER_GCNBT_SERVER_KDCNBT_SERVER_TIMESERVNBT_SERVER_CLOSESTNBT_SERVER_GOOD_TIMESERVNBT_SERVER_NDNC!NBT_SERVER_SELECT_SECRET_DOMAIN_6NBT_SERVER_FULL_SECRET_DOMAIN_6NBT_SERVER_ADS_WEB_SERVICENBT_SERVER_DS_8NBT_SERVER_DS_9NBT_SERVER_DS_10NBT_SERVER_HAS_DNS_NAMENBT_SERVER_IS_DEFAULT_NCNBT_SERVER_FOREST_ROOTgeneric_bitmap_to_stringserver_typeoutfwritepdc_namepdc_dns_namer5   r6   )r   credoptsr   require_pdcrequire_writabler6   r4   remote_binding_options
remote_netremote_flagsremote_infoerrorflag_mapserver_type_strings   &&&&&         r   setup_remote_server&DomainTrustCommand.setup_remote_server   s    ###)%%%<vE  ,,,//> **!#
	Y\==OJ..1B1BBL 7 77 2 22$++,Wd+eK

t
 
 t	

 
 ##Z
 ""I
 ##Z
 ((/
 
 113K
 //1G
 **,=
 
 
    '!
" ''#
$ ((/&&'
* "::8;F;R;R_c ; e		#,,#00*, 	-
 )55:>:L:LNd%e"(!!!I  	8 &

1 7 8 8 	YNQWWXX	Ys%   5A"K *K L.)$LL.L.c                r    \         P                  ! V P                  V P                  V P                  VR 7      # rt   )r	   rv   r5   r0   r6   rw   s   &&r   new_remote_lsa_connection,DomainTrustCommand.new_remote_lsa_connection   s/    zz&&MM-	
 	
r    c                r    \         P                   ! V P                  V P                  V P                  VR 7      # rt   )r   r5   r0   r6   rw   s   &&r   new_remote_netlogon_connection1DomainTrustCommand.new_remote_netlogon_connection   s1      &&MM-	
 	
r    c                    ^p\         P                  ! 4       p^Vn        \         P                  Vn        \        VRVVRV4      w  rVrxVP                  V\         P                  4      p	WXWgV	3# )   ra   F)r	   revision_info1revision$LSA_FEATURE_TDO_AUTH_INFO_AES_CIPHERsupported_featuresr   QueryInfoPolicy2LSA_POLICY_INFO_DNS)
r   conn_fnpolicy_access
in_versionin_revision_info1connout_versionout_revision_info1policyinfos
   &&&       r   get_lsa_infoDomainTrustCommand.get_lsa_info   s|    
..0%&"44 	, 9K9
5- $$VS-D-DEktDDr    c           	          VP                  VR ^ R R R \        P                  4      pVP                  #   \         d    TP                  Y#4      u # i ; ir/   )netr_DsRGetDCNameEx2r   DS_RETURN_DNS_NAMEdc_uncRuntimeErrornetr_GetDcName)r   r   r   r   r   s   &&&& r   get_netlogon_dc_unc&DomainTrustCommand.get_netlogon_dc_unc   sZ    	7,,V-11dD$-5-H-HJD ;; 	7&&v66	7s   03 AAc           	     P    VP                  VR ^ R R R \        P                  4      pV# r/   )r   r   r   )r   r   r   r   s   &&& r   get_netlogon_dc_info'DomainTrustCommand.get_netlogon_dc_info  s0    (()-q$d)1)D)DF r    c                p    VP                   \        P                  8X  d   VP                  # VP                  # r/   )
trust_typer	   LSA_TRUST_TYPE_DOWNLEVELnetbios_namedns_namer   ts   &&r   netr_DomainTrust_to_name+DomainTrustCommand.netr_DomainTrust_to_name  s(    <<3777>>!zzr    c                   R pR pV Fg  pVP                   \        P                  ,          '       g   K,  TpVP                   \        P                  ,          '       g   WP                  ,          p M	  VP                   \        P
                  ,          '       dL   W$J d   R# VP                   \        P                  ,          '       d   R# WP                  ,          pWcJ d   R# R# VP                  \        P                  ,          '       d   R# R# )NParentTreeRootChildShortcutForestExternal)	trust_flagsr   NETR_TRUST_FLAG_PRIMARYNETR_TRUST_FLAG_TREEROOTparent_indexNETR_TRUST_FLAG_IN_FORESTtrust_attributesr	   %LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE)r   ar   primaryprimary_parent_tparents   &&&    r   netr_DomainTrust_to_type+DomainTrustCommand.netr_DomainTrust_to_type  s    B~~ @ @@@~~(I(III%&%7N  ==8===="}}x@@@@!~~&F  I IIIr    c                    VP                   \        P                  ,          '       d   R # VP                  \        P
                  ,          '       d   R# VP                  \        P                  ,          '       d   R # R# )YesNo)r   r   r   r   r	   "LSA_TRUST_ATTRIBUTE_NON_TRANSITIVEr   r   s   &&r   netr_DomainTrust_to_transitive1DomainTrustCommand.netr_DomainTrust_to_transitive)  sQ    ==8==== F FFF I IIIr    c                J   VP                   \        P                  ,          '       d*   VP                   \        P                  ,          '       d   R # VP                   \        P                  ,          '       d   R# VP                   \        P                  ,          '       d   R# R# )BOTHINCOMINGOUTGOINGINVALID)r   r   NETR_TRUST_FLAG_INBOUNDNETR_TRUST_FLAG_OUTBOUNDr   s   &&r   netr_DomainTrust_to_direction0DomainTrustCommand.netr_DomainTrust_to_direction5  sb    ==8;;;;==8<<<<==8;;;;==8<<<<r    c                     W,          pRW$3,          pV#   \          d    T P                  T4      pR T,          p L3i ; i)z__unknown__%08X__	0x%x (%s))KeyErrorr>   )r   e_dictr=   r   wv32rs   &&&&   r   generic_enum_to_string)DomainTrustCommand.generic_enum_to_stringB  sI    	*	A
 1&   	*,,q/C#c)A	*s    %>>c                <   . pTp\        VP                  4       4       F,  pWV,          '       g   K  WV( ,          pWAV,          .,          pK.  	  V^ 8w  d#   V P                  V4      pVRV,          .,          pRP                  V4      pV'       d   V# RW(3,          p	V	# )r   z__unknown_%08X__,r  )sortedkeysr>   join)
r   b_dictr=   r   scbc32r  r  s
   &&&&      r   r   +DomainTrustCommand.generic_bitmap_to_stringL  s    &AEEGA)A	 ' 6,,q/C$s*++AHHQKH1& r    c                    \         P                  R \         P                  R\         P                  R\         P                  R/pV P                  W!4      # )	DOWNLEVELUPLEVELMITDCE)r	   r   LSA_TRUST_TYPE_UPLEVELLSA_TRUST_TYPE_MITLSA_TRUST_TYPE_DCEr  )r   r=   typess   && r   trustType_string#DomainTrustCommand.trustType_stringa  sH    ((+&&	""E""E	
 **544r    c                    \         P                  \         P                  ,          R \         P                  R\         P                  R/pV P                  W!4      # )r  INBOUNDOUTBOUND)r	   LSA_TRUST_DIRECTION_INBOUNDLSA_TRUST_DIRECTION_OUTBOUNDr  )r   r=   
directionss   && r   trustDirection_string(DomainTrustCommand.trustDirection_stringj  sL    ++,,-.4++Y,,j	

 **:99r    c                (   \         P                  R \         P                  R\         P                  R\         P                  R\         P
                  R\         P                  R\         P                  R\         P                  R/pV P                  W!4      # )NON_TRANSITIVEUPLEVEL_ONLYQUARANTINED_DOMAINFOREST_TRANSITIVECROSS_ORGANIZATIONWITHIN_FORESTTREAT_AS_EXTERNALUSES_RC4_ENCRYPTION)
r	   r   LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY&LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAINr   &LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION!LSA_TRUST_ATTRIBUTE_WITHIN_FOREST%LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL'LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTIONr   )r   r=   
attributess   && r   trustAttributes_string)DomainTrustCommand.trustAttributes_strings  sz    224D00.668L557J668L11?557J779N	

 ,,Z;;r    c                h   \         P                  R \         P                  R\         P                  R\         P                  R\         P
                  R\         P                  R\         P                  R\         P                  R\         P                  R\         P                  R	/
pV P                  W!4      # )
DES_CBC_CRCDES_CBC_MD5RC4_HMAC_MD5AES128_CTS_HMAC_SHA1_96AES256_CTS_HMAC_SHA1_96zAES256_CTS_HMAC_SHA1_96-SKFAST_SUPPORTEDCOMPOUND_IDENTITY_SUPPORTEDCLAIMS_SUPPORTED!RESOURCE_SID_COMPRESSION_DISABLED)r   KERB_ENCTYPE_DES_CBC_CRCKERB_ENCTYPE_DES_CBC_MD5KERB_ENCTYPE_RC4_HMAC_MD5$KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96$KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96'KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96_SKKERB_ENCTYPE_FAST_SUPPORTED(KERB_ENCTYPE_COMPOUND_IDENTITY_SUPPORTEDKERB_ENCTYPE_CLAIMS_SUPPORTED.KERB_ENCTYPE_RESOURCE_SID_COMPRESSION_DISABLEDr   )r   r=   enctypess   && r   kerb_EncTypes_string'DomainTrustCommand.kerb_EncTypes_string  s    --}--}..99;T99;T<<>Z002B==?\224FCCEh
 ,,X99r    c                    V^ 8X  d   R# \         P                  R\         P                  R\         P                  R/pRV P	                  W!RR7      ,          # )r   Status[Enabled]zDisabled-NewDisabledzDisabled-Conflicting
Status[%s]Tr   )r	   LSA_TLN_DISABLED_NEWLSA_TLN_DISABLED_ADMINLSA_TLN_DISABLED_CONFLICTr   r   e_flagsr   s   && r   entry_tln_status#DomainTrustCommand.entry_tln_status  sU    a<$ $$n&&
))+A

 d;;EW[;\\\r    c                    V^ 8X  d   R# \         P                  R\         P                  R\         P                  R\         P                  R/pRV P                  W!RR7      ,          # )	r   rh  zDisabled-SIDzDisabled-SID-ConflictingzDisabled-NBzDisabled-NB-Conflictingrj  Tr   )r	   LSA_SID_DISABLED_ADMINLSA_SID_DISABLED_CONFLICTLSA_NB_DISABLED_ADMINLSA_NB_DISABLED_CONFLICTr   rn  s   && r   entry_dom_status#DomainTrustCommand.entry_dom_status  sa    a<$ &&))+E%%}((*C	
 d;;EW[;\\\r    c                >   Ve   RV,          pMRpV P                   P                  R\        VP                  4      V3,          4       \	        VP                  4       EF  w  rVVP
                  pRpVeP   VP                   F?  p	V	P                  V8w  d   K  V	P
                  pRV	P                  P                  ,          pKA  	  VP                  p
VP                  \        P                  8X  dE   V P                   P                  RV P                  V4      :R RV
P                  : RV: R	24       K  VP                  \        P                  8X  d3   V P                   P                  R
R:R RV
P                  : R24       EK'  VP                  \        P                  8X  g   EKI  V P                   P                  RV P!                  V4      :R RV
P"                  P                  : RV
P$                  P                  : RV
P&                  : RV: R	24       EK  	  R # )Nz TDO[%s]ra   zNamespaces[%d]%s:
z Collision[%s]TLN: 32 DNS[*.re   
zTLN_EX: 29r   zDOM: z DNS[z
] Netbios[] SID[)r   r   lenentries	enumerater   indexnamestringforest_trust_datatyper	   LSA_FOREST_TRUST_TOP_LEVEL_NAMErp  "LSA_FOREST_TRUST_TOP_LEVEL_NAME_EXLSA_FOREST_TRUST_DOMAIN_INFOrw  dns_domain_namenetbios_domain_name
domain_sid)r   ftitln
collisions
tln_stringier   collision_stringr'  ds   &&&&       r   write_forest_trust_info*DomainTrustCommand.write_forest_trust_info  s   ?#c)JJ		-CKK(*16 6 	7 ckk*DAGGE!%#++Aww!| GGE'7166=='I$	 , ##Avv<<<		 $ 5 5e < !*:!< = 3AAA		 "AHH!. /3;;;		 $ 5 5e < ! 1 1 8 8 ! 5 5 < < !.>	!@ A+ +4 	r    )r2   r3   rk   r0   r1   r5   r6   r4   r/   )TT)F)NN)%r#   r$   r%   r&   __doc__r   r>   rE   r   rP   rV   r]   rq   rx   r{   r   r   r   r   r   r   r   r   r  r  r  r  r   r4  r<  rN  re  rp  rw  r  r'   r(   r)   s   @r   r,   r,   -   s     
!(7L 77\ 77 7!>
]'@"D

E*78
*5:<:	]
]# #r    r,   c                   n   a  ] tR tRt o RtRtR]P                  R]P                  R]	/t
. tR
R ltR	tV tR# )cmd_domain_trust_listi  r-   z%prog [options]rl   versionoptsrm   Nc                l   V P                  W4      p V P                  4       p TP	                  T\
        P                  \
        P                  ,          \
        P                  ,          4      pTP                  pT F  p	T	P                  \
        P                  ,          '       d   K,  T P                   P#                  RT P%                  Y4      ,          :R RRT P'                  T	4      ,          :R RR	T P)                  T	4      ,          :R
 RRT P+                  T	4      ,          : R24       K  	  R#   \         d   pT P                  YR 4      hRp?ii ; i  \         dP   pT P                  T\        P                  4      '       d   \        RT,          4      hT P                  YR4      hRp?ii ; i)!failed to connect netlogon serverNz:LOCAL_DC[%s]: netr_DsrEnumerateDomainTrusts not supported.z$netr_DsrEnumerateDomainTrusts failedzType[%s]14 zTransitive[%s]15zDirection[%s]19zName[%s]r}  )rq   r{   r   rP   netr_DsrEnumerateDomainTrustsr   r   r  r  rE   r   WERR_RPC_S_PROCNUM_OUT_OF_RANGEr   arrayr   r   r   r   r  r  r  r   )
r   rl   r  rm   r1   local_netlogonr   local_netlogon_trustsr  r   s
   &&&&      r   runcmd_domain_trust_list.run  s   ..yF	[!??AN	^<<\=E=_=_=E=^=^>_=E=]=]>^_ " "''A}}x????IIOO&)F)Fq)LLL,t/R/RST/UUU+d.P.PQR.SSS&)F)Fq)III	K L  	3  	[((6YZZ	[  	^''v/U/UVV"#_#/$1 2 2((6\]]	^s0   D4 A
E 4E?EEF3$A
F..F3r!   NNN)r#   r$   r%   r&   r  synopsisr   SambaOptionsVersionOptionsr   takes_optiongroupstakes_optionsr  r'   r(   r)   s   @r   r  r    sD      H 	W))w--0M r    r  c                   t   a  ] tR tRt o RtRtR]P                  R]P                  R]	/t
. tR.tRR	 ltR
tV tR# )cmd_domain_trust_showi  Show trusted domain details.%prog NAME [options]rl   r  rm   r   Nc           	     l   V P                  W$4        \        P                  pV P                  V P                  V4      w  pppp	p
T P                  P                  RT
P                  P                  : RT
P                  P                  : RT
P                  : R24       \        P                  ! 4       pYn
         TP                  TT\        P                  4      pTP                   pTP"                  p TP                  TT\        P.                  4      p RpTP8                  \        P:                  ,          '       d"   TP=                  TT\        P>                  4      pT P                  P                  R
4       T P                  P                  RTPJ                  P                  ,          4       TPJ                  P                  TPL                  P                  8w  d7   T P                  P                  RTPL                  P                  ,          4       T P                  P                  RTP                  ,          4       T P                  P                  RT PO                  TPP                  4      ,          4       T P                  P                  RT PS                  TPT                  4      ,          4       T P                  P                  RT PW                  TP8                  4      ,          4       \X        PZ                  ! TP"                  4      P\                  p\X        P^                  ! TP"                  4      P\                  pT P                  P                  RTT3,          4       T P                  P                  RT Pa                  TP6                  4      ,          4       TP8                  \        P:                  ,          '       d(   T Pc                  TTPL                  P                  R7       R#   \
         d   pT P                  YR 4      hRp?ii ; i  \$         dP   pT P'                  T\(        P*                  4      '       d   \-        RT,          4      hT P                  YR4      hRp?ii ; i  \$         d   pT P'                  T\(        P0                  4      '       d   RpT P'                  T\(        P2                  4      '       d   RpTe   T P                  YR4      h\        P4                  ! 4       p^ Tn         Rp?ELRp?ii ; i  \
         d   pT P'                  T\(        P@                  4      '       d   RpT P'                  T\(        PB                  4      '       d   RpTe   T P                  YR	4      h\        PD                  ! 4       p^ Tn#        . Tn$         Rp?ELMRp?ii ; i)#failed to query LSA_POLICY_INFO_DNSNLocalDomain Netbios[r   r  r   4trusted domain object does not exist for domain [%s]z.QueryTrustedDomainInfoByName(FULL_INFO) failed?QueryTrustedDomainInfoByName(SUPPORTED_ENCRYPTION_TYPES) failedz&lsaRQueryForestTrustInformation failedzTrustedDomain:

zNetbiosName:    %s
zDnsName:        %s
zSID:            %s
zType:           %s
zDirection:      %s
zAttributes:     %s
zPosixOffset:    0x%08X (%d)
zkerb_EncTypes:  %s
r  )2rq   r	   !LSA_POLICY_VIEW_LOCAL_INFORMATIONr   rx   r   rP   r   r   r  r  
dns_domainsidStringQueryTrustedDomainInfoByName!LSA_TRUSTED_DOMAIN_INFO_FULL_INFOinfo_exposix_offsetr   rE   r   NT_STATUS_OBJECT_NAME_NOT_FOUNDr   -LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPESNT_STATUS_INVALID_PARAMETERNT_STATUS_INVALID_INFO_CLASS TrustDomainInfoSupportedEncTypes	enc_typesr   r   lsaRQueryForestTrustInformationr  "NT_STATUS_RPC_PROCNUM_OUT_OF_RANGENT_STATUS_NOT_FOUNDForestTrustInformationcountr  r   domain_namer4  r   r<  trust_directionrN  r:   r;   r<   c_int32re  r  )r   r   rl   r  rm   local_policy_access	local_lsalocal_policylocal_versionlocal_revision_info1local_lsa_infor   	lsaStringlocal_tdo_fulllocal_tdo_infolocal_tdo_posixlocal_tdo_enctypeslocal_tdo_forestposix_offset_u32posix_offset_i32s   &&&&&               r   r  cmd_domain_trust_show.run  s   	7
	]"%"G"G !!$"?"?ATU$
 			&++22&1188&**, 	-
 JJL	!	h66|7@7:7\7\^  ,33N,99O	-66|7@7:7h7hj "	*#..1Z1ZZZ==l>G>A>^>^` !  			,-		.1L1L1S1SST&&--1K1K1R1RRIIOO2^5O5O5V5VVW		.1C1CCD		.1F1F~G`G`1aab		.1K1KNLjLj1kkl		.1L1L^MlMl1mmn!???+G+GHNN!>>/*F*FGMM		7;KM]:^^_		.1J1JK]KgKg1hhi**S-V-VVV(()9-;-G-G-N-N ) P 	[  	]((6[\\	]"  	h''x/W/WXX"#Y\b#bcc((6fgg		h  	-''x/S/STT''x/T/TUU ,,T-np p "%!E!E!G+,((	-(  
	*''x/Z/Z[[''x/K/KLL ,,T:bcc"99;%&"')$$
	*st   2O7 ;9P 5!Q9 (T  !T 7PPPQ6'A
Q11Q69TAT4TTV3AV.-;V..V3r!   r  )r#   r$   r%   r&   r  r  r   r  r  r   r  r  
takes_argsr  r'   r(   r)   s   @r   r  r    sO     &%H 	W))w--0M JY Yr    r  c            
          a  ] tR tRt o RtRtR]P                  R]P                  R]	/t
]! RRR	R
RR7      ]! RRRRRR7      ]! RRRRRR7      .tR.tRR ltRtV tR# )cmd_domain_trust_modifyif  r  r  rl   r  rm   z--use-aes-keys
store_truez!The trust uses AES kerberos keys.use_aes_keysNactionhelpdestdefault--no-aes-keysz:The trust does not have any support for AES kerberos keys.disable_aes_keysz--raw-kerb-enctypesstorezThe raw kerberos enctype bitskerb_enctypesr   c           	     6   ^ p^ p	Ve
   V	^,          p	Ve
   V	^,          p	Ve
   V	^,          p	V	^8  d   \        R4      hV	^8X  d
   V^,          pV^ 8X  d   \        R4      hV P                  W$4        \        P                  p
V P	                  V P
                  V
4      w  pppppT P                  P                  RTP                  P                  : RTP                  P                  : RTP                  : R24       T	^8X  Ed   \        P                  ! 4       pTTn         TP                  TT\        P                   4      pT P                  P                  R
T P1                  TP.                  4      ,          4       \        P,                  ! 4       pTe   \3        T^ R7      Tn        MfTe>   \4        P6                  Tn        T;P.                  \4        P8                  ,          un        M%Te   \4        P:                  Tn        M\        R4      hTP.                  TP.                  8w  da    TP=                  TT\        P                   T4      pT P                  P                  RT P1                  TP.                  4      ,          4       R# T P                  P                  R4       R#   \         d   pT P                  T TR4      hRp?ii ; i  \"         d   pT P%                  T\&        P(                  4      '       d   RpT P%                  T\&        P*                  4      '       d   RpTe   T P                  T TR	4      h\        P,                  ! 4       p^ Tn         Rp?ELRp?ii ; i  \"         d#   pTe   T P                  T TR4      h Rp?R# Rp?ii ; i)r   NzL--no-aes-keys, --use-aes-keys and --raw-kerb-enctypes are mutually exclusivez/modification arguments are required, try --helpr  r  r   r  r   r  zOld kerb_EncTypes:  %s
)basez&Internal error should be checked abovezNew kerb_EncTypes:  %s
z=SetTrustedDomainInfoByName(SUPPORTED_ENCRYPTION_TYPES) failedzNo kerb_EncTypes update needed
)r   rq   r	   r  r   rx   r   rP   r   r   r  r  r  r  r  r  r  r   rE   r   r  r  r  r  re  intr   r]  r^  r\  SetTrustedDomainInfoByName)r   r   rl   r  rm   r  r  r  num_modificationsenctype_argsr  r  r  r  r  r  r   r  r  r  s   &&&&&&&&            r   r  cmd_domain_trust_modify.run  s_    $AL#AL'AL!mnn1"!PQQ	7
	]"%"G"G !!$"?"?ATU$
 			&++22&1188&**, 	-
 1

I%I1::<;D;>;l;ln #" IIOO69R9RSeSoSo9ppq<<>I(&)-a&@	#)&.&S&S	###x'T'TT#!- '/&H&H	#"#KLL""&8&B&BB
v!<<\=F=@=n=n=FH '
 IIOO$>AZAZ[d[n[nAo$op 	 		 BCy  	]((u6[\\	]" ! 1++E83W3WXX E++E83X3XYY E$00u1rt t &)%I%I%K"/0",,1H % v("44T55tv v ) 	vsP   22J) #!K -AM+ )K4KKM(AM#(5M##M(+N6NNr!   )NNNNNNr#   r$   r%   r&   r  r  r   r  r  r   r  r   r  r  r  r'   r(   r)   s   @r   r  r  f  s     &%H 	W))w--0 	7"	 	|P&	 	$W3#	M J[ [r    r  c                     a  ] tR tRt o RtRtR]P                  R]P                  R]P                  R]
/t]! RR	R
RR.RRRR7      ]! RR	R. R6ORRRR7      ]! RR	RRR.RRRR7      ]! RRRRRR7      ]! R R	R!. R7OR#R$R"R7      ]! R%RR&R'RR7      ]! R(RR)R*RR7      ]! R+R,R-R.R/R7      ]! R0R,R1R2R/R7      .	tR3.tR8R4 ltR5tV tR"# )9cmd_domain_trust_createi  z Create a domain or forest trust.%prog DOMAIN [options]rl   r  r   rm   z--typechoiceTYPEexternalforestz.The type of the trust: 'external' or 'forest'.r   r  metavarchoicesr  r  r  z--direction	DIRECTIONbothz6The trust direction: 'incoming', 'outgoing' or 'both'.r  z--create-locationLOCATIONlocalz=Where to create the trusted domain object: 'local' or 'both'.create_locationz--cross-organisationr  z=The related domains does not belong to the same organisation.cross_organisationFr  z--quarantinedzyes|noNzSpecial SID filtering rules are applied to the trust. With --type=external the default is yes. With --type=forest the default is no.quarantined_argz--not-transitivez#The forest trust is not transitive.not_transitivez--treat-as-externalz'The treat the forest trust as external.treat_as_externalr  store_falsez)The trust does not use AES kerberos keys.r  Tz--skip-validationzSkip validation of the trust.validater   c           
     (*  a  \         P                  ! 4       pR pV
f   VR8X  d   RpM	V
R8X  d   RpVR8w  d'   V'       d   \        R4      hV'       d   \        R4      h\         P                  ! 4       pV'       d>   \        P
                  Vn        V;P                  \        P                  ,          un        M\        P                  Vn        \         P                  pV\         P                  ,          pV\         P                  ,          p\         P                  ! 4       p\         P                  Vn        ^ Vn        VR8X  dP   V;P                  \         P                   ,          un        V;P                  \         P"                  ,          un        M]VR	8X  d)   V;P                  \         P                   ,          un        M.VR
8X  d(   V;P                  \         P"                  ,          un        ^ Vn        V	'       d(   V;P$                  \         P&                  ,          un        V'       d(   V;P$                  \         P(                  ,          un        VR8X  d(   V;P$                  \         P*                  ,          un        V'       d(   V;P$                  \         P,                  ,          un        V'       d(   V;P$                  \         P.                  ,          un        V 3R lpRpRp\         P                  pVR8X  d   VP                  \         P                   ,          '       d#   V! R4      p\1        VP3                  R4      4      pVP                  \         P"                  ,          '       d#   V! R4      p\1        VP3                  R4      4      pRpEMdR pVP                  \         P                   ,          '       d	   V! ^4      pVP                  \         P"                  ,          '       d	   V! ^4      pV\         P                  ,          pV\         P                  ,          p\         P                  ! 4       p\         P                  Vn        ^ Vn        VR8X  dP   V;P                  \         P                   ,          un        V;P                  \         P"                  ,          un        M]VR	8X  d)   V;P                  \         P"                  ,          un        M.VR
8X  d(   V;P                  \         P                   ,          un        ^ Vn        V	'       d(   V;P$                  \         P&                  ,          un        V'       d(   V;P$                  \         P(                  ,          un        VR8X  d(   V;P$                  \         P*                  ,          un        V'       d(   V;P$                  \         P,                  ,          un        V'       d(   V;P$                  \         P.                  ,          un        S P5                  W#4      p S P7                  S P8                  V4      w  pppp p!S P>                  PA                  RT!PB                  PD                  : RT!PF                  PD                  : RT!PH                  : R24        S PK                  YA4      p# S P7                  S PN                  T4      w  p$p%p&p'p(S P>                  PA                  RT(PB                  PD                  : RT(PF                  PD                  : RT(PH                  : R24       T(PF                  PD                  TPP                  n"        T(PB                  PD                  TPR                  n"        T(PH                  Tn$        T'       d\   T!PF                  PD                  TPP                  n"        T!PB                  PD                  TPR                  n"        T!PH                  Tn$         TPP                  PD                  Tn"        TPU                  TT\         PV                  4       \        RTPD                  ,          4      h  \:         d   p"S P=                  S T"R4      hRp"?"ii ; i  \:         d   p"S PM                  S T"R4      hRp"?"ii ; i  \:         d   p"S PM                  S T"R4      hRp"?"ii ; i  \X         dU   p"S P[                  T"\\        P^                  4      '       g%   S P=                  S T"RTPD                  ,          4      h Rp"?"MRp"?"ii ; i TPR                  PD                  Tn"        TPU                  TT\         PV                  4       \        RTPD                  ,          4      h  \X         dU   p"S P[                  T"\\        P^                  4      '       g%   S P=                  S T"RTPD                  ,          4      h Rp"?"MRp"?"ii ; iT'       Edw    TPP                  PD                  Tn"        T$PU                  T%T\         PV                  4       \        RTPD                  ,          4      h  \X         dU   p"S P[                  T"\\        P^                  4      '       g%   S PM                  S T"RTPD                  ,          4      h Rp"?"MRp"?"ii ; i TPR                  PD                  Tn"        T$PU                  T%T\         PV                  4       \        RTPD                  ,          4      h  \X         dU   p"S P[                  T"\\        P^                  4      '       g%   S PM                  S T"RTPD                  ,          4      h Rp"?"MRp"?"ii ; i S Pa                  4       p)M&  \:         d   p"S P=                  S T"R4      hRp"?"ii ; i S Pc                  T)T4      p*M&  \:         d   p"S P=                  S T"R4      hRp"?"ii ; iT'       dt    S Pe                  4       p+M&  \:         d   p"S PM                  S T"R4      hRp"?"ii ; i S Pg                  T+T#T4      p,M&  \:         d   p"S PM                  S T"R4      hRp"?"ii ; iR p-\h        Pj                  ! 4       p.T-! TT.4      p/T-! TT.4      p0Rp1Rp2 T'       d   S P>                  PA                  R4       RRR R!/p3\m        T$T%T\         Pn                  T&T'T0T/4      p2S P>                  PA                  R"4       T'       dC   S P>                  PA                  R#4       RRR R$/p3T$Pq                  T2\         Pr                  T4       S P>                  PA                  R%4       RRR R!/p3\m        TTT\         Pn                  TT T/T04      p1S P>                  PA                  R&4       T'       dC   S P>                  PA                  R'4       RRR R$/p3TPq                  T1\         Pr                  T4       EM  \:         d   p"S P>                  PA                  R(X3R ,          : R)T3R,          : R*24       T2'       d/   S P>                  PA                  R+4       T$Pu                  T24       Rp2T1'       d/   S P>                  PA                  R,4       TPu                  T14       Rp1T3R,          R8X  d"   S PM                  S T"R-T3R ,          ,          4      hS P=                  S T"R-T3R ,          ,          4      hRp"?"ii ; iT'       Ed   TP$                  \         P*                  ,          '       Ed   S P>                  PA                  R.4        T)Pw                  T*Px                  T(PF                  PD                  \z        P|                  4      p4M&  \:         d   p"S P=                  S T"R/4      hRp"?"ii ; i TP                  TT(PF                  \         P                  T4^ 4      p5M&  \:         d   p"S P=                  S T"R04      hRp"?"ii ; iS P                  T4T(PF                  PD                  T5R17       T'       d   S P>                  PA                  R24        X+Pw                  X,T!PF                  PD                  \z        P|                  4      p6M&  \:         d   p"S PM                  S T"R/4      hRp"?"ii ; i T$P                  T%T!PF                  \         P                  T6^ 4      p7M&  \:         d   p"S PM                  S T"R04      hRp"?"ii ; iS P                  T6T!PF                  PD                  T7R17       TP                  \         P"                  ,          '       Ed   S P>                  PA                  R34        T)P                  T*Px                  \z        P                  ^T(PF                  PD                  4      p8M&  \:         d   p"S P=                  S T"R44      hRp"?"ii ; iS P                  T8P                  ^ ,          4      p9S P                  T8P                  ^ ,          4      p:T8P                  \z        P                  ,          '       d=   R5T8P                  : R6T8P                  ^,          : R7T8P                  ^,          : R82p;M;R5T8P                  : R6T8P                  ^,          : R7T8P                  ^,          : R92p;T9\        P                  8w  g   T:\        P                  8w  d   \        T;4      hS P>                  PA                  R:T;,          4       T'       Ed   TP                  \         P"                  ,          '       Ed   S P>                  PA                  R;4        X+P                  X,\z        P                  ^T!PF                  PD                  4      p<M&  \:         d   p"S PM                  S T"R44      hRp"?"ii ; iS P                  T<P                  ^ ,          4      p=S P                  T<P                  ^ ,          4      p>T<P                  \z        P                  ,          '       d=   R<T<P                  : R6T<P                  ^,          : R7T<P                  ^,          : R82p?M;R<T<P                  : R6T<P                  ^,          : R7T<P                  ^,          : R92p?T=\        P                  8w  g   T>\        P                  8w  d   \        T?4      hS P>                  PA                  R:T?,          4       T2e'    T$P                  T24       M  \:         d     Mi ; iRp2T1e'    TP                  T14       M  \:         d     Mi ; iRp1S P>                  PA                  R=4       R# )>FNr  Tyesr  z'--not-transitive requires --type=forestz*--treat-as-external requires --type=forestr  incomingoutgoingc                    < R p Ve
   VR8w  d   V# \        RV ,          4      p\        RV ,          4      pW8X  d   K:  R pSP                  P                  R4       KY  )Nra   zNew %s Password: zRetype %s Password: zSorry, passwords do not match.
)r   r   r   )r  passwordpasswordverifyr   s   &  r   get_password1cmd_domain_trust_create.run.<locals>.get_passwordR  sX    H'HN#O"#6#=>!()?$)F!G1#HIIOO$FGr    r  zIncoming Trust	utf-16-lezOutgoing Trustc                     \         P                  ! V ^,          V ^,          4      p\        VP                  R4      4      # )   r  )samba generate_random_machine_passwordlistencode)lengthpws   & r   random_trust_secret8cmd_domain_trust_create.run.<locals>.random_trust_secrett  s1    ;;FaKSTUBIIk233r    r  r  r   r  r   failed to locate remote serverRemoteDomain Netbios[zTrustedDomain %s already exist'z2QueryTrustedDomainInfoByName(%s, FULL_INFO) failedr  failed to get netlogon dc infoc                    V f   \         P                  ! 4       p^ Vn        V# \         P                  ! 4       p\	        V 4      Vn        Wn        \         P                  ! 4       p\        P                  ! V4      Vn
        \        P                  Vn        W4n        \         P                  ! 4       p^Vn        V.Vn        \         P                  ! 4       p^Vn        WRn        V# r/   )r   trustAuthInOutBlobr  AuthInfoClearr  sizer  AuthenticationInformationr  unix2nttimeLastUpdateTimer	   TRUST_AUTH_TYPE_CLEARAuthTypeAuthInfoAuthenticationInformationArrayr  current)secretupdate_timeblobclearr   r  s   &&    r   generate_AuthInOutBlob;cmd_domain_trust_create.run.<locals>.generate_AuthInOutBlob  s    ~224
**,EVEJ#N557D"'"3"3K"@D55DM!M;;=EEK&EK..0DDJ LKr    zCreating remote TDO.
locationremoter  CreateTrustedDomainEx2zRemote TDO created.
z2Setting supported encryption types on remote TDO.
SetInformationTrustedDomainzCreating local TDO.
zLocal TDO created
z1Setting supported encryption types on local TDO.
zError: z failed zly - cleaning up
zDeleting remote TDO.
zDeleting local TDO.
z%sz(Setup local forest trust information...
*netr_DsRGetForestTrustInformation() failed&lsaRSetForestTrustInformation() failedr  r  z)Setup remote forest trust information...
zValidating outgoing trust...
!NETLOGON_CONTROL_TC_VERIFY failedLocalValidation: DC[] CONNECTION[] TRUST[] VERIFY_STATUS_RETURNEDre   OK: %s
zValidating incoming trust...
RemoteValidation: DC[z	Success.
)Mr	   r  r   r  r   r]  r  r^  r\  r  LSA_POLICY_TRUST_ADMINLSA_POLICY_CREATE_SECRETTrustDomainInfoInfoExr0  r   r  r9  r:  r   rI  rH  r   r  rK  r  r  rq   r   rx   r   rP   r   r   r  r  r  r  r   rV   r   r  r   r  r  r   rE   r   r  r{   r   r   r   r  current_unix_timer   LSA_TRUSTED_DOMAIN_ALL_ACCESSr5  r  DeleteObject!netr_DsRGetForestTrustInformationr   r   DS_GFTI_UPDATE_TDOlsaRSetForestTrustInformationr  r  netr_LogonControl2ExNETLOGON_CONTROL_TC_VERIFYr>   pdc_connection_statustc_connection_statusr   NETLOGON_VERIFY_STATUS_RETURNEDtrusted_dc_namer   WERR_SUCCESSClose)@r   r   rl   rm   r   r  r   r  r  r  r  r  r  r  r  r  quarantinedr  r  local_trust_infor  incoming_secretoutgoing_secretremote_policy_accessincoming_passwordoutgoing_passwordremote_trust_infor  r1   r  r  r  r  r  r   r4   
remote_lsaremote_policyremote_versionremote_revision_info1remote_lsa_infor  local_netlogon_inforemote_netlogonremote_netlogon_dc_uncr0  r-  incoming_bloboutgoing_bloblocal_tdo_handleremote_tdo_handlecurrent_requestlocal_forest_infolocal_forest_collisionremote_forest_inforemote_forest_collisionlocal_trust_verifylocal_trust_statuslocal_conn_statuslocal_validationremote_trust_verifyremote_trust_statusremote_conn_statusremote_validations@   f&&&&&&&&&&&&&&                                                 r   r  cmd_domain_trust_create.run  s3    JJL	"Z'"%K!"#LMM "#OPP88:	"*"O"OI8#P#PP #+"D"DI!CCs999s;;;446&)&@&@#+,(f$,,0O0OO,,,0P0PP,
*,,0O0OO,
*,,0P0PP,,-)--1[1[[---1[1[[-!--1Z1ZZ---1W1WW---1Z1ZZ-		H "DDg%//#2Q2QQQ$01A$B!"&'8'?'?'L"M//#2R2RRR$01A$B!"&'8'?'?'L"M $4  //#2Q2QQQ"5c"://#2R2RRR"5c": C$>$>>  C$@$@@  # 9 9 ;+.+E+E(01-&(!11S5T5TT1!11S5U5UU1 J.!11S5U5UU1 J.!11S5T5TT112.!!22c6`6``2!22c6`6``2X%!22c6_6__2!22c6\6\\2 !22c6_6__2..yF		] !!$"?"?ATU$
 			&++22&1188&**, 	-
	Y 44XFM		^ !!$"@"@BVW%
 			',,33'2299'++- 	.
 />.H.H.O.O$$+/>/C/C/J/J%%,.223A3L3L3S3S))04B4G4G4N4N**1$2$6$6!
	D/;;BBI22<3<363X3XZ @9CSCSSTTW  	]((u6[\\	]  	Y))$7WXX	Y  	^))$7\]]	^.  	D++E83[3[\\,,T5-a1:1A1A.CD D ]	D
	D/<<CCI22<3<363X3XZ @9CSCSSTT 	D++E83[3[\\,,T5-a1:1A1A.CD D ]	D 
I#4#@#@#G#G	 778A8;8]8]_ ##DyGWGW#WXX  I//x7_7_``11$2f6?6F6F3HI I aI
I#4#A#A#H#H	 778A8;8]8]_ ##DyGWGW#WXX  I//x7_7_``11$2f6?6F6F3HI I aI	[!??AN 	[((u6YZZ	[	X"&";";NL"Y 	X((u6VWW	X `"&"E"E"G `--dE;^__`])-)A)A/BOQW*Y& ]--dE;[\\]	4 --/.L.L 8	C 		 89#-xAY"Z$?!%55")!!	%! 		 78IIOO$YZ'18VEb&cO::;L;>;l;l;DF IIOO34)7F<TUO: 11$	  IIOO12		 TU#-w@]"^556F696g6g6?A  	CIIOO+F33_Z5P5PR S 		 89''(9:$(!		 78&&'78#' z*h6--dE4.=f.E<G H H((ud)8)@7B C C	C" 80033\3\\\		 KL
l 'HHI\IcIcIXIcIcIjIjIQIdIdf & $ l00u>jkkl	h "??@O@Z@Z@C@`@`@Q@A	C + $ h00u>fggh ,,->1@1K1K1R1R8N - P %IIOO$PQ
q ,MMNdN\NgNgNnNnNVNiNik + ( q"55dECoppq	m 'DD]ESE^E^EHEeEeEWEF	H 0 ( m"55dECkllm 001C5C5N5N5U5U<S 1 U  //#2R2RRR		 @Ac)7)L)LM`MgMgMUMpMpMNM\MgMgMnMn*p& $ c00u>abbc &*\\2D2Z2Z[\2]%^"$(LL1C1X1XYZ1[$\!%++h.V.VVV'9'I'I'9'N'Nq'Q'Q'9'O'OPQ'R'R(T$ W (:'I'I'9'N'Nq'Q'Q'9'O'OPQ'R'R(T$
 &)<)<<@QU[UhUh@h&'788IIOOJ1A$AB  $44s7W7WWWIIOO$DEh+@@AWAIAdAdABAOAZAZAaAac ,
 ( h"55dECfggh +/,,7J7`7`ab7c*d')-6I6^6^_`6a)b&*0083[3[[[+>+N+N+>+S+STU+V+V+>+T+TUV+W+W-Y) \ ,?+N+N+>+S+STU+V+V+>+T+TUV+W+W-Y)
 +f.A.AAEW[a[n[nEn*+<==		
5F(FG(  !23  $' 01 #		%s  "`. 	a "a: Ab  .a9aaa7a22a7:bbb c?+A
c::c?Ae f:&A
f55f:Ah i>*A
i99i>Ak l9%A
l44l9=m m1m,,m15n n+n&&n+7o o+o&&o+/p p&p!!p&v.  Ev. .z,9A/z')A>z''z,<?|< <}}}#-~ ~4~//~4@5A@9 @9AAAAAAAAA -AB BAB1BAB,B,AB1D A AE! E!AFE,AE?E?AFL6AM MAM'MAM"M"AM'R(AR: R:ASSASSAS$ S$AS2S1AS2r!   )r  r  r  )r
  noN)NNNNNNNFNFFFTr#   r$   r%   r&   r  r  r   r  r  r   r   r  r   r  r  r  r'   r(   r)   s   @r   r  r    sR    *'H 	W))w--G..0	 	xh"H-D !		#
 	}8[7L%		
 	":(S%		
 	%lS(	 	Xx*< &	 	!,9$	 	$\='	 	}?"	 	"=3	O+MZ JS Sr    r  c            
          a  ] tR tRt o RtRtR]P                  R]P                  R]P                  R]
/t]! RR	R
RR.RRRR7      .tR.tRR ltRtV tR# )cmd_domain_trust_deletei  zDelete a domain trust.r  rl   r  r   rm   z--delete-locationr  r   r  r  z=Where to delete the trusted domain object: 'local' or 'both'.delete_locationr  r   Nc           	        \         P                  pV\         P                  ,          pV\         P                  ,          pVR 8X  d   RpM>\         P                  pV\         P                  ,          pV\         P                  ,          pV P	                  W#4        V P                  V P                  V4      w  p	p
pppT P                  P                  RTP                  P                  : RTP                  P                  : RTP                  : R24       RpRpRpRp\         P                  ! 4       p TTn        T	P!                  T
T\         P"                  4      pTEeW    T P1                  YA4        T P                  T P2                  T4      w  pppppT P                  P                  R	TP                  P                  : RTP                  P                  : RTP                  : R24       TP                  TP                  8w  g_   TP                  P                  TP4                  P                  8w  g0   TP                  P                  TP6                  P                  8w  dK   \-        R
TP4                  P                  : RTP6                  P                  : RTP                  : R24      h TP                  P                  Tn        TP!                  TT\         P"                  4      pTe   TP                  TP                  8w  g_   TP                  P                  TP4                  P                  8w  g0   TP                  P                  TP6                  P                  8w  dK   \-        RTP4                  P                  : RTP6                  P                  : RTP                  : R24      hTeQ    TP6                  P                  Tn        T	P9                  T
T\:        P<                  4      pT	P?                  T4       RpTe>    TP6                  P                  Tn        XP9                  XT\:        P<                  4      pTe2    XP?                  T4       RpT P                  P                  R4       R# R#   \         d   pT P                  YR4      hRp?ii ; i  \$         dP   pT P'                  T\(        P*                  4      '       d   \-        RT,          4      hT P/                  YR4      hRp?ii ; i  \         d   pT P/                  YR4      hRp?ii ; i  \         d   pT P/                  YR4      hRp?ii ; i  \$         dU   pT P'                  T\(        P*                  4      '       g$   T P/                  YRTP                  ,          4      h Rp?ELRp?ii ; i  \         d)   pT P                  YRTP                  ,          4      hRp?ii ; i  \         d)   pT P/                  YRTP                  ,          4      hRp?ii ; i  \         d>   pT P                  P                  RT P/                  YR4      ,          4        Rp?R# Rp?ii ; i)r  Nr  r  r   r  r   z$Failed to find trust for domain '%s'r  r  zLocalTDO inconsistent: Netbios[re   z QueryTrustedDomainInfoByName(%s)z RemoteTDO inconsistent: Netbios[zOpenTrustedDomainByName(%s)zRemoteTDO deleted.
z%s
zDeleteObject() failed) r	   r  r@  rA  rq   r   rx   r   rP   r   r   r  r  r  r  r  r  LSA_TRUSTED_DOMAIN_INFO_INFO_EXr   rE   r   r  r   rV   r   r   r   r  OpenTrustedDomainByNamer   SEC_STD_DELETErE  )r   r   rl   rm   r   r  rw  r  rU  r  r  r  r  r  r   r  rc  remote_tdo_inford  r  rY  rZ  r[  r\  r]  s   &&&&&&&                  r   r  cmd_domain_trust_delete.run  s    "CCs999s;;;g%#' #&#H#H  C$>$>>  C$@$@@ 	7		] !!$"?"?ATU$
 			&++22&1188&**, 	-
  JJL		Y%I&CCLDMsOrOrtN  +]((:	b %%d&D&DFZ[!")#
 IIOO+0077+66==+//1 2
 ""n&8&88##**n.I.I.P.PP))00N4N4N4U4UU"#1#>#>#E#E#1#=#=#D#D#1#5#5$7 8 8
	E#1#<#<#C#C	 ;;M<E<?<_<_a   *!%%)<)<<!&&--1M1M1T1TT!,,337R7R7Y7YY&'6'C'C'J'J'6'B'B'I'I'6':':(< = =
 %@#1#=#=#D#D	 55l6?6>6M6MO ! ""#34#&A#2#>#>#E#E	 66}7@7?7N7NP " (h''(9:$(!		 67 	U  	]((6[\\	]$  	Y''x/W/WXX"#IF#RSS))$7WXX	Y   ]--d;[\\]   b--d;`aab, ! E//x7_7_``11$?a2;2B2B@D E E aE*   @,,T:W-6-=-=;? @ @@   A--d;X.7.>.><@ A AA   h		)@)@Ne)f fgghs   "R 3(R' !T 3"T) 3<U ;<V0 <W& .X R$RR$'T2A
S<<TT&T!!T&)U4UUV-A	V((V-0W#;#WW#&X1#XXY$'2YY$r!   NNNNNrt  r)   s   @r   rv  rv    s|      'H 	W))w--G..0	 	":(S%		M JB Br    rv  c            
          a  ] tR tRt o RtRtR]P                  R]P                  R]P                  R]
/t]! RR	R
RR.RRRR7      .tR.tRR ltRtV tR# )cmd_domain_trust_validatei  zValidate a domain trust.r  rl   r  r   rm   z--validate-locationr  r   r  r  z?Where to validate the trusted domain object: 'local' or 'both'.validate_locationr  r   Nc           	     N   \         P                  pV P                  W%4      p V P                  V P                  V4      w  p	p
pppT P                  P                  RTP                  P                  : RTP                  P                  : RTP                  : R24        \         P                  ! 4       pYn
        T	P                  T
T\         P                  4      pT P                  P                  RTP*                  P                  : RTP,                  P                  : RTP                  : R24        T P/                  4       p TP1                  T\2        P4                  ^TP,                  P                  4      pT P7                  TP8                  ^ ,          4      pT P7                  TP:                  ^ ,          4      pTP<                  \2        P>                  ,          '       d=   RTP@                  : RTP:                  ^,          : RTP8                  ^,          : R2pM;RTP@                  : RTP:                  ^,          : RTP8                  ^,          : R2pT\B        PD                  8w  g   T\B        PD                  8w  d   \)        T4      hT P                  P                  RT,          4        TP@                  PG                  RR4      pTP,                  P                  : RT: 2pTP1                  T\2        PH                  ^T4      pT P7                  TP:                  ^ ,          4      pRTP@                  : RTP:                  ^,          : R2pT\B        PD                  8w  d   \)        T4      hT P                  P                  RT,          4       TR8w  Ed|    T PK                  YARR7      p T PO                  4       p TP1                  T\2        P4                  ^TP                  P                  4      pT P7                  TP8                  ^ ,          4      pT P7                  TP:                  ^ ,          4      pTP<                  \2        P>                  ,          '       d=   RTP@                  : RTP:                  ^,          : RTP8                  ^,          : R2pM;RTP@                  : RTP:                  ^,          : RTP8                  ^,          : R2pT\B        PD                  8w  g   T\B        PD                  8w  d   \)        T4      hT P                  P                  RT,          4        TP@                  PG                  RR4      pTP                  P                  : RT: 2pTP1                  T\2        PH                  ^T4      p T P7                  T P:                  ^ ,          4      pRT P@                  : RT P:                  ^,          : R2p!T\B        PD                  8w  d   \)        T!4      hT P                  P                  RT!,          4       R#   \
         d   pT P                  YR 4      hRp?ii ; i  \          dP   pT P#                  T\$        P&                  4      '       d   \)        RT,          4      hT P                  YR4      hRp?ii ; i  \
         d   pT P                  YR	4      hRp?ii ; i  \
         d   pT P                  YR
4      hRp?ii ; i  \
         d   pT P                  YR4      hRp?ii ; i  \
         d   pT PM                  YR4      hRp?ii ; i  \
         d   pT PM                  YR	4      hRp?ii ; i  \
         d   pT PM                  YR
4      hRp?ii ; i  \
         d   pT PM                  YR4      hRp?ii ; i)r  Nr  r   r  r   r  ,QueryTrustedDomainInfoByName(INFO_EX) failedLocalTDO Netbios[r  r9  r:  r;  r<  r=  re   r>  \ra   z"NETLOGON_CONTROL_REDISCOVER failedzLocalRediscover: DC[r  F)r   r  r?  zRemoteRediscover: DC[)(r	   r  rq   r   rx   r   rP   r   r   r  r  r  r  r  r  ry  r   rE   r   r  r   r   r  r{   rI  r   rJ  r>   rK  rL  r   rM  rN  r   rO  replaceNETLOGON_CONTROL_REDISCOVERr   rV   r   )"r   r   rl   r  r   rm   r  r  r1   r  r  r  r  r  r   r  r  r  rj  rk  rl  rm  r   domain_and_serverlocal_trust_rediscoverlocal_rediscoverr4   r_  rn  ro  rp  rq  remote_trust_rediscoverremote_rediscovers"   &&&&&&&                           r   r  cmd_domain_trust_validate.run  s    "CC..yF		] !!$"?"?ATU$
 			&++22&1188&**, 	-
	f

I%66|7@7:7Z7Z\  			&33::&2299&**, 	-
	[!??AN	[33L4<4W4W454B4N4N4U4UW  "\\*<*R*RST*UV LL);)P)PQR)ST##h&N&NNN1AA1FFqII1GGJJ L O  2AA1FFqII1GGJJ L
 !4!448IVM`M`8`/00IIOOJ)99:		\'77??bIF,:,F,F,M,Mv V33L4<4X4X454EG # !LL)?)T)TUV)WX5EE5JJ1MMO  3 33/00IIOOJ)99:'] $ 8 8W\ 8 ]`"&"E"E"G`#889A9\9\9:9G9R9R9Y9Y[ $ #',,/B/X/XYZ/["\!%.A.V.VWX.Y!Z"((8+S+SSS#6#F#F#6#K#KA#N#N#6#L#LQ#O#O%Q! T $7#F#F#6#K#KA#N#N#6#L#LQ#O#O%Q!
 #f&9&99=OSYSfSf=f"#455		
-> >?	a,<<DDT2N0>0I0I0P0PRX$Y!#889A9]9]9:9JL ( "&.E.Z.Z[\.]!^ $;#J#J#:#O#OPQ#R#R!T "V%8%88"#455		
-> >?[  	]((6[\\	]  	f''x/W/WXX"#Y\b#bcc((6dee		f  	[((6YZZ	[  	[((6YZZ	[<  	\((6Z[[	\    ]--d;[\\]
   `--d;^__`   `--d;^__`<   a--d;_``as   "X"  <Y 7Z$ 6[	 8A[. &\ :\8 6] ;A^ "Y-X??YZ!A
ZZ!$[/[[	[+[&&[+.\9\\\5\00\58]]]]?(]::]?^$^^$r!   r~  rt  r)   s   @r   r  r    s|     "'H 	W))w--G..0	 	$8Z(U'		M J\ \r    r  c                     a  ] tR tRt o RtRtR]P                  R]P                  R]	/t
]! RRR	. R@ORRR
R7      ]! RRRRRR7      ]! RRRRR. R7      ]! RRRRR. R7      ]! RRRRR. R7      ]! R RRR!R". R7      ]! R#RR$R%R&. R7      ]! R'RR$R(R). R7      ]! R*RR+R,R-. R7      ]! R.RR+R/R0. R7      ]! R1RRR2R3. R7      ]! R4RRR5R6. R7      ]! R7RRR8R9. R7      ]! R:RRR;R<. R7      .tR=.tRAR> ltR?tV tR
# )Bcmd_domain_trust_namespacesi@  zManage forest trust namespaces.z%prog [DOMAIN] [options]rl   r  rm   z	--refreshr  zcheck|storeNzLList and maybe store refreshed forest trust information: 'check' or 'store'.refreshr  z--enable-allr  zATry to update disabled entries, not allowed with --refresh=check.
enable_allFr  z--enable-tlnappend	DNSDOMAINz?Enable a top level name entry. Can be specified multiple times.
enable_tln)r  r  r  r  r  z--disable-tlnz@Disable a top level name entry. Can be specified multiple times.disable_tlnz--add-tln-exzAAdd a top level exclusion entry. Can be specified multiple times.
add_tln_exz--delete-tln-exzDDelete a top level exclusion entry. Can be specified multiple times.delete_tln_exz--enable-nbNETBIOSDOMAINzIEnable a netbios name in a domain entry. Can be specified multiple times.	enable_nbz--disable-nbzJDisable a netbios name in a domain entry. Can be specified multiple times.
disable_nbz--enable-sid	DOMAINSIDz@Enable a SID in a domain entry. Can be specified multiple times.enable_sid_strz--disable-sidzADisable a SID in a domain entry. Can be specified multiple times.disable_sid_strz--add-upn-suffixzVAdd a new uPNSuffixes attribute for the local forest. Can be specified multiple times.add_upnz--delete-upn-suffixz^Delete an existing uPNSuffixes attribute of the local forest. Can be specified multiple times.
delete_upnz--add-spn-suffixz[Add a new msDS-SPNSuffixes attribute for the local forest. Can be specified multiple times.add_spnz--delete-spn-suffixzcDelete an existing msDS-SPNSuffixes attribute of the local forest. Can be specified multiple times.
delete_spnzdomain?c           	     zC   Vf   . pVf   . pV	f   . p	V
f   . p
Vf   . pVf   . pVf   . pVf   . pVf   . pVf   . pVf   . pVf   . pRpVEf   VR8X  d   \        RV,          4      hV'       d   \        R4      h\        V4      ^ 8  d   \        R4      h\        V4      ^ 8  d   \        R4      h\        V	4      ^ 8  d   \        R4      h\        V
4      ^ 8  d   \        R4      h\        V4      ^ 8  d   \        R	4      h\        V4      ^ 8  d   \        R
4      h\        V4      ^ 8  d   \        R4      h\        V4      ^ 8  d   \        R4      h\        V4      ^ 8  d5   V F,  pVP                  R4      '       g   K  \        RV,          4      h	  Rp\        V4      ^ 8  d5   V F,  pVP                  R4      '       g   K  \        RV,          4      h	  RpV FA  pV F8  pVP                  4       VP                  4       8w  d   K(  \        RV,          4      h	  KC  	  \        V4      ^ 8  d5   V F,  pVP                  R4      '       g   K  \        RV,          4      h	  Rp\        V4      ^ 8  d5   V F,  pVP                  R4      '       g   K  \        RV,          4      h	  RpV FA  pV F8  pVP                  4       VP                  4       8w  d   K(  \        RV,          4      h	  KC  	  Ml\        V4      ^ 8  d   \        R4      h\        V4      ^ 8  d   \        R4      h\        V4      ^ 8  d   \        R4      h\        V4      ^ 8  d   \        R4      hVEe   VR8X  d   RpV'       d   VR8w  d   \        RV,          4      h\        V4      ^ 8  d   \        R4      h\        V4      ^ 8  d   \        R4      h\        V	4      ^ 8  d   \        R4      h\        V
4      ^ 8  d   \        R4      h\        V4      ^ 8  d   \        R4      h\        V4      ^ 8  d   \        R4      h\        V4      ^ 8  d   \        R 4      h\        V4      ^ 8  d   \        R!4      hEMV'       dT   Rp\        V4      ^ 8  d   \        R"4      h\        V4      ^ 8  d   \        R#4      h\        V4      ^ 8  d   \        R$4      h\        V4      ^ 8  d   Rp\        V4      ^ 8  d   RpV FA  pV F8  pVP                  4       VP                  4       8w  d   K(  \        R%V,          4      h	  KC  	  \        V	4      ^ 8  d5   V	 F,  pVP                  R4      '       g   K  \        R&V,          4      h	  Rp\        V
4      ^ 8  d5   V
 F,  pVP                  R4      '       g   K  \        R'V,          4      h	  RpV	 FA  pV
 F8  pVP                  4       VP                  4       8w  d   K(  \        R(V,          4      h	  KC  	  \        V4      ^ 8  d   Rp\        V4      ^ 8  d   RpV FA  pV F8  pVP	                  4       VP	                  4       8w  d   K(  \        R)V,          4      h	  KC  	  . pV F+  p \
        P                  ! V4      pTP                  T4       K-  	  . pV F+  p \
        P                  ! V4      pTP                  T4       K-  	  \        V4      ^ 8  d   Rp\        V4      ^ 8  d   RpV F%  pV F  pVV8w  d   K  \        R,V,          4      h	  K'  	  \        P                  pV'       d   V\        P                  ,          pV P                  W#4      p V P                  4       p T P#                  T P                  T4      w  pp p!p"p#T P$                  P'                  R/T#P(                  P*                  : R0T#P,                  P*                  : R1T#P.                  : R224       TEf    T P1                  4       p$ T P3                  T$T4      p%T%P4                  T%P6                  8w  d)   \        R5T%P4                  : R6T%P6                  : R724      h T$P9                  T%P:                  R ^ 4      p&T P$                  P'                  R:4       T PG                  T&T#P,                  P*                  R;7        T PI                  4       p'R=\K        T'PM                  4       4      ,          p(R>R?.p) T'PO                  T(\P        PR                  R@T)RA7      p*T*^ ,          p+. p,R>T+9   d   T,PY                  T+R>,          4       . p-R?T+9   d   T-PY                  T+R?,          4       T P$                  P'                  RC\        T,4      ,          4       T, F(  p.T P$                  P'                  RDRE:RF RGT.: R224       K*  	  T P$                  P'                  RH\        T-4      ,          4       T- F(  p.T P$                  P'                  RDRE:RF RGT.: R224       K*  	  T'       g   R # Rp/. p0T0PY                  T,4       Rp1. p2T2PY                  T-4       T F]  p3T0 FA  p.\K        T.4      P                  4       T3P                  4       8X  g   K1  \        RIT3,          4      h	  T0P                  T34       Rp/K_  	  T Fs  p3R p4\[        T04       F6  w  p5p.\K        T.4      P                  4       T3P                  4       8w  d   K4  T5p4 M	  T4f   \        RJT3,          4      hT0P]                  T44       Rp/Ku  	  T F]  p6T2 FA  p.\K        T.4      P                  4       T6P                  4       8X  g   K1  \        RKT6,          4      h	  T2P                  T64       Rp1K_  	  T Fs  p6R p4\[        T24       F6  w  p5p.\K        T.4      P                  4       T6P                  4       8w  d   K4  T5p4 M	  T4f   \        RLT6,          4      hT2P]                  T44       Rp1Ku  	  T P$                  P'                  RM\        T04      ,          4       T0 F(  p.T P$                  P'                  RDRE:RF RGT.: R224       K*  	  T P$                  P'                  RN\        T24      ,          4       T2 F(  p.T P$                  P'                  RDRE:RF RGT.: R224       K*  	  \P        P^                  ! 4       p7T+P`                  T7n0        T/'       d*   \P        Pb                  ! T0\P        Pd                  R>4      T7R>&   T1'       d*   \P        Pb                  ! T2\P        Pd                  R?4      T7R?&    T'Pg                  T74        T$P9                  T%P:                  R ^ 4      p8T P$                  P'                  RP4       T PG                  T8T#P,                  P*                  R;7       R #  \        Ph                  ! 4       p9TT9n        TPk                  T T9\        Pl                  4      p:T P$                  P'                  RST:Pt                  P*                  : R0T:P4                  P*                  : R1T:P.                  : R224       T:Pv                  \        Px                  ,          '       g   \        RTT,          4      hTEe    T P1                  4       p$ T P3                  T$T4      p%^p;TR8X  d   \z        P|                  p<T'       d   ^ p;M^ p< T$P9                  T%P:                  T:P4                  P*                  T<4      p= TP                  T T:P4                  \        P                  T=T;4      p>T P$                  P'                  RV4       T PG                  T=T:P4                  P*                  T>RW7       TR8X  d    \        Ph                  ! 4       p9T:P4                  P*                  T9n        TP                  T T9\        P                  4      p8T P$                  P'                  RP4       T PG                  T8T:P4                  P*                  R;7       R #  \        Ph                  ! 4       p9T:P4                  P*                  T9n        TP                  T T9\        P                  4      p?T P$                  P'                  RY4       T PG                  T?T:P4                  P*                  R;7       T'       g   R # . p@T@PY                  T?P                  4       \        P                  ! 4       pA\        T@4      TAnD        T@TAnB        T'       Ed   XAP                   Ff  pBTBP                  \        P                  8w  d   K$  XBP                  ^ 8X  d   K7  ^ XBnH        TB;P                  \        P                  ( ,          unG        Kh  	  XAP                   F  pBTBP                  \        P                  8w  d   K$  XBP                  ^ 8X  d   K7  ^ XBnH        TB;P                  \        P                  ( ,          unG        TB;P                  \        P                  ( ,          unG        K  	  T EF2  pCR p4\[        XAP                  4       Fb  w  p5pBTBP                  \        P                  8w  d   K'  XBP                  P*                  P                  4       XCP                  4       8w  d   K`  T5p4 M	  T4f   \        RZXC,          4      hXAP                  T4,          P                  \        P                  ,          '       g   \        R[XC,          4      h^ XAP                  T4,          nH        TAP                  T4,          ;P                  \        P                  ( ,          unG        EK5  	  T EFj  pCR p4\[        XAP                  4       Fb  w  p5pBTBP                  \        P                  8w  d   K'  XBP                  P*                  P                  4       XCP                  4       8w  d   K`  T5p4 M	  T4f   \        R\XC,          4      hXAP                  T4,          P                  \        P                  ,          '       d   \        R]XC,          4      h^ XAP                  T4,          nH        TAP                  T4,          ;P                  \        P                  ( ,          unG        TAP                  T4,          ;P                  \        P                  ,          unG        EKm  	  T	 EF  pDR p4\[        XAP                  4       Fb  w  p5pBTBP                  \        P                  8w  d   K'  XBP                  P*                  P                  4       XDP                  4       8w  d   K`  T5p4 M	  T4e   \        R^XD,          4      hR_XDP                  4       ,          pER p4\[        XAP                  4       F  w  p5pBTBP                  \        P                  8w  d   K'  R_XBP                  P*                  P                  4       ,          pFXETF8X  d   \        R`XD,          4      hXEP                  XF4      '       g   K  T5p4 M	  T4f   \        RaXD,          4      h\        P                  ! 4       pB\        P                  TBnE        ^ TBnG        ^ TBnH        XDTBP                  n        . p@T@PY                  XAP                  4       T@P                  T4^,           TB4       \        T@4      TAnD        T@TAnB        EK  	  T
 F  pDR p4\[        XAP                  4       Fb  w  p5pBTBP                  \        P                  8w  d   K'  XBP                  P*                  P                  4       XDP                  4       8w  d   K`  T5p4 M	  T4f   \        RbXD,          4      h. p@T@PY                  XAP                  4       T@P]                  T44       \        T@4      TAnD        T@TAnB        K  	  T EF<  pGR p4\[        XAP                  4       Fl  w  p5pBTBP                  \        P                  8w  d   K'  XBP                  P                  P*                  P	                  4       XGP	                  4       8w  d   Kj  T5p4 M	  T4f   \        RcXG,          4      hXAP                  T4,          P                  \        P                  ,          '       g   \        RdXG,          4      h^ XAP                  T4,          nH        TAP                  T4,          ;P                  \        P                  ( ,          unG        EK?  	  T EFt  pGR p4\[        XAP                  4       Fl  w  p5pBTBP                  \        P                  8w  d   K'  XBP                  P                  P*                  P	                  4       XGP	                  4       8w  d   Kj  T5p4 M	  T4f   \        ReXG,          4      hXAP                  T4,          P                  \        P                  ,          '       d   \        RfXG,          4      h^ XAP                  T4,          nH        TAP                  T4,          ;P                  \        P                  ( ,          unG        TAP                  T4,          ;P                  \        P                  ,          unG        EKw  	  X EF  pR p4\[        XAP                  4       FF  w  p5pBTBP                  \        P                  8w  d   K'  XBP                  P                  T8w  d   KD  T5p4 M	  T4f   \        RgT,          4      hXAP                  T4,          P                  \        P                  ,          '       g   \        RhXG,          4      h^ XAP                  T4,          nH        TAP                  T4,          ;P                  \        P                  ( ,          unG        EK  	  X EFN  pR p4\[        XAP                  4       FF  w  p5pBTBP                  \        P                  8w  d   K'  XBP                  P                  T8w  d   KD  T5p4 M	  T4f   \        RiT,          4      hXAP                  T4,          P                  \        P                  ,          '       d   \        RjXG,          4      h^ XAP                  T4,          nH        TAP                  T4,          ;P                  \        P                  ( ,          unG        TAP                  T4,          ;P                  \        P                  ,          unG        EKQ  	   TP                  T T:P4                  \        P                  XA^ 4      pHT P$                  P'                  Rk4       T PG                  XAT:P4                  P*                  XHRW7        \        Ph                  ! 4       p9T:P4                  P*                  T9n        TP                  T T9\        P                  4      p8T P$                  P'                  RP4       T PG                  T8T:P4                  P*                  R;7       R #   \        \        3 d    \        R*T,          4      hi ; i  \        \        3 d    \        R+T,          4      hi ; i  \         d   pT P!                  T TR-4      hR p?ii ; i  \         d   pT P!                  T TR.4      hR p?ii ; i  \         d   pT P!                  T TR34      hR p?ii ; i  \         d   pT P!                  T TR44      hR p?ii ; i  \         d   pT P=                  T\>        P@                  4      '       d   \        R8T,          4      hT P=                  T\>        PB                  4      '       d   \        R8T,          4      hT P=                  T\>        PD                  4      '       d   \        R8T,          4      hT P!                  T TR94      hR p?ii ; i  \         d   pT P!                  T TR<4      hR p?ii ; i  \P        PT                   d   pT PW                  T TRB4      hR p?ii ; i  \P        PT                   d   pT PW                  T TRO4      hR p?ii ; i  \         d   pT P!                  T TR94      hR p?ii ; i  \n         dQ   pT P=                  T\p        Pr                  4      '       d   \        RQT,          4      hT P!                  T TRR4      hR p?ii ; i  \         d   pT P!                  T TR34      hR p?ii ; i  \         d   pT P!                  T TR44      hR p?ii ; i  \         d   pT P!                  T TR94      hR p?ii ; i  \         d   pT P!                  T TRU4      hR p?ii ; i  \         d   pT P!                  T TRX4      hR p?ii ; i  \         d   pT P!                  T TRX4      hR p?ii ; i  \         d   pT P!                  T TRU4      hR p?ii ; i  \         d   pT P!                  T TRX4      hR p?ii ; i)lNFr  z'--refresh=%s not allowed without DOMAINz'--enable-all not allowed without DOMAINz'--enable-tln not allowed without DOMAINz(--disable-tln not allowed without DOMAINz'--add-tln-ex not allowed without DOMAINz*--delete-tln-ex not allowed without DOMAINz&--enable-nb not allowed without DOMAINz'--disable-nb not allowed without DOMAINz'--enable-sid not allowed without DOMAINz(--disable-sid not allowed without DOMAINz*.zEvalue[%s] specified for --add-upn-suffix should not include with '*.'TzHvalue[%s] specified for --delete-upn-suffix should not include with '*.'z@value[%s] specified for --add-upn-suffix and --delete-upn-suffixzEvalue[%s] specified for --add-spn-suffix should not include with '*.'zHvalue[%s] specified for --delete-spn-suffix should not include with '*.'z@value[%s] specified for --add-spn-suffix and --delete-spn-suffixz1--add-upn-suffix not allowed together with DOMAINz4--delete-upn-suffix not allowed together with DOMAINz1--add-spn-suffix not allowed together with DOMAINz4--delete-spn-suffix not allowed together with DOMAINz3--enable-all not allowed together with --refresh=%sz0--enable-tln not allowed together with --refreshz1--disable-tln not allowed together with --refreshz0--add-tln-ex not allowed together with --refreshz3--delete-tln-ex not allowed together with --refreshz/--enable-nb not allowed together with --refreshz0--disable-nb not allowed together with --refreshz0--enable-sid not allowed together with --refreshz1--disable-sid not allowed together with --refreshz3--enable-tln not allowed together with --enable-allz2--enable-nb not allowed together with --enable-allz3--enable-sid not allowed together with --enable-allz6value[%s] specified for --enable-tln and --disable-tlnzAvalue[%s] specified for --add-tln-ex should not include with '*.'zDvalue[%s] specified for --delete-tln-ex should not include with '*.'z8value[%s] specified for --add-tln-ex and --delete-tln-exz4value[%s] specified for --enable-nb and --disable-nbz7value[%s] specified for --enable-sid is not a valid SIDz8value[%s] specified for --disable-sid is not a valid SIDz6value[%s] specified for --enable-sid and --disable-sidzfailed to connect lsa serverr  r  r   r  r   r  r  zThe local domain [z] is not the forest root [re   z@LOCAL_DC[%s]: netr_DsRGetForestTrustInformation() not supported.r6  z Own forest trust information...
r  zfailed to connect to SamDBzCN=Partitions,%suPNSuffixeszmsDS-SPNSuffixesz(objectClass=crossRefContainer))r  scope
expressionattrszfailed to search partition dnz#Stored uPNSuffixes attributes[%d]:
rz  ra   r{  r|  z(Stored msDS-SPNSuffixes attributes[%d]:
zBEntry already present for value[%s] specified for --add-upn-suffixz?Entry not found for value[%s] specified for --delete-upn-suffixzBEntry already present for value[%s] specified for --add-spn-suffixz?Entry not found for value[%s] specified for --delete-spn-suffixz#Update uPNSuffixes attributes[%d]:
z(Update msDS-SPNSuffixes attributes[%d]:
zfailed to update partition dnz#Stored forest trust information...
r  r  r  zItrusted domain object for domain [%s] is not marked as FOREST_TRANSITIVE.r7  z"Fresh forest trust information...
r8  z(lsaRQueryForestTrustInformation() failedz"Local forest trust information...
z8Entry not found for value[%s] specified for --enable-tlnzGEntry found for value[%s] specified for --enable-tln is already enabledz9Entry not found for value[%s] specified for --disable-tlnzIEntry found for value[%s] specified for --disable-tln is already disabledz>Entry already present for value[%s] specified for --add-tln-exz.%sz:TLN entry present for value[%s] specified for --add-tln-exz>No TLN parent present for value[%s] specified for --add-tln-exz;Entry not found for value[%s] specified for --delete-tln-exz7Entry not found for value[%s] specified for --enable-nbzFEntry found for value[%s] specified for --enable-nb is already enabledz7Entry not found for value[%s] specified for --delete-nbzHEntry found for value[%s] specified for --disable-nb is already disabledz8Entry not found for value[%s] specified for --enable-sidzGEntry found for value[%s] specified for --enable-sid is already enabledz8Entry not found for value[%s] specified for --delete-sidzIEntry found for value[%s] specified for --disable-sid is already disabledz$Updated forest trust information...
)Vr   r  
startswithlowerupperr   dom_sid
ValueError	TypeErrorr  r	   r  r@  rq   rx   r   rP   r   r   r   r  r  r  r  r{   r   r  forest_namerF  r   rE   r   r  WERR_INVALID_FUNCTIONWERR_NERR_ACFNOTLOADEDr  r   strget_config_basednsearchldb
SCOPE_BASELdbErrorr]   extendr  popMessagednMessageElementFLAG_MOD_REPLACEmodifyr  r  ry  r   r   r  r   r   r   r   rG  rH  r  r  r  r  r  r  r  r   timeLSA_TLN_DISABLED_MASKLSA_NB_DISABLED_MASKLSA_SID_DISABLED_MASKr  rl  r  endswithForestTrustRecordinsertr  ru  r  rs  )Ir   r   rl   rm   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  require_updatenr  r  r  
enable_sidr&  r  disable_sidr  r1   r  r   r  r  r  r  r  r^  own_forest_infolocal_samdblocal_partitions_dnr  msgs
stored_msgstored_upn_valsstored_spn_valsr=   replace_upnupdate_upn_valsreplace_spnupdate_spn_valsupnidxr  spn
update_msgstored_forest_infor  r  lsa_update_checknetlogon_update_tdofresh_forest_infofresh_forest_collisionrf  r  update_forest_infor  r  tln_extln_dotr_dotnbupdate_forest_collisionsI   &&&&&&&&&&&&&&&&&&&                                                      r   r  cmd_domain_trust_namespaces.run  s    JKJ M!N" OIJ?GJ?GJ>'!"#Lw#VWW"#LMM:""#LMM;!#"#MNN:""#LMM=!A%"#OPP9~!"#KLL:""#LMM>"Q&"#LMM?#a'"#MNN7|a A<<-- &'nqr'rss ! "&:"#A<<-- &'qtu'uvv $ "&#AwwyAGGI- &'ilm'mnn $  7|a A<<-- &'nqr'rss ! "&:"#A<<-- &'qtu'uvv $ "&#AwwyAGGI- &'ilm'mnn $  7|a"#VWW:""#YZZ7|a"#VWW:""#YZZ'!!%g0"#X[b#bcc:""#UVV;!#"#VWW:""#UVV=!A%"#XYY9~!"#TUU:""#UVV>"Q&"#UVV?#a'"#VWW ( !%z?Q&&'\]]y>A%&'[\\~&*&'\]]:"!%;!#!%$AwwyAGGI- &'_bc'cdd %   :"#A<<-- &'jmn'noo $ "&=!A%&A<<-- &'mpq'qrr ' "&&AwwyAGGI- &'ade'eff '   9~!!%:"!%#AwwyAGGI- &']`a'abb $  J#f"**1-C !!#& $ K$g"**1-C ""3' % :"!%;!#!%$AAv &'_bc'cdd %   "CC3#=#==..yF	V557I		] !!$"?"?ATU$
 			&++22&1188&**, 	-
 >_!%!C!C!E\&*&?&?P\&]# #..2E2Q2QQ"#6#B#B#6#B#B$D E Eh"0"R"RSfSmSmSWYZ#\" IIOO?@((-;-F-F-M-M ) OX"<<> #5s;;X;X;Z7["["$67EW"))/B035V05 * 7 "!W
 !O
*&&z-'@A O!Z/&&z2D'EFIIOOBSEYYZ$		B BC %IIOOG#oJ^^_$		B BC % "K O""?3K O""?3(A1v||~4* ,>@C,D E E )
  &&s+"  "%o6DAq1v||~4 C	 7
 ;&'hkn'noo##C(" " (A1v||~4* ,>@C,D E E )
  &&s+"  "%o6DAq1v||~4 C	 7
 ;&'hkn'noo##C(" " IIOOBSEYYZ$		B BC %IIOOG#oJ^^_$		B BC % J&MMJM,/,>,>?B?S?S?L-N
=) 141C1CODGDXDXDV2X
-.W"":.h%3%U%UViVpVpVZ\]&_"
 IIOOBC(();-;-F-F-M-M ) O	f

I%I66|7@7:7Z7Z\  			&33::&2299&**, 	-
 ..1Z1ZZZjmsstt_!%!C!C!E\&*&?&?P\&]#  !'!&.&A&A#'($&'#
h #DDEXE_E_ESE_E_EfEfEXZ "d;;L<J<V<V<?<\<\<M<L	N ' IIOOAB(():-;-G-G-N-N4J ) L '!j #

I'5'A'A'H'HI$!AA,BKBEBbBbd ' 		 FG,,-?1?1K1K1R1R - T 	b

I-99@@I99,:C:=:Z:Z\  			=>$$%6)7)C)C)J)J 	% 	L (001 779#&w< %,":'//66S@@@77a<C5555 0 (//66S===77a<C4444C5555 0 CC!"4"<"<=166S@@@&&--335D > {"#]`c#cdd%--c2883;T;TTT"#lor#rss34&&s+0&&s+11c6O6O5OO11   CC!"4"<"<=166S@@@&&--335D > {"#^ad#dee!))#.44s7Q7QQQ"#nqt#tuu34&&s+0&&s+11c6O6O5OO1&&s+11S5O5OO11 " !FC!"4"<"<=166SCCC&&--335G > "#cfl#lmmflln,GC!"4"<"<=166S@@@ 3 3 : : @ @ BBe#&'cfl'lmm''.. > {"#cfl#lmm%%'A;;AFAGAF)/A&GNN-556NN37A&'*7|$)0&M !P $FC!"4"<"<=166SCCC&&--335G > {"#`ci#ijjGNN-556KK'*7|$)0&! $$ BC!"4"<"<=166S===&&::AAGGIRXXZW > {"#\_a#abb%--c2883;S;SSS"#knp#pqq34&&s+0&&s+11c6N6N5NN11   BC!"4"<"<=166S===&&::AAGGIRXXZW > {"#\_a#abb!))#.44s7P7PPP"#mpr#rss34&&s+0&&s+11c6N6N5NN1&&s+11S5N5NN11 " CC!"4"<"<=166S===&&11S8 > {"#]`c#cdd%--c2883;T;TTT"#loq#qrr34&&s+0&&s+11c6O6O5OO11   CC!"4"<"<=166S===&&11S8 > {"#]`c#cdd!))#.44s7Q7QQQ"#nqs#stt34&&s+0&&s+11c6O6O5OO1&&s+11S5O5OO11 "	`&/&M&MlN\NhNhNQNnNnN`bc'e# 			?@$$%7)7)C)C)J)J0G 	% 	I	b

I-99@@I!*!J!J<KTKNKkKk"m 			>?$$%7)7)C)C)J)J 	% 	LG #I. f&'`cd'deef #I. g&'ade'effg(  	V((u6TUU	V  	]((u6[\\	]   _,,T5:]^^_
   \,,T5:Z[[\   h++E63Y3YZZ&'i'3(5 6 6 ++E63O3OPP&'i'3(5 6 6 ++E63P3PQQ&'i'3(5 6 6 ,,T5:fggh*   X,,T5:VWWX << W((u6UVVWz << W((u6UVVW   h,,T5:fggh  	f''x/W/WXX"#Y\b#bcc((u6dee		f"   _,,T5:]^^_
   \,,T5:Z[[\(   h,,T5:fggh   d,,T5:bccd  $ j00u>hiij(  	b((u6`aa	bF  	`((u6^__	`  	b((u6`aa	bsd  0Aw#Aw6Ax /"Ay 1Ay) Az Az5 8A~ -,A~) 4A B@	 (=B@/ >BB BB3 1BC :-BC? 2ABD% @ABE s	-BE1 t:ABF w$Aw3w6$AxxAy x(Ax;x;Ay yAy&yAy!y!Ay&y)Azy4AzzAzzAz2zAz-z-Az2z5A~ { AA};|7A};}%A};};A~ ~A~&~A~!~!A~&~)A~>AAB@.B@@B@@	B@,@B@'@'B@,@/BB
@:ABBBBB
BBB0BBB+B+BB0B3BCB>BCCBCCBC<C$BC7C7BC<C?BD"D
BDDBD"D%BED0BEEBEEBE.EBE)E)BE.E1BFE<BFFBFFBF:F"BF5F5BF:r!   )checkr  N)NNNNNFNNNNNNNNNNNNr  r)   s   @r   r  r  @  s    ))H 	W))w--0 	{=/b		
 	~lW 	 	~hU 	 	xV!	 	~hW 	 	 ;Z#	 	}X_	 	~h` 	 	~hV$	 	xW%	 	!(Kl	 	$X{t 	 	!(Kq	 	$X{y 	m:Mx J}
 }
r    r  c                       ] tR tRtRt/ t]! 4       ]R&   ]! 4       ]R&   ]! 4       ]R&   ]	! 4       ]R&   ]
! 4       ]R&   ]! 4       ]R&   ]! 4       ]R	&   R
tR# )cmd_domain_trustiI	  z#Domain and forest trust management.r  showcreater  deleter  
namespacesr!   N)r#   r$   r%   r&   r  subcommandsr  r  r  r  rv  r  r  r'   r!   r    r   r  r  I	  se    -K/1K/1K35K35K35K79K
 ; =Kr    r  )*r:   r   r  samba.getoptgetoptr   samba.ntaclsr  r   r   r   
samba.authr   samba.dcerpcr   r	   r
   r   r   	samba.netr   samba.netcmdr   r   r   r   samba.samdbr   samba.lsa_utilsr   r   r   r   r,   r  r  r  r  rv  r  r  r  r!   r    r   <module>r     s   2   
   1 1 % ? ?  D D  KS : : S
\ \~,. ,^i. iVw0 wrN0 NbX0 Xvr 2 rjF"4 FR
>| 
>r    