/usr/lib/python3.9/site-packages/sepolgen/__pycache__
NameSizeModeActions
access.cpython-39.opt-1.pyc113610644editdlrm
access.cpython-39.pyc113610644editdlrm
audit.cpython-39.opt-1.pyc172600644editdlrm
audit.cpython-39.pyc172600644editdlrm
classperms.cpython-39.opt-1.pyc24710644editdlrm
classperms.cpython-39.pyc24710644editdlrm
defaults.cpython-39.opt-1.pyc22980644editdlrm
defaults.cpython-39.pyc22980644editdlrm
interfaces.cpython-39.opt-1.pyc125920644editdlrm
interfaces.cpython-39.pyc125920644editdlrm
lex.cpython-39.opt-1.pyc213770644editdlrm
lex.cpython-39.pyc213770644editdlrm
matching.cpython-39.opt-1.pyc61690644editdlrm
matching.cpython-39.pyc61690644editdlrm
module.cpython-39.opt-1.pyc71700644editdlrm
module.cpython-39.pyc71700644editdlrm
objectmodel.cpython-39.opt-1.pyc39710644editdlrm
objectmodel.cpython-39.pyc39710644editdlrm
output.cpython-39.opt-1.pyc35450644editdlrm
output.cpython-39.pyc35450644editdlrm
policygen.cpython-39.opt-1.pyc128870644editdlrm
policygen.cpython-39.pyc129200644editdlrm
refparser.cpython-39.opt-1.pyc292590644editdlrm
refparser.cpython-39.pyc292590644editdlrm
refpolicy.cpython-39.opt-1.pyc401730644editdlrm
refpolicy.cpython-39.pyc401730644editdlrm
sepolgeni18n.cpython-39.opt-1.pyc3940644editdlrm
sepolgeni18n.cpython-39.pyc3940644editdlrm
util.cpython-39.opt-1.pyc63640644editdlrm
util.cpython-39.pyc63640644editdlrm
yacc.cpython-39.opt-1.pyc531330644editdlrm
yacc.cpython-39.pyc532120644editdlrm
__init__.cpython-39.opt-1.pyc1440644editdlrm
__init__.cpython-39.pyc1440644editdlrm
Edit: /usr/lib/python3.9/site-packages/sepolgen/__pycache__/objectmodel.cpython-39.pyc (3971B)
a BÒiwã@sbdZgd¢ZdZdZdZeeBZeeeedœZedededed iZGd d „d ƒZGd d „d ƒZ dS)z¬ 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. ) ZsocketÚfdZprocessÚfileZlnk_fileZ fifo_fileZdbusZ capabilityZunix_stream_socketééé)ÚnÚrÚwÚbrrrr c@s eZdZdZdd„Zdd„ZdS)ÚPermMapaA 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)ÚpermÚdirÚweight)Úselfr r r©rú8/usr/lib/python3.9/site-packages/sepolgen/objectmodel.pyÚ__init__TszPermMap.__init__cCsd|jt|j|jfS)Nz')r Ú dir_to_strr r©rrrrÚ__repr__YsþzPermMap.__repr__N)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrrrr Msr c@s@eZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dS)Ú PermMappingszÛThe 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 characteristics. cCsi|_d|_t|_dS)Né)ÚclassesÚdefault_weightÚ FLOW_BOTHÚ default_dirrrrrrdszPermMappings.__init__cCsÊd}|D]¼}| ¡}t|ƒdkst|ƒdks|ddkr:q|ddkrv|d}||jvr`tdƒ‚i|j|<|j|}qt|ƒdkrŠtdƒ‚|durštd ƒ‚t|dt|dt|d ƒƒ}|||j<qdS) zsRead the permission mappings from a file. This reads the format used by Apol in the setools suite. Nrrú#Úclasszduplicate class in perm mapéz!error in object class permissionszpermission outside of classr)ÚsplitÚlenrÚ ValueErrorr Ú str_to_dirÚintr )rrZcurÚlineÚfieldsÚcÚpmrrrÚ from_fileis" $      zPermMappings.from_filecCs|j||S)zÈGet the permission map for the object permission. Returns: PermMap representing the permission Raises: KeyError if the object or permission is not defined )r)rÚobjr rrrÚget…szPermMappings.getcCs:z|j||}Wn"ty4t||j|jƒYS0|S)aGet 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. )rÚKeyErrorr rr)rr-r r+rrrÚ getdefault�s  zPermMappings.getdefaultcCs(t}|D]}| ||¡}||jB}q|Sr )Ú FLOW_NONEr0r )rr-Úpermsr r r+rrrÚgetdefault_directionœs   z!PermMappings.getdefault_directioncCs(d}|D]}| ||¡}||j7}q|S)Nr)r0r)rr-r2Útotalr r+rrrÚgetdefault_distance£s   z PermMappings.getdefault_distanceN) rrrrrr,r.r0r3r5rrrrr^s  rN) rZimplicitly_typed_objectsr1Z FLOW_READZ FLOW_WRITErr&rr rrrrrÚs