MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/3/root/usr/lib/python2.4/site-packages/sepolgen/objectmodel.pyo
m
=&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((t8/usr/lib/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!
**