+
    4SsiB7  ã                   óp  € R t Rt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t  ! R R]4      t
R tR tR	 tRR
 lt^tR tR tR tR tR tR t]P.                  ! R4      t]P.                  ! R]P2                  R7      tRR ltR t]P:                  t]P<                  t]P>                  t]P@                  t ]PB                  t!]PD                  t"]PF                  t#]PH                  t$]PJ                  t%]PL                  t&]PN                  t']PP                  t(]PR                  t)]PT                  t*]PV                  t+]PX                  t,]PZ                  t-]P\                  t.]P^                  t/]P`                  t0]Pb                  t1]Pd                  t2]Pf                  t3]Ph                  t4]Pj                  t5R# )zSamba 4.ÚrestructuredTextN)Ú_glue)ÚLdbc                   ó~   a € ] tR t^"t o RtRR ltRR]P                  3R ltR t	R t
R tR tRR	 ltRR
 ltRtV tR# )r   a  Simple Samba-specific LDB subclass that takes care
of setting up the modules dir, credentials pointers, etc.

Please note that this is intended to be for all Samba LDB files,
not necessarily the Sam database. For Sam-specific helper
functions see samdb.py.
Nc                óN  € Ve   V P                  V4       MKV P                  \        P                  P                  \        P
                  P                  4       R4      4       Ve   V P                  V4       Ve   V P                  V4       Ve   V P                  V4       V P                  4        R pV P                  4        Ve5   VP                  R4      p	V	e    V	'       d   V\        P                  ,          pV P                  R4       Ve   V P!                  WV4       R# R# )a  Opens a Samba Ldb file.

:param url: Optional LDB URL to open
:param lp: Optional loadparm object
:param modules_dir: Optional modules directory
:param session_info: Optional session information
:param credentials: Optional credentials, defaults to anonymous.
:param flags: Optional LDB flags
:param options: Additional options (optional)

This is different from a regular Ldb file in that the Samba-specific
modules-dir is used by default and that credentials and session_info
can be passed through (required by some modules).
NÚldbc                 ó   € \        V4       R # ©N)Úprint)ÚlÚtexts   &&Ú0/usr/lib/python3/dist-packages/samba/__init__.pyÚmsgÚLdb.__init__.<locals>.msgP   s	   € Ü�$ŽKó    z
ldb:nosynci€  )Úset_modules_dirÚosÚpathÚjoinÚsambaÚparamÚmodules_dirÚset_session_infoÚset_credentialsÚset_loadparmÚregister_samba_handlersÚset_utf8_casefoldÚgetr   Ú
FLG_NOSYNCÚset_create_permsÚconnect)
ÚselfÚurlÚlpr   Úsession_infoÚcredentialsÚflagsÚoptionsr   Únosync_ps
   &&&&&&&&  r   Ú__init__ÚLdb.__init__+   sï   € ð" Ò"Ø× Ñ  Õ-à× Ñ ¤§¡§¡¬e¯k©k×.EÑ.EÓ.GÈÓ!OÔPàÒ#Ø×!Ñ! ,Ô/àÒ"Ø× Ñ  Ô-àŠ>Ø×Ñ˜bÔ!ð
 	×$Ñ$Ô&ò	ð 	×ÑÔ ð Š>Ø—v‘v˜lÓ+ˆHØÒ#¯ØœŸ™Õ'�à×Ñ˜eÔ$àŠ?Ø�L‰L˜ WÖ-ñ r   c                ó  € V P                  W$W1.4      p\        V4      ^8w  g   V^ ,          V,          f   R# \        V^ ,          V,          4      p\        V4      ^8X  g   Q hV P                  WP	                  4       4      # )a  Search for one attribute as a string.

:param basedn: BaseDN for the search.
:param attribute: Name of the attribute
:param expression: Optional search expression.
:param scope: Search scope (defaults to base).
:return: Value of attribute as a string or None if it wasn't found.
N)ÚsearchÚlenÚsetÚschema_format_valueÚpop)r!   Ú	attributeÚbasednÚ
expressionÚscopeÚresÚvaluess   &&&&&  r   Ú	searchoneÚLdb.searchonea   sn   € ð �k‰k˜&¨°[ÓAˆÜˆs‹8�qŒ=˜C �F 9Õ-Ò5ÙÜ�S˜•V˜IÕ&Ó'ˆÜ�6‹{˜aÔÐÐØ×'Ñ'¨	·:±:³<Ó@Ð@r   c                ó¸  €  V P                  V\        P                  . RR7      p T F   pT P                  TP                  R.4       K"  	  R#   \        P                   d0   pTP                  w  rET\        P
                  8X  d    Rp?R# h Rp?ii ; i  \        P                   d0   pTP                  w  rET\        P
                  8w  d   h  Rp?R# Rp?ii ; i)z¼Erases user and computer objects from our AD.

This is needed since the 'samldb' module denies the deletion of primary
groups. Therefore all groups shouldn't be primary somewhere anymore.
z+(|(objectclass=user)(objectclass=computer)))Úbaser4   Úattrsr3   Núrelax:0)r,   r   ÚSCOPE_SUBTREEÚLdbErrorÚargsÚERR_NO_SUCH_OBJECTÚdeleteÚdn)r!   rB   r5   ÚerrorÚerrnoÚestrr   s   &&     r   Úerase_users_computersÚLdb.erase_users_computersr   s¸   € ð		Ø—+‘+ 2¬S×->Ñ->ÀbØ)Vð ó XˆCð	Û�Ø—‘˜CŸF™F Y KÖ0ó øô �|‰|ô 	Ø!ŸJ™J‰MˆUØœ×.Ñ.Ô.åàûð	ûô �|‰|ô 	Ø!ŸJ™J‰MˆUØœ×.Ñ.Ô.àõ /ûð	ús4   ‚#A ¦&B ÁBÁ##BÂBÂBÂCÂ*$CÃCc                óˆ  € RpV P                  V4       V P                  V\        P                  R. RR.R7       F!  p V P	                  VP
                  R.4       K#  	  V P                  V\        P                  R. RR.R7      p\        V4      ^ 8X  g   Q hR F  p V P	                  VR.4       K  	  R#   \        P                   d0   pTP                  w  rET\        P                  8w  d   h  Rp?K»  Rp?ii ; i  \        P                   d0   pTP                  w  rET\        P                  8w  d   h  Rp?K£  Rp?ii ; i)	zfErase this ldb.

:note: Removes all records, except those that are controlled by
    Samba4's schema.
Ú zJ(&(|(objectclass=*)(distinguishedName=*))(!(distinguishedName=@BASEINFO)))zshow_deleted:0zshow_recycled:0)Úcontrolsr<   N)z@SUBCLASSESz@MODULESz@OPTIONSz
@PARTITIONz
@KLUDGEACL)
rF   r,   r   r=   rA   rB   r>   r?   r@   r-   )r!   r2   r   rC   rD   rE   r5   Úattrs   &       r   Úerase_except_schema_controlledÚ"Ldb.erase_except_schema_controlled�   s6  € ð ˆð 	×"Ñ" 6Ô*ð —;‘;˜v¤s×'8Ñ'8ØkØ!Ð-=Ð?PÐ,Qð ö SˆCðØ—‘˜CŸF™F Y KÖ0ñ	Sð �k‰k˜&¤#×"3Ñ"3ØfØÐ(8Ð:KÐ'Lð ó Nˆô �3‹x˜1Œ}Ðˆ}ó=ˆDðØ—‘˜D 9 +Ö.ó=øô —<‘<ô Ø %§
¡
‘�ØœC×2Ñ2Ô2àõ 3ûðûô  —<‘<ô Ø %§
¡
‘�ØœC×2Ñ2Ô2àõ 3ûðús/   ¾B6ÂC=Â6C:Ã$C5Ã5C:Ã=EÄ$D<Ä<Ec                óî   € V P                  4        R F  p V P                  VR.4       K  	  R#   \        P                   d0   pTP                  w  r4T\        P
                  8w  d   h  Rp?K\  Rp?ii ; i)z%Erase this ldb, removing all records.r<   N)z
@INDEXLISTz@ATTRIBUTES)rL   rA   r   r>   r?   r@   )r!   rK   rC   rD   rE   s   &    r   ÚeraseÚ	Ldb.erase¶   sf   € à×+Ñ+Ô-ó 2ˆDðØ—‘˜D 9 +Ö.ó 2øô —<‘<ô Ø %§
¡
‘�ØœC×2Ñ2Ô2àõ 3ûðús   —0°A4Á$A/Á/A4c                ó¦   € \        VR4      ;_uu_ 4       pV P                  VP                  4       4       RRR4       R#   + '       g   i     R# ; i)z8Load a LDIF file.

:param ldif_path: Path to LDIF file.
ÚrN)ÚopenÚadd_ldifÚread)r!   Ú	ldif_pathÚ	ldif_files   && r   Úload_ldif_file_addÚLdb.load_ldif_file_addÄ   s5   € ô
 �)˜S×!Ô! YØ�M‰M˜)Ÿ.™.Ó*Ô+÷ "×!×!Ò!ús	   • ?¿A	c                óŠ   € V P                  V4       F-  w  r4V\        P                  8X  g   Q hV P                  WB4       K/  	  R# )z:Add data based on a LDIF string.

:param ldif: LDIF text.
N)Ú
parse_ldifr   ÚCHANGETYPE_NONEÚadd)r!   ÚldifrJ   Ú
changetyper   s   &&&  r   rT   ÚLdb.add_ldifÌ   s9   € ð
  $Ÿ™¨tÖ4‰OˆJØ¤×!4Ñ!4Ô4Ð4Ð4Ø�H‰H�SÖ#ó  5r   c                óF  € V P                  V4       EF
  w  r4V\        P                  8X  d   \        P                  pV\        P                  8X  d   V P                  WB4       KS  V\        P                  8X  d   V P                  WB4       K{  V\        P                  8X  d   TpV P                  WR4       K¥  V\        P                  8X  dA   VR,          pVR,          pVR,          pVRJ d   \        R4      hV P                  WhV4       Kú  \        RW43,          4      h	  R# )zAModify database based on a LDIF string.

:param ldif: LDIF text.
ÚolddnÚdeleteoldrdnÚnewdnFz5Invalid ldb.CHANGETYPE_MODRDN with deleteoldrdn=FalsezInvalid ldb.CHANGETYPE_%u: %sN)r[   r   r\   ÚCHANGETYPE_MODIFYÚCHANGETYPE_ADDr]   ÚmodifyÚCHANGETYPE_DELETErA   ÚCHANGETYPE_MODRDNÚ
ValueErrorÚrename)	r!   r^   rJ   r_   r   Údeldnrb   rc   rd   s	   &&&      r   Úmodify_ldifÚLdb.modify_ldifÕ   så   € ð
  $Ÿ™¨t×4‰OˆJØœS×0Ñ0Ô0Ü ×2Ñ2�
àœS×/Ñ/Ô/Ø—‘˜Ö'Øœs×4Ñ4Ô4Ø—‘˜CÖ*Øœs×4Ñ4Ô4Ø�Ø—‘˜EÖ,Øœs×4Ñ4Ô4Ø˜G��Ø" >Õ2�Ø˜G��Ø 5Ó(Ü$Ð%\Ó]Ð]Ø—‘˜E¨(Ö3ä Ð!@ÀJÐCTÕ!TÓUÐUó'  5r   © )NNNNNé    Nr	   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r)   r   Ú
SCOPE_BASEr7   rF   rL   rO   rX   rT   rm   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r   "   sJ   ø‡ € ñô4.ðl +/¸4ØŸ™ôAò"ò6'òRò,ô$÷Vò Vr   r   c                óþ   € VP                  4        Fh  w  r#\        V\        4      '       g   Q RV,          4       h\        V\        4      '       g   Q RV: RV: R24       hV P                  RV,          V4      p Kj  	  V # )z´Substitute strings of the form ${NAME} in str, replacing
with substitutions from values.

:param text: Text in which to substitute.
:param values: Dictionary with keys and values.
z%r is not a stringzValue z for z is not a stringz${%s})ÚitemsÚ
isinstanceÚstrÚreplace)r   r6   ÚnameÚvalues   &&  r   Úsubstitute_varr�   ð   sm   € ð  Ÿ™ž‰ˆÜ˜$¤×$Ò$ÐAÐ&:¸TÕ&AÓAÐ$Ü˜%¤×%Ò%ÑXËEÓSWÐ'XÓXÐ%Ø�|‰|˜G d�N¨EÓ2Šñ (ð
 €Kr   c                ó�   € RV 9  d   R# V P                  R4      pV P                  RV4      p\        RWV^,            ,          4      h)zŸCheck that all substitution variables in a string have been replaced.

If not, raise an exception.

:param text: The text to search for substitution variables
z${NÚ}z!Not all variables substituted: %s)ÚfindÚ	Exception)r   Ú	var_startÚvar_ends   &  r   Úcheck_all_substitutedrˆ      sM   € ð �4ÔÙà—	‘	˜$“€IØ�i‰i˜˜YÓ'€Gä
Ð7Ø 7¨Q¥;Ð/õ0ó 1ð 1r   c                óÀ   € \        V RRR7      ;_uu_ 4       pVP                  4       pVe   \        W14      p\        V4       RRR4       V#   + '       g   i     X# ; i)z²Read a file and sub in variables found in it

:param file_name: File to be read (typically from setup directory)
:param subst_vars: Optional variables to substitute in the file.
rR   zutf-8)ÚencodingN)rS   rU   r�   rˆ   )Ú	file_nameÚ
subst_varsÚ	data_fileÚdatas   &&  r   Úread_and_sub_filer�     sU   € ô 
ˆi˜ w×	/Õ	/°9Ø�~‰~ÓˆØÒ!Ü! $Ó3ˆDÜ! $Ô'÷	 
0ð
 €K÷ 
0Ö	/ð
 €Kús   —+AÁA	c                ó  € \         P                  P                  V4      '       d   \         P                  ! V4       \	        W4      p\        VR4      p VP                  V4       VP                  4        R#   TP                  4        i ; i)z£Setup a file in the private dir.

:param template: Path of the template file.
:param fname: Path of the file to create.
:param subst_vars: Substitution variables.
ÚwN)r   r   ÚexistsÚunlinkr�   rS   ÚwriteÚclose)ÚtemplateÚfnamerŒ   rŽ   Úfs   &&&  r   Ú
setup_filer™     s\   € ô 
‡w�w‡~�~�e×ÒÜ
�	Š	�%Ôä˜XÓ2€DÜˆU�CÓ€AðØ	�‰�Œà	�‰Ž	øˆ�‰�	ús   ÁA7 Á7B	c                 ó<   € V P                  4       ;'       g    V R 9   # )z !#$%&'()-.@^_{}~)Úisalnum)Úcs   &r   Úis_valid_netbios_charr�   4  s   € Ø�I‰I‹K×3Ð3˜1Ð 3Ñ3Ð4r   c                ól   € \        V 4      \        8”  d   R# V  F  p\        V4      '       d   K   R# 	  R# )z1Check whether a name is valid as a NetBIOS name. FT)r-   ÚMAX_NETBIOS_NAME_LENr�   )r   Úxs   & r   Úvalid_netbios_namer¡   8  s1   € ô ˆ4ƒyÔ'Ô'ÙÛˆÜ$ Q×'Ô'Úñ ñ r   c                óP   € RRP                  V P                  R4      4      ,           # )z.return a DN from a DNS name domain/forest rootzDC=z,DC=Ú.)r   Úsplit)Ú	dnsdomains   &r   Údn_from_dns_namer¦   C  s   € à�6—;‘;˜yŸ™¨sÓ3Ó4Õ4Ð4r   c                  ó>   € \        \        P                  ! 4       4      # r	   )ÚintÚtimero   r   r   Úcurrent_unix_timerª   H  s   € ÜŒt�yŠy‹{ÓÐr   c                 ó   € ^ RI Hp V! W4      # )rp   )Úarcfour_crypt_blob)Úsamba.cryptor¬   )ÚkeyrŽ   r¬   s   && r   Úarcfour_encryptr¯   L  s   € Ý/Ù˜dÓ(Ð(r   c                 ó&   € ^ RI Hp V! V VVVV4      # )rp   )Ú!aead_aes_256_cbc_hmac_sha512_blob)r­   r±   )Ú	plaintextÚcekÚkey_saltÚmac_saltÚivr±   s   &&&&& r   Úaead_aes_256_cbc_hmac_sha512r·   Q  s!   € Ý>Ù,ØØØØØ
óð r   z<[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})r&   c                óx   € V'       d   \         P                  V 4      pM\        P                  V 4      pVf   R# R# )aF  Is the string an ordinary undecorated string GUID?

That is, like 12345678-abcd-1234-FEED-1234567890ab, and not like
variants which have surrounding curly brackets or lack hyphens.

If lower case_only is true, only lowercase hex characters are
accepted. This is tighter than we ever require, but matches what
we usually emit.
FT)ÚGUID_REÚ	fullmatchÚGUID_MIXCASE_RE)ÚstringÚlower_case_onlyÚms   && r   Ústring_is_guidr¿   d  s2   € ÷ Ü×Ñ˜fÓ%‰ä×%Ñ% fÓ-ˆà‚yÙÙr   c                 ó   € ^ RI Hp  ^ RI Hp R# )zTThis function modifies the samba.net.Net class to contain
an export_keytab() method.)Únet)ÚdckeytabN)r   rÁ   rÂ   )rÁ   rÂ   s     r   Úenable_net_export_keytabrÃ   {  s
   € õ ßr   r	   )F)6ru   Ú__docformat__r   r©   r   Úsamba.paramr   Úrer   Ú
samba._ldbr   Ú_Ldbr�   rˆ   r�   r™   rŸ   r�   r¡   r¦   rª   r¯   r·   Úcompiler¹   Ú
IGNORECASEr»   r¿   rÃ   ÚversionÚinterface_ipsÚfault_setupÚset_debug_levelÚget_debug_levelÚfloat2nttimeÚnttime2floatÚnttime2stringÚnttime2unixÚunix2nttimeÚgenerate_random_passwordÚ generate_random_machine_passwordÚcheck_password_qualityÚgenerate_random_bytesÚstrcasecmp_mÚstrstr_mÚis_ntvfs_fileserver_builtÚis_heimdal_builtÚis_ad_dc_builtÚis_selftest_enabledÚis_rust_builtÚNTSTATUSErrorÚHRESULTErrorÚWERRORErrorÚDsExtendedErrorro   r   r   Ú<module>rä      s¿  ðñ* à"€ã 	Û Û 
Û Û 	Ý Ý "ôKVˆ$ô KVò\ò 1ò"ôð$ Ð ò5òò5ò
ò)ò
ð �*Š*ØBóD€ð —*’*ØBØ�M‰Mô€ô
ò.ð" �-‰-€Ø×#Ñ#€Ø×Ñ€Ø×'Ñ'€Ø×'Ñ'€Ø×!Ñ!€Ø×!Ñ!€Ø×#Ñ#€Ø×Ñ€Ø×Ñ€Ø ×9Ñ9Ð Ø#(×#IÑ#IÐ  Ø×5Ñ5Ð Ø×3Ñ3Ð Ø×!Ñ!€Ø�>‰>€Ø!×;Ñ;Ð Ø×)Ñ)Ð Ø×%Ñ%€Ø×/Ñ/Ð Ø×#Ñ#€à×#Ñ#€Ø×!Ñ!€Ø×Ñ€Ø×'Ñ'‚r   