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 :  /usr/lib64/python2.4/site-packages/sepolgen/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/site-packages/sepolgen/objectmodel.pyo
m
d&KRc	@sdZddddddddd	g	Zd
ZdZdZeeBZhd
e<de<de<de<Zhed
<ed<ed<ed<ZdfdYZdfdYZ	dS(s
This module provides knowledge object classes and permissions. It should
be used to keep this knowledge from leaking into the more generic parts of
the policy generation.
tsockettfdtprocesstfiletlnk_filet	fifo_filetdbust
capabilitytunix_stream_socketiiitntrtwtbtPermMapcBs tZdZdZdZRS(sA mapping between a permission and its information flow properties.

    PermMap represents the information flow properties of a single permission
    including the direction (read, write, etc.) and an abstract representation
    of the bandwidth of the flow (weight).
    cCs||_||_||_dS(N(tpermtselftdirtweight(RRRR((t:/usr/lib64/python2.4/site-packages/sepolgen/objectmodel.pyt__init__Ts		cCsd|it|i|ifS(Ns'<sepolgen.objectmodel.PermMap %s %s %d>(RRt
dir_to_strRR(R((Rt__repr__Ys(t__name__t
__module__t__doc__RR(((RR
Ms	tPermMappingscBsDtZdZdZdZdZdZdZdZRS(sThe information flow properties of a set of object classes and permissions.

    PermMappings maps one or more classes and permissions to their PermMap objects
    describing their information flow charecteristics.
    cCsh|_d|_t|_dS(Ni(Rtclassestdefault_weightt	FLOW_BOTHtdefault_dir(R((RRds		cCs6d
}x)|D]!}|i}t|djp$t|djp|ddjoq
n|ddjoK|d}|i	i
|otdnh|i	|<|i	|}q
t|djotdn|d
jotdnt|dt
|dt|d	}|||i<q
Wd
S(ssRead the permission mappings from a file. This reads the format used
        by Apol in the setools suite.
        iit#tclasssduplicate class in perm mapis"error in object classs permissionsspermission outside of classiN(tNonetcurRtlinetsplittfieldstlentcRRthas_keyt
ValueErrorR
t
str_to_dirtinttpmR(RRR!R$R&R"R+((Rt	from_fileis&7


(cCs|i||S(sGet the permission map for the object permission.

        Returns:
          PermMap representing the permission
        Raises:
          KeyError if the object or permission is not defined
        N(RRtobjR(RR-R((RtgetscCsEy|i||}Wn)tj
ot||i|iSnX|S(sGet the permission map for the object permission or a default.

        getdefault is the same as get except that a default PermMap is
        returned if the object class or permission is not defined. The
        default is FLOW_BOTH with a weight of 5.
        N(	RRR-RR+tKeyErrorR
RR(RR-RR+((Rt
getdefaultscCs:t}x-|D]%}|i||}||iB}q
W|S(N(t	FLOW_NONERtpermsRRR0R-R+(RR-R2RRR+((Rtgetdefault_directionscCs:d}x-|D]%}|i||}||i7}q
W|S(Ni(ttotalR2RRR0R-R+R(RR-R2RR4R+((Rtgetdefault_distances(	RRRRR,R.R0R3R5(((RR^s			
	
	N(
Rtimplicitly_typed_objectsR1t	FLOW_READt
FLOW_WRITERR)RR
R(	R6RR8R1RR)R
R7R((Rt?s!
**

Anon7 - 2021