%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/python/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/python/__pycache__/fakepwd.cpython-312.pyc

�

Ϫ�f���p�dZddlmZmZddgZGd�d�ZGd�d�ZGd�d	�ZGd
�d�Zy)zM
L{twisted.python.fakepwd} provides a fake implementation of the L{pwd} API.
�)�List�Optional�UserDatabase�ShadowDatabasec�J�eZdZdZdededededededed	d
fd�Zd	efd�Zd
�Zy
)�_UserRecordz�
    L{_UserRecord} holds the user data for a single user in L{UserDatabase}.
    It corresponds to the C{passwd} structure from the L{pwd} module.
    See that module for attribute documentation.
    �name�password�uid�gid�gecos�home�shell�returnNc�f�||_||_||_||_||_||_||_y�N��pw_name�	pw_passwd�pw_uid�pw_gid�pw_gecos�pw_dir�pw_shell)�selfr	r
rrr
rrs        �8/usr/lib/python3/dist-packages/twisted/python/fakepwd.py�__init__z_UserRecord.__init__s5�����!�����������
������
�c��y)N���rs r�__len__z_UserRecord.__len__'���rc��|j|j|j|j|j|j
|jf|Srr�r�indexs  r�__getitem__z_UserRecord.__getitem__*sG���L�L��N�N��K�K��K�K��M�M��K�K��M�M�
���	r�	�__name__�
__module__�__qualname__�__doc__�str�intrr#r(r!rrrrsk���������	�
���
�����
��$���	rrc��eZdZUdZeeed<dZeed<dZ	eed<dd	�Z
						dded
edeed
eededededdfd�Z
dedefd�Zdedefd�Zdeefd�Zy)rz�
    L{UserDatabase} holds a traditional POSIX user data in memory and makes it
    available via the same API as L{pwd}.

    @ivar _users: A C{list} of L{_UserRecord} instances holding all user data
        added to this database.
    �_usersiu'�_lastUIDi�N�_lastGIDrNc��g|_yr�r1r"s rrzUserDatabase.__init__C�	����rr
�usernamerrr
rrc	���|�!|j}|xjdz
c_|�!|j}|xjdz
c_t|||||||�}|jj	|�y)a�
        Add a new user record to this database.

        @param username: The value for the C{pw_name} field of the user
            record to add.

        @param password: The value for the C{pw_passwd} field of the user
            record to add.

        @param uid: The value for the C{pw_uid} field of the user record to
            add.

        @param gid: The value for the C{pw_gid} field of the user record to
            add.

        @param gecos: The value for the C{pw_gecos} field of the user record
            to add.

        @param home: The value for the C{pw_dir} field of the user record to
            add.

        @param shell: The value for the C{pw_shell} field of the user record to
            add.
        N�)r2r3rr1�append)	rr7r
rrr
rr�newUsers	         r�addUserzUserDatabase.addUserFse��D�;��-�-�C��M�M�Q��M��;��-�-�C��M�M�Q��M��h��#�s�E�4��O�������7�#rc�^�|jD]}|j|k(s�|cSt��)zH
        Return the user record corresponding to the given uid.
        )r1r�KeyError)rr�entrys   r�getpwuidzUserDatabase.getpwuidqs2���[�[�	�E��|�|�s�"���	��j�rr	c��t|t�stdt|�����|jD]}|j
|k(s�|cSt
��)zM
        Return the user record corresponding to the given username.
        z%getpwuam() argument must be str, not )�
isinstancer.�	TypeError�typer1rr>)rr	r?s   r�getpwnamzUserDatabase.getpwnamzsS���$��$��C�D��J�<�P�Q�Q��[�[�	�E��}�}��$���	��j�rc��|jS)z4
        Return a list of all user records.
        r5r"s r�getpwallzUserDatabase.getpwall�����{�{�r�rN)r
NN�rJz/bin/sh)r*r+r,r-rr�__annotations__r2r/r3rr.rr<r@rErGr!rrrr6s����
�����H�c���H�c���#�!�!����)$��)$��)$��c�]�	)$�
�c�]�)$��
)$��)$��)$�
�)$�V�C��K��	�S�	�[�	��$�{�+�rc�R�eZdZdZdededededededed	ed
eddfd
�Zdefd�Zd�Zy)�
_ShadowRecordz�
    L{_ShadowRecord} holds the shadow user data for a single user in
    L{ShadowDatabase}.  It corresponds to C{spwd.struct_spwd}.  See that class
    for attribute documentation.
    r7r
�
lastChange�min�max�warn�inact�expire�flagrNc
��||_||_||_||_||_||_||_||_|	|_yr�	�sp_nam�sp_pwd�	sp_lstchg�sp_min�sp_max�sp_warn�sp_inact�	sp_expire�sp_flag�
rr7r
rNrOrPrQrRrSrTs
          rrz_ShadowRecord.__init__�sC��������#��������������
������rc��y)N�	r!r"s rr#z_ShadowRecord.__len__�r$rc	���|j|j|j|j|j|j
|j|j|jf	|SrrVr&s  rr(z_ShadowRecord.__getitem__�sU���K�K��K�K��N�N��K�K��K�K��L�L��M�M��N�N��L�L�

��
�
	rr)r!rrrMrM�s���������	�
���
���������
��,���rrMc�p�eZdZUdZeeed<dd�Zdedede	d	e	d
e	de	de	d
e	de	ddfd�Z
dedefd�Zd�Zy)rz�
    L{ShadowDatabase} holds a shadow user database in memory and makes it
    available via the same API as C{spwd}.

    @ivar _users: A C{list} of L{_ShadowRecord} instances holding all user data
        added to this database.

    @since: 12.0
    r1rNc��g|_yrr5r"s rrzShadowDatabase.__init__�r6rr7r
rNrOrPrQrRrSrTc

�\�|jjt|||||||||	�	�y)a�
        Add a new user record to this database.

        @param username: The value for the C{sp_nam} field of the user record to
            add.

        @param password: The value for the C{sp_pwd} field of the user record to
            add.

        @param lastChange: The value for the C{sp_lstchg} field of the user
            record to add.

        @param min: The value for the C{sp_min} field of the user record to add.

        @param max: The value for the C{sp_max} field of the user record to add.

        @param warn: The value for the C{sp_warn} field of the user record to
            add.

        @param inact: The value for the C{sp_inact} field of the user record to
            add.

        @param expire: The value for the C{sp_expire} field of the user record
            to add.

        @param flag: The value for the C{sp_flag} field of the user record to
            add.
        N)r1r:rMr`s
          rr<zShadowDatabase.addUser�s2��P	
�������(�J��S�$��v�t�
�	
rc��t|t�stdt|�����|jD]}|j
|k(s�|cSt
|��)zT
        Return the shadow user record corresponding to the given username.
        z%getspnam() argument must be str, not )rBr.rCrDr1rWr>)rr7r?s   r�getspnamzShadowDatabase.getspnam�sW���(�C�(��C�D��N�CS�T�U�U��[�[�	�E��|�|�x�'���	��x� � rc��|jS)z;
        Return a list of all shadow user records.
        r5r"s r�getspallzShadowDatabase.getspallrHrrI)
r*r+r,r-rrMrKrr.r/r<rhrjr!rrrr�s����
�����,
��,
��,
��	,
�
�,
��
,
��,
��,
��,
��,
�
�,
�\	!��	!��	!�rN)	r-�typingrr�__all__rrrMrr!rr�<module>rmsI��
�"��+�
,��%�%�PS�S�l+�+�\M�Mr

Zerion Mini Shell 1.0