404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.225.95.117: ~ $
3

Kl�f�}�@sbddlZddlZdZdZdZdZdZdZddd	d
ddgZeeeeeed
�Z	Gdd�d�Z
Gdd�de
�ZGdd�de
�Zdzdd�Z
d{dd�Zd}dd�Zdd�ZGd d!�d!e�ZGd"d#�d#e�ZGd$d%�d%e�ZGd&d'�d'�ZGd(d)�d)e�ZGd*d+�d+e�ZGd,d-�d-e�ZGd.d/�d/e�ZGd0d1�d1e�ZGd2d3�d3e�ZGd4d5�d5e�ZGd6d7�d7e�ZGd8d9�d9e�ZGd:d;�d;e�ZGd<d=�d=e�Z Gd>d?�d?e�Z!Gd@dA�dAe�Z"GdBdC�dCe�Z#GdDdE�dEe�Z$GdFdG�dGe�Z%GdHdI�dIe�Z&GdJdK�dKe�Z'GdLdM�dMe�Z(GdNdO�dOe�Z)GdPdQ�dQe�Z*GdRdS�dSe�Z+GdTdU�dUe�Z,GdVdW�dWe�Z-GdXdY�dYe�Z.GdZd[�d[e�Z/Gd\d]�d]e�Z0d^d_�Z1Gd`da�dae�Z2Gdbdc�dce�Z3Gddde�dee�Z4Gdfdg�dge�Z5Gdhdi�die�Z6Gdjdk�dke�Z7Gdldm�dme�Z8Gdndo�doe�Z9Gdpdq�dqe�Z:Gdrds�dse�Z;Gdtdu�du�Z<Gdvdw�dw�Z=Gdxdy�dy�Z>dS)~�N������source�target�object�
permission�role�destination)rrr	r
rrc@seZdZddd�ZdS)�
PolicyBaseNcCsd|_d|_dS)N)�parent�comment)�selfr�r�/usr/lib/python3.6/refpolicy.py�__init__5szPolicyBase.__init__)N)�__name__�
__module__�__qualname__rrrrrr
4sr
c@s�eZdZdZd/dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�ZdS)0�Nodea�Base class objects produced from parsing the reference policy.

    The Node class is used as the base class for any non-leaf
    object produced by parsing the reference policy. This object
    should contain a reference to its parent (or None for a top-level
    object) and 0 or more children.

    The general idea here is to have a very simple tree structure. Children
    are not separated out by type. Instead the tree structure represents
    fairly closely the real structure of the policy statements.

    The object should be iterable - by default over all children but
    subclasses are free to provide additional iterators over a subset
    of their childre (see Interface for example).
    NcCstj||�g|_dS)N)r
r�children)rrrrrrJsz
Node.__init__cCs
t|j�S)N)�iterr)rrrr�__iter__Nsz
Node.__iter__cCstdd�t|��S)NcSs
t|t�S)N)�
isinstancer)�xrrr�<lambda>WszNode.nodes.<locals>.<lambda>)�filter�walktree)rrrr�nodesVsz
Node.nodescCstdd�t|��S)NcSs
t|t�S)N)r�Module)rrrrrZszNode.modules.<locals>.<lambda>)rr)rrrr�modulesYszNode.modulescCstdd�t|��S)NcSs
t|t�S)N)r�	Interface)rrrrr]sz!Node.interfaces.<locals>.<lambda>)rr)rrrr�
interfaces\szNode.interfacescCstdd�t|��S)NcSs
t|t�S)N)r�Template)rrrrr`sz Node.templates.<locals>.<lambda>)rr)rrrr�	templates_szNode.templatescCstdd�t|��S)NcSs
t|t�S)N)r�
SupportMacros)rrrrrcsz%Node.support_macros.<locals>.<lambda>)rr)rrrr�support_macrosbszNode.support_macroscCstdd�t|��S)NcSs
t|t�S)N)r�ModuleDeclaration)rrrrrhsz*Node.module_declarations.<locals>.<lambda>)rr)rrrr�module_declarationsgszNode.module_declarationscCstdd�t|��S)NcSs
t|t�S)N)r�
InterfaceCall)rrrrrksz&Node.interface_calls.<locals>.<lambda>)rr)rrrr�interface_callsjszNode.interface_callscCstdd�t|��S)NcSs
t|t�S)N)r�AVRule)rrrrrnszNode.avrules.<locals>.<lambda>)rr)rrrr�avrulesmszNode.avrulescCstdd�t|��S)NcSs
t|t�S)N)r�	AVExtRule)rrrrrqsz!Node.avextrules.<locals>.<lambda>)rr)rrrr�
avextrulespszNode.avextrulescCstdd�t|��S)NcSs
t|t�S)N)r�TypeRule)rrrrrtsz Node.typerules.<locals>.<lambda>)rr)rrrr�	typerulessszNode.typerulescCstdd�t|��S)NcSs
t|t�S)N)r�	TypeBound)rrrrrwsz!Node.typebounds.<locals>.<lambda>)rr)rrrr�
typeboundsvszNode.typeboundscCstdd�t|��S)zAIterate over all of the TypeAttribute children of this Interface.cSs
t|t�S)N)r�
TypeAttribute)rrrrr{sz%Node.typeattributes.<locals>.<lambda>)rr)rrrr�typeattributesyszNode.typeattributescCstdd�t|��S)zAIterate over all of the RoleAttribute children of this Interface.cSs
t|t�S)N)r�
RoleAttribute)rrrrrsz%Node.roleattributes.<locals>.<lambda>)rr)rrrr�roleattributes}szNode.roleattributescCstdd�t|��S)NcSs
t|t�S)N)r�Require)rrrrr�szNode.requires.<locals>.<lambda>)rr)rrrr�requires�sz
Node.requirescCstdd�t|��S)NcSs
t|t�S)N)r�Role)rrrrr�szNode.roles.<locals>.<lambda>)rr)rrrr�roles�sz
Node.rolescCstdd�t|��S)NcSs
t|t�S)N)r�	RoleAllow)rrrrr�sz"Node.role_allows.<locals>.<lambda>)rr)rrrr�role_allows�szNode.role_allowscCstdd�t|��S)NcSs
t|t�S)N)r�RoleType)rrrrr�sz!Node.role_types.<locals>.<lambda>)rr)rrrr�
role_types�szNode.role_typescCs(|jrt|j�d|j�S|j�SdS)N�
)r�str�	to_string)rrrr�__str__�szNode.__str__cCsd|jj|j�fS)Nz<%s(%s)>)�	__class__rrC)rrrr�__repr__�sz
Node.__repr__cCsdS)N�r)rrrrrC�szNode.to_string)N)rrr�__doc__rrr r"r$r&r(r*r,r.r0r2r4r6r8r:r<r>r@rDrFrCrrrrr9s.
rc@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�LeafNcCstj||�dS)N)r
r)rrrrrr�sz
Leaf.__init__cCs(|jrt|j�d|j�S|j�SdS)NrA)rrBrC)rrrrrD�szLeaf.__str__cCsd|jj|j�fS)Nz<%s(%s)>)rErrC)rrrrrF�sz
Leaf.__repr__cCsdS)NrGr)rrrrrC�szLeaf.to_string)N)rrrrrDrFrCrrrrrI�s
rITFc
cs�|r
d}nd}|dfg}x�t|�dkr�|j|�\}}|rD||fVn|Vt|t�rg}t|j�d}	xD|	dkr�|dks�t|j|	|�r�|j|j|	|df�|	d8}	qhW|j|�qWdS)a�Iterate over a Node and its Children.

    The walktree function iterates over a tree containing Nodes and
    leaf objects. The iteration can perform a depth first or a breadth
    first traversal of the tree (controlled by the depthfirst
    paramater. The passed in node will be returned.

    This function will only work correctly for trees - arbitrary graphs
    will likely cause infinite looping.
    rrN���)�len�poprrr�append�extend)
�nodeZ
depthfirst�	showdepth�type�index�stackZcur�depth�items�irrrr�s"



rccs*x$|D]}|dkst||�r|VqWdS)aIterate over the direct children of a Node.

    The walktree function iterates over the children of a Node.
    Unlike walktree it does note return the passed in node or
    the children of any Node objects (that is, it does not go
    beyond the current level in the tree).
    N)r)rOrQrrrr�walknode�s
rW�{�}cCsRt|�}d}|dkrtd��dj|�}|dkr2|S|dd|d|dSdS)z�Convert a set (or any sequence type) into a string representation
    formatted to match SELinux space separated list conventions.

    For example the list ['read', 'write'] would be converted into:
    '{ read write }'
    rGrz"cannot convert 0 len set to string� rN)rK�
ValueError�join)�s�cont�lrBrrr�list_to_space_str�s
r`cCs"t|�}|dkrtd��dj|�S)Nrz'cannot conver 0 len set to comma stringz, )rKr[r\)r]r_rrr�list_to_comma_str�srac@s&eZdZddd�Zdd�Zdd�ZdS)	�IdSetNcCs&|rtj||�n
tj|�d|_dS)NF)�setrZ
compliment)r�listrrrr�s
zIdSet.__init__cCstt|��S)N)r`�sorted)rrrr�to_space_strszIdSet.to_space_strcCstt|��S)N)rare)rrrr�to_comma_strszIdSet.to_comma_str)N)rrrrrfrgrrrrrb�s
rbc@s4eZdZdZddd�Zdd�Zdd�Zdd	d
�ZdS)
�SecurityContextz;An SELinux security context with optional MCS / MLS fields.NcCs:tj||�d|_d|_d|_d|_|dk	r6|j|�dS)z�Create a SecurityContext object, optionally from a string.

        Parameters:
           [context] - string representing a security context. Same format
              as a string passed to the from_string method.
        rGN)rIr�userrrQ�level�from_string)r�contextrrrrrszSecurityContext.__init__cCs�tj|�}|ddkr|d}|jd�}t|�dkr@td|��|d|_|d|_|d|_t|�dkr�dj|dd��|_	nd|_	dS)z�Parse a string representing a context into a SecurityContext.

        The string should be in the standard format - e.g.,
        'user:role:type:level'.

        Raises ValueError if the string is not parsable as a security context.
        rr�:rz)context string [%s] not in a valid formatrN)
�selinuxZselinux_trans_to_raw_context�splitrKr[rirrQr\rj)rrl�raw�fieldsrrrrks	




zSecurityContext.from_stringcCs0|j|jko.|j|jko.|j|jko.|j|jkS)aCompare two SecurityContext objects - all fields must be exactly the
        the same for the comparison to work. It is possible for the level fields
        to be semantically the same yet syntactically different - in this case
        this function will return false.
        )rirrQrj)r�otherrrr�__eq__4szSecurityContext.__eq__cCs\|j|j|jg}|jdkrF|dkr:tj�dkrD|jd�qR|j|�n|j|j�dj|�S)a�Return a string representing this security context.

        By default, the string will contiain a MCS / MLS level
        potentially from the default which is passed in if none was
        set.

        Arguments:
           default_level - the default level to use if self.level is an
             empty string.

        Returns:
           A string represening the security context in the form
              'user:role:type:level'.
        NrZs0rm)rirrQrjrnZis_selinux_mls_enabledrMr\)rZ
default_levelrqrrrrC?s
zSecurityContext.to_string)NN)N)rrrrHrrkrsrCrrrrrh	s

rhc@seZdZdZddd�ZdS)�ObjectClassa"SELinux object class and permissions.

    This class is a basic representation of an SELinux object
    class - it does not represent separate common permissions -
    just the union of the common and class specific permissions.
    It is meant to be convenient for policy generation.
    rGNcCstj||�||_t�|_dS)N)rIr�namerb�perms)rrurrrrraszObjectClass.__init__)rGN)rrrrHrrrrrrtYsrtc@s<eZdZdZddd�Zdd�Zdd�Zdd
d�Zdd
�Zd	S)�XpermSeta)Extended permission set.

    This class represents one or more extended permissions
    represented by numeric values or ranges of values. The
    .complement attribute is used to specify all permission
    except those specified.

    Two xperm set can be merged using the .extend() method.
    FcCs||_g|_dS)N)�
complement�ranges)rrxrrrrpszXpermSet.__init__cCs�|jj�d}x�|t|j�kr�x�|dt|j�kr�|j|dd|j|ddkr�|j|dt|j|d|j|dd�f|j|<|j|d=q Pq W|d7}qWdS)z0Ensure that ranges are not overlapping.
        rrN)ry�sortrK�max)rrVrrrZ__normalize_rangests
$zXpermSet.__normalize_rangescCs|jj|j�|j�dS)z%Add ranges from an xperm set
        N)ryrN�_XpermSet__normalize_ranges)rr]rrrrN�szXpermSet.extendNcCs(|dkr|}|jj||f�|j�dS)z7Add value of range of values to the xperm set.
        N)ryrMr|)rZminimumZmaximumrrr�add�szXpermSet.addcCsz|js
dS|jrdnd}t|j�dkrX|jdd|jddkrX|t|jdd�Stdd�|j�}d|dj|�fS)	NrGz~ rrcSs$|d|dkrt|d�Sd|S)Nrrz%s-%s)rB)rrrrr�sz$XpermSet.to_string.<locals>.<lambda>z%s{ %s }rZ)ryrxrKrB�mapr\)rZcompl�valsrrrrC�s*zXpermSet.to_string)F)N)	rrrrHrr|rNr}rCrrrrrwfs	

rwc@s"eZdZdZddd�Zdd�ZdS)r5z[SElinux typeattribute statement.

    This class represents a typeattribute statement.
    NcCstj||�d|_t�|_dS)NrG)rIrrQrb�
attributes)rrrrrr�szTypeAttribute.__init__cCsd|j|jj�fS)Nztypeattribute %s %s;)rQr�rg)rrrrrC�szTypeAttribute.to_string)N)rrrrHrrCrrrrr5�s
r5c@s"eZdZdZddd�Zdd�ZdS)r7z[SElinux roleattribute statement.

    This class represents a roleattribute statement.
    NcCstj||�d|_t�|_dS)NrG)rIrrrbr8)rrrrrr�szRoleAttribute.__init__cCsd|j|jj�fS)Nzroleattribute %s %s;)rr8rg)rrrrrC�szRoleAttribute.to_string)N)rrrrHrrCrrrrr7�s
r7c@seZdZddd�Zdd�ZdS)r;NcCstj||�d|_t�|_dS)NrG)rIrrrb�types)rrrrrr�sz
Role.__init__cCs*d}x |jD]}|d|j|f7}qW|S)NrGzrole %s types %s;
)r�r)rr]�trrrrC�szRole.to_string)N)rrrrrCrrrrr;�s
r;c@seZdZddd�Zdd�ZdS)�TyperGNcCs&tj||�||_t�|_t�|_dS)N)rIrrurbr��aliases)rrurrrrr�sz
Type.__init__cCsRd|j}t|j�dkr*|d|jj�}t|j�dkrJ|d|jj�}|dS)Nztype %srzalias %sz, %s�;)rurKr�rfr�rg)rr]rrrrC�s
zType.to_string)rGN)rrrrrCrrrrr��s
r�c@seZdZddd�Zdd�ZdS)�	TypeAliasNcCstj||�d|_t�|_dS)NrG)rIrrQrbr�)rrrrrr�szTypeAlias.__init__cCsd|j|jj�fS)Nztypealias %s alias %s;)rQr�rf)rrrrrC�szTypeAlias.to_string)N)rrrrrCrrrrr��s
r�c@seZdZddd�Zdd�ZdS)�	AttributerGNcCstj||�||_dS)N)rIrru)rrurrrrr�szAttribute.__init__cCs
d|jS)Nz
attribute %s;)ru)rrrrrC�szAttribute.to_string)rGN)rrrrrCrrrrr��s
r�c@seZdZddd�Zdd�ZdS)�Attribute_RolerGNcCstj||�||_dS)N)rIrru)rrurrrrr�szAttribute_Role.__init__cCs
d|jS)Nzattribute_role %s;)ru)rrrrrC�szAttribute_Role.to_string)rGN)rrrrrCrrrrr��s
r�c@sBeZdZdZdZdZdZdZddd�Zd	d
�Z	dd�Z
d
d�ZdS)r-a�SELinux access vector (AV) rule.

    The AVRule class represents all varieties of AV rules including
    allow, dontaudit, and auditallow (indicated by the flags self.ALLOW,
    self.DONTAUDIT, and self.AUDITALLOW respectively).

    The source and target types, object classes, and perms are all represented
    by sets containing strings. Sets are used to make it simple to add
    strings repeatedly while avoiding duplicates.

    No checking is done to make certain that the symbols are valid or
    consistent (e.g., perms that don't match the object classes). It is
    even possible to put invalid types like '$1' into the rules to allow
    storage of the reference policy interfaces.
    rrrrNcCsFtj||�t�|_t�|_t�|_t�|_|j|_|rB|j	|�dS)N)
rIrrb�	src_types�	tgt_types�obj_classesrv�ALLOW�	rule_type�from_av)r�avrrrrr
szAVRule.__init__cCsD|j|jkrdS|j|jkr dS|j|jkr0dS|j|jkr@dSdS)NZallowZ	dontauditZ
auditallowZ
neverallow)r�r��	DONTAUDIT�
AUDITALLOW�
NEVERALLOW)rrrr�__rule_type_strszAVRule.__rule_type_strcCsV|jj|j�|j|jkr(|jjd�n|jj|j�|jj|j�|jj|j�dS)zIAdd the access from an access vector to this allow
        rule.
        rN)	r�r}�src_type�tgt_typer�r��	obj_classrv�update)rr�rrrr�szAVRule.from_avcCs.d|j�|jj�|jj�|jj�|jj�fS)z�Return a string representation of the rule
        that is a valid policy language representation (assuming
        that the types, object class, etc. are valie).
        z%s %s %s:%s %s;)�_AVRule__rule_type_strr�rfr�r�rv)rrrrrC*s
zAVRule.to_string)NN)rrrrHr�r�r�r�rr�r�rCrrrrr-�s


r-c@sBeZdZdZdZdZdZdZddd�Zd	d
�Z	dd�Z
d
d�ZdS)r/ajExtended permission access vector rule.

    The AVExtRule class represents allowxperm, dontauditxperm,
    auditallowxperm, and neverallowxperm rules.

    The source and target types, and object classes are represented
    by sets containing strings. The operation is a single string,
    e.g. 'ioctl'. Extended permissions are represented by an XpermSet.
    rrrrNcCsNtj||�t�|_t�|_t�|_|j|_t�|_	||_
|rJ|j||�dS)N)rIrrbr�r�r��
ALLOWXPERMr�rw�xperms�	operationr�)rr��oprrrrrDszAVExtRule.__init__cCsD|j|jkrdS|j|jkr dS|j|jkr0dS|j|jkr@dSdS)NZ
allowxpermZdontauditxpermZauditallowxpermZneverallowxperm)r�r��DONTAUDITXPERM�AUDITALLOWXPERM�NEVERALLOWXPERM)rrrrr�OszAVExtRule.__rule_type_strcCsZ|jj|j�|j|jkr(|jjd�n|jj|j�|jj|j�||_|j||_dS)Nr)	r�r}r�r�r�r�r�r�r�)rr�r�rrrr�YszAVExtRule.from_avcCs2d|j�|jj�|jj�|jj�|j|jj�fS)z�Return a string representation of the rule that is
        a valid policy language representation (assuming that
        the types, object class, etc. are valid).
        z%s %s %s:%s %s %s;)�_AVExtRule__rule_type_strr�rfr�r�r�r�rC)rrrrrCcszAVExtRule.to_string)NNN)rrrrHr�r�r�r�rr�r�rCrrrrr/5s	


r/c@s6eZdZdZdZdZdZddd�Zdd	�Zd
d�Z	dS)
r1z�SELinux type rules.

    This class is very similar to the AVRule class, but is for representing
    the type rules (type_trans, type_change, and type_member). The major
    difference is the lack of perms and only and sing destination type.
    rrrNcCs6tj||�t�|_t�|_t�|_d|_|j|_dS)NrG)	rIrrbr�r�r��	dest_type�TYPE_TRANSITIONr�)rrrrrrzszTypeRule.__init__cCs(|j|jkrdS|j|jkr dSdSdS)NZtype_transitionZtype_changeZtype_member)r�r��TYPE_CHANGE)rrrrr��s
zTypeRule.__rule_type_strcCs*d|j�|jj�|jj�|jj�|jfS)Nz%s %s %s:%s %s;)�_TypeRule__rule_type_strr�rfr�r�r�)rrrrrC�s
zTypeRule.to_string)N)
rrrrHr�r�ZTYPE_MEMBERrr�rCrrrrr1os
r1c@s"eZdZdZddd�Zdd�ZdS)r3zSSElinux typebound statement.

    This class represents a typebound statement.
    NcCstj||�d|_t�|_dS)NrG)rIrrQrbr�)rrrrrr�szTypeBound.__init__cCsd|j|jj�fS)Nztypebounds %s %s;)rQr�rg)rrrrrC�szTypeBound.to_string)N)rrrrHrrCrrrrr3�s
r3c@seZdZddd�Zdd�ZdS)r=NcCs tj||�t�|_t�|_dS)N)rIrrb�	src_roles�	tgt_roles)rrrrrr�szRoleAllow.__init__cCsd|jj�|jj�fS)Nzallow %s %s;)r�rgr�)rrrrrC�s
zRoleAllow.to_string)N)rrrrrCrrrrr=�s
r=c@seZdZddd�Zdd�ZdS)r?NcCstj||�d|_t�|_dS)NrG)rIrrrbr�)rrrrrr�szRoleType.__init__cCs*d}x |jD]}|d|j|f7}qW|S)NrGzrole %s types %s;
)r�r)rr]r�rrrrC�szRoleType.to_string)N)rrrrrCrrrrr?�s
r?c@seZdZddd�Zdd�ZdS)r)NcCs"tj||�d|_d|_d|_dS)NrGF)rIrru�version�	refpolicy)rrrrrr�szModuleDeclaration.__init__cCs*|jrd|j|jfSd|j|jfSdS)Nzpolicy_module(%s, %s)z
module %s %s;)r�rur�)rrrrrC�szModuleDeclaration.to_string)N)rrrrrCrrrrr)�s
r)c@seZdZddd�Zdd�ZdS)�ConditionalNcCstj||�g|_dS)N)rr�	cond_expr)rrrrrr�szConditional.__init__cCsdt|jdd�S)Nz[If %s]rG)r^)rGrG)r`r�)rrrrrC�szConditional.to_string)N)rrrrrCrrrrr��s
r�c@seZdZddd�Zdd�ZdS)�BoolNcCstj||�d|_d|_dS)NrGF)rIrru�state)rrrrrr�sz
Bool.__init__cCs$d|j}|jr|dS|dSdS)Nzbool %s �trueZfalse)rur�)rr]rrrrC�s
zBool.to_string)N)rrrrrCrrrrr��s
r�c@seZdZddd�Zdd�ZdS)�
InitialSidNcCstj||�d|_d|_dS)NrG)rIrrurl)rrrrrZ__init�szInitialSid.__initcCsd|jt|j�fS)Nz	sid %s %s)rurBrl)rrrrrC�szInitialSid.to_string)N)rrrZ_InitialSid__initrCrrrrr��s
r�c@seZdZddd�Zdd�ZdS)�GenfsConNcCs"tj||�d|_d|_d|_dS)NrG)rIr�
filesystem�pathrl)rrrrrr�szGenfsCon.__init__cCsd|j|jt|j�fS)Nzgenfscon %s %s %s)r�r�rBrl)rrrrrC�szGenfsCon.to_string)N)rrrrrCrrrrr��s
r�c@s*eZdZdZdZdZd	dd�Zdd�ZdS)
�
FilesystemUserrrNcCs$tj||�|j|_d|_d|_dS)NrG)rIr�XATTRrQr�rl)rrrrrr�szFilesystemUse.__init__cCsNd}|j|jkrd}n"|j|jkr(d}n|j|jkr8d}d||jt|j�fS)NrGz
fs_use_xattr z
fs_use_trans zfs_use_task z	%s %s %s;)rQr��TRANS�TASKr�rBrl)rr]rrrrC�szFilesystemUse.to_string)N)rrrr�r�r�rrCrrrrr��s

r�c@seZdZddd�Zdd�ZdS)�PortConNcCs"tj||�d|_d|_d|_dS)NrG)rIr�	port_type�port_numberrl)rrrrrrszPortCon.__init__cCsd|j|jt|j�fS)Nzportcon %s %s %s)r�r�rBrl)rrrrrCszPortCon.to_string)N)rrrrrCrrrrr��s
r�c@seZdZddd�Zdd�ZdS)�NodeConNcCs"tj||�d|_d|_d|_dS)NrG)rIr�start�endrl)rrrrrr
szNodeCon.__init__cCsd|j|jt|j�fS)Nznodecon %s %s %s)r�r�rBrl)rrrrrCszNodeCon.to_string)N)rrrrrCrrrrr�	s
r�c@seZdZddd�Zdd�ZdS)�NetifConNcCs"tj||�d|_d|_d|_dS)NrG)rIr�	interface�interface_context�packet_context)rrrrrrszNetifCon.__init__cCsd|jt|j�t|j�fS)Nznetifcon %s %s %s)r�rBr�r�)rrrrrCszNetifCon.to_string)N)rrrrrCrrrrr�s
r�c@seZdZddd�Zdd�ZdS)�PirqConNcCstj||�d|_d|_dS)NrG)rIr�pirq_numberrl)rrrrrrszPirqCon.__init__cCsd|jt|j�fS)Nz
pirqcon %s %s)r�rBrl)rrrrrC#szPirqCon.to_string)N)rrrrrCrrrrr�s
r�c@seZdZddd�Zdd�ZdS)�IomemConNcCstj||�d|_d|_dS)NrG)rIr�
device_memrl)rrrrrr'szIomemCon.__init__cCsd|jt|j�fS)Nziomemcon %s %s)r�rBrl)rrrrrC,szIomemCon.to_string)N)rrrrrCrrrrr�&s
r�c@seZdZddd�Zdd�ZdS)�	IoportConNcCstj||�d|_d|_dS)NrG)rIr�ioportrl)rrrrrr0szIoportCon.__init__cCsd|jt|j�fS)Nzioportcon %s %s)r�rBrl)rrrrrC5szIoportCon.to_string)N)rrrrrCrrrrr�/s
r�c@seZdZddd�Zdd�ZdS)�PciDeviceConNcCstj||�d|_d|_dS)NrG)rIr�devicerl)rrrrrr9szPciDeviceCon.__init__cCsd|jt|j�fS)Nzpcidevicecon %s %s)r�rBrl)rrrrrC>szPciDeviceCon.to_string)N)rrrrrCrrrrr�8s
r�c@seZdZddd�Zdd�ZdS)�
DeviceTreeConNcCstj||�d|_d|_dS)NrG)rIrr�rl)rrrrrrBszDeviceTreeCon.__init__cCsd|jt|j�fS)Nzdevicetreecon %s %s)r�rBrl)rrrrrCGszDeviceTreeCon.to_string)N)rrrrrCrrrrr�As
r�cCsLxFt|dd�D]6\}}d}xt|�D]}|d}q$Wt|t|��qWdS)NT)rPrG�	)r�range�printrB)�headrOrTr]rVrrr�
print_treeLs
r�c@seZdZddd�Zdd�ZdS)�HeadersNcCstj||�dS)N)rr)rrrrrrUszHeaders.__init__cCsdS)Nz	[Headers]r)rrrrrCXszHeaders.to_string)N)rrrrrCrrrrr�Ts
r�c@seZdZddd�Zdd�ZdS)r!NcCstj||�dS)N)rr)rrrrrr]szModule.__init__cCsdS)NrGr)rrrrrC`szModule.to_string)N)rrrrrCrrrrr!\s
r!c@s"eZdZdZddd�Zdd�ZdS)	r#zqA reference policy interface definition.

    This class represents a reference policy interface definition.
    rGNcCstj||�||_dS)N)rrru)rrurrrrrhszInterface.__init__cCs
d|jS)Nz[Interface name: %s])ru)rrrrrClszInterface.to_string)rGN)rrrrHrrCrrrrr#cs
r#c@seZdZddd�Zdd�ZdS)�
TunablePolicyNcCstj||�g|_dS)N)rrr�)rrrrrrpszTunablePolicy.__init__cCsdt|jdd�S)Nz[Tunable Policy %s]rG)r^)rGrG)r`r�)rrrrrCtszTunablePolicy.to_string)N)rrrrrCrrrrr�os
r�c@seZdZddd�Zdd�ZdS)r%rGNcCstj||�||_dS)N)rrru)rrurrrrrxszTemplate.__init__cCs
d|jS)Nz[Template name: %s])ru)rrrrrC|szTemplate.to_string)rGN)rrrrrCrrrrr%ws
r%c@seZdZddd�Zdd�ZdS)�IfDefrGNcCstj||�||_dS)N)rrru)rrurrrrr�szIfDef.__init__cCs
d|jS)Nz[Ifdef name: %s])ru)rrrrrC�szIfDef.to_string)rGN)rrrrrCrrrrr�s
r�c@s&eZdZd	dd�Zdd�Zdd�ZdS)
r+rGNcCs"tj||�||_g|_g|_dS)N)rIr�ifname�argsZcomments)rr�rrrrr�szInterfaceCall.__init__cCsT|j|jkrdSt|j�t|j�kr(dSx&t|j|j�D]\}}||kr8dSq8WdS)NFT)r�rKr��zip)rrr�a�brrr�matches�szInterfaceCall.matchescCsdd|j}d}xL|jD]B}t|t�r.t|�}n|}|dkrH|d|}n||}|d7}qW|dS)Nz%s(rz, %sr�))r�r�rrdr`)rr]rVr�rBrrrrC�s


zInterfaceCall.to_string)rGN)rrrrr�rCrrrrr+�s

r+c@seZdZddd�Zdd�ZdS)�OptionalPolicyNcCstj||�dS)N)rr)rrrrrr�szOptionalPolicy.__init__cCsdS)Nz[Optional Policy]r)rrrrrC�szOptionalPolicy.to_string)N)rrrrrCrrrrr��s
r�c@s>eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)r'NcCstj||�d|_dS)N)rrr~)rrrrrr�szSupportMacros.__init__cCsdS)Nz[Support Macros]r)rrrrrC�szSupportMacros.to_stringcCsDt�}||jkr6x.|j|�D]}|j|j|��qWn
|j|�|S)N)rcr~�by_namer��_SupportMacros__expand_permr})r�permr]�prrrZ
__expand_perm�s

zSupportMacros.__expand_permcCsJi|_x>|D]6}t�}x|jD]}|j|j|��qW||j|j<qWdS)N)r~rcrvr�r�ru)rrZ	exp_permsr�rrrZ	__gen_map�s
zSupportMacros.__gen_mapcCs|js|j�|j|S)N)r~�_SupportMacros__gen_map)rrurrrr��szSupportMacros.by_namecCs|js|j�||jkS)N)r~r�)rrurrr�has_key�szSupportMacros.has_key)N)	rrrrrCr�r�r�r�rrrrr'�s
r'c@s&eZdZddd�Zdd�Zdd�ZdS)	r9NcCs6tj||�t�|_i|_t�|_t�|_t�|_dS)N)rIrrbr�r�r<�data�users)rrrrrr�szRequire.__init__cCs|jj|t��}|j|�dS)N)r��
setdefaultrbr�)rr�rvr�rrr�
add_obj_class�szRequire.add_obj_classcCs�g}|jd�x|jD]}|jd|�qWx,|jj�D]\}}|jd||j�f�q8Wx|jD]}|jd|�qbWx|jD]}|jd|�q�Wx|jD]}|jd|�q�W|jd�t|�dkr�d	Sd
j	|�S)Nz	require {z		type %s;z
	class %s %s;z		role %s;z		bool %s;z		user %s;rYrrGrA)
rMr�r�rUrfr<r�r�rKr\)rr]rQr�rvr�boolrirrrrC�s 

zRequire.to_string)N)rrrrr�rCrrrrr9�s
r9c@seZdZdd�Zdd�ZdS)�
ObjPermSetcCs||_t�|_dS)N)rurcrv)rrurrrr�szObjPermSet.__init__cCsd|j|jj�fS)Nzdefine(`%s', `%s'))rurvrf)rrrrrC�szObjPermSet.to_stringN)rrrrrCrrrrr��sr�c@seZdZdd�Zdd�ZdS)�ClassMapcCs||_||_dS)N)r�rv)rr�rvrrrrszClassMap.__init__cCs|jd|jS)Nz: )r�rv)rrrrrCszClassMap.to_stringN)rrrrrCrrrrr�sr�c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�CommentNcCs|r||_ng|_dS)N)�lines)rr_rrrr
szComment.__init__cCsBt|j�dkrdSg}x|jD]}|jd|�qWdj|�SdS)NrrG�#rA)rKr�rMr\)r�out�linerrrrCszComment.to_stringcCs2t|j�r.x"|jD]}|dkr|jj|�qWdS)NrG)rKr�rM)rrrr�rrr�merges
z
Comment.mergecCs|j�S)N)rC)rrrrrD!szComment.__str__)N)rrrrrCr�rDrrrrr�	s
r�)TFN)N�rXrY)r�)?�stringrnZSRC_TYPEZTGT_TYPEZ	OBJ_CLASSZPERMSZROLEZ	DEST_TYPEZfield_to_strZstr_to_fieldr
rrIrrWr`rarcrbrhrtrwr5r7r;r�r�r�r�r-r/r1r3r=r?r)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r!r#r�r%r�r+r�r'r9r�r�r�rrrr�<module>s|a
&

	P
=
	@:!


	



				!&$

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 113 B 0644
__init__.cpython-36.pyc File 113 B 0644
access.cpython-36.opt-1.pyc File 11.02 KB 0644
access.cpython-36.pyc File 11.02 KB 0644
audit.cpython-36.opt-1.pyc File 17.29 KB 0644
audit.cpython-36.pyc File 17.29 KB 0644
classperms.cpython-36.opt-1.pyc File 2.43 KB 0644
classperms.cpython-36.pyc File 2.43 KB 0644
defaults.cpython-36.opt-1.pyc File 2.19 KB 0644
defaults.cpython-36.pyc File 2.19 KB 0644
interfaces.cpython-36.opt-1.pyc File 12.25 KB 0644
interfaces.cpython-36.pyc File 12.25 KB 0644
lex.cpython-36.opt-1.pyc File 20.92 KB 0644
lex.cpython-36.pyc File 20.92 KB 0644
matching.cpython-36.opt-1.pyc File 5.95 KB 0644
matching.cpython-36.pyc File 5.95 KB 0644
module.cpython-36.opt-1.pyc File 6.95 KB 0644
module.cpython-36.pyc File 6.95 KB 0644
objectmodel.cpython-36.opt-1.pyc File 3.83 KB 0644
objectmodel.cpython-36.pyc File 3.83 KB 0644
output.cpython-36.opt-1.pyc File 3.42 KB 0644
output.cpython-36.pyc File 3.42 KB 0644
policygen.cpython-36.opt-1.pyc File 12.52 KB 0644
policygen.cpython-36.pyc File 12.57 KB 0644
refparser.cpython-36.opt-1.pyc File 28.38 KB 0644
refparser.cpython-36.pyc File 28.38 KB 0644
refpolicy.cpython-36.opt-1.pyc File 39.9 KB 0644
refpolicy.cpython-36.pyc File 39.9 KB 0644
sepolgeni18n.cpython-36.opt-1.pyc File 304 B 0644
sepolgeni18n.cpython-36.pyc File 304 B 0644
util.cpython-36.opt-1.pyc File 6.22 KB 0644
util.cpython-36.pyc File 6.22 KB 0644
yacc.cpython-36.opt-1.pyc File 52.77 KB 0644
yacc.cpython-36.pyc File 52.86 KB 0644