/usr/lib64/python3.9/site-packages/setools/__pycache__
NameSizeModeActions
boolquery.cpython-39.opt-1.pyc21010644editdlrm
boolquery.cpython-39.pyc21010644editdlrm
boundsquery.cpython-39.opt-1.pyc18830644editdlrm
boundsquery.cpython-39.pyc18830644editdlrm
categoryquery.cpython-39.opt-1.pyc16820644editdlrm
categoryquery.cpython-39.pyc16820644editdlrm
commonquery.cpython-39.opt-1.pyc19120644editdlrm
commonquery.cpython-39.pyc19120644editdlrm
constraintquery.cpython-39.opt-1.pyc47580644editdlrm
constraintquery.cpython-39.pyc47580644editdlrm
defaultquery.cpython-39.opt-1.pyc23630644editdlrm
defaultquery.cpython-39.pyc23630644editdlrm
descriptors.cpython-39.opt-1.pyc101200644editdlrm
descriptors.cpython-39.pyc103130644editdlrm
devicetreeconquery.cpython-39.opt-1.pyc25900644editdlrm
devicetreeconquery.cpython-39.pyc25900644editdlrm
dta.cpython-39.opt-1.pyc156130644editdlrm
dta.cpython-39.pyc156130644editdlrm
exception.cpython-39.opt-1.pyc93230644editdlrm
exception.cpython-39.pyc93230644editdlrm
fsusequery.cpython-39.opt-1.pyc30420644editdlrm
fsusequery.cpython-39.pyc30420644editdlrm
genfsconquery.cpython-39.opt-1.pyc32760644editdlrm
genfsconquery.cpython-39.pyc32760644editdlrm
ibendportconquery.cpython-39.opt-1.pyc33510644editdlrm
ibendportconquery.cpython-39.pyc33510644editdlrm
ibpkeyconquery.cpython-39.opt-1.pyc47630644editdlrm
ibpkeyconquery.cpython-39.pyc47630644editdlrm
infoflow.cpython-39.opt-1.pyc130470644editdlrm
infoflow.cpython-39.pyc130470644editdlrm
initsidquery.cpython-39.opt-1.pyc26180644editdlrm
initsidquery.cpython-39.pyc26180644editdlrm
iomemconquery.cpython-39.opt-1.pyc40960644editdlrm
iomemconquery.cpython-39.pyc40960644editdlrm
ioportconquery.cpython-39.opt-1.pyc41000644editdlrm
ioportconquery.cpython-39.pyc41000644editdlrm
mixins.cpython-39.opt-1.pyc69470644editdlrm
mixins.cpython-39.pyc69470644editdlrm
mlsrulequery.cpython-39.opt-1.pyc32900644editdlrm
mlsrulequery.cpython-39.pyc32900644editdlrm
netifconquery.cpython-39.opt-1.pyc26960644editdlrm
netifconquery.cpython-39.pyc26960644editdlrm
nodeconquery.cpython-39.opt-1.pyc40320644editdlrm
nodeconquery.cpython-39.pyc40320644editdlrm
objclassquery.cpython-39.opt-1.pyc31880644editdlrm
objclassquery.cpython-39.pyc31880644editdlrm
pcideviceconquery.cpython-39.opt-1.pyc29900644editdlrm
pcideviceconquery.cpython-39.pyc29900644editdlrm
permmap.cpython-39.opt-1.pyc128200644editdlrm
permmap.cpython-39.pyc130540644editdlrm
pirqconquery.cpython-39.opt-1.pyc29120644editdlrm
pirqconquery.cpython-39.pyc29120644editdlrm
polcapquery.cpython-39.opt-1.pyc14820644editdlrm
polcapquery.cpython-39.pyc14820644editdlrm
portconquery.cpython-39.opt-1.pyc47530644editdlrm
portconquery.cpython-39.pyc47530644editdlrm
query.cpython-39.opt-1.pyc12720644editdlrm
query.cpython-39.pyc12720644editdlrm
rbacrulequery.cpython-39.opt-1.pyc43520644editdlrm
rbacrulequery.cpython-39.pyc43520644editdlrm
rolequery.cpython-39.opt-1.pyc21900644editdlrm
rolequery.cpython-39.pyc21900644editdlrm
sensitivityquery.cpython-39.opt-1.pyc24020644editdlrm
sensitivityquery.cpython-39.pyc24020644editdlrm
terulequery.cpython-39.opt-1.pyc67030644editdlrm
terulequery.cpython-39.pyc67030644editdlrm
typeattrquery.cpython-39.opt-1.pyc23520644editdlrm
typeattrquery.cpython-39.pyc23520644editdlrm
typequery.cpython-39.opt-1.pyc31460644editdlrm
typequery.cpython-39.pyc31460644editdlrm
userquery.cpython-39.opt-1.pyc40200644editdlrm
userquery.cpython-39.pyc40200644editdlrm
util.cpython-39.opt-1.pyc77230644editdlrm
util.cpython-39.pyc77230644editdlrm
__init__.cpython-39.opt-1.pyc37560644editdlrm
__init__.cpython-39.pyc37560644editdlrm
Edit: /usr/lib64/python3.9/site-packages/setools/__pycache__/util.cpython-39.pyc (7723B)
a qqe]@sddlmZddlmZmZmZmZddlmZm Z ddl m Z m Z m Z eedddZeed d d Zeedd d ZeeedddZeeedddZeeeeedddZe e eeeedddZd"eeeee ee ddddZd#eeeeeefdd d!ZdS)$)suppress)IterableListOptionalTuple)InvalidPermissionNoCommon)LevelObjClass SELinuxPolicy)regexreturncCs"|rt|t|S||kSdS)z Match the object with optional regular expression. Parameters: obj The object to match. criteria The criteria to match. regex If regular expression matching should be used. N)boolsearchstrobjcriteriar r2/usr/lib64/python3.9/site-packages/setools/util.py match_regex s r)equalrcCs|r ||kSt||SdS)a Match the object (a set) with optional set equality. Parameters: obj The object to match. (a set) criteria The criteria to match. (a set) equal If set equality should be used. Otherwise any set intersection will match. N)r intersection)rrrrrr match_sets rcs&|rtfdd|DS|vSdS)z Match if the criteria is in the list, with optional regular expression matching. Parameters: obj The object to match. criteria The criteria to match. regex If regular expression matching should be used. csg|]}t|r|qSrrr.0mrrr :z match_in_set..N)rrrrr match_in_set.s r")indirectr rcsN|r>|r"tfdd|DStt|Sn t||SdS)aK Match the object with optional regular expression and indirection. Parameters: obj The object to match. criteria The criteria to match. regex If regular expression matching should be used. indirect If object indirection should be used, e.g. expanding an attribute. csg|]}t|r|qSrr)rorrrr Mr!z(match_indirect_regex..N)rexpandsetrr)rrr#r rrrmatch_indirect_regex?s r')rr rcs.|rtfdd|DSt|t|SdS)a" Match the object (a set) with either set comparisons (equality or intersection) or by regex matching of the set members. Regular expression matching will override the set equality option. Parameters: obj The object to match. (a set) criteria The criteria to match. equal If set equality should be used. Otherwise any set intersection will match. Ignored if regular expression matching is used. regex If regular expression matching should be used. csg|]}t|r|qSrrrrrrr er!z&match_regex_or_set..N)rrr&)rrrr rrrmatch_regex_or_setTsr()subsetoverlapsupersetproperrcCs|rX|j|jko|jknpV|j|jko:|jknpV|j|jkoV|j|jkS|r|r|j|jkrx|j|jkp|j|jko|j|jkS|j|jko|j|jkSnp|r|r|j|jkr|j|jkp|j|jko|j|jkS|j|jko|j|jkSn|j|jko|j|jkSdS)aR Match ranges of objects. obj An object with attributes named "low" and "high", representing the range. criteria An object with attributes named "low" and "high", representing the criteria. subset If true, the criteria will match if it is a subset obj's range. overlap If true, the criteria will match if it overlaps any of the obj's range. superset If true, the criteria will match if it is a superset of the obj's range. proper If true, use proper superset/subset operations. No effect if not using set operations. N)ZlowZhigh)rrr)r*r+r,rrr match_rangejs& r-)rrdomdombyincomprcCs0|r ||kS|r||kS|r$||AS||kSdS)aX Match the an MLS level. obj The level to match. criteria The criteria to match. (a level) dom If true, the criteria will match if it dominates obj. domby If true, the criteria will match if it is dominated by obj. incomp If true, the criteria will match if it is incomparable to obj. Nr)rrr.r/r0rrr match_levels r1N)permstclasspolicyrc Cs|s td|r$tdd|D}n|r6t|}ntdtdd|D}|D]J}||j8}tt||jj8}Wdn1s0Y|sTqqT|rtdd |ntd d |dS) a Validate that each permission is valid for at least one of specified object classes. If no classes are specified, then all classes in the policy are checked. A tclass or policy must be specified. Parameters: perms A container of str permission names. Keyword Parameters. tclass An iterable of 1 or more ObjClass. policy A SELinuxPolicy Exceptions: ValueError Invalid parameter. InvalidPermission One or more permissions is invalid. Return: None zNo permissions specified.css|] }|VqdSNr)rcrrr r!z%validate_perms_any..z(No object class(es) or policy specified.css|] }|VqdSr5r)rprrrr7r!Nz7Permission(s) do not exist in the specified classes: {}z, z(Permission(s) do not exist any class: {}) ValueErrorr&classesr2rr commonrformatjoin)r2r3r4Zselected_classesZinvalidr6rrrvalidate_perms_anys2  *r>,)r2 separatorrcCsg}||D]}|d}t|dkrP|t|dddt|dddfqt|dkr|t|dddt|dddfqtd|q|S)a Create a extended permission list of ranges from a string representation of ranges. This does not do any checking for out-of-range values. Parameters: perms A string representation of integer extended permissions, such as "0x08,0x30-0x40,0x55,0x60-0x65" Keyword Parameters: separator The separator between permissions/permission ranges. Default is "," Return: List[Tuple[int, int]] equivalent of the permissions. -r)baserz Unable to parse "{}" for xperms.)splitlenappendintr9r<)r2r@Zxpermsitemrngrrrxperm_str_to_tuple_rangess  ( (rK)NN)r?) contextlibrtypingrrrr exceptionrr Z policyrepr r r rrrr"r'r(r-r1rr>rHrKrrrrs ! 6