+
    4Ssi(  ã                   ód   € ^ RI Ht ^ RIHtHt ^ RIHt ^ RIH	t	H
t
Ht ^ RIHt  ! R R]	4      tR# )é    N)ÚdsdbÚldb)Úsystem_session)ÚCommandÚCommandErrorÚOption)ÚSamDBc                   ó^  a € ] tR t^t o RtRt]! RRR]RRR7      ]! R	R
]R7      ]! RR]R7      ]! RR]R7      ]! RR]RR7      ]! RRRR7      ]! RR]R7      ]! RR]R7      ]! RR]R7      ]! RR]R7      .
tR .t	R!]
P                  R"]
P                  R#]
P                  /tR(R% ltR& tR'tV tR$# ))Úcmd_user_renamea%  Rename a user and related attributes.

This command allows to set the user's name related attributes. The user's
CN will be renamed automatically.
The user's new CN will be made up by combining the given-name, initials
and surname. A dot ('.') will be appended to the initials automatically
if required.
Use the --force-new-cn option to specify the new CN manually and the
--reset-cn option to reset this change.

Use an empty attribute value to remove the specified attribute.

The username specified on the command is the sAMAccountName.

The command may be run locally from the root userid or another authorized
userid.

The -H or --URL= option can be used to execute the command against a remote
server.

Example1:
samba-tool user rename johndoe --surname='Bloggs'

Example1 shows how to change the surname of a user 'johndoe' to 'Bloggs' on
the local server. The user's CN will be renamed automatically, based on
the given name, initials and surname.

Example2:
samba-tool user rename johndoe --force-new-cn='John Bloggs (Sales)' \
    --surname=Bloggs -H ldap://samba.samdom.example.com -U administrator

Example2 shows how to rename the CN of a user 'johndoe' to 'John Bloggs (Sales)'.
Additionally the surname ('sn' attribute) is set to 'Bloggs'.
The -H parameter is used to specify the remote target server.
z%prog <username> [options]z-Hz--URLz%LDB URL for database or target serverÚURLÚH)ÚhelpÚtypeÚmetavarÚdestz	--surnamezNew surname)r   r   z--given-namezNew given namez
--initialszNew initialsz--force-new-cnz^Specify a new CN (RDN) instead of using a combination of the given name, initials and surname.ÚNEW_CN)r   r   r   z
--reset-cnz–Set the CN (RDN) to the combination of the given name, initials and surname. Use this option to reset the changes made with the --force-new-cn option.Ú
store_true)r   Úactionz--display-namezNew display namez--mail-addresszNew email addressz--samaccountnamez,New account name (sAMAccountName/logon name)z--upnzNew user principal nameÚusernameÚ	sambaoptsÚcredoptsÚversionoptsNc           	     ód  € V'       d   V'       d   \        R 4      hVR8X  d   \        R4      hVR8X  d   \        R4      hVP                  4       pVP                  VRR7      p\        V\	        4       VVR7      p\
        P                  ! VVP                  4       4      pR\        P                  \
        P                  ! V4      3,          p VP                  VV\
        P                  . R"OR7      pV^ ,          pVP                  pTP                  4       pTR,          ^ ,          pTe   TMTR,          pTe   TpMTP!                  TTTTTR7      pTP!                  TTR,          R7      p\#        T4      \#        T4      8g  ;'       d5    \#        T4      \#        T4      8H  ;'       g    T;'       g    \%        T4      p\
        P                  ! TRT,          4      pTP'                  T4       Te*   T P)                  TT4      R8X  d   \        RT,          4      h\
        P*                  ! 4       pTTn        TP-                  TTR	T4       TP-                  TTR
T4       TP-                  TTRT4       TP-                  TTRT	4       TP-                  TTRT
4       TP-                  TTRT4       TP-                  TTRT4       \/        T4      ^ 8„  pTP1                  4         TR8X  d   TP3                  T4       TR8X  d   TP5                  TT4       TP;                  4        TR8X  d)   T P<                  P?                  RT: RT: RT: R24       TR8X  d€   T P<                  P?                  RT,          4       TPA                  4        FG  p!T!R8X  d   K  T P<                  P?                  T!: RTT!,          '       d
   TT!,          MR : R!24       KI  	  R# R#   \         d    \        RT,          4      hi ; i  \6         d)   p TP9                  4        \        RT,          T 4      hRp ? ii ; i)#zEIt is not allowed to specify --force-new-cn together with --reset-cn.Ú z7Failed to rename user - delete protected attribute 'CN'zCFailed to rename user - delete protected attribute 'sAMAccountName'T)Úfallback_machine)ÚurlÚsession_infoÚcredentialsÚlpz)(&(sAMAccountType=%d)(sAMAccountName=%s))ÚsAMAccountNameÚ	givenNameÚinitialsÚsnÚmailÚuserPrincipalNameÚdisplayNameÚcn)ÚbaseÚ
expressionÚscopeÚattrszUnable to find user "%s"N)Ú	old_attrsÚ
given_namer"   ÚsurnameÚfallback_default)r,   r/   zCN=%sFzo"%s" is not a valid upn. You can manage the upn suffixes with the "samba-tool domain trust namespaces" command.zFailed to rename user "%s"zRenamed CN of user "z" from "z" to "z" successfully
zBFollowing attributes of user "%s" have been changed successfully:
Údnz: z	[removed]Ú
)r    r!   r"   r#   r$   r%   r&   r'   )!r   Úget_loadparmÚget_credentialsr	   r   r   ÚDnÚ	domain_dnr   ÚATYPE_NORMAL_ACCOUNTÚbinary_encodeÚsearchÚSCOPE_SUBTREEr0   Ú
IndexErrorÚparentÚfullname_from_namesÚstrÚboolÚadd_baseÚis_valid_upnÚMessageÚprepare_attr_replaceÚlenÚtransaction_startÚmodifyÚrenameÚ	ExceptionÚtransaction_cancelÚtransaction_commitÚoutfÚwriteÚkeys)"Úselfr   r   r   r   r   r.   r-   r"   Údisplay_nameÚmail_addressÚsamaccountnameÚupnÚforce_new_cnÚreset_cnr   ÚcredsÚsamdbr5   ÚfilterÚresÚold_userÚuser_dnÚuser_parent_dnÚold_cnÚnew_fallback_cnÚnew_user_cnÚexpected_cnÚmust_change_cnÚnew_user_dnÚ
user_attrsÚattributes_changedÚeÚattrs"   &&&&&&&&&&&&&&&                   Ú:/usr/lib/python3/dist-packages/samba/netcmd/user/rename.pyÚrunÚcmd_user_rename.runo   s7  € ÷ ŸHÜð  ;ó <ð <à˜2ÔÜð  0ó 1ð 1à˜RÔÜð  <ó =ð =ð ×#Ñ#Ó%ˆØ×(Ñ(¨¸dÐ(ÓCˆÜ˜!¬.Ó*:Ø"'¨Bô0ˆä—F’F˜5 %§/¡/Ó"3Ó4ˆ	à=Ü×,Ñ,¬c×.?Ò.?ÀÓ.IÐJõKˆð	HØ—,‘, IØ*0Ü%(×%6Ñ%6ò&,ð ó 
-ˆCð ˜1•vˆHØ—k‘kˆGð !Ÿ™Ó)ˆØ˜$• Õ"ˆð -;Ò,F™.ØÐ*Õ+ð 	ð Ò#Ø&‰Kà×3Ñ3¸hØ?IØ=EØ<CØETð	 4ó VˆKð ×/Ñ/¸(ØAIÐJZÕA[ð 0ó ]ˆä˜V›¬¨KÓ(8Ñ8÷ ,ð ,Ü�‹Kœ3˜{Ó+Ñ+÷ +ð +Ø÷+ð +Ü˜\Ó*ð 	ô —f’f˜U G¨kÕ$9Ó:ˆØ×Ñ˜^Ô,àŠ?Ø× Ñ  ¨Ó,°Ô5Ü"ð $@ð CFõ$Fó Gð Gô
 —[’[“]ˆ
Øˆ
ŒØ×"Ñ" :¨x¸ÀjÔQØ×"Ñ" :¨x¸ÀXÔNØ×"Ñ" :¨x¸¸wÔGØ×"Ñ" :¨x¸ÈÔUØ×"Ñ" :¨x¸ÀÔNØ×"Ñ" :¨xÐ9IÈ>ÔZØ×"Ñ" :¨xÐ9LÈcÔRä  ›_¨qÑ0Ðà×ÑÔ!ð	KØ! TÔ)Ø—‘˜ZÔ(Ø Ô%Ø—‘˜W kÔ2ð 	× Ñ Ô"à˜TÔ!Ø�I‰I�OŠOÛ08»&Ã+ðOô Pð  Ô%Ø�I‰I�O‰Oð 6Ø9AõCô Dà"Ÿ™Ö)�Ø˜D”LÙØ—	‘	—‘«dØ#-¨d×#3Ô#3ð 5?¸tÖ4DØ9Dò5Eð !Fö Gó *ñ &øôA ô 	HÜÐ9¸XÕFÓGÐGð	Hûôn ô 	KØ×$Ñ$Ô&ÜÐ;¸hÕFÈÓJÐJûð	Kús$   Ã:O Ë#1O< ÏO9Ï<P/Ð#P*Ð*P/c                óú  € VP                  4       pVP                  4       pW4.pVP                  4       pR V,          pVP                  V\        P
                  RR.R7      p\        V4      ^8¼  dI   V^ ,          p	RV	9   d9   V	R,           F+  p
VP                  \        V
4      P                  4       4       K-  	  VP                  R4      p\        V4      ^8  d   R# VR,          P                  4       pWÅ9  d   R# R# )zCN=Partitions,%sz(objectClass=crossRefContainer)ÚuPNSuffixes)r(   r*   r)   r+   Ú@FTéÿÿÿÿ)Údomain_dns_nameÚforest_dns_nameÚget_config_basednr8   r   Ú
SCOPE_BASErC   Úappendr=   ÚlowerÚsplit)rM   rU   rQ   Ú
domain_dnsÚ
forest_dnsÚupn_suffixesÚconfig_basednÚpartitions_dnrW   ÚmsgÚsÚ	upn_splitÚ
upn_suffixs   &&&          re   r@   Úcmd_user_rename.is_valid_upnÞ   sç   € Ø×*Ñ*Ó,ˆ
Ø×*Ñ*Ó,ˆ
Ø"Ð/ˆà×/Ñ/Ó1ˆØ*¨]Õ:ˆØ�l‰lØÜ—.‘.Ø8Ø �/ð	 ó #ˆô �‹H˜ŒMØ�a•&ˆCØ Ô#Ø˜]×+Ð+�AØ ×'Ñ'¬¨A«¯©«Ö7ñ ,ð —I‘I˜c“Nˆ	Ü�	‹N˜QÔÙà˜r•]×(Ñ(Ó*ˆ
ØÔ)Ùáó    © )NNNNNNNNNNNNN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úsynopsisr   r=   Útakes_optionsÚ
takes_argsÚoptionsÚSambaOptionsÚCredentialsOptionsÚVersionOptionsÚtakes_optiongroupsrf   r@   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @re   r   r      s%  ø‡ € ñ"ðH ,€Hñ 	ˆt�WØ;Ø ¨Sô	2ñ 	ˆ{Ø!Øô	ñ 	ˆ~Ø$Øô	ñ 	ˆ|Ø"Øô	ñ 	Ðð?à ô	+ñ 	ˆ|ðGð #ô		$ñ
 	ÐØ&Øô	ñ 	ÐØ'Øô	ñ 	Ð!ØBØô	ñ 	ˆwØ-Øô	ð?"€MðH �€Jà�W×)Ñ)Ø�G×.Ñ.Ø�w×-Ñ-ðÐômG÷^ð r}   r   )Úsamba.getoptÚgetoptr‡   Úsambar   r   Ú
samba.authr   Úsamba.netcmdr   r   r   Úsamba.samdbr	   r   r~   r}   re   Ú<module>r•      s'   ðõ, ß Ý %ß 6Ñ 6Ý ô\�gö \r}   