Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
site-packages
/
sepolgen
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/site-packages/sepolgen/access.pyo
mς φ"Qc @ s] d Z d k Z d Z d f d YZ d Z d f d YZ d Z d Z d S( sV Classes representing basic access. SELinux - at the most basic level - represents access as the 4-tuple subject (type or context), target (type or context), object class, permission. The policy language elaborates this basic access to faciliate more concise rules (e.g., allow rules can have multiple source or target types - see refpolicy for more information). This module has objects for representing the most basic access (AccessVector) and sets of that access (AccessVectorSet). These objects are used in Madison in a variety of ways, but they are the fundamental representation of access. Nc C s` t | d j oE | d d j o4 y t | d Wn t j o t Sn Xt Sn t Sd S( s¬ Determine if an id is a paramater in the form $N, where N is an integer. Returns: True if the id is a paramater False if the id is not a paramater i i t $N( t lent idt intt ValueErrort Falset True( R ( ( t3 /usr/lib/python2.4/site-packages/sepolgen/access.pyt is_idparam$ s $ t AccessVectorc B sG t Z d Z e d Z d Z d Z d Z d Z d Z RS( sΊ An access vector is the basic unit of access in SELinux. Access vectors are the most basic representation of access within SELinux. It represents the access a source type has to a target type in terms of an object class and a set of permissions. Access vectors are distinct from AVRules in that they can only store a single source type, target type, and object class. The simplicity of AccessVectors makes them useful for storing access in a form that is easy to search and compare. The source, target, and object are stored as string. No checking done to verify that the strings are valid SELinux identifiers. Identifiers in the form $N (where N is an integer) are reserved as interface parameters and are treated as wild cards in many circumstances. Properties: .src_type - The source type allowed access. [String or None] .tgt_type - The target type to which access is allowed. [String or None] .obj_class - The object class to which access is allowed. [String or None] .perms - The permissions allowed to the object class. [IdSet] .audit_msgs - The audit messages that generated this access vector [List of strings] c C sX | o | i | n4 d | _ d | _ d | _ t i | _ g | _ d | _ d S( N( t init_listt selft from_listt Nonet src_typet tgt_typet obj_classt refpolicyt IdSett permst audit_msgst info_flow_dir( R R ( ( R t __init__O s c C sn t | d j o t d t | n | d | _ | d | _ | d | _ t i | d | _ d S( sx Initialize an access vector from a list. Initialize an access vector from a list treating the list as positional arguments - i.e., 0 = src_type, 1 = tgt_type, etc. All of the list elements 3 and greater are treated as perms. For example, the list ['foo_t', 'bar_t', 'file', 'read', 'write'] would create an access vector list with the source type 'foo_t', target type 'bar_t', object class 'file', and permissions 'read' and 'write'. This format is useful for very simple storage to strings or disc (see to_list) and for initializing access vectors. i s+ List must contain at least four elements %si i i i N( R t listR t strR R R R R R R ( R R ( ( R R ] s c C s, | i | i | i g } | i | i | S( sξ Convert an access vector to a list. Convert an access vector to a list treating the list as positional values. See from_list for more information on how an access vector is represented in a list. N( R R R R t lt extendR ( R R ( ( R t to_listr s c C s | i S( N( R t to_string( R ( ( R t __str__~ s c C s&