+
    4Ssi                        ^ RI Ht ^ RIt^ RIt^RIHt ^ RIt^ RIH	t	 ^ RI
HtHtHtHt ^ RIHt ^ RIHt ^ RIHtHtHt ^ RIHtHt ^ R	I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% R t&R t'R t(R t)Rt* ! R R]4      t+ ! R R]4      t, ! R R]4      t- ! R R]4      t. ! R R]4      t/ ! R R]4      t0 ! R R ]4      t1 ! R! R"]4      t2R# )#    N)common)system_session)CommandCommandErrorOptionSuperCommand)attr_default)SamDB)	drs_utilsnttime2stringdsdb)drsuapimisc)
join_clone)colour)get_partition_mapsget_utdv_edgesget_utdv_distancesget_utdv_summaryget_kcc_and_dsas)
get_string)get_default_backend_storec                     \         P                  ! V P                  V P                  V P                  4      w  V n        V n        V n        R#   \         d#   p\        RT P                  ,          T4      hRp?ii ; i)z'make a DRSUAPI connection to the serverzDRS connection to %s failedN)
r   drsuapi_connectserverlpcredsr   drsuapi_handlebind_supported_extensions	Exceptionr   ctxes   & 2/usr/lib/python3/dist-packages/samba/netcmd/drs.pyr   r   4   su    JKTKdKdeheoeoqtqwqwy|  zC  zC  LDHc(#*G J83::EqIIJs   A	A A:A55A:c                     \        RV P                  ,          \        4       V P                  V P                  R7      V n        R#   \         d#   p\        RT P                  ,          T4      hRp?ii ; i)z$make a ldap connection to the server	ldap://%surlsession_infocredentialsr   zLDAP connection to %s failedN)r
   r   r   r   r   samdbr    r   r!   s   & r$   samdb_connectr,   <   s]    KkCJJ6'5'7&)iiCFF<	  K9CJJFJJKs   AA A2A--A2c                0    V w  rV^ 8X  d   R# RW3,          # )z*return "was successful" or an error stringzwas successfulzfailed, result %u (%s) )werrecodeestrings   &  r$   
drs_errmsgr2   F   s"    Uz#u&666    c                   V P                  R4      pV^ ,          R8w  g   V^,          R8w  g   V^,          R8w  d   \        RV ,          4      hV^,          P                  R4      ^,          pV^,          P                  R4      ^,          pW23# )z+parse a NTDS DN returning a site and server,zCN=NTDS Settingsz
CN=ServerszCN=Siteszbad NTDS DN %s=)splitRuntimeError)ntds_dnar   sites   &   r$   drs_parse_ntds_dnr<   N   sx    cAt!!QqT\%9QqTZ=O+g566qTZZ_QFqTZZ_QD>r3   classicc                   `  a  ] tR t^[t o RtRtR]P                  R]P                  R]P                  /t
]! 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7      .tR.tR  tR! tR" tR#R#R#R#]R$3R% ltR& tR' tR( tR) tR* tR+ tR, tR-tV tR## ).cmd_drs_showreplzShow replication status.%prog [<DC>] [options]	sambaoptsversionoptscredopts--jsonz"replication details in JSON formatformatstore_constjson)helpdestactionconstz	--summaryz5summarize overall DRS health as seen from this serversummaryz--pull-summaryz:Have we successfully replicated from all relevant servers?pull_summaryz--notify-summarynotify_summaryzsHave we successfully notified all relevant servers of local changes, and did they say they successfully replicated?)rJ   rK   rI   rH   z	--classiczprint local replication detailsr=   )rH   rI   rJ   rK   defaultz-vz	--verbosez
Be verbose
store_truerH   rJ   DC?c                ~   \        VP                  4      pRVP                  RVR\        VP                  4      R\        VP                  4      RVP                  R\        VP                  4      R\        VP                  4      RR	/p V P                  P                  R
V,          \        P                  . R7        \#        TP                  4      w  rxT: RT: 2TR&   T#   \        P                   d4   pTP                  w  rVT\        P                   8X  d   RTR&    Rp?Lhh Rp?ii ; i  \$         d     T# i ; i)z8Convert an ldb neighbour object into a python dictionaryNC dnDSA objectGUIDlast attempt timelast attempt messageconsecutive failureslast successNTDS DN
is deletedFz	<GUID=%s>basescopeattrsTN\DSA)strsource_dsa_obj_guidnaming_context_dnr   last_attemptr2   result_last_attemptconsecutive_sync_failureslast_successsource_dsa_obj_dnr+   searchldb
SCOPE_BASELdbErrorargsERR_NO_SUCH_OBJECTr<   r8   )	selfndsa_objectguiddr#   errno_r;   r   s	   &&       r$   parse_neighbour cmd_drs_showrepl.parse_neighbour|   s!   Q223Q((nq~~!>"Jq/D/D$E"A$?$?M!..9s1../%	
		JJ;#?$'NN$&  (	.q/B/BCNT#'0AeH  || 	JU..."&,	  		s0   	3C" =#D- "D*7(D%$D%%D*-D<;D<c                   V P                  RVR,          ,          4       RV9   d!   V P                  RVR,          ,          4       MV P                  RVR,          ,          4       V P                  RVR,          ,          4       V P                  R	VR
,          : RVR,          : 24       V P                  RVR,          ,          4       V P                  RVR,          ,          4       V P                  R4       R# )z&print one set of neighbour informationz%srT   ra   z	%s via RPCz	NTDS DN: %srZ   z		DSA object GUID: %srU   z		Last attempt @ rV    rW   z		%u consecutive failure(s).rX   z		Last success @ %srY    N)message)rp   rs   s   &&r$   print_neighbour cmd_drs_showrepl.print_neighbour   s    TAgJ&'A:LL!E(23LL1Y<78.3C1DDE15H3I3I345K3LN 	O5-./ 	0,q/@@ARr3   c                8   \         P                  ! 4       pWn         V P                   P                  V P                  ^V4      w  rTP                   Uu. uF  qPP                  T4      NK  	  ppT#   \
         d   p\        RT,          T4      hRp?ii ; iu upi )   z"DsReplicaGetInfo of type %u failedN)	r   DsReplicaGetInfoRequest1	info_typeDsReplicaGetInfor   r    r   arrayrv   )rp   r   req1infor#   rq   repss   &&     r$   get_neighbourscmd_drs_showrepl.get_neighbours   s    //1"	T $ = =##Q!.Y
 26<A$$Q'<	  	TCiOQRSS	T =s   )A1 B1B<BBNFc           
        VP                  4       V n        Vf!   \        P                  ! V P                  4      pWn        VP                  V P                  RR7      V n        W`n        RV P                  RV P                  RV P                  RV P                  RV P                  /P                  V4      pVf   \        RV,          4      hV! 4       # )	NTfallback_machinerL   rN   rM   rG   r=   zunknown showrepl format %s)get_loadparmr   r   netcmd_dnsnamer   get_credentialsr   verbosesummary_outputnotify_summary_outputpull_summary_outputjson_outputclassic_outputgetr   )rp   DCrA   rC   rB   rE   r   output_functions   &&&&&&& r$   runcmd_drs_showrepl.run   s     ((*:&&tww/B--dgg-M
 t**d88D44D$$t**
 #f+ 	 ";fDEE  r3   c                v    V P                  4       pVR  VR \        P                  ! WP                  ^R7       R# )r;   r   indentN)get_local_repl_datarG   dumpoutf)rp   datas   & r$   r   cmd_drs_showrepl.json_output   s0    '')LN		$		!,r3   c                ^   . p. pV P                  4       pVR8w  dQ   VR,           FC  pVR,          '       d   K  VR,          ^ 8w  g   VR,          ^ 8X  g   K2  VP                  V4       KE  	  VR8w  dQ   VR,           FC  pVR,          '       d   K  VR,          ^ 8w  g   VR,          ^ 8X  g   K2  VP                  V4       KE  	  V'       g	   V'       d   V P                  \        P                  ! R4      4       V'       d@   V P                  \        P                  ! R	4      4       V F  pV P                  V4       K  	  V'       d@   V P                  \        P                  ! R
4      4       V F  pV P                  V4       K  	  ^# V P                  \        P                  ! R4      4       R# )z[Print a short message if every seems fine, but print details of any
links that seem broken.rM   repsTor[   rX   rY   rN   repsFromzThere are failing connectionszFailing outbound connections:zFailing inbound connection:z
[ALL GOOD]N)r   appendr{   r   c_REDr|   c_GREEN)rp   typeof_outputfailing_repstofailing_repsfrom
local_datareps   &&    r$   summary_output_handler'cmd_drs_showrepl.summary_output_handler   sZ    --/
N*!(++|$$-.!3s>7Ja7O"))#.	 , ,,!*--|$$-.!3s>7Ja7O$++C0	 . -LL&EFGV\\*IJK)C((- *V\\*GHI+C((- , V^^L12r3   c                $    V P                  R 4      # )rL   r   rp   s   &r$   r   cmd_drs_showrepl.summary_output   s    **955r3   c                $    V P                  R 4      # )rN   r   r   s   &r$   r   &cmd_drs_showrepl.notify_summary_output   s    **+;<<r3   c                $    V P                  R 4      # )rM   r   r   s   &r$   r   $cmd_drs_showrepl.pull_summary_output   s    **>::r3   c                   \        V 4       \        V 4       V P                  P                  4       p\	        V4      w  r# V P                  P                  V\        P                  . ROR7      pR \        \        T^ ,          R ^ 4      4      R\        T P                  P                  RT^ ,          R,          ^ ,          4      4      R\        T P                  P                  RT^ ,          R,          ^ ,          4      4      /pT P                  P                  TRR7      pT P                  \        P                   4      pT P                  \        P"                  4      p	. p
T EFd  p\%        TR,          ^ ,          4      P'                  R	4      w  rpR
\%        TR
,          4      R\%        TR,          ^ ,          4      R \        \        TR ^ 4      4      R\        \        TRR4      4      P)                  4       R8H  /pT
P+                  T4        T P                  P                  T\        P                  R.R7      p\%        T^ ,          R,          ^ ,          4      TR&   . TR&   TP7                  R. 4       FN  p\%        T4      P9                  R4      pTR,          P+                  T^,          \        T^,          4      34       KP  	  EKg  	  RTRTRT	RT
RTRT/#   \         d   p\        RT,          4      hRp?ii ; i  \        P,                   d4   pTP.                  w  ppT\        P0                  8X  d   RTR&    Rp?LRp?i\2        \4        3 d     Li ; i)options
objectGUIDinvocationIdr\   zFailed to search NTDS DN %sNz(objectClass=nTDSConnection))r]   
expression
fromServerr5   name	remote DNenabledenabledConnectionTRUEdnsHostNamedns nameTr[   replicates NCzmS-DS-ReplicatesNCReason:dsar   r   NTDSConnectionsr;   r   )r   r   r   )r   r,   r+   get_dsServiceNamer<   rj   rk   rl   r    r   intr	   r   schema_format_valuer   r   !DRSUAPI_DS_REPLICA_INFO_NEIGHBORSDRSUAPI_DS_REPLICA_INFO_REPSTOrb   	partitionupperr   rm   rn   ro   KeyError
IndexErrorr   r7   )rp   r9   r;   r   ntdsr#   dsa_detailsconnrepsfromrepstoconn_detailscc_rdnsepc_server_dnrs   c_server_resrt   ru   rr:   s   &                    r$   r   $cmd_drs_showrepl.get_local_repl_data  s   d **..0*73	H::$$'Ox$yD
 s<QA>?*TZZ%C%Cd1gl3A6&8 9Jtzz'E'Ed1gn5a8(: ;	
 zz  g:X Y&&w'P'PQ$$W%K%KLA&)!L/!*<&=&G&G&L#EAfIS<!343|Ay!<=J|A7J)/(1 227%'VD	A "
#zz00k7:~~8E  1  H !$LOM$B1$E F* "$AoUU5r:FLL%/"))1Q4QqT*;< ;1 : ;f|Df
 	
Y  	H<wFGG	H@ << +VV
C222&*AlOj) s<   .K 
AK;K8!K33K8;M)L>>MMMc                   V P                  4       pVR ,          pVR,          pVR,          pVR,          pVR,          pVR,          pV P                  V: RV: 24       V P                  RVR,          ,          4       V P                  R	VR
,          ,          4       V P                  RVR,          ,          4       V P                  R4       V F  pV P                  V4       K  	  V P                  R4       V F  pV P                  V4       K  	  . R#Op	V P                  R4       V EF  p
V P                  R4       V
P                  R4      '       d   V P                  R4       V P                  RV
R,          ,          4       V P                  R\	        V
R,          4      P                  4       ,          4       V P                  RV
P                  R4      ,          4       V P                  RV
R,          ,          4       V P                  R4       V P                  RV
R,          ,          4       V
R,          '       d   V
R,           Fv  w  rV P                  RV,          4       V P                  RV,          4       V	 F;  p\        \        V^ 4      V,          '       g   K#  V P                  R V,          4       K=  	  Kx  	  EK  V P                  R!4       EK  	  R"# )$r   r   r   r   r;   r   r`   zDSA Options: 0x%08xr   zDSA object GUID: %sr   zDSA invocationId: %s
r   z==== INBOUND NEIGHBORS ====
z==== OUTBOUND NEIGHBORS ====
z!==== KCC CONNECTION OBJECTS ====
zConnection --r[   z'	WARNING: Connection to DELETED server!z	Connection name: %sr   z	Enabled        : %sr   z	Server DNS name : %sr   z	Server DN name  : %sr   z		TransportType: RPCz		options: 0x%08Xr   z		ReplicatesNC: %sz		Reason: 0x%08xz			%sz)Warning: No NC replicated for Connection!N)
NTDSCONN_KCC_GC_TOPOLOGYNTDSCONN_KCC_RING_TOPOLOGY#NTDSCONN_KCC_MINIMIZE_HOPS_TOPOLOGY#NTDSCONN_KCC_STALE_SERVERS_TOPOLOGY,NTDSCONN_KCC_OSCILLATING_CONNECTION_TOPOLOGY"NTDSCONN_KCC_INTERSITE_GC_TOPOLOGYNTDSCONN_KCC_INTERSITE_TOPOLOGY%NTDSCONN_KCC_SERVER_FAILOVER_TOPOLOGY#NTDSCONN_KCC_SITE_FAILOVER_TOPOLOGY&NTDSCONN_KCC_REDUNDANT_SERVER_TOPOLOGY)r   r{   r|   r   rb   r   getattrr   )rp   r   r   r   r   r   r;   r   rq   reasonsrs   ncreasonss   &             r$   r   cmd_drs_showrepl.classic_output@  sA   '')5k
#h-.F|hv./*[-CCD*[-FFG-N0KKL45A  #  	56A  # 	= 	9:ALL)uu\""GHLL01V9<=LL03q|3D3J3J3LLMLL1AEE*4EEFLL1AkNBCLL12LL.9=>!!"#O"4"4JBLL!7"!<=LL!5!>?$"4A.77 LLa8 % #5 HI) r3   )r   r   r   r   )__name__
__module____qualname____firstlineno____doc__synopsisr   SambaOptionsVersionOptionsCredentialsOptionstakes_optiongroupsr   DEFAULT_SHOWREPL_FORMATtakes_options
takes_argsrv   r|   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell____classdict__s   @r$   r?   r?   [   s%    "'H 	W))w--G.. 	xB]&	B{ #5])	E 	 (D].	J 	!-%H#	%
 	{!B]).	0 	t[|LI#M( J>
 Tt*!.-#3J6=;=
~6J 6Jr3   r?   c                      a  ] tR tRt o RtRtR]P                  R]P                  R]P                  /t
R.tRR	 ltR
tV tR# )cmd_drs_kcciy  z)Trigger knowledge consistency center run.r@   rA   rB   rC   rR   Nc                   VP                  4       V n        Vf!   \        P                  ! V P                  4      pWn        VP                  V P                  RR7      V n        \        V 4       \        P                  ! 4       p V P                  P                  V P                  ^V4       T P                  RT,          4       R #   \         d   p\        RT4      hR p?ii ; i)NTr   zDsExecuteKCC failedz#Consistency check on %s successful.)r   r   r   r   r   r   r   r   r   DsExecuteKCC1DsExecuteKCCr   r    r   r{   )rp   r   rA   rC   rB   r   r#   s   &&&&&  r$   r   cmd_drs_kcc.run  s     ((*:&&tww/B--dgg-M
$$&	9LL%%d&9&91dC 	:R?@  	94a88	9s   'C C CC r   r   r   NNNNr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r$   r  r  y  sM     3'H 	W))w--G.. JA Ar3   r  c                   4  a  ] tR tRt o RtRtR]P                  R]P                  R]P                  /t
. ROt]! RRR	R
7      ]! RRR	R
7      ]! RRR	R
7      ]! RRR	R
7      ]! RRR	R
7      ]! RRR	R
7      ]! RRR	R
7      ]! RRR	R
7      .tRR ltRR ltRtV tR# ) cmd_drs_replicatei  z+Replicate a naming context between two DCs.z/%prog <destinationDC> <sourceDC> <NC> [options]rA   rB   rC   z	--add-refz&use ADD_REF to add to repsTo on sourcerP   rQ   z--sync-forcedz,use SYNC_FORCED to force inbound replicationz
--sync-allz&use SYNC_ALL to replicate from all DCsz--full-synczresync all objectsz--localzIpull changes directly into the local database (destination DC is ignored)z--local-onlinez_pull changes into the local database (destination DC is ignored) as a normal online replicationz
--async-opz use ASYNC_OP for the replicationz--single-objectz\Replicate only the object specified, instead of the whole Naming Context (only with --local)c           
     D   Wn         \        V 4       \        \        4       RV P                  V P
                  ^ R7      V n        \        RV P                   ,          \        4       V P                  V P
                  R7      V n        V P                  P                  R\        P                  R.R7      pV^ ,          R,          ^ ,          V n        V P                  P                  V P                  \        P                  R.R7      p\        P                  ! V P                  P                  RV^ ,          R,          ^ ,          4      4      V n        \        P                  ! V P                  P!                  4       4      p\        P                  ! V P                  P!                  4       4      pV P                  p	\"        P$                  p
V'       d   \"        P&                  p
R	pV P                  P)                  4        \*        P,                  ! R
V P                   ,          V P
                  V P                  V P                  V4      pV P                  P/                  4       p VP1                  VVV	VVV
VR7      w  rT P                  P7                  4        T'       d2   T P9                  RYTT P                  P:                  3,          4       R# T P9                  RYTT P                  P:                  3,          4       R#   \2         d   p\5        RT,          T4      hRp?ii ; i)z+replicate from a source DC to the local SAMN)r)   r(   r*   r   flagsr&   r'   rz   dsServiceNamer\   r   Tzncacn_ip_tcp:%s[seal])rodc	full_syncexopsync_forcedzError replicating DN %szMFull Replication of all %d objects and %d links from %s to %s was successful.zPIncremental replication of %d objects and %d links from %s to %s was successful.)r   r   r
   r   r   r   local_samdbr+   rj   rk   rl   r9   r   GUIDr   	ntds_guidget_invocation_idr   DRSUAPI_EXOP_NONEDRSUAPI_EXOP_REPL_OBJtransaction_startr   drs_Replicateam_rodc	replicater    r   transaction_commitr{   r(   )rp   	SOURCE_DCNCr  single_objectr  ressource_dsa_invocation_iddest_dsa_invocation_iddestination_dsa_guidr  replr  num_objects	num_linksr#   s   &&&&&&          r$   drs_local_replicate%cmd_drs_replicate.drs_local_replicate  s   
   !n.>D-1ZZDGG'(* {T[[8(6(8'+zzdgg?

 %%2S^^-<,= & ?1vo.q1%%4<<s~~-9N & <JJ**<+.q6,+?+BDE $(99TZZ-I-I-K#L !%4+;+;+M+M+O!P#~~((00DI

$$&&&'>'L'+ww'+zz43C3C'=? '')		B'+~~b6N6J;?@I;?BM (6 (O$[ 	

%%'LL 9%)**..00 1
 LL 9%)**..00 1  	B82=qAA	Bs   K< <LLLNc           	        Wn         VP                  4       V n        VP                  V P                  R R7      V n        V'       d   V P                  W#VVVR7       R# V	'       d9   \        P                  ! RV P                  R7      p\        P                  ! 4       pM#\        V 4       V P                  pV P                  pV
'       g   RVn        \        V 4       V P                  P                  V P                  P                  4       R\         P"                  ! V4      : R\         P"                  ! V4      : R2. R	7      p\%        V4      ^ 8X  d   \'        R
V,          4      hV^ ,          R,          pV P                  P                  V\         P(                  RRR.R7      p\%        V4      ^ 8X  d   \'        RV,          4      hV^ ,          R,          ^ ,          p\+        \-        VR^ 4      4      p^ pV\.        P0                  ,          '       g   V\        P2                  ,          pV'       d   V\        P4                  ,          pV'       d   V\        P6                  ,          pV'       d   V\        P8                  ,          pV'       d   V\        P:                  ,          pV
'       d   V\        P<                  ,          p \>        P@                  ! VVVVV4       T
'       d   T PE                  RT: RT: R24       R# T PE                  RT: RT: R24       R#   \>        PB                   d   p\'        RT4      hRp?ii ; i)Tr   )r  r  r  Nzirpc:dreplsrv)lp_ctxz!(&(objectCategory=server)(|(name=z)(dNSHostName=z))))r]   r   r_   zFailed to find source DC %sdnz5(|(objectCategory=nTDSDSA)(objectCategory=nTDSDSARO))r   r   )r]   r^   r   r_   z Failed to find source NTDS DN %szDsReplicaSync failedzReplicate from z to z was started.z was successful.i,  )#r   r   r   r   r   r'  r   r   policy_handler   r   request_timeoutr,   r+   rj   get_config_basednrk   binary_encodelenr   SCOPE_ONELEVELr   r	   r   $DS_NTDSDSA_OPT_DISABLE_OUTBOUND_REPLDRSUAPI_DRS_WRIT_REPDRSUAPI_DRS_ADD_REFDRSUAPI_DRS_SYNC_FORCEDDRSUAPI_DRS_SYNC_ALLDRSUAPI_DRS_FULL_SYNC_NOWDRSUAPI_DRS_ASYNC_OPr   sendDsReplicaSyncdrsExceptionr{   )rp   DEST_DCr  r  add_refr  sync_allr  locallocal_onlineasync_opr  rA   rC   rB   server_bindserver_bind_handlemsg	server_dnsource_dsa_guiddsa_optionsreq_optionsestrs   &&&&&&&&&&&&&&&        r$   r   cmd_drs_replicate.run  s   
 ((*--dgg-M
$$Yi3@1< % > !///$''JK!%!3!3!5D!,,K!%!4!4*0K'd jjTZZ%A%A%Ci(i(,* ')	   *
 s8q=<yHIIF4L	jjYc6H6H+b'3Y&?   A s8q=AIMNNa&.q1,sIq9:dGGGG7777K7666K7:::K7777K7<<<K7777K	=''5GZ\^ij LL9gVWLLiQXYZ %% 	=5t<<	=s   L M2L>>M)r   r  r   r9   r  r+   r   )r;  r  r  )FFF)FFFFFFFFNNN)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r'  r   r   r   r   s   @r$   r
  r
    s     5@H 	W))w--G.. 0J 	{!IR^_%S\hi|"JS_`}#7Myjs  	A  'H  Q]  	^|"D\Z   (F  O[  	\	MD1LE[ E[r3   r
  c                      a  ] tR tRt o RtRtR]P                  R]P                  R]P                  /t
R.tRR	 ltR
tV tR# )cmd_drs_bindi@  z"Show DRS capabilities of a server.r@   rA   rB   rC   rR   Nc           
        VP                  4       V n        Vf!   \        P                  ! V P                  4      pWn        VP                  V P                  RR7      V n        \        V 4       \        P                  ! 4       p^Vn
        \        P                  ! 4       Vn        V P                  P                  \        P                  ! \        P                   4      V4      w  rg. RNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*NR+NR,NR-NR.NR/NR0NR1Np. R2Op	V P#                  RV,          4       V P#                  R4       V F]  w  r\%        \        V
^ 4      pVP                  P&                  V,          '       d   RpMRpV P#                  RV
:R R	V: R
V: R24       K_  	  \)        VP                  \        P*                  4      '       du   V P#                  R4       V	 F]  w  r\%        \        V
^ 4      pVP                  P,                  V,          '       d   RpMRpV P#                  RV
:R R	V: R
V: R24       K_  	  V P#                  RVP                  P.                  ,          4       V P#                  RVP                  P0                  ,          4       \)        VP                  \        P*                  4      '       d/   V P#                  RVP                  P2                  ,          4       R # R # )3NTr   zBind to %s succeeded.zExtensions supported:YeszNo   60: z ()z
Extended Extensions supported:z
Site GUID: %szRepl epoch: %uzForest GUID: %s) DRSUAPI_SUPPORTED_EXTENSION_BASEDRS_EXT_BASE)-DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATIONDRS_EXT_ASYNCREPL)%DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPIDRS_EXT_REMOVEAPI)&DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2DRS_EXT_MOVEREQ_V2)+DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESSDRS_EXT_GETCHG_DEFLATE)%DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1DRS_EXT_DCINFO_V1)4DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION DRS_EXT_RESTORE_USN_OPTIMIZATION)$DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYDRS_EXT_ADDENTRY)'DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTEDRS_EXT_KCC_EXECUTE)'DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2DRS_EXT_ADDENTRY_V2)4DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION DRS_EXT_LINKED_VALUE_REPLICATION)%DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2DRS_EXT_DCINFO_V2)8DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD$DRS_EXT_INSTANCE_TYPE_NOT_REQ_ON_MOD)'DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BINDDRS_EXT_CRYPTO_BIND))DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFODRS_EXT_GET_REPL_INFO)-DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTIONDRS_EXT_STRONG_ENCRYPTION)&DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01DRS_EXT_DCINFO_VFFFFFFFF)1DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIPDRS_EXT_TRANSITIVE_MEMBERSHIP)+DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORYDRS_EXT_ADD_SID_HISTORY)&DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3DRS_EXT_POST_BETA3)(DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V5DRS_EXT_GETCHGREQ_V5),DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2DRS_EXT_GETMEMBERSHIPS2)(DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6DRS_EXT_GETCHGREQ_V6))DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCSDRS_EXT_NONDOMAIN_NCS)(DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8DRS_EXT_GETCHGREQ_V8)*DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5DRS_EXT_GETCHGREPLY_V5)*DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6DRS_EXT_GETCHGREPLY_V6),DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3DRS_EXT_WHISTLER_BETA3)*DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7r  ))DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECTr  )+DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESSDRS_EXT_W2K3_DEFLATE))DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V10DRS_EXT_GETCHGREQ_V10)*DRSUAPI_SUPPORTED_EXTENSION_RESERVED_PART2*DRS_EXT_RESERVED_FOR_WIN2K_OR_DOTNET_PART2)*DRSUAPI_SUPPORTED_EXTENSION_RESERVED_PART3*DRS_EXT_RESERVED_FOR_WIN2K_OR_DOTNET_PART3)) DRSUAPI_SUPPORTED_EXTENSION_ADAMDRS_EXT_ADAM)$DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2DRS_EXT_LH_BETA2)'DRSUAPI_SUPPORTED_EXTENSION_RECYCLE_BINDRS_EXT_RECYCLE_BIN)r   r   r   r   r   r   r   r   r   DsBindInfoCtrlengthDsBindInfo28r   DsBindr   r  DRSUAPI_DS_BIND_GUIDr{   r   supported_extensions
isinstanceDsBindInfo48supported_extensions_ext	site_guid
repl_epochconfig_dn_guid)rp   r   rA   rC   rB   	bind_infor   handleoptmap
optmap_extoptrb   optvalyesnos   &&&&&         r$   r   cmd_drs_bind.runM  sz    ((*:&&tww/B--dgg-M
))+		 --/	,,TYYw7S7S-TV_`#
@#
R#
 K#
 M	#

 V#
 K#
 i#
 I#
 O#
 O#
 i#
 K#
 q#
 O#
 S#
  [!#
" S##
$ c%#
& W'#
( M)#
* Q+#
, X-#
. Q/#
0 S1#
2 Q3#
4 U5#
6 U7#
8 W9#
: U;#
< T=#
> T?#
@ SA#
B iC#
D iE#
JP

 	,r12,- JSWc1-Fyy--66LLsE3?@ ! dii!5!566LL;<(
 #q19955>>!E!E3sCD ) 	&)<)<<=%		(<(<<=dii!5!566LL*TYY-E-EEF 7r3   r  r  r  r   s   @r$   rK  rK  @  sO     ,'H 	W))w--G.. JQG QGr3   rK  c                      a  ] tR tRt o RtRtR]P                  R]P                  R]P                  /t
R.t]! RR	R
RR7      .tR^R^R^R^/tRR ltRtV tR# )cmd_drs_optionsi  zJQuery or change 'options' for NTDS Settings object of a Domain Controller.r@   rA   rB   rC   rR   z--dsa-optionzDSA option to enable/disablerb   za{+|-}IS_GC | {+|-}DISABLE_INBOUND_REPL | {+|-}DISABLE_OUTBOUND_REPL | {+|-}DISABLE_NTDSCONN_XLATE)rH   typemetavarIS_GCDISABLE_INBOUND_REPLDISABLE_OUTBOUND_REPLDISABLE_NTDSCONN_XLATENc                   VP                  4       V n        Vf!   \        P                  ! V P                  4      pWn        VP                  V P                  RR7      V n        \        V 4       V P                  P                  4       pV P                  P                  V\        P                  R.R7      p\        V^ ,          R,          ^ ,          4      pV P                   U	u. uF&  qP                  V	,          V,          '       g   K$  V	NK(  	  p
p	V P                  RRP!                  V
4      ,           4       V'       Ed   VR,          R9  d   \#        R	V,          4      hVR
,          pWP                  P%                  4       9  d   \#        R	V,          4      hVR,          R8X  d   WP                  V,          ,          pMWP                  V,          ( ,          p\        P&                  ! 4       p\        P(                  ! V P                  V4      Vn        \        P,                  ! \/        V4      \        P0                  R4      VR&   V P                  P3                  V4       V P                   U	u. uF&  qP                  V	,          V,          '       g   K$  V	NK(  	  p
p	V P                  RRP!                  V
4      ,           4       R # R # u up	i u up	i )NTr   r   r\   zCurrent DSA options: z, :Nr   N+zUnknown option %s:r   NNzNew DSA options: )r  -)r   r   r   r   r   r   r   r,   r+   r   rj   rk   rl   r   
option_mapr{   joinr   keysMessageDnr+  MessageElementrb   FLAG_MOD_REPLACEmodify)rp   r   
dsa_optionrA   rC   rB   r9   r   dsa_optsxcur_optsflagms   &&&&&&       r$   r   cmd_drs_options.run  s    ((*:&&tww/B--dgg-M
d**..0jjWCNN9+Vs1vi(+,  $P!//!2Dx2O2OAAP,tyy/BBC :"~Z/"#6#CDDb>D??//11"#6#CDD"~$OOD11__T222A66$**g.AD--c(mS=Q=QS\]AiLJJa #'??T?aooa6H86S6S?HTLL,tyy/BBC# 	 Q( Us   "!K
K
1!KKr  )NNNNN)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r   r   s   @r$   r  r    s     T'H 	W))w--G.. J 	~$Bz	|M
 :(*):*J8J
%D %Dr3   r  c                   $  a  ] tR tRt o RtRtR]P                  R]P                  R]P                  /t
]! RR]R	7      ]! R
R]R	7      ]! RRRRR7      ]! RRRR7      ]! RRRRR.R]! 4       ,          R7      ]! RRRR"R7      .tR.tR#R  ltR!tV tR# )$cmd_drs_clone_dc_databasei  z9Replicate an initial clone of domain, but DO NOT JOIN it.z%prog <dnsdomain> [options]rA   rB   rC   z--serverz
DC to join)rH   r  z--targetdirz#where to store provision (required)z-qz--quietzBe quietrP   rQ   z--include-secretszAlso replicate secret valuesz--backend-storechoiceBACKENDSTOREtdbmdbz7Specify the database backend to be used (default is %s))r  r  choicesrH   z--backend-store-sizebytesSIZE)r  r  rH   domainNc                    VP                  4       pVP                  V4      pV P                  WR 7      pVf   \        R4      h\	        WWVRWiV
VR7
       R# ))r   quietNz$--targetdir option must be specifiedSAMBA_INTERNAL)
loggerr   r   r   r  dns_backend	targetdirinclude_secretsbackend_storebackend_store_size)r   r   
get_loggerr   r   )rp   r  rA   rC   rB   r   r  r  r   r  r  r  r   r   r  s   &&&&&&&&&&&&   r$   r   cmd_drs_clone_dc_database.run  s_     ##%((,>EFF&u .>&!.&8		:r3   r.   zeSpecify the size of the backend database, currentlyonly supported by lmdb backends (default is 8 Gb).)
NNNNNFFFNN)r   r   r   r   r   r   r   r   r   r   r   r   rb   r   r   r   r   r   r   r   s   @r$   r  r    s     C,H 	W))w--G.. 	z37}#HsStYZE")GP\] xu~&(A(CD	E 	%GVI	JM J: :r3   r  c                   
  a  ] tR tRt o RtRtR]P                  R]P                  R]P                  /t
]! RRR	R
RR7      ]! RRRR7      ]! RRRR7      ]! RRRR7      ]! RRRR7      ]! RRRR7      .tR tR tR R ltRtV tR# )!cmd_drs_uptodatenessi  zShow uptodateness statusz%prog [options]rA   rB   rC   z-Hz--URLURLHz%LDB URL for database or target server)r  rI   rH   z-pz--partitionzrestrict to this partition)rH   rD   rP   zPrint data in json format)rJ   rH   z	--maximumz#Print maximum out-of-date-ness onlyz--medianz"Print median out-of-date-ness onlyz--fullz Print full out-of-date-ness datac                2    \         P                  ! V^R7      # )   r   )rG   dumps)rp   partitions_summariess   &&r$   format_as_json#cmd_drs_uptodateness.format_as_json(  s    zz.q99r3   c                   . pVP                  4        FY  w  r4VP                  4        UUu. uF  w  rVV: R V: 2NK  	  pppV:R RRP                  V4      : 2pVP                  V4       K[  	  RP                  V4      # u uppi )rP  15ry   rN  
)itemsr  r   )	rp   r  lines	part_namerL   kvr  lines	   &&       r$   format_as_text#cmd_drs_uptodateness.format_as_text+  st    "6"<"<">I3:==?C?41A&?EC!*DIIe,<=DLL #? yy Ds   BNc                   VP                  4       pVP                  VR R7      p\        WV4      w  rVP                  p\	        V4      w  ppV'       d(   VV9   d   VV,          pVV/pM\        RV,          4      h. pV'       d   VP                  R4       V'       d   VP                  R4       / p/ pVP                  4        F6  w  pp\        WVW4      p\        VV4      p\        VVR7      pVVV&   VVV&   K8  	  V'       d   V P                  V4      pM+V'       d   V P                  V4      pMV P                  V4      p\        VV P                  R7       R# )Tr   zunknown partition %smaximummedian)filters)fileN)r   r   r   r+   r   r   r   r  r   r   r   r  r  printr   )rp   r  r   rG   r  r  fullrA   rC   rB   r  r   r   r   	local_kccdsasr+   short_partitionsru   part_dnr  partitions_distancesr  r  
utdv_edges	distancesrL   outputs   &&&&&&&&&&&&                r$   r   cmd_drs_uptodateness.run3  sL   
 ##%((d(C*1%8	07!,,*95$-w#7 "#9I#EFFNN9%NN8$!!"2"8"8":Iw'	"LJ*:t<I&y'BG.7 +.5 + #; (()=>F,,-AB,,-ABf499%r3   r.   )NNFFFFNNNFF)r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r   r   r   r   s   @r$   r  r    s     " H 	W))w--G.. 	tWe#;	=t]0	2x/	1{<9	;z,8	:x6	8M: *& *&r3   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_drsi`  z0Directory Replication Services (DRS) management.bindkccr  showreplr   zclone-dc-databaseuptodatenessr.   N)r   r   r   r   r   subcommandsrK  r  r
  r?   r  r  r  r   r.   r3   r$   r  r  `  sd    :K&.K$K02K.0K
,.K	'@'BK#$"6"8Kr3   r  )3samba.getoptgetoptr   rk   loggingrz   r   rG   
samba.authr   samba.netcmdr   r   r   r   samba.netcmd.commonr	   samba.samdbr
   sambar   r   r   samba.dcerpcr   r   
samba.joinr   r   samba.uptodatenessr   r   r   r   r   samba.commonr   r   r   r,   r2   r<   r   r?   r  r
  rK  r  r  r  r  r.   r3   r$   <module>r     s   ,  
    %  -  0 0 & !   $ 1JK7 $ [Jw [J|A' ABc[ c[L^G7 ^GB<Dg <D~+: +:\O&7 O&d
9l 
9r3   