[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.143.7.112: ~ $
�
��^c@s�dZddlZddlmZddlmZddlmZdejfd��YZd	d
d
��YZddd��YZ	dS(sI
Classes and algorithms for matching requested access to access vectors.
i����Ni(taccess(tobjectmodel(tutiltMatchcBs eZddd�Zd�ZRS(icCs(||_||_t|_d|_dS(N(t	interfacetdisttFalsetinfo_dir_changetNonet__hash__(tselfRR((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyt__init__ s			cCsTy5|j|jf}|j|jf}|||�SWnttfk
rOtSXdS(N(RRtAttributeErrort	TypeErrortNotImplemented(R
tothertmethodtatb((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyt_compare(sN(t__name__t
__module__RRR(((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyRst	MatchListcBsMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(i�cCs4g|_g|_|j|_t|_d|_dS(N(tchildrentbastardstDEFAULT_THRESHOLDt	thresholdRtallow_info_dir_changeRtav(R
((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyR3s
			cCs8t|j�r|jdSt|j�r4|jdSdS(Ni(tlenRRR(R
((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pytbest<s
cCst|j�t|j�S(N(RRR(R
((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyt__len__CscCs
t|j�S(N(titerR(R
((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyt__iter__IscCstj|j|j�S(N(t	itertoolstchainRR(R
((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pytallLscCs_|j|jkrK|js%|jr8|jj|�q[|jj|�n|jj|�dS(N(RRRRRtappendR(R
tmatch((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyR%Os
cCs|jj�|jj�dS(N(RtsortR(R
((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyR'Xs
(
RRRRRRR!R$R%R'(((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyR1s								t
AccessMatchercBsAeZdd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs@d|_d|_|r$||_ntj�|_d|_dS(Ni
id(ttype_penaltytobj_penaltyt	perm_mapsRtPermMappingstinfo_dir_penalty(R
R+((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyR^s		cCs+||kstj|�rdS|jSdS(Ni(Rt
is_idparamR)(R
RR((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyt
type_distancejscCss|jj|j�}t|�dkrD|jj|j|�}|S|jj|j�}|jj|j|�SdS(Ni(tpermst
differenceRR+tgetdefault_distancet	obj_class(R
tav_reqtav_provtdiffttotal((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyt
perm_distanceqscCs	d}||j|j|j�7}||j|j|j�7}|j|jkrstj|j�rs||j8}n|dkr�|jj|j|j	�}n|j
||�}|dkr�|dkr�||S||Sn+|dkr|dkr�||S||SndS(s+Determine the 'distance' between 2 access vectors.

        This function is used to find an access vector that matches
        a 'required' access. To do this we comput a signed numeric
        value that indicates how close the req access is to the
        'provided' access vector. The closer the value is to 0
        the closer the match, with 0 being an exact match.

        A value over 0 indicates that the prov access vector provides more
        access than the req (in practice, this means that the source type,
        target type, and object class is the same and the perms in prov is
        a superset of those in req.

        A value under 0 indicates that the prov access less - or unrelated
        - access to the req access. A different type or object class will
        result in a very low value.

        The values other than 0 should only be interpreted relative to
        one another - they have no exact meaning and are likely to
        change.

        Params:
          req - [AccessVector] The access that is required. This is the
                access being matched.
          prov - [AccessVector] The access provided. This is the potential
                 match that is being evaluated for req.
        Returns:
          0   : Exact match between the acess vectors.

          < 0 : The prov av does not provide all of the access in req.
                A smaller value indicates that the access is further.

          > 0 : The prov av provides more access than req. The larger
                the value the more access over req.
        iN(R/tsrc_typettgt_typeR3RR.R*R+R2R0R8(R
treqtprovRtpdist((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pytav_distance|s '%cCsVd}x�|D]�}|j||�}|dkr:|}q
|dkrm|dkr_||7}q�||}q
|dkr�||7}q
||8}q
W|jj|j|j�}|jdkrtj|_x6|D]+}|j|jj|j|j�B|_q�Wn|tj	@dkrR|jtj	@rR|dkrB||j
8}qR||j
7}n|S(s


        iN(RR>R+tgetdefault_directionR3R0tinfo_dirRt	FLOW_NONEt
FLOW_WRITER-(R
tav_setRRtxttmptav_dir((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pytav_set_match�s.
	


&#cCs�||_x~tj|j|jj|jg��D]U}|jsFq1n|j|j	|�}|dkr1t
||�}|j|�q1q1W|j�dS(Ni(
RR"R#ttgt_type_allttgt_type_maptgetR:tenabledRGRRR%R'(R
tifsetRt
match_listtivRtm((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyt
search_ifs�s		N(	RRRRR/R8R>RGRP(((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyR(]s			H	((((
t__doc__R"tRRRt
ComparisonRRR((((s7/usr/lib64/python2.7/site-packages/sepolgen/matching.pyt<module>s,

Filemanager

Name Type Size Permission Actions
.__init__.pyo.40009 File 142 B 0644
.access.pyo.40009 File 13.18 KB 0644
.audit.pyo.40009 File 22.33 KB 0644
.classperms.pyo.40009 File 3.16 KB 0644
.defaults.pyo.40009 File 2.87 KB 0644
.interfaces.pyo.40009 File 15.86 KB 0644
.lex.pyo.40009 File 19.24 KB 0644
.matching.pyo.40009 File 7.4 KB 0644
.module.pyo.40009 File 8.4 KB 0644
.objectmodel.pyo.40009 File 4.64 KB 0644
.output.pyo.40009 File 4.51 KB 0644
.refparser.pyo.40009 File 36.27 KB 0644
.refpolicy.pyo.40009 File 46.45 KB 0644
.sepolgeni18n.pyo.40009 File 410 B 0644
.util.pyo.40009 File 7.87 KB 0644
.yacc.pyo.40009 File 41.4 KB 0644
__init__.py File 0 B 0644
__init__.pyc File 142 B 0644
__init__.pyo File 142 B 0644
access.py File 12.33 KB 0644
access.pyc File 13.18 KB 0644
access.pyo File 13.18 KB 0644
audit.py File 23.64 KB 0644
audit.pyc File 22.33 KB 0644
audit.pyo File 22.33 KB 0644
classperms.py File 2.75 KB 0644
classperms.pyc File 3.16 KB 0644
classperms.pyo File 3.16 KB 0644
defaults.py File 2.69 KB 0644
defaults.pyc File 2.87 KB 0644
defaults.pyo File 2.87 KB 0644
interfaces.py File 16.21 KB 0644
interfaces.pyc File 15.86 KB 0644
interfaces.pyo File 15.86 KB 0644
lex.py File 32.86 KB 0644
lex.pyc File 19.24 KB 0644
lex.pyo File 19.24 KB 0644
matching.py File 8.45 KB 0644
matching.pyc File 7.4 KB 0644
matching.pyo File 7.4 KB 0644
module.py File 7.12 KB 0644
module.pyc File 8.4 KB 0644
module.pyo File 8.4 KB 0644
objectmodel.py File 6.37 KB 0644
objectmodel.pyc File 4.64 KB 0644
objectmodel.pyo File 4.64 KB 0644
output.py File 5.01 KB 0644
output.pyc File 4.51 KB 0644
output.pyo File 4.51 KB 0644
policygen.py File 16.31 KB 0644
policygen.pyc File 15.25 KB 0644
policygen.pyo File 15.18 KB 0644
refparser.py File 30.2 KB 0644
refparser.pyc File 36.27 KB 0644
refparser.pyo File 36.27 KB 0644
refpolicy.py File 27.31 KB 0644
refpolicy.pyc File 46.45 KB 0644
refpolicy.pyo File 46.45 KB 0644
sepolgeni18n.py File 912 B 0644
sepolgeni18n.pyc File 410 B 0644
sepolgeni18n.pyo File 410 B 0644
util.py File 5.41 KB 0644
util.pyc File 7.87 KB 0644
util.pyo File 7.87 KB 0644
yacc.py File 80.04 KB 0644
yacc.pyc File 41.4 KB 0644
yacc.pyo File 41.4 KB 0644