403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/sepolgen/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/sepolgen/matching.pyc
Ñò
†·Jc@sgdZddkZddkZddkZdd	d„ƒYZdd
d„ƒYZddd„ƒYZdS(sI
Classes and algorithms for matching requested access to access vectors.
iÿÿÿÿNtMatchcBs eZddd„Zd„ZRS(icCs||_||_t|_dS(N(t	interfacetdisttFalsetinfo_dir_change(tselfRR((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyt__init__s		cCsk|i|ijo8|io|iodSdSqg|iodSdSn|i|ijodSdSdS(Niiiÿÿÿÿ(RR(Rtother((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyt__cmp__"s


N(t__name__t
__module__tNoneRR(((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyRst	MatchListcBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	RS(ixcCs4g|_g|_|i|_t|_d|_dS(N(tchildrentbastardstDEFAULT_THRESHOLDt	thresholdRtallow_info_dir_changeRtav(R((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyR6s
			cCs$t|iƒo|idSdSdS(Ni(tlenR
R(R((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pytbest?scCs
t|iƒS(N(RR
(R((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyt__len__EscCs
t|iƒS(N(titerR
(R((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyt__iter__KscCsti|i|iƒS(N(t	itertoolstchainR
R(R((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pytallNscCsd|i|ijo=|ip
|io|ii|ƒq`|ii|ƒn|ii|ƒdS(N(RRRRR
tappendR(Rtmatch((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyRQs
cCs|iiƒ|iiƒdS(N(R
tsortR(R((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyRZs
(
R	R
RRRRRRRR(((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyR4s								t
AccessMatchercBsAeZdd„Zd„Zd„Zd„Zd„Zd„ZRS(cCsBd|_d|_|o
||_ntiƒ|_d|_dS(Ni
id(ttype_penaltytobj_penaltyt	perm_mapstobjectmodeltPermMappingstinfo_dir_penalty(RR!((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyR`s		
cCs.||jpti|ƒodS|iSdS(Ni(taccesst
is_idparamR(Rtatb((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyt
type_distancelscCsu|ii|iƒ}t|ƒdjo|ii|i|ƒ}|S|ii|iƒ}|ii|i|ƒSdS(Ni(tpermst
differenceRR!tgetdefault_distancet	obj_class(Rtav_reqtav_provtdiffttotal((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyt
perm_distancesscCsd}||i|i|iƒ7}||i|i|iƒ7}|i|ijo%ti|iƒo||i8}n|djo|ii|i|i	ƒ}n|i
||ƒ}|djo"|djo	||S||Sn0|djo"|djo	||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_typeR-R%R&R R!R,R*R2(RtreqtprovRtpdist((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pytav_distance~s ''


	

	cCsed}x“|D]‹}|i||ƒ}|djo
|}q
|djo*|djo||7}q˜||}q
|djo||7}q
||8}q
W|ii|i|iƒ}|idjoFti|_x7|D]+}|i|ii|i|iƒB|_qÚWn|ti	@djo@|iti	@o/|djo||i
8}qa||i
7}n|S(s


        iN(RR8R!tgetdefault_directionR-R*tinfo_dirR"t	FLOW_NONEt
FLOW_WRITER$(Rtav_setRRtxttmptav_dir((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pytav_set_matchÆs2




'%
cCsœ||_x‚ti|i|ii|igƒƒD]Y}|ipq1n|i|i	|ƒ}|djo t
||ƒ}|i|ƒq1q1W|iƒdS(Ni(
RRRttgt_type_allttgt_type_maptgetR4tenabledRAR%RRR(RtifsetRt
match_listtivRtm((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyt
search_ifsîs	

N(	R	R
RRR)R2R8RARJ(((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyR_s			H	(((((t__doc__R%R"RRRR(((s5/usr/lib/python2.6/site-packages/sepolgen/matching.pyt<module>s+

Youez - 2016 - github.com/yon3zu
LinuXploit