+
    4Ssi79                         ^ 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 R]4      t ! R R	]4      t ! R
 R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]
4      tR# )    N)system_session)CommandCommandErrorOptionSuperCommand)SamDB)
attrgetterc            	          a  ] tR t^!t o RtRt]! RRR]RRR7      .tR	R
.t	R]
P                  R]
P                  R]
P                  /tRR ltRtV tR# )
cmd_renamea  Rename an organizational unit.

The name of the organizational units can be specified as a full DN
or without the domainDN component.

Examples:
samba-tool ou rename 'OU=OrgUnit,DC=samdom,DC=example,DC=com' \
    'OU=NewNameOfOrgUnit,DC=samdom,DC=example,DC=com'
samba-tool ou rename 'OU=OrgUnit' 'OU=NewNameOfOrgUnit'

The examples show how an administrator would rename an ou 'OrgUnit'
to 'NewNameOfOrgUnit'. The new DN would be
'OU=NewNameOfOrgUnit,DC=samdom,DC=example,DC=com'
z'%prog <old_ou_dn> <new_ou_dn> [options]-H--URL%LDB URL for database or target serverURLHhelptypemetavardest	old_ou_dn	new_ou_dn	sambaoptscredoptsversionoptsNc                   VP                  4       pVP                  VR R7      p\        V\        4       WR7      p	 V	P	                  V4      p
 T	P	                  T4      p T	P                  T
R\        P                  . R7      p\        T4      ^ 8X  d%   T P                  P                  R	T,          4       R# T	P                  Y4       T P                  P                  RT
: RT: R24       R#   \
         d   p\        RT: RT: 24      hRp?ii ; i  \
         d   p\        RT: RT: 24      hRp?ii ; i  \
         d   p\        R
T
,          T4      hRp?ii ; i)Tfallback_machineurlsession_infocredentialslpInvalid old_ou_dn "": NzInvalid new_ou_dn " (objectclass=organizationalUnit)base
expressionscopeattrsUnable to find ou "%s"
zFailed to rename ou "%s"zRenamed ou "z" to ""
)get_loadparmget_credentialsr   r   normalize_dn_in_domain	Exceptionr   searchldb
SCOPE_BASElenoutfwriterename)selfr   r   r   r   r   r   r"   credssamdbfull_old_ou_dnefull_new_ou_dnress   &&&&&&&       1/usr/lib/python3/dist-packages/samba/netcmd/ou.pyruncmd_rename.run?   sQ   ##%((d(C!.*:"'0	/"99)DN	/"99)DN

	O,,N*L%(^^2  ?C 3x1}		 :Y FGLL8 			~7EG 	H)  	/ )1 . / /	/
  	/ )1 . / /	/  	O9NJANN	OsN   C- D AD9 6D9 -D8DDD6D11D69EEE NNNN__name__
__module____qualname____firstlineno____doc__synopsisr   strtakes_options
takes_argsoptionsSambaOptionsCredentialsOptionsVersionOptionstakes_optiongroupsr@   __static_attributes____classdictcell____classdict__s   @r?   r   r   !   sq      9H 	tW#JS	2M
 {+JW))G..w--H H    r   c            	          a  ] tR t^`t o RtRt]! RRR]RRR7      .tR	R
.t	R]
P                  R]
P                  R]
P                  /tRR ltRtV tR# )cmd_movea=  Move an organizational unit.

The name of the organizational units can be specified as a full DN
or without the domainDN component.

Examples:
samba-tool ou move 'OU=OrgUnit,DC=samdom,DC=example,DC=com' \
    'OU=NewParentOfOrgUnit,DC=samdom,DC=example,DC=com'
samba-tool ou rename 'OU=OrgUnit' 'OU=NewParentOfOrgUnit'

The examples show how an administrator would move an ou 'OrgUnit'
into the ou 'NewParentOfOrgUnit'. The ou 'OrgUnit' would become
a child of the 'NewParentOfOrgUnit' ou. The new DN would be
'OU=OrgUnit,OU=NewParentOfOrgUnit,DC=samdom,DC=example,DC=com'
z+%prog <old_ou_dn> <new_parent_dn> [options]r   r   r   r   r   r   r   new_parent_dnr   r   r   Nc                b   VP                  4       pVP                  VR R7      p\        V\        4       WR7      p	 V	P	                  V4      p
 T	P	                  T4      p\        P                  ! T	\        T
4      4      pTP                  \        T
4      ^,
          4       TP                  T4        T	P                  T
R\        P                  . R7      p\        T4      ^ 8X  d%   T P                  P!                  R	T
,          4       R# T	P#                  Y4       T P                  P!                  RT
: RT: R24       R#   \
         d   p\        RT: RT: 24      hRp?ii ; i  \
         d   p\        RT: RT: 24      hRp?ii ; i  \
         d   p\        R
T
,          T4      hRp?ii ; i)Tr   r   r#   r$   NzInvalid new_parent_dn "r%   r&   r+   zFailed to move ou "%s"z
Moved ou "z" into "r,   )r-   r.   r   r   r/   r0   r   r2   DnrK   remove_base_componentsr4   add_baser1   r3   r5   r6   r7   )r8   r   rZ   r   r   r   r   r"   r9   r:   r;   r<   full_new_parent_dnr=   r>   s   &&&&&&&        r?   r@   cmd_move.run   s   ##%((d(C!.*:"'0	/"99)DN	3!&!=!=m!L
 s>':;--c..AA.EF 23		M,,N*L%(^^2  ?C 3x1}		 :^ KLLL8 			');= 	>/  	/ )1 . / /	/
  	3 -q 2 3 3	3   	M7.H!LL	MsN   D? E% 1AF F ?E"
EE"%F0FFF.F))F.rB   rC   rD   rU   s   @r?   rY   rY   `   so       =H 	tW#JS	2M
 /JW))G..w--!> !>rW   rY   c            	          a  ] tR t^t o RtRt]! RRR]RRR7      ]! R	R
]RR7      .tR.t	R]
P                  R]
P                  R]
P                  /tRR ltRtV tR# )cmd_adda`  Add a new organizational unit.

The name of the new ou can be specified as a full DN or without the
domainDN component.

Examples:
samba-tool ou add 'OU=OrgUnit'
samba-tool ou add 'OU=SubOU,OU=OrgUnit,DC=samdom,DC=example,DC=com'

The examples show how an administrator would add a new ou 'OrgUnit'
and a new ou 'SubOU' as a child of the ou 'OrgUnit'.
%prog <ou_dn> [options]r   r   r   r   r   r   z--descriptionzOU's descriptiondescription)r   r   r   ou_dnr   r   r   Nc                   VP                  4       pVP                  VR R7      p\        V\        4       WR7      p	 V	P	                  V4      p
 T	P                  YR7       T P                  P                  RT
,          4       R#   \
         d   p\        RT: RT: 24      hRp?ii ; i  \
         d   p\        RT
,          T4      hRp?ii ; i)	Tr   r   Invalid ou_dn "r$   N)rd   zFailed to add ou "%s"zAdded ou "%s"
)
r-   r.   r   r   r/   r0   r   	create_our5   r6   )r8   re   r   r   r   r   rd   r"   r9   r:   
full_ou_dnr<   s   &&&&&&&     r?   r@   cmd_add.run   s    ##%((d(C!.*:"'0	F55e<J	HOOJO@ 			)J67  	F5!DEE	F
  	H6CQGG	Hs/   B B) B&B!!B&)C4CCrB   )NNNNNrD   rU   s   @r?   rb   rb      s~      )H 	tW#JS	2%7m	-M JW))G..w--8 8rW   rb   c                      a  ] tR t^t o RtRt]! RRR]RRR7      ]! R	R
RRRR7      ]! RRRRRRR7      .tR.t	R]
P                  R]
P                  R]
P                  /tRR ltRtV tR# )cmd_listobjectsaa  List all objects in an organizational unit.

The name of the organizational unit can be specified as a full DN
or without the domainDN component.

Examples:
samba-tool ou listobjects 'OU=OrgUnit,DC=samdom,DC=example,DC=com'
samba-tool ou listobjects 'OU=OrgUnit'

The examples show how an administrator would list all child objects
of the ou 'OrgUnit'.
rc   r   r   r   r   r   r   	--full-dnfull_dnF
store_true"Display DNs including the base DN.r   defaultactionr   z-rz--recursive	recursivezList objects recursively.re   r   r   r   Nc                x   VP                  4       pVP                  VR R7      p	\        V\        4       WR7      p
\        P
                  ! WP                  4       4      p V
P                  V4      p^ p\        P                  pT'       d   ^p\        P                  p T
P                  TRT. R7      p\        T4      T8:  d%   T P                  P                  RT,          4       R# \!        T\#        R	4      R
7       Fn  pTP$                  T8X  d   K  T'       g%   TP$                  P'                  \        T4      4       T P                  P                  RTP$                  ,          4       Kp  	  R#   \         d   p\        RT: RT: 24      hRp?ii ; i  \         d   p\        RT,          T4      hRp?ii ; i)Tr   r   rg   r$   Nz(objectclass=*)r&   zou "%s" is empty
dnkey%s
z"Failed to list contents of ou "%s")r-   r.   r   r   r2   r\   	domain_dnr/   r0   r   SCOPE_ONELEVELSCOPE_SUBTREEr1   r4   r5   r6   sortedr	   rv   r]   )r8   re   r   r   r   r   rn   rt   r"   r9   r:   rz   ri   r<   minchildrenr)   childrenchilds   &&&&&&&&          r?   r@   cmd_listobjects.run   sz   ##%((d(C!.*:"'0FF5//"34		F55e<J ""K%%E	.||/@*/r $ ;H 8}+		 4u <=j.>?88z)HH33C	NC		 12 @#  	F5!DEE	F0  	.C) *+,. .	.s>   E0 AF &3F AF 0F;FFF9!F44F9rB   )NNNNFFrD   rU   s   @r?   rl   rl      s      )H 	tW#JS	2{E,8	:t]e")D	FM JW))G..w--$. $.rW   rl   c            
          a  ] tR tRt o RtRt]! RRR]RRR	7      ]! R
RR]R7      ]! RRRRRR7      .tR]	P                  R]	P                  R]	P                  /tRR ltRtV tR# )cmd_listi  zList all organizational units.

Example:
samba-tool ou listobjects

The example shows how an administrator would list all organizational
units.
z%prog [options]r   r   r   r   r   r   z-bz	--base-dnzSpecify base DN to use.)r   r   rm   rn   Fro   rp   rq   r   r   r   Nc                   VP                  4       pVP                  VR R7      p\        V\        4       WR7      p	\        P
                  ! WP                  4       4      p
V'       d   V	P                  V4      p
V	P                  V
\        P                  R. R7      p\        V4      ^ 8X  d   R# \        V\        R4      R7       F  pV'       gI   \        P
                  ! WP                  4       4      pVP                  P                  \        V4      4       V P                  P!                  R\#        VP                  4      ,          4       K  	  R# )	Tr   r   z (objectClass=organizationalUnit))r)   r(   r*   Nrv   rw   ry   )r-   r.   r   r   r2   r\   rz   r/   r1   r|   r4   r}   r	   rv   r]   r5   r6   rK   )r8   r   r   r   r   base_dnrn   r"   r9   r:   	search_dnr>   msgrz   s   &&&&&&&       r?   r@   cmd_list.run7  s     ##%((d(C!.*:"'0 FF5//"34	44W=Ill9!$!2!2&H!#  % HM#:d#34CFF5//*;<	--c)n=IIOOFS[01	 5rW   rB   )NNNNNF)rE   rF   rG   rH   rI   rJ   r   rK   rL   rN   rO   rP   rQ   rR   r@   rS   rT   rU   s   @r?   r   r     s      !H 	tW#JS	2t[-	 	{E,8	:M 	W))G..w--2 2rW   r   c            	          a  ] tR tRt o RtRt]! RRR]RRR	7      ]! R
RRRRR7      .tR.t	R]
P                  R]
P                  R]
P                  /tRR ltRtV tR# )
cmd_deleteiU  a7  Delete an organizational unit.

The name of the organizational unit can be specified as a full DN
or without the domainDN component.

Examples:
samba-tool ou delete 'OU=OrgUnit,DC=samdom,DC=example,DC=com'
samba-tool ou delete 'OU=OrgUnit'

The examples show how an administrator would delete the ou 'OrgUnit'.
rc   r   r   r   r   r   r   z--force-subtree-deleteforce_subtree_deleteFro   z7Delete organizational unit and all children recursivelyrq   re   r   r   r   Nc                d   VP                  4       pVP                  VR R7      p\        V\        4       WR7      p	 V	P	                  V4      p
. pT'       d   R.p T	P                  T
R\        P                  . R7      p\        T4      ^ 8X  d%   T P                  P                  R	T,          4       R# T	P                  Y4       T P                  P                  RT
,          4       R#   \
         d   p\        RT: RT: 24      hRp?ii ; i  \
         d   p\        R
T
,          T4      hRp?ii ; i)Tr   r   rg   r$   Nztree_delete:1r%   r&   r+   zFailed to delete ou "%s"zDeleted ou "%s"
)r-   r.   r   r   r/   r0   r   r1   r2   r3   r4   r5   r6   delete)r8   re   r   r   r   r   r   r"   r9   r:   ri   r<   controlsr>   s   &&&&&&&       r?   r@   cmd_delete.runs  s   ##%((d(C!.*:"'0	F55e<J '(H		K,,J*L%(^^2  ?C 3x1}		 :U BCLL. 			+j89%  	F5!DEE	F  	K9JFJJ	Ks6   C& AD 1D &D	1DD	D/D**D/rB   )NNNNFrD   rU   s   @r?   r   r   U  s     
 )H 	tW#JS	2'.D\M	OM JW))G..w--: :rW   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_oui  z%Organizational Units (OU) management.addcreater   mover7   listlistobjectsrB   N)rE   rF   rG   rH   rI   subcommandsrb   r   rY   r   r   rl   rS   rB   rW   r?   r   r     s_    /K K#IK&LK"*K&LK"*K!0!2KrW   r   )samba.getoptgetoptrN   r2   
samba.authr   samba.netcmdr   r   r   r   samba.samdbr   operatorr	   r   rY   rb   rl   r   r   r   rB   rW   r?   <module>r      s   &  
 %   <H <H~@>w @>F/8g /8dC.g C.L72w 72t9: 9:x
3\ 
3rW   