/usr/lib64/python2.6/site-packages/sepolgen
NameSizeModeActions
access.py116390644editdlrm
access.pyc126950644editdlrm
access.pyo126950644editdlrm
audit.py207060644editdlrm
audit.pyc205140644editdlrm
audit.pyo205140644editdlrm
classperms.py28010644editdlrm
classperms.pyc32000644editdlrm
classperms.pyo32000644editdlrm
defaults.py12870644editdlrm
defaults.pyc15160644editdlrm
defaults.pyo15160644editdlrm
interfaces.py165090644editdlrm
interfaces.pyc160510644editdlrm
interfaces.pyo160510644editdlrm
lex.py335860644editdlrm
lex.pyc201030644editdlrm
lex.pyo201030644editdlrm
matching.py86290644editdlrm
matching.pyc74860644editdlrm
matching.pyo74860644editdlrm
module.py72180644editdlrm
module.pyc85650644editdlrm
module.pyo85650644editdlrm
objectmodel.py65240644editdlrm
objectmodel.pyc47900644editdlrm
objectmodel.pyo47900644editdlrm
output.py50310644editdlrm
output.pyc45240644editdlrm
output.pyo45240644editdlrm
policygen.py144270644editdlrm
policygen.pyc140950644editdlrm
policygen.pyo140260644editdlrm
refparser.py290300644editdlrm
refparser.pyc344630644editdlrm
refparser.pyo344630644editdlrm
refpolicy.py264480644editdlrm
refpolicy.pyc442310644editdlrm
refpolicy.pyo442310644editdlrm
sepolgeni18n.py9120644editdlrm
sepolgeni18n.pyc4100644editdlrm
sepolgeni18n.pyo4100644editdlrm
util.py25730644editdlrm
util.pyc27220644editdlrm
util.pyo27220644editdlrm
yacc.py820750644editdlrm
yacc.pyc432200644editdlrm
yacc.pyo432200644editdlrm
__init__.py00644editdlrm
__init__.pyc1420644editdlrm
__init__.pyo1420644editdlrm
Edit: /usr/lib64/python2.6/site-packages/sepolgen/matching.pyo (7486B)
Ñò Ô<*Xc@sgdZddkZddkZddkZdd d„ƒYZdd d„ƒYZdd d„ƒ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((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyt__init__s  cCsk|i|ijo8|io|iodSdSqg|iodSdSn|i|ijodSdSdS(Niiiÿÿÿÿ(RR(Rtother((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyt__cmp__"s   N(t__name__t __module__tNoneRR(((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyRst MatchListcBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(i–cCs4g|_g|_|i|_t|_d|_dS(N(tchildrentbastardstDEFAULT_THRESHOLDt thresholdRtallow_info_dir_changeR tav(R((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyR6s     cCs<t|iƒo |idSt|iƒo |idSdS(Ni(tlenR RR (R((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pytbest?s   cCst|iƒt|iƒS(N(RR R(R((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyt__len__FscCs t|iƒS(N(titerR (R((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyt__iter__LscCsti|i|iƒS(N(t itertoolstchainR R(R((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pytallOscCsd|i|ijo=|i p |io|ii|ƒq`|ii|ƒn|ii|ƒdS(N(RRRRR tappendR(Rtmatch((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyRRs cCs|iiƒ|iiƒdS(N(R tsortR(R((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyR[s ( R R RRRRRRRR(((s7/usr/lib64/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_penaltyt obj_penaltyt perm_mapst objectmodelt PermMappingstinfo_dir_penalty(RR!((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyRas    cCs.||jpti|ƒodS|i SdS(Ni(taccesst is_idparamR(Rtatb((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyt type_distancemscCsu|ii|iƒ}t|ƒdjo|ii|i|ƒ}| S|ii|iƒ}|ii|i|ƒSdS(Ni(tpermst differenceRR!tgetdefault_distancet obj_class(Rtav_reqtav_provtdiffttotal((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyt perm_distancets 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((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyt av_distances ''        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( R R8R!tgetdefault_directionR-R*tinfo_dirR"t FLOW_NONEt FLOW_WRITER$(Rtav_setRRtxttmptav_dir((s7/usr/lib64/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((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyt search_ifsïs   N( R R R RR)R2R8RARJ(((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyR`s   H (((((t__doc__R%R"RRR R(((s7/usr/lib64/python2.6/site-packages/sepolgen/matching.pyts    ,