ó
    cÛ–i«y  ã                   óX  • S SK Jr  S SKrS SKrS SKrS SKJrJr  S SK	J
r
  S SKJr  S SKJr  S SKJrJr  S SKJr  S SKJrJrJrJr  S S	KJr  S
SKJr   " S S\5      r " S S\5      r " S S\5      r " S S\5      r  " S S\5      r! " S S\5      r" " S S\5      r# " S S\5      r$g)é    N)Ú
check_callÚCalledProcessError)Ú
attrgetter)Úsystem_session)ÚSamDB)ÚcredentialsÚdsdb)ÚNet)ÚCommandÚCommandErrorÚSuperCommandÚOption)Ú	get_bytesé   )Úcommonc                   óv  • \ rS rSrSrSr\" SSS\SSS	9\" S
S\S9\" SS\S9\" SS\S9\" SS\S9\" SS\S9\" SS\S9\" SS\S9\" SS\S9\" SS\S9\" SS\S9\" SS \S9\" S!S"\S9\" S#S$\S9\" S%S&\S9/rS'/r	\
R                  \
R                  \
R                  S(.r                   S,S* jrS+rg))-Úcmd_addé+   af  Add a new contact.

This command adds a new contact to the Active Directory domain.

The name of the new contact can be specified by the first argument
'contactname' or the --given-name, --initial and --surname arguments.
If no 'contactname' is given, contact's name will be made up of the given
arguments by combining the given-name, initials and surname. Each argument
is optional. A dot ('.') will be appended to the initials automatically.

Example1:
samba-tool contact add "James T. Kirk" --job-title=Captain \
    -H ldap://samba.samdom.example.com -UAdministrator%Passw1rd

The example shows how to add a new contact to the domain against a remote
LDAP server.

Example2:
samba-tool contact add --given-name=James --initials=T --surname=Kirk

The example shows how to add a new contact to the domain against a local
server. The resulting name is "James T. Kirk".
z%prog [contactname] [options]ú-Hú--URLú%LDB URL for database or target serverÚURLÚH©ÚhelpÚtypeÚmetavarÚdestz--ouzœDN of alternative location (with or without domainDN counterpart) in which the new contact will be created. E.g. 'OU=<OU name>'. Default is the domain base.©r   r   ú	--surnamezContact's surnameú--given-namezContact's given nameú
--initialszContact's initialsú--display-namezContact's display namez--job-titlezContact's job titlez--departmentzContact's departmentz	--companyzContact's companyz--descriptionzContact's descriptionú--mail-addresszContact's email addressz--internet-addresszContact's home pagez--telephone-numberzContact's phone numberz--mobile-numberzContact's mobile phone numberz--physical-delivery-officezContact's office locationzfullcontactname?©Ú	sambaoptsÚcredoptsÚversionoptsNc                 ó"  • UR                  5       nUR                  U5      n [        U[        5       UUS9nUR	                  UUUUU	U
UUUUUUUUUS9nU R                  R                  SU-  5        g ! [
         a  n[        SU5      eS nAff = f)N©ÚurlÚsession_infor   Úlp)ÚfullcontactnameÚouÚsurnameÚ	givennameÚinitialsÚdisplaynameÚjobtitleÚ
departmentÚcompanyÚdescriptionÚmailaddressÚinternetaddressÚtelephonenumberÚmobilenumberÚphysicaldeliveryofficezFailed to add contactz Contact '%s' added successfully
)	Úget_loadparmÚget_credentialsr   r   Ú
newcontactÚ	Exceptionr   ÚoutfÚwrite)Úselfr.   r&   r'   r(   r   r/   r0   Ú
given_namer2   Údisplay_nameÚ	job_titler5   r6   r7   Úmail_addressÚinternet_addressÚtelephone_numberÚmobile_numberÚphysical_delivery_officer-   ÚcredsÚsamdbÚret_nameÚes                            Ú6/usr/lib/python3/dist-packages/samba/netcmd/contact.pyÚrunÚcmd_add.runj   s¼   € ð* ×#Ñ#Ó%ˆØ×(Ñ(¨Ó,ˆð	;Ü˜aÜ'5Ó'7Ø&+Øñ!ˆEð ×'Ñ'Ø /ØØØ$Ø!Ø(Ø"Ø%ØØ'Ø(Ø 0Ø 0Ø*Ø'?ð (ð AˆHð& 	�	‰	�‰Ð;¸hÑFÕGøô ó 	;ÜÐ6¸Ó:Ð:ûð	;ús   £1A3 Á3
BÁ=B	Â	B© )NNNNNNNNNNNNNNNNNNN©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úsynopsisr   ÚstrÚtakes_optionsÚ
takes_argsÚoptionsÚSambaOptionsÚCredentialsOptionsÚVersionOptionsÚtakes_optiongroupsrQ   Ú__static_attributes__rS   ó    rP   r   r   +   sj  † ñð0 /€Hñ 	ˆt�WÐ#JØ ¨Sñ	2áˆvð3ð ñ	ñ 	ˆ{Ð!4¸3Ñ?Ùˆ~Ð$:ÀÑEÙˆ|Ð"6¸SÑAÙÐÐ&>ÀSÑIÙˆ}Ð#8¸sÑCÙˆ~Ð$:ÀÑEÙˆ{Ð!4¸3Ñ?ÙˆÐ%<À3ÑGÙÐÐ&?ÀcÑJÙÐ#Ð*?ÀcÑJÙÐ#Ð*BÈÑMÙÐ Ø3Øñ	ñ 	Ð+Ø/Øñ	ð/€Mð8 %Ð%€Jð ×)Ñ)Ø×.Ñ.Ø×-Ñ-ñÐð !ØØØØØØØØØØØØØØØ!Ø!ØØ%)÷'0Hrd   r   c            	       ó”   • \ rS rSrSrSr\" SSS\SSS	9/rS
/r	\
R                  \
R                  \
R                  S.r    SS jrSrg)Ú
cmd_deleteé�   a  Delete a contact.

This command deletes a contact object from the Active Directory domain.

The contactname specified on the command is the common name or the
distinguished name of the contact object. The distinguished name of the
contact can be specified with or without the domainDN component.

Example:
samba-tool contact delete Contact1 \
    -H ldap://samba.samdom.example.com \
    --username=Administrator --password=Passw1rd

The example shows how to delete a contact in the domain against a remote
LDAP server.
ú%prog <contactname> [options]r   r   r   r   r   r   Úcontactnamer%   Nc                 ó–  • UR                  5       nUR                  USS9n[        U[        5       UUS9nUR	                  5       n	[
        R                  n
S[
        R                  " U5      -  nUR                  5       R                  S5      (       a$  Sn[
        R                  n
 UR                  U5      n	 UR                  U	U
US	/S
9nUS   R                  n[#        U5      S:”  aP  [%        U['        S	5      S9 H+  nU R(                  R+                  SUR                  -  5        M-     [        SU-  5      e UR-                  U5        U R(                  R+                  SU-  5        g ! [         a  n[        SU< SU< 35      eS nAff = f! [          a    [        SU-  5      ef = f! [         a  n[        SU-  U5      eS nAff = f)NT©Úfallback_machiner*   ú!(&(objectClass=contact)(name=%s))úCN=ú(objectClass=contact)úInvalid dn "ú": Údn©ÚbaseÚscopeÚ
expressionÚattrsr   úUnable to find contact "%s"r   ©Úkeyú
found: %s
úFMultiple results for contact '%s'
Please specify the contact's full DNzFailed to remove contact "%s"zDeleted contact %s
)r=   r>   r   r   Ú	domain_dnÚldbÚSCOPE_SUBTREEÚbinary_encodeÚupperÚ
startswithÚ
SCOPE_BASEÚnormalize_dn_in_domainr@   r   Úsearchrr   Ú
IndexErrorÚlenÚsortedr   rA   rB   Údelete)rC   ri   r&   r'   r(   r   r-   rL   rM   Úbase_dnru   ÚfilterrO   ÚresÚ
contact_dnÚmsgs                   rP   rQ   Úcmd_delete.runÁ   s×  € ð ×#Ñ#Ó%ˆØ×(Ñ(¨¸dÐ(ÐCˆÜ˜!Ü#1Ó#3Ø"'Øñˆð —/‘/Ó#ˆÜ×!Ñ!ˆà5Ü×#Ò# KÓ0ñ1ˆð ×ÑÓ×)Ñ)¨%×0Ñ0à,ˆFÜ—N‘NˆEð5Ø×6Ñ6°{ÓC�ð
	NØ—,‘, GØ%*Ø*0Ø&* Vð ð -ˆCð ˜Q™Ÿ™ˆJô ˆs‹8�a‹<Ü˜c¤z°$Ó'7Ô8�Ø—	‘	—‘ °·±Ñ 6Ö7ñ 9äð  Fà*ñ +ó ,ð ,ð	QØ�L‰L˜Ô$ð 	�	‰	�‰Ð.°Ñ<Õ=øô1 ó 5Ý"Û$/²ð$4ó 5ð 5ûð5ûô ó 	NÜÐ<ÀÑLÓMÐMð	Nûô ó 	QÜÐ>ÀÑLÈaÓPÐPûð	Qús<   Â%E) Â7"F Ä9F* Å)
FÅ3FÆFÆF'Æ*
GÆ4GÇGrS   ©NNNNrT   rS   rd   rP   rf   rf   �   sq   † ñð  /€Hñ 	ˆtØØ;ØØØñ	ð€Mð  �€Jð ×)Ñ)Ø×.Ñ.Ø×-Ñ-ñÐð ØØØ÷0>rd   rf   c            
       ó´   • \ rS rSrSrSr\" SSS\SSS	9\" S
SS\S9\" SSSSSS9/r\	R                  \	R                  \	R                  S.r      SS jrSrg)Úcmd_listéô   zList all contacts.
    z%prog [options]r   r   r   r   r   r   z-bz	--base-dnzSpecify base DN to use.r   z	--full-dnÚfull_dnFÚ
store_truez.Display contact's full DN instead of the name.)r   ÚdefaultÚactionr   r%   Nc                 ó   • UR                  5       nUR                  USS9n[        U[        5       UUS9n	U	R	                  5       n
U(       a  U	R                  U5      n
U	R                  U
[        R                  SS/S9n[        U5      S:X  a  g U(       aC  [        U[        S5      S	9 H+  nU R                  R                  S
UR                  -  5        M-     g U H1  nUR                  SSS9nU R                  R                  S
U-  5        M3     g )NTrk   r*   ro   Úname)ru   rv   rw   r   rr   ry   z%s
)Úidx)r=   r>   r   r   r}   r„   r…   r~   r   r‡   rˆ   r   rA   rB   rr   Úget)rC   r&   r'   r(   r   rŠ   r”   r-   rL   rM   Ú	search_dnrŒ   rŽ   Úcontact_names                 rP   rQ   Úcmd_list.run  sû   € ð ×#Ñ#Ó%ˆØ×(Ñ(¨¸dÐ(ÐCˆä˜!Ü#1Ó#3Ø"'Øñˆð
 —O‘OÓ%ˆ	ÞØ×4Ñ4°WÓ=ˆIà�l‰l˜9Ü!$×!2Ñ!2Ø&=Ø"( ð ð +ˆô �‹H˜‹MØæÜ˜c¤z°$Ó'7Ô8�Ø—	‘	—‘ ¨¯©¡Ö0ñ 9àãˆCØŸ7™7 6¨q˜7Ð1ˆLà�I‰I�O‰O˜F \Ñ1Ö2ò rd   rS   )NNNNNF)rU   rV   rW   rX   rY   rZ   r   r[   r\   r^   r_   r`   ra   rb   rQ   rc   rS   rd   rP   r’   r’   ô   s›   † ñð !€Hñ 	ˆtØØ;ØØØñ	ñ 	ˆt�[Ø-Øñ	ñ 	ˆ{ØØØ"ØDñ		Fð€Mð$ ×)Ñ)Ø×.Ñ.Ø×-Ñ-ñÐð ØØØØØ÷"3rd   r’   c            	       ó¤   • \ rS rSrSrSr\" SSS\SSS	9\" S
S\S9/rS/r	\
R                  \
R                  \
R                  S.r     SS jrSrg)Úcmd_editi6  aè  Modify a contact.

This command will allow editing of a contact object in the Active Directory
domain. You will then be able to add or change attributes and their values.

The contactname specified on the command is the common name or the
distinguished name of the contact object. The distinguished name of the
contact can be specified with or without the domainDN component.

The command may be run 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 contact edit Contact1 -H ldap://samba.samdom.example.com \
    -U Administrator --password=Passw1rd

Example1 shows how to edit a contact's attributes in the domain against a
remote LDAP server.

The -H parameter is used to specify the remote target server.

Example2:
samba-tool contact edit CN=Contact2,OU=people,DC=samdom,DC=example,DC=com

Example2 shows how to edit a contact's attributes in the domain against a
local server. The contact, which is located in the 'people' OU,
is specified by the full distinguished name.

Example3:
samba-tool contact edit Contact3 --editor=nano

Example3 shows how to edit a contact's attributes in the domain against a
local server using the 'nano' editor.
rh   r   r   r   r   r   r   z--editorzQEditor to use instead of the system default, or 'vi' if no system default is set.r   ri   r%   Nc                 óv  • UR                  5       nUR                  USS9n[        U[        5       X‡S9n	U	R	                  5       n
[
        R                  nS[
        R                  " U5      -  nUR                  5       R                  S5      (       a$  Sn[
        R                  n U	R                  U5      n
 U	R                  U
UUS	9nUS
   R                  n[#        U5      S:”  aP  [%        U['        S5      S9 H+  nU R(                  R+                  SUR                  -  5        M-     [        SU-  5      eU HÎ  n[,        R.                  " U	U5      nUc$  [0        R2                  R5                  S5      nUc  Sn[6        R8                  " SS9 nUR+                  [;        U5      5        UR=                  5          [?        UUR@                  /5        [E        UR@                  5       nURG                  5       nS S S 5        S S S 5        MÐ     U	RI                  W5      n[K        U5      S   nU	RM                  WU5      n[#        U5      S
:X  a  U R(                  R+                  S5        g  U	RO                  U5        U R(                  R+                  SU-  5        g ! [         a  n[        SU< SU< 35      eS nAff = f! [          a    [        SU-  5      ef = f! [B         a  n[C        SU5      eS nAff = f! , (       d  f       GN= f! , (       d  f       GMà  = f! [         a  n[        SU-  U5      eS nAff = f)NTrk   r*   rm   rn   ro   rp   rq   )rt   ru   rv   r   rx   r   rr   ry   r{   r|   ÚEDITORÚviz.tmp)ÚsuffixzERROR: zNothing to do
zFailed to modify contact '%s': z#Modified contact '%s' successfully
)(r=   r>   r   r   r}   r~   r   r€   r�   r‚   rƒ   r„   r@   r   r…   rr   r†   r‡   rˆ   r   rA   rB   r   Úget_ldif_for_editorÚosÚenvironr›   ÚtempfileÚNamedTemporaryFiler   Úflushr   r™   r   ÚopenÚreadÚ
parse_ldifÚnextÚmsg_diffÚmodify)rC   ri   r&   r'   r(   r   Úeditorr-   rL   rM   rŠ   ru   r‹   rO   rŒ   r�   rŽ   Úresult_ldifÚt_fileÚedited_fileÚedited_messageÚmsgs_editedÚ
msg_editedÚres_msg_diffs                           rP   rQ   Úcmd_edit.runq  sù  € ð ×#Ñ#Ó%ˆØ×(Ñ(¨¸dÐ(ÐCˆÜ˜!¬.Ó*:Ø"'ñ0ˆà—/‘/Ó#ˆÜ×!Ñ!ˆà5Ü×$Ò$ [Ó1ñ2ˆð ×ÑÓ×)Ñ)¨%×0Ñ0à,ˆFÜ—N‘NˆEð5Ø×6Ñ6°{ÓC�ð
	NØ—,‘, GØ%*Ø*0ð ð 2ˆCð ˜Q™Ÿ™ˆJô ˆs‹8�a‹<Ü˜c¤z°$Ó'7Ô8�Ø—	‘	—‘ °·±Ñ 6Ö7ñ 9äð  Fà*ñ +ó ,ð ,ó ˆCÜ ×4Ò4°U¸CÓ@ˆKà‰~ÜŸ™Ÿ™¨Ó1�Ø‘>Ø!�Fä×,Ò,°FÒ;¸vØ—‘œY {Ó3Ô4Ø—‘”ð;Ü ¨¯©Ð4Ô5ô ˜&Ÿ+™+Ô&¨+Ø%0×%5Ñ%5Ó%7�N÷ '÷ <Ñ;ñ ð& ×&Ñ& ~Ó6ˆÜ˜+Ó& qÑ)ˆ
à—~‘~ c¨:Ó6ˆÜˆ|Ó Ó!Ø�I‰I�O‰OÐ-Ô.Øð	"Ø�L‰L˜Ô&ð
 	�	‰	�‰Ð>ÀÑLÕMøôi ó 5Ý"Û$/²ð$4ó 5ð 5ûð5ûô ó 	NÜÐ<ÀÑLÓMÐMð	Nûô. *ó ;Ü,¨Y¸Ó:Ð:ûð;úç&Ö&ú÷ <×;ûô* ó 	"ÜÐ@À;ÑNØ ó"ð "ûð	"ús„   Â$J Â6 J; Æ+LÆ8KÇLÇ$K5Ç5LÉ&L Ê
J8Ê J3Ê3J8Ê;KË
K2Ë!K-Ë-K2Ë2LË5
LË?LÌ
L	Ì
L8Ì$L3Ì3L8rS   ©NNNNNrT   rS   rd   rP   r    r    6  s‰   † ñ#ðH /€Hñ 	ˆtØØ;ØØØñ	ñ 	ˆzð;àñ	ð€Mð  �€Jà×)Ñ)Ø×.Ñ.Ø×-Ñ-ñÐð ØØØØ÷KNrd   r    c            	       ó¦   • \ rS rSrSrSr\" SSS\SSS	9\" S
S\SS9/rS/r	\
R                  \
R                  \
R                  S.r     SS jrSrg)Úcmd_showi¿  a”  Display a contact.

This command displays a contact object with it's attributes in the Active
Directory domain.

The contactname specified on the command is the common name or the
distinguished name of the contact object. The distinguished name of the
contact can be specified with or without the domainDN component.

The command may be run 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 contact show Contact1 -H ldap://samba.samdom.example.com \
    -U Administrator --password=Passw1rd

Example1 shows how to display a contact's attributes in the domain against
a remote LDAP server.

The -H parameter is used to specify the remote target server.

Example2:
samba-tool contact show CN=Contact2,OU=people,DC=samdom,DC=example,DC=com

Example2 shows how to display a contact's attributes in the domain against
a local server. The contact, which is located in the 'people' OU, is
specified by the full distinguished name.

Example3:
samba-tool contact show Contact3 --attributes=mail,mobile

Example3 shows how to display a contact's mail and mobile attributes.
rh   r   r   r   r   r   r   z--attributesz:Comma separated list of attributes, which will be printed.Úcontact_attrs)r   r   r   ri   r%   Nc                 óœ  • UR                  5       nUR                  USS9n[        U[        5       UUS9n	U	R	                  5       n
[
        R                  nS nU(       a  UR                  S5      nS[
        R                  " U5      -  nUR                  5       R                  S5      (       a$  Sn[
        R                  n U	R                  U5      n
 U	R                  U
UUUS
9nUS   R                   n[%        U5      S:”  aP  ['        U[)        S5      S9 H+  nU R*                  R-                  SUR                   -  5        M-     [        SU-  5      eU H5  n[.        R0                  " U	U5      nU R*                  R-                  U5        M7     g ! [         a  n[        SU< S	U< 35      eS nAff = f! ["         a    [        SU-  5      ef = f)NTrk   r*   Ú,rm   rn   ro   rp   rq   )rt   rv   ru   rw   r   rx   r   rr   ry   r{   zAMultiple results for contact '%s'
Please specify the contact's DN)r=   r>   r   r   r}   r~   r   Úsplitr€   r�   r‚   rƒ   r„   r@   r   r…   rr   r†   r‡   rˆ   r   rA   rB   r   r¥   )rC   ri   r&   r'   r(   r   r½   r-   rL   rM   rŠ   ru   rw   r‹   rO   rŒ   r�   rŽ   Úcontact_ldifs                      rP   rQ   Úcmd_show.runú  sË  € ð ×#Ñ#Ó%ˆØ×(Ñ(¨¸dÐ(ÐCˆÜ˜!Ü#1Ó#3Ø"'Øñˆð —/‘/Ó#ˆÜ×!Ñ!ˆàˆÞØ!×'Ñ'¨Ó,ˆEà5Ü×#Ò# KÓ0ñ1ˆð ×ÑÓ×)Ñ)¨%×0Ñ0à,ˆFÜ—N‘NˆEð5Ø×6Ñ6°{ÓC�ð
	NØ—,‘, GØ*0Ø%*Ø%*ð ð ,ˆCð ˜Q™Ÿ™ˆJô ˆs‹8�a‹<Ü˜c¤z°$Ó'7Ô8�Ø—	‘	—‘ °·±Ñ 6Ö7ñ 9äð  Aà*ñ +ó ,ð ,ó ˆCÜ!×5Ò5°e¸SÓAˆLØ�I‰I�O‰O˜LÖ)ò øô) ó 5Ý"Û$/²ð$4ó 5ð 5ûð5ûô ó 	NÜÐ<ÀÑLÓMÐMð	Nús$   Â?F Ã!F2 Æ
F/ÆF*Æ*F/Æ2GrS   rº   rT   rS   rd   rP   r¼   r¼   ¿  sŠ   † ñ"ðF /€Hñ 	ˆtØØ;ØØØñ	ñ 	ˆ~ð.àØ#ñ		%ð€Mð  �€Jà×)Ñ)Ø×.Ñ.Ø×-Ñ-ñÐð ØØØØ÷4*rd   r¼   c            	       ó–   • \ rS rSrSrSr\" SSS\SSS	9/rS
S/r	\
R                  \
R                  \
R                  S.r    SS jrSrg)Úcmd_movei1  a  Move a contact object to an organizational unit or container.

The contactname specified on the command is the common name or the
distinguished name of the contact object. The distinguished name of the
contact can be specified with or without the domainDN component.

The name of the organizational unit or container can be specified as the
distinguished name, with or without the domainDN component.

The command may be run 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 contact move Contact1 'OU=people' \
    -H ldap://samba.samdom.example.com -U Administrator

Example1 shows how to move a contact Contact1 into the 'people'
organizational unit on a remote LDAP server.

The -H parameter is used to specify the remote target server.

Example2:
samba-tool contact move Contact1 OU=Contacts,DC=samdom,DC=example,DC=com

Example2 shows how to move a contact Contact1 into the OU=Contacts
organizational unit on the local server.
z-%prog <contactname> <new_parent_dn> [options]r   r   r   r   r   r   ri   Únew_parent_dnr%   Nc                 ó®  • UR                  5       nUR                  USS9n[        U[        5       UUS9n	U	R	                  5       n
[
        R                  nS[
        R                  " U5      -  nUR                  5       R                  S5      (       a$  Sn[
        R                  n U	R                  U5      n
 U	R                  U
UUS	/S
9nUS   R                  n[#        U5      S:”  aP  [%        U['        S	5      S9 H+  nU R(                  R+                  SUR                  -  5        M-     [        SU-  5      e U	R                  U5      n[
        R,                  " U	[/        U5      5      nUR1                  [#        U5      S-
  5        UR3                  U5         U	R5                  UU5        U R(                  R+                  SU< SU< S35        g ! [         a  n[        SU< SU< 35      eS nAff = f! [          a    [        SU-  5      ef = f! [         a  n[        SU< SU< 35      eS nAff = f! [         a  n[        SU-  U5      eS nAff = f)NTrk   r*   rm   rn   ro   rp   rq   rr   rs   r   rx   r   ry   r{   r|   zInvalid new_parent_dn "zFailed to move contact "%s"zMoved contact "z" into "z"
)r=   r>   r   r   r}   r~   r   r€   r�   r‚   rƒ   r„   r@   r   r…   rr   r†   r‡   rˆ   r   rA   rB   ÚDnr[   Úremove_base_componentsÚadd_baseÚrename)rC   ri   rÅ   r&   r'   r(   r   r-   rL   rM   rŠ   ru   r‹   rO   rŒ   r�   rŽ   Úfull_new_parent_dnÚfull_new_contact_dns                      rP   rQ   Úcmd_move.runb  s[  € ð ×#Ñ#Ó%ˆØ×(Ñ(¨¸dÐ(ÐCˆÜ˜!Ü#1Ó#3Ø"'Øñˆð —/‘/Ó#ˆÜ×!Ñ!ˆà5Ü×#Ò# KÓ0ñ1ˆð ×ÑÓ×)Ñ)¨%×0Ñ0à,ˆFÜ—N‘NˆEð5Ø×6Ñ6°{ÓC�ð
	NØ—,‘, GØ%*Ø*0Ø&* Vð ð -ˆCð ˜Q™Ÿ™ˆJô ˆs‹8�a‹<Ü˜c¤z°$Ó'7Ô8�Ø—	‘	—‘ °·±Ñ 6Ö7ñ 9äð  Fà*ñ +ó ,ð ,ð	3Ø!&×!=Ñ!=¸mÓ!LÐô
 "Ÿfšf U¬C°
«OÓ<ÐØ×2Ñ2´3°z³?ÀQÑ3FÔGØ×$Ñ$Ð%7Ô8ð	OØ�L‰L˜Ð%8Ô9ð 	�	‰	�ŠÛ$Ó&8ð:õ 	;øôE ó 5Ý"Û$/²ð$4ó 5ð 5ûð5ûô ó 	NÜÐ<ÀÑLÓMÐMð	Nûô ó 	3ÝÛ -ªqð 2ó 3ð 3ûð	3ûô ó 	OÜÐ<¸{ÑJÈAÓNÐNûð	OúsT   Â%G Â7"G5 Ä9H ÆH6 Ç
G2ÇG-Ç-G2Ç5HÈ
H3ÈH.È.H3È6
IÉ IÉIrS   r�   rT   rS   rd   rP   rÄ   rÄ   1  sr   † ñð< ?€Hñ 	ˆtØØ;ØØØñ	ð€Mð   Ð1€Jà×)Ñ)Ø×.Ñ.Ø×-Ñ-ñÐð ØØØ÷<;rd   rÄ   c                   óö   • \ rS rSrSrSr\" SSS\SSS	9\" S
S\S9\" SS\S9\" SS\S9\" SS\SS9\" SSSS9\" SS\S9\" SS\S9/rS/r	\
R                  \
R                  \
R                  S.r   S"S  jrS!rg)#Ú
cmd_renamei   a5  Rename a contact and related attributes.

This command allows to set the contact's name related attributes.
The contact'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 changes.

Use an empty attribute value to remove the specified attribute.

The contactname specified on the command is the CN.

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 contact rename "John Doe" --surname=Bloggs \
    --force-new-cn=John

Example1 shows how to change the surname ('sn' attribute) of a contact
'John Doe' to 'Bloggs' and change the CN to 'John' on the local server.

Example2:
samba-tool contact rename "J Doe" --given-name=John
    -H ldap://samba.samdom.example.com -U administrator

Example2 shows how to rename the given name of a contact 'J Doe' to
'John'. The contact's cn will be renamed automatically, based on
the given name, initials and surname, if the previous CN is the
standard combination of the previous name attributes.
The -H parameter is used to specify the remote target server.
rh   r   r   r   r   r   r   r    zNew surnamer   r!   zNew given namer"   z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.r•   )r   r—   r#   zNew display namer$   zNew email addressri   r%   Nc           	      óî  • U	(       a  U(       a  [        S5      eU	S:X  a  [        S5      eUR                  5       nUR                  USS9n[        U[	        5       XíS9n[
        R                  " XÿR                  5       5      nS[
        R                  " U5      -  n UR                  U[
        R                  U/ SQS	9nUS
   nUR                  nUR                  5       nUS   S
   nU	b  U	nOUR                  UUUUS9nUR                  US9n[        U5      [        U5      :g  =(       a2    [        U5      [        U5      :H  =(       d    U=(       d    [!        U	5      n[
        R                  " USU-  5      nUR#                  U5        US:X  a  U(       a  [        SU-  5      e[
        R$                  " 5       nUUl        UR'                  UUSU5        UR'                  UUSU5        UR'                  UUSU5        UR'                  UUSU
5        UR'                  UUSU5        [)        U5      S
:„  nUR+                  5          US:X  a  UR-                  U5        U(       a  UR/                  UU5        UR5                  5         U(       a(  U R6                  R9                  SU< SU< SU< S35        U(       ap  U R6                  R9                  SU-  5        UR;                  5        H=  nUS:X  a  M  U R6                  R9                  U< SUU   (       a  UU   OS< S35        M?     g g ! [         a    [        SU-  5      ef = f! [0         a$  nUR3                  5         [        SU-  U5      eS nAff = f) NzEIt is not allowed to specify --force-new-cn together with --reset-cn.Ú z:Failed to rename contact - delete protected attribute 'CN'Trk   r*   rm   )r™   ÚsnÚ	givenNameÚcnr2   ÚdisplayNameÚmailrs   r   rx   rÕ   )Ú	old_attrsrD   r2   r0   )rØ   zCN=%sz­Failed to rename contact '%s' - can not set an empty CN (please use --force-new-cn to specify a different CN or --given-name, --initials or --surname to set name attributes)rÔ   rÓ   r2   rÖ   r×   zFailed to rename contact "%s"zRenamed CN of contact "z" from "z" to "z" successfully
zEFollowing attributes of contact "%s" have been changed successfully:
rr   z: z	[removed]Ú
)r   r=   r>   r   r   r~   rÇ   r}   r€   r…   r   rr   r†   ÚparentÚfullname_from_namesr[   ÚboolrÉ   ÚMessageÚprepare_attr_replacer‡   Útransaction_startr°   rÊ   r@   Útransaction_cancelÚtransaction_commitrA   rB   Úkeys)rC   ri   r'   r&   r(   r   r0   rD   r2   Úforce_new_cnrE   rG   Úreset_cnr-   rL   rM   r}   r‹   rŒ   Úold_contactr�   Úcontact_parent_dnÚold_cnÚnew_cnÚexcepted_cnÚmust_change_cnÚnew_contact_dnr½   Úcontact_attributes_changedrO   Úattrs                                  rP   rQ   Úcmd_rename.runî  s‘  € ö žHÜð  ;ó <ð <à˜2ÓÜð  0ó 1ð 1ð ×#Ñ#Ó%ˆØ×(Ñ(¨¸dÐ(ÐCˆÜ˜!¬.Ó*:Ø"'ñ0ˆä—F’F˜5§/¡/Ó"3Ó4ˆ	à5Ü×#Ò# KÓ0ñ1ˆð	MØ—,‘, IÜ%(×%6Ñ%6Ø*0ò&.ð ð 
ˆCð ˜a™&ˆKØ$Ÿ™ˆJð '×-Ñ-Ó/ÐØ˜TÑ" 1Ñ%ˆàÑ#Ø!‰Fà×.Ñ.¸Ø:DØ8@Ø7>ð /ð @ˆFð ×/Ñ/¸+Ð/ÐFˆÜ˜V›¬¨F«Ñ3÷ :Ü˜f›+¬¨[Ó)9Ñ9÷ 9Ø"÷9Ü&*¨<Ó&8ð 	ô Ÿš  w°Ñ'7Ó8ˆØ×ÑÐ 1Ô2à�R‹<žNÜð  Cð FLñ	 Ló Mð Mô Ÿš›ˆØ%ˆÔØ×"Ñ" =°+¸{ÈJÔWØ×"Ñ" =°+¸tÀWÔMØ×"Ñ" =°+¸zÈ8ÔTØ×"Ñ" =°+¸}ÈlÔ[Ø×"Ñ" =°+¸vÀ|ÔTä%(¨Ó%7¸!Ñ%;Ð"ð 	×ÑÔ!ð	QØ)¨TÓ1Ø—‘˜]Ô+ÞØ—‘˜Z¨Ô8ð 	× Ñ Ô"æØ�I‰I�OŠOÛ0;»VÃVðMô Nö &Ø�I‰I�O‰Oð 6Ø9DñFô Gà%×*Ñ*Ö,�Ø˜4“<ÙØ—	‘	—‘«dØ,¨T×2ð 5BÀ$Ò4GØ8Cò5Dð !Eö Fò -ð &øôu ó 	MÜÐ;¸{ÑKÓLÐLð	Mûôb ó 	QØ×$Ñ$Ô&ÜÐ>ÀÑLÈaÓPÐPûð	Qús$   Â3L* É0M Ì*MÍ
M4ÍM/Í/M4rS   )NNNNNNNNNNNrT   rS   rd   rP   rÏ   rÏ      sø   † ñ#ðJ /€Hñ 	ˆt�WØ8Ø˜e¨#ñ	/ñ 	ˆ{Ø!Øñ	ñ 	ˆ~Ø$Øñ	ñ 	ˆ|Ø"Øñ	ñ 	Ðð?à ñ	+ñ 	ˆ|ðGð #ñ		$ñ
 	ÐØ&Øñ	ñ 	ÐØ'Øñ	ð3
€Mð<  �€Jà×)Ñ)Ø×.Ñ.Ø×-Ñ-ñÐð KOØOSØ;?÷bFrd   rÏ   c                   ó¼   • \ rS rSrSr0 r\" 5       \S'   \" 5       \S'   \" 5       \S'   \" 5       \S'   \	" 5       \S'   \
" 5       \S'   \" 5       \S	'   \" 5       \S
'   Srg)Úcmd_contactiR  zContact management.ÚaddÚcreater‰   ÚeditÚlistÚmoveÚshowrÊ   rS   N)rU   rV   rW   rX   rY   Úsubcommandsr   rf   r    r’   rÄ   r¼   rÏ   rc   rS   rd   rP   rð   rð   R  sj   † Ùà€KÙ ›€K�ÑÙ#›I€K�ÑÙ&›L€K�ÑÙ"›*€K�ÑÙ"›*€K�ÑÙ"›*€K�ÑÙ"›*€K�ÑÙ&›L€K�Ôrd   rð   )%Úsamba.getoptÚgetoptr^   r~   r¦   r¨   Ú
subprocessr   r   Úoperatorr   Ú
samba.authr   Úsamba.samdbr   Úsambar   r	   Ú	samba.netr
   Úsamba.netcmdr   r   r   r   Úsamba.commonr   rÒ   r   r   rf   r’   r    r¼   rÄ   rÏ   rð   rS   rd   rP   Ú<module>r     s´   ðõ& Û 
Û 	Û ß 5Ý Ý %Ý ÷õ ÷ó õ #Ý ôoHˆgô oHôdT>�ô T>ôn?3ˆwô ?3ôDFNˆwô FNôRo*ˆwô o*ôdm;ˆwô m;ô^pF�ô pFôd)�,õ )rd   