KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21573/root/usr/lib/python2.4/site-packages/setroubleshoot/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/lib/python2.4/site-packages/setroubleshoot/access_control.pyo
mò
3ÔUc@sNdZdkZdkZdkZdkZdklZdkTdk	Z	dgZ
y
eiZWn×ej
oËei
ƒdZeideƒo
dZq7eideƒo
dZq7eid	eƒo
d
Zq7eideƒo
dZq7eid
eƒo
dZq7eideƒo
dZq7dZnXdfd„ƒYZdS(s©Access control for setroubleshoot. For now this is only used for
determining which users are allowed to connect to the server: see
UserServerAccess for more information.N(s
get_config(t*tServerAccessis^i\d86is^x86_64s^(ppc|powerpc)is
^(alpha|mips)is^sparci@s^parisci@cBswtZdZhdhde<<dhde<<Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„ZRS(sg
    Determine if a user should be given access to the server based
    on the configuration file.
    tclienttwildcardtfix_cmdcCs=h|_x-tiiƒD]}|i|ƒ|i|<qWdS(N(tselft
privilegesRtkeyst	privilegetinit_privilege(RR((tA/usr/lib/python2.4/site-packages/setroubleshoot/access_control.pyt__init__Cs	cCsAg}tdd|ƒidƒD]}||iƒq!~}|S(Ntaccesss%s_userst,(t_[1]t
get_configRtsplittnametstript	cfg_names(RRRRR((R
R	Ns=cCs5tii|ƒ}|otSntid|ƒtS(Nsunknown access privilege (%s)(	RRthas_keyRtvalidtTruetlog_programterrortFalse(RRR((R
tvalid_privilegeSs
cCsC|i|ƒptSnti|dptSnd|i|jS(NRR(RRRRRR(RR((R
tunrestricted_privilegeYs
cCsT|i|ƒptSn|i|ƒotSn||i|jotSntSdS(sƒ
        Determine if the given user name is allowed access.
        Returns True if access should be given, False if not.
        N(RRRRRRtuserR(RRR((R
tuser_allowed`scCsq|i|ƒptSn|i|ƒotSnyti|ƒ}Wnt
j
otSnX|i||dƒS(sÅ
        Determine if the given uid is allowed access. No error
        is returned if the uid is invalid (False is returned).
        Returns True if access should be given, False if not.
        iN(RRRRRRtpwdtgetpwuidtuidt	pwd_entrytKeyErrorR(RRR R!((R
tuid_allowedns	c
Cs d}}}y+|i}|tijo||fSnWntj
onXd}t
i|ƒ}y||i
tit|ƒ}t
i||ƒ\}}}|djo
d}n|djo
d}n|djo
d}nWn3tj
o'}	d}}}tid|	ƒnX||fS(sêObtain the effective user and group IDs of the process on
        the other end of a socket. SO_PEERCRED is used so the information
        returned is generally trustworthy (though root processes can
        impersonate any uid/gid).tIIIiÿÿÿÿsget_credentials(): %sN(tNonetpidR tgidtsocktfamilytSockettAF_UNIXtAttributeErrortformat_ucredtstructtcalcsizetsizeof_ucredt
getsockoptt
SOL_SOCKETtSO_PEERCREDtucredtunpackt	ExceptionteRR(
RR(R4R R)R&R0R-R'R7((R
tget_credentials‚s.	




(
t__name__t
__module__t__doc__RRRRR	RRRR#R8(((R
R9s*						(R;tostreR.tsocketR*tsetroubleshoot.configRtsetroubleshoot.logRt__all__R3R,tunametmachinetsearchR(
R.RARR3RCR=RRR<R*((R
t?s4				
		








Anon7 - 2021