ok

Mini Shell

Direktori : /proc/thread-self/root/proc/self/root/usr/lib/python2.7/site-packages/clcommon/
Upload File :
Current File : //proc/thread-self/root/proc/self/root/usr/lib/python2.7/site-packages/clcommon/clpwd.pyc

�
b=0Yc@s/ddlZddlZddd��YZdS(i����NtClPwdcBs�eZdefd��YZdd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
d�ZRS(tNoSuchUserExceptioncBseZd�ZRS(cCstj|d|f�dS(NsNo such user (%s)(t	Exceptiont__init__(tselftuser((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pyRs(t__name__t
__module__R(((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pyRscCsRi|_i|_i|_i|_|dkrE|jd�|_n	||_dS(Ni�(t
_user_key_mapt_uid_key_mapt_user_full_mapt
_uid_full_maptNonetget_sys_min_uidt_min_uid(Rtmin_uid((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pyR	s				cCs|j�|jS(N(t_load_passwd_databaseR(R((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pyt
get_user_dicts
cCs|j�|jS(N(RR	(R((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pytget_uid_dicts
cCs|j�|jS(N(RR
(R((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pytget_user_full_dicts
cCs|j�|jS(N(RR(R((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pytget_uid_full_dicts
cCs9y|j�|SWn tk
r4tj|��nXdS(s*
        Return pw_entry for user
        N(RtKeyErrorRR(RR((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pytget_pw_by_name#s
cCs9y|j�|SWn tk
r4tj|��nXdS(s7
        Return list of passwd entries for uid
        N(RRRR(Rtuid((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pyt
get_pw_by_uid,s
cCs<y|j�|jSWn tk
r7tj|��nXdS(s&
        Returns uid for user
        N(Rtpw_uidRRR(RR((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pytget_uid5s
cCs<y|j�|jSWn tk
r7tj|��nXdS(s`
        Returns homedir for a user
        @param user: string
        @return: string
        N(Rtpw_dirRRR(RR((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pytget_homedir>s
cCs�|js�x�tj�D]�}||j|j<|j|jkrQg|j|j<n|j|jj|�|j|jkr||j|j<|j|j	kr�g|j	|j<n|j	|jj|�qqWndS(sZ
        Loads the passwd database and fills user_to_uid and user_to_homedir maps
        N(
RtpwdtgetpwallR
tpw_nameRtappendRRR	(Rtentry((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pyRIs	cCsQy|j�|}Wn tk
r6tj|��nXg|D]}|j^q>S(ss
        Return names of users with uid specified
        @param uid: int
        @return: list of strings
        (RRRRR(RRtentriesR!((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pyt	get_namesYs

i�cCs�d}tjj|�r�t|d�}xX|D]M}|jd�r.y!t|jd�dj��SWq{tk
rwq{Xq.q.Wn|S(s�
        Return system defined MIN_UID from /etc/login.def or def_min_uid
        @param def_min_uid: int
        @return: MIN_UID: int
        s/etc/login.defstrtUID_MINi(	tostpathtexiststopent
startswithtinttsplittstript
ValueError(Rtdef_min_uidtLOGIN_DEF_FILEtlinestline((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pyR
gs
!
N(RRRRRRRRRRRRRRRR#R
(((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pyRs
													((RR&R(((s2/usr/lib/python2.7/site-packages/clcommon/clpwd.pyt<module>s

Zerion Mini Shell 1.0