+
    Dfj                     r    R t ^ RIHtHt RR.t ! R R4      t ! R R4      t ! R R4      t ! R	 R4      tR
# )zM
L{twisted.python.fakepwd} provides a fake implementation of the L{pwd} API.
)ListOptionalUserDatabaseShadowDatabasec                   N   a  ] tR t^t o RtV 3R lR ltV 3R lR ltR tRtV t	R# )	_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.
c                H   < V ^8  d   QhRS[ RS[ RS[RS[RS[ RS[ RS[ RR	/# )
   namepassworduidgidgecoshomeshellreturnNstrint)format__classdict__s   "8/usr/lib/python3/dist-packages/twisted/python/fakepwd.py__annotate___UserRecord.__annotate__   s[        	
     
    c                Z    Wn         W n        W0n        W@n        WPn        W`n        Wpn        R # Npw_name	pw_passwdpw_uidpw_gidpw_gecospw_dirpw_shell)selfr
   r   r   r   r   r   r   s   &&&&&&&&r   __init___UserRecord.__init__   s'     !r   c                    < V ^8  d   QhRS[ /# r	   r   r   )r   r   s   "r   r   r   '          r   c                    ^# )    r%   s   &r   __len___UserRecord.__len__'       r   c                    V P                   V P                  V P                  V P                  V P                  V P
                  V P                  3V,          # r   r   r%   indexs   &&r   __getitem___UserRecord.__getitem__*   sG    LLNNKKKKMMKKMM
  	r   )r#   r"   r!   r   r   r$   r    N
__name__
__module____qualname____firstlineno____doc__r&   r0   r6   __static_attributes____classdictcell__r   s   @r   r   r      s(      $ 	 	r   r   c                      a  ] tR t^6t o RtRtRtV 3R lR ltRV 3R lR lltV 3R	 lR
 lt	V 3R lR lt
V 3R lR ltV 3R ltRtV tR# )r   z
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.
iu'  iN  c                   < V ^8  d   QhRR/# r	   r   Nr.   )r   r   s   "r   r   UserDatabase.__annotate__C         $ r   c                    . V n         R # r   _usersr/   s   &r   r&   UserDatabase.__init__C   	    r   Nc                h   < V ^8  d   QhRS[ RS[ RS[S[,          RS[S[,          RS[ RS[ RS[ RR	/# )
r	   usernamer   r   r   r   r   r   r   N)r   r   r   )r   r   s   "r   r   rD   F   sc     )$ )$)$ )$ c]	)$
 c])$ )$ )$ )$ 
)$r   c           	         Vf&   V P                   pV ;P                   ^,          un         Vf&   V P                  pV ;P                  ^,          un        \        WW4WVV4      pV P                  P	                  V4       R# )ab  
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)_lastUID_lastGIDr   rH   append)	r%   rL   r   r   r   r   r   r   newUsers	   &&&&&&&& r   addUserUserDatabase.addUserF   s_    D ;--CMMQM;--CMMQMh#EO7#r   c                &   < V ^8  d   QhRS[ RS[/# )r	   r   r   )r   r   )r   r   s   "r   r   rD   q   s      C K r   c                f    V P                    F  pVP                  V8X  g   K  Vu # 	  \        4       h)z8
Return the user record corresponding to the given uid.
)rH   r    KeyError)r%   r   entrys   && r   getpwuidUserDatabase.getpwuidq   s-     [[E||s" ! jr   c                &   < V ^8  d   QhRS[ RS[/# )r	   r
   r   )r   r   )r   r   s   "r   r   rD   z   s     	 	S 	[ 	r   c                    \        V\        4      '       g   \        R\        V4       24      hV P                   F  pVP
                  V8X  g   K  Vu # 	  \        4       h)z=
Return the user record corresponding to the given username.
z%getpwuam() argument must be str, not )
isinstancer   	TypeErrortyperH   r   rV   )r%   r
   rW   s   && r   getpwnamUserDatabase.getpwnamz   sQ     $$$CDJ<PQQ[[E}}$ ! jr   c                0   < V ^8  d   QhRS[ S[,          /# r)   )r   r   )r   r   s   "r   r   rD      s      ${+ r   c                    V P                   # )z$
Return a list of all user records.
rG   r/   s   &r   getpwallUserDatabase.getpwall        {{r   c                N   < V ^8  d   Qh/ S[ S[,          ;R&   S[;R&   S[;R&   # )r	   rH   rN   rO   )r   r   r   )r   r   s   "r   r   rD   6   s1           r   rG   )r   NN rg   z/bin/sh)r9   r:   r;   r<   r=   rN   rO   r&   rR   rX   r_   rc   __annotate_func__r>   r?   r@   s   @r   r   r   6   sQ      HH )$ )$V 	 	 _  r   c                   N   a  ] tR t^t o RtV 3R lR ltV 3R lR ltR tRtV t	R# )	_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.
c                T   < V ^8  d   QhRS[ RS[ RS[RS[RS[RS[RS[RS[R	S[R
R/
# r	   rL   r   
lastChangeminmaxwarninactexpireflagr   Nr   )r   r   s   "r   r   _ShadowRecord.__annotate__   so        	
       
r   c
                r    Wn         W n        W0n        W@n        WPn        W`n        Wpn        Wn        Wn        R # r   	sp_namsp_pwd	sp_lstchgsp_minsp_maxsp_warnsp_inact	sp_expiresp_flag
r%   rL   r   rm   rn   ro   rp   rq   rr   rs   s
   &&&&&&&&&&r   r&   _ShadowRecord.__init__   s1     #r   c                    < V ^8  d   QhRS[ /# r)   r*   )r   r   s   "r   r   rt      r+   r   c                    ^	# )	   r.   r/   s   &r   r0   _ShadowRecord.__len__   r2   r   c           	         V P                   V P                  V P                  V P                  V P                  V P
                  V P                  V P                  V P                  3	V,          # r   rv   r4   s   &&r   r6   _ShadowRecord.__getitem__   sU    KKKKNNKKKKLLMMNNLL

 
 
	r   )	r~   r   r}   ry   r{   rz   rw   rx   r|   Nr8   r@   s   @r   rj   rj      s(      ,  r   rj   c                   l   a  ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R lR ltR tV 3R	 lt	R
t
V tR# )r   z
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
c                   < V ^8  d   QhRR/# rC   r.   )r   r   s   "r   r   ShadowDatabase.__annotate__   rE   r   c                    . V n         R # r   rG   r/   s   &r   r&   ShadowDatabase.__init__   rJ   r   c                T   < V ^8  d   QhRS[ RS[ RS[RS[RS[RS[RS[RS[R	S[R
R/
# rl   r   )r   r   s   "r   r   r      so     ,
 ,
,
 ,
 	,

 ,
 ,
 ,
 ,
 ,
 ,
 
,
r   c
                V    V P                   P                  \        WW4WVWxV	4	      4       R# )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)rH   rP   rj   r   s
   &&&&&&&&&&r   rR   ShadowDatabase.addUser   s*    P 	JSt	
r   c                &   < V ^8  d   QhRS[ RS[/# )r	   rL   r   )r   rj   )r   r   s   "r   r   r      s     	! 	! 	! 	!r   c                    \        V\        4      '       g   \        R\        V4       24      hV P                   F  pVP
                  V8X  g   K  Vu # 	  \        V4      h)zD
Return the shadow user record corresponding to the given username.
z%getspnam() argument must be str, not )r\   r   r]   r^   rH   rw   rV   )r%   rL   rW   s   && r   getspnamShadowDatabase.getspnam   sU     (C((CDNCSTUU[[E||x' ! x  r   c                    V P                   # )z+
Return a list of all shadow user records.
rG   r/   s   &r   getspallShadowDatabase.getspall  re   r   c                6   < V ^8  d   Qh/ S[ S[,          ;R&   # )r	   rH   )r   rj   )r   r   s   "r   r   r      s       r   rG   N)r9   r:   r;   r<   r=   r&   rR   r   r   rh   r>   r?   r@   s   @r   r   r      s6      ,
 ,
\	! 	!S  r   N)	r=   typingr   r   __all__r   r   rj   r   r.   r   r   <module>r      sI   
 "+
,% %PS Sl+ +\M Mr   