%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/samba/netcmd/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/samba/netcmd/__pycache__/dsacl.cpython-312.pyc

�

�I�dZ"��.�ddlmZddlmZddlmZddlmZddl	m
Z
mZddlm
Z
mZmZmZmZmZmZmZmZmZmZmZmZddlZddlmZddlZddlmZdd	lm Z m!Z!m"Z"m#Z#Gd
�de �Z$Gd�d
e$�Z%Gd�de$�Z&Gd�de$�Z'Gd�de"�Z(y)�N)�sd_utils)�security)�SamDB)�
ndr_unpack�ndr_pack)
�GUID_DRS_ALLOCATE_RIDS�GUID_DRS_CHANGE_DOMAIN_MASTER�GUID_DRS_CHANGE_INFR_MASTER�GUID_DRS_CHANGE_PDC�GUID_DRS_CHANGE_RID_MASTER�GUID_DRS_CHANGE_SCHEMA_MASTER�GUID_DRS_GET_CHANGES�GUID_DRS_GET_ALL_CHANGES� GUID_DRS_GET_FILTERED_ATTRIBUTES�GUID_DRS_MANAGE_TOPOLOGY�GUID_DRS_MONITOR_TOPOLOGY�GUID_DRS_REPL_SYNCRONIZE�GUID_DRS_RO_REPL_SECRET_SYNC)�
SCOPE_BASE)�system_session)�Command�CommandError�SuperCommand�Optionc�d�eZdZdZdZejejejd�Z	dd�Z
y)�cmd_dsacl_basezBase class for DSACL commands.z%prog [options])�	sambaopts�credopts�versionoptsc��|j|�}|jj|�d|�d��|jj|dz�y)Nzdescriptor for z:
�
)�get_sd_as_sddl�outf�write)�self�	sd_helper�	object_dn�prefix�	desc_sddls     �4/usr/lib/python3/dist-packages/samba/netcmd/dsacl.py�	print_aclzcmd_dsacl_base.print_acl9s<���,�,�Y�7�	��	�	���F�I�F�G��	�	���	�D�(�)�N)�)�__name__�
__module__�__qualname__�__doc__�synopsis�options�SambaOptions�CredentialsOptions�VersionOptions�takes_optiongroupsr+�r,r*rr.s4��(� �H��)�)��.�.��-�-���*r,rc
��eZdZdZdZedddedd��ed	d
gd�e��ed
d
ddgd��eddd��eddd��eddd��gZd�Zd�Z		dd�Z
y)�
cmd_dsacl_setz)Modify access list on a directory object.z+ The access control right to allow or deny �-H�--URL�%LDB URL for database or target server�URL�H��help�type�metavar�destz--car�choice�
z
change-ridz
change-pdczchange-infrastructurez
change-schemaz
change-naming�
allocate_ridszget-changeszget-changes-allzget-changes-filteredztopology-manageztopology-monitorz	repl-synczro-repl-secret-sync)rB�choicesrAz--action�allow�denyzDeny or allow access�
--objectdn�#DN of the object whose SD to modify�string�rArBz--trusteednz!DN of the entity that gets access�--sddlz1An ACE or group of ACEs to be added on the objectc��|j|dt��}t|�dk(sJ�ttj
|ddd�S)Nz(objectClass=*))�base�
expression�scope�r�	objectSid)�searchr�lenrr�dom_sid)r%�samdb�	trusteedn�ress    r*�find_trustee_sidzcmd_dsacl_set.find_trustee_sid_sN���l�l�	�6G�!+��-���3�x�1�}��}��(�*�*�C��F�;�,?��,B�C�Cr,c�.�|j||�\}}|D];}|j|j�}|jj	d|z��=|D];}|j|j�}|jj	d|z��=y)zAdd new ace explicitly.�%WARNING: ignored INHERITED_ACE (%s).
zDWARNING: (%s) was already found in the current security descriptor.
N)�dacl_prepend_aces�as_sddl�
domain_sidr#r$)r%r&r'�new_ace�ai�ii�ace�sddls        r*�add_acezcmd_dsacl_set.add_acees����+�+�I�w�?���2��	M�C��;�;�y�3�3�4�D��I�I�O�O�D�t�K�L�	M��	l�C��;�;�y�3�3�4�D��I�I�O�O�c�fj�j�k�	lr,Nc
��|j�}
|j|
�}|�|�|�|�|�|j�St|t	�||
��}tj|�}
tttttttttt t"t$t&d�
}|j)||�}|r|}nD|dk(rd||�dt+|��d�}n)|dk(rd||�dt+|��d�}nt-d	|z��|j/|
|d
��|j1|
||�|j/|
|d��y)
N��url�session_info�credentials�lprFrIz(OA;;CR;z;;�)rJz(OD;;CR;zWrong argument '%s'!�old �r(�new )�get_loadparm�get_credentials�usagerrr�SDUtilsrrr
r
r	rrrrrrrrr\�strrr+rg)r%�car�action�objectdnrZrfr?rrrrm�credsrYr&�cars�sidrbs                 r*�runzcmd_dsacl_set.runos-��
�
#�
#�
%���(�(��,���<�S�[�F�N� (� 0�I�4E��:�:�<���!�.�*:�"'�B�0���$�$�U�+�	�8�1�)D�!>�!>�!7�3�#;�(H�#;�$=�5�'C�
���#�#�E�9�5����G�
�w�
�+/��9�c�#�h�?�G�
�v�
�+/��9�c�#�h�?�G��5��>�?�?����y�(�6��:����Y��'�2����y�(�6��:r,�NNNN)r.r/r0r1�car_helprrv�
takes_optionsr\rgr}r8r,r*r:r:?s���3�@�H�	�t�W�#J���S�	2��w�X�0G��
	�	�z��7�F�2C�.�	0��|�"G��	��}�#F��	��x�Q��	�/�M�6D�l�@D�&;r,r:c�L�eZdZdZedddedd��edd	d
��gZ	dd
�Zy)�
cmd_dsacl_getz(Print access list on a directory object.r;r<r=r>r?r@rKrLrMrNNc���|j�}|j|�}t|t�||��}t	j
|�}	|j
|	|�y)Nri)rrrsrrrrur+)
r%ryr?rrrrmrzrYr&s
          r*r}zcmd_dsacl_get.run�sT��
�
#�
#�
%���(�(��,���!�.�*:��"�&���$�$�U�+�	����y�(�+r,r~)r.r/r0r1rrvr�r}r8r,r*r�r��s@��2�	�t�W�#J���S�	2��|�"G��	�
�M�@D�,r,r�c�d�eZdZdZedddedd��edd	d
��edd
d
��gZdd�Zd�Zy)�cmd_dsacl_deletez2Delete an access list entry on a directory object.r;r<r=r>r?r@rKrLrMrNrOz5An ACE or group of ACEs to be deleted from the objectNc�<�|j�}|j|�}|�|�|j�St|t	�||��}	tj|	�}
|j|
|d��|j|
||�|j|
|d��y)Nrirorprq)	rrrsrtrrrrur+�
delete_ace)r%ryrfr?rrrrmrzrYr&s           r*r}zcmd_dsacl_delete.run�s���
�
#�
#�
%���(�(��,���<�8�+��:�:�<���!�.�*:�"'�B�0���$�$�U�+�	����y�(�6��:����	�8�T�2����y�(�6��:r,c�.�|j||�\}}|D];}|j|j�}|jj	d|z��=|D];}|j|j�}|jj	d|z��=y)zDelete ace explicitly.r^z@WARNING: (%s) was not found in the current security descriptor.
N)�dacl_delete_acesr`rar#r$)r%r&r'�delete_aces�dirdrerfs        r*r�zcmd_dsacl_delete.delete_ace�s����*�*�9�k�B���2��	M�C��;�;�y�3�3�4�D��I�I�O�O�D�t�K�L�	M��	h�C��;�;�y�3�3�4�D��I�I�O�O�_�bf�f�g�	hr,r~)	r.r/r0r1rrvr�r}r�r8r,r*r�r��sO��<�	�t�W�#J���S�	2��|�"G��	��x�U��	�
�M�
;�hr,r�c�P�eZdZdZiZe�ed<e�ed<e�ed<y)�	cmd_dsaclzDS ACLs manipulation.�set�get�deleteN)r.r/r0r1�subcommandsr:r�r�r8r,r*r�r��s/����K�&��K���&��K���,�.�K��r,r�))�samba.getopt�getoptr3�sambar�samba.dcerpcr�samba.samdbr�	samba.ndrrr�samba.dcerpc.securityrr	r
rrr
rrrrrrr�ldbr�re�
samba.authr�samba.netcmdrrrrrr:r�r�r�r8r,r*�<module>r�s���&��!��*�"�"�"�"���	�%���*�W�*�"V;�N�V;�r,�N�,�*#h�~�#h�L/��/r,

Zerion Mini Shell 1.0