Your IP : 18.223.43.122


Current Path : /lib64/python2.7/site-packages/sepolgen/
Upload File :
Current File : //lib64/python2.7/site-packages/sepolgen/refpolicy.pyo

�
��^c@s�ddlZddlZdZdZdZdZdZdZdd	d
ddd
gZied6ed	6ed
6ed6ed6ed
6Z	ddod��YZ
de
fd��YZde
fd��YZe
edd�Zdd�Zdpd�Zd�Zdefd��YZdefd��YZdefd��YZd efd!��YZd"efd#��YZd$efd%��YZd&efd'��YZd(efd)��YZd*efd+��YZd,efd-��YZd.efd/��YZd0efd1��YZ d2efd3��YZ!d4efd5��YZ"d6efd7��YZ#d8efd9��YZ$d:efd;��YZ%d<efd=��YZ&d>efd?��YZ'd@efdA��YZ(dBefdC��YZ)dDefdE��YZ*dFefdG��YZ+dHefdI��YZ,dJefdK��YZ-dLefdM��YZ.dNefdO��YZ/dPefdQ��YZ0dRefdS��YZ1dT�Z2dUefdV��YZ3dWefdX��YZ4dYefdZ��YZ5d[efd\��YZ6d]efd^��YZ7d_efd`��YZ8daefdb��YZ9dcefdd��YZ:deefdf��YZ;dgefdh��YZ<didqdj��YZ=dkdrdl��YZ>dmdsdn��YZ?dS(ti����Niiiiiitsourcettargettobjectt
permissiontroletdestinationt
PolicyBasecBseZdd�ZRS(cCsd|_d|_dS(N(tNonetparenttcomment(tselfR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt__init__5s	N(t__name__t
__module__RR(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR4stNodecBs�eZdZdd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(s�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).
    cCstj||�g|_dS(N(RRtchildren(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRJscCs
t|j�S(N(titerR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt__iter__NscCstd�t|��S(NcSs
t|t�S(N(t
isinstanceR(tx((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt<lambda>Ws(tfiltertwalktree(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytnodesVscCstd�t|��S(NcSs
t|t�S(N(RtModule(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRZs(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytmodulesYscCstd�t|��S(NcSs
t|t�S(N(Rt	Interface(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR]s(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt
interfaces\scCstd�t|��S(NcSs
t|t�S(N(RtTemplate(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR`s(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt	templates_scCstd�t|��S(NcSs
t|t�S(N(Rt
SupportMacros(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRcs(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytsupport_macrosbscCstd�t|��S(NcSs
t|t�S(N(RtModuleDeclaration(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRhs(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytmodule_declarationsgscCstd�t|��S(NcSs
t|t�S(N(Rt
InterfaceCall(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRks(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytinterface_callsjscCstd�t|��S(NcSs
t|t�S(N(RtAVRule(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRns(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytavrulesmscCstd�t|��S(NcSs
t|t�S(N(RtTypeRule(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRqs(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt	typerulespscCstd�t|��S(NcSs
t|t�S(N(Rt	TypeBound(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRts(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt
typeboundssscCstd�t|��S(sAIterate over all of the TypeAttribute children of this Interface.cSs
t|t�S(N(Rt
TypeAttribute(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRxs(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyttypeattributesvscCstd�t|��S(sAIterate over all of the RoleAttribute children of this Interface.cSs
t|t�S(N(Rt
RoleAttribute(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR|s(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytroleattributeszscCstd�t|��S(NcSs
t|t�S(N(RtRequire(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRs(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytrequires~scCstd�t|��S(NcSs
t|t�S(N(RtRole(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytroles�scCstd�t|��S(NcSs
t|t�S(N(Rt	RoleAllow(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytrole_allows�scCstd�t|��S(NcSs
t|t�S(N(RtRoleType(R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s(RR(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt
role_types�scCs2|jr$t|j�d|j�S|j�SdS(Ns
(R	tstrt	to_string(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt__str__�s	cCsd|jj|j�fS(Ns<%s(%s)>(t	__class__RR7(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt__repr__�scCsdS(Nt((R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
t__doc__RRRRRRRRR!R#R%R'R)R+R-R/R1R3R5R8R:R7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR9s,																			tLeafcBs/eZdd�Zd�Zd�Zd�ZRS(cCstj||�dS(N(RR(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�scCs2|jr$t|j�d|j�S|j�SdS(Ns
(R	R6R7(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR8�s	cCsd|jj|j�fS(Ns<%s(%s)>(R9RR7(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR:�scCsdS(NR;((R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR8R:R7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR=�s		c
cs|rd}nd}|dfg}x�t|�dkr|j|�\}}|rb||fVn|Vt|t�r'g}t|j�d}	x]|	dkr�|dks�t|j|	|�r�|j|j|	|df�n|	d8}	q�W|j|�q'q'WdS(s�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.
    i����iiN(tlentpopRRRRtappendtextend(
tnodet
depthfirstt	showdepthttypetindextstacktcurtdepthtitemsti((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s"
	"!ccs8x1|D])}|dks(t||�r|VqqWdS(sIterate 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(RR(RBRER((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytwalknode�s
t{t}cCslt|�}d}|dkr-td��ndj|�}|dkrL|S|dd|d|dSdS(s�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 }'
    R;is"cannot convert 0 len set to stringt iN(R>t
ValueErrortjoin(tstconttlR6((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytlist_to_space_str�scCs4t|�}|dkr'td��ndj|�S(Nis'cannot conver 0 len set to comma strings, (R>RPRQ(RRRT((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytlist_to_comma_str�stIdSetcBs&eZdd�Zd�Zd�ZRS(cCs3|rtj||�n
tj|�t|_dS(N(tsetRtFalset
compliment(R
tlist((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s
cCstt|��S(N(RUtsorted(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytto_space_strscCstt|��S(N(RVR\(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytto_comma_strsN(RR
RRR]R^(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRW�s	tSecurityContextcBs;eZdZddd�Zd�Zd�Zdd�ZRS(s;An SELinux security context with optional MCS / MLS fields.cCsTtj||�d|_d|_d|_d|_|dk	rP|j|�ndS(s�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.
        R;N(R=RtuserRRERtleveltfrom_string(R
tcontextR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRs				cCs�tj|�}|ddkr,|d}n|jd�}t|�dkr`td|��n|d|_|d|_|d|_t|�dkr�dj|d�|_	n	d|_	dS(s�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.
        iit:is)context string [%s] not in a valid formatiN(tselinuxtselinux_trans_to_raw_contexttsplitR>RPR`RRERQRaR(R
Rctrawtfields((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRbs	



cCsF|j|jkoE|j|jkoE|j|jkoE|j|jkS(sCompare 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.
        (R`RRERa(R
tother((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt__eq__1scCs�|j|j|jg}|jdkrh|dkrXtj�dkre|jd�qeqx|j|�n|j|j�dj|�S(s�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'.
        its0RdN(	R`RRERaRRetis_selinux_mls_enabledR@RQ(R
t
default_levelRi((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7<sN(RR
R<RRRbRkR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR_s
		tObjectClasscBseZdZddd�ZRS(s"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.
    R;cCs)tj||�||_t�|_dS(N(R=RtnameRWtperms(R
RpR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR^s	N(RR
R<RR(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRoVsR*cBs#eZdZdd�Zd�ZRS(s[SElinux typeattribute statement.

    This class represents a typeattribute statement.
    cCs)tj||�d|_t�|_dS(NR;(R=RRERWt
attributes(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRjs	cCsd|j|jj�fS(Nstypeattribute %s %s;(RERrR^(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7osN(RR
R<RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR*esR,cBs#eZdZdd�Zd�ZRS(s[SElinux roleattribute statement.

    This class represents a roleattribute statement.
    cCs)tj||�d|_t�|_dS(NR;(R=RRRWR-(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRws	cCsd|j|jj�fS(Nsroleattribute %s %s;(RR-R^(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7|sN(RR
R<RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR,rsR0cBseZdd�Zd�ZRS(cCs)tj||�d|_t�|_dS(NR;(R=RRRWttypes(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s	cCs5d}x(|jD]}|d|j|f7}qW|S(NR;srole %s types %s;
(RsR(R
RRtt((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR0�stTypecBs eZddd�Zd�ZRS(R;cCs5tj||�||_t�|_t�|_dS(N(R=RRpRWRrtaliases(R
RpR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s	cCssd|j}t|j�dkr<|d|jj�}nt|j�dkrk|d|jj�}n|dS(Nstype %sisalias %ss, %st;(RpR>RvR]RrR^(R
RR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�s
N(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRu�st	TypeAliascBseZdd�Zd�ZRS(cCs)tj||�d|_t�|_dS(NR;(R=RRERWRv(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s	cCsd|j|jj�fS(Nstypealias %s alias %s;(RERvR](R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRx�st	AttributecBs eZddd�Zd�ZRS(R;cCstj||�||_dS(N(R=RRp(R
RpR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�scCsd|jS(Ns
attribute %s;(Rp(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRy�stAttribute_RolecBs eZddd�Zd�ZRS(R;cCstj||�||_dS(N(R=RRp(R
RpR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�scCsd|jS(Nsattribute_role %s;(Rp(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRz�sR$cBsPeZdZdZdZdZdZd	d	d�Zd�Z	d�Z
d�ZRS(
s�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.
    iiiicCsftj||�t�|_t�|_t�|_t�|_|j|_|rb|j	|�ndS(N(
R=RRWt	src_typest	tgt_typestobj_classesRqtALLOWt	rule_typetfrom_av(R
tavR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�scCs4|j|jkrdS|j|jkr,dSdSdS(Ntallowt	dontauditt
auditallow(RR~t	DONTAUDIT(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt__rule_type_str�s
cCsu|jj|j�|j|jkr8|jjd�n|jj|j�|jj|j�|jj|j�dS(sIAdd the access from an access vector to this allow
        rule.
        R
N(	R{taddtsrc_typettgt_typeR|R}t	obj_classRqtupdate(R
R�((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��scCsAd|j�|jj�|jj�|jj�|jj�fS(s�Return a string representation of the rule
        that is a valid policy language representation (assuming
        that the types, object class, etc. are valie).
        s%s %s %s:%s %s;(t_AVRule__rule_type_strR{R]R|R}Rq(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�s
N(RR
R<R~R�t
AUDITALLOWt
NEVERALLOWRRR�R�R7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR$�s
		R&cBs>eZdZdZdZdZdd�Zd�Zd�Z	RS(s�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.
    iiicCsMtj||�t�|_t�|_t�|_d|_|j|_dS(NR;(	R=RRWR{R|R}t	dest_typetTYPE_TRANSITIONR(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s	cCs4|j|jkrdS|j|jkr,dSdSdS(Nttype_transitionttype_changettype_member(RR�tTYPE_CHANGE(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s
cCs;d|j�|jj�|jj�|jj�|jfS(Ns%s %s %s:%s %s;(t_TypeRule__rule_type_strR{R]R|R}R�(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7s
N(
RR
R<R�R�tTYPE_MEMBERRRR�R7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR&�s	R(cBs#eZdZdd�Zd�ZRS(sSSElinux typebound statement.

    This class represents a typebound statement.
    cCs)tj||�d|_t�|_dS(NR;(R=RRERWR|(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRs	cCsd|j|jj�fS(Nstypebounds %s %s;(RER|R^(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7sN(RR
R<RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR(sR2cBseZdd�Zd�ZRS(cCs,tj||�t�|_t�|_dS(N(R=RRWt	src_rolest	tgt_roles(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR$scCs d|jj�|jj�fS(Nsallow %s %s;(R�R^R�(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7)sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR2#sR4cBseZdd�Zd�ZRS(cCs)tj||�d|_t�|_dS(NR;(R=RRRWRs(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR.s	cCs5d}x(|jD]}|d|j|f7}qW|S(NR;srole %s types %s;
(RsR(R
RRRt((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR73sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR4-sR cBseZdd�Zd�ZRS(cCs/tj||�d|_d|_t|_dS(NR;(R=RRptversionRYt	refpolicy(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR:s		cCs5|jrd|j|jfSd|j|jfSdS(Nspolicy_module(%s, %s)s
module %s %s;(R�RpR�(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7@s	N(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR 9stConditionalcBseZdd�Zd�ZRS(cCstj||�g|_dS(N(RRt	cond_expr(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRGscCsdt|jdd�S(Ns[If %s]RSR;(R;R;(RUR�(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7KsN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�FstBoolcBseZdd�Zd�ZRS(cCs&tj||�d|_t|_dS(NR;(R=RRpRYtstate(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyROs	cCs*d|j}|jr|dS|dSdS(Nsbool %s ttruetfalse(RpR�(R
RR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7Ts
	N(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�Nst
InitialSidcBseZdd�Zd�ZRS(cCs&tj||�d|_d|_dS(NR;(R=RRpRRc(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt__init\s	cCsd|jt|j�fS(Ns	sid %s %s(RpR6Rc(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7asN(RR
Rt_InitialSid__initR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�[stGenfsConcBseZdd�Zd�ZRS(cCs/tj||�d|_d|_d|_dS(NR;(R=Rt
filesystemtpathRRc(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRes		cCs d|j|jt|j�fS(Nsgenfscon %s %s %s(R�R�R6Rc(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7ksN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�dst
FilesystemUsecBs/eZdZdZdZdd�Zd�ZRS(iiicCs2tj||�|j|_d|_d|_dS(NR;(R=RtXATTRRER�RRc(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRss	cCskd}|jtkrd}n0|jtkr6d}n|jtkrNd}nd||jt|j�fS(NR;s
fs_use_xattr s
fs_use_trans sfs_use_task s	%s %s %s;(RER�tTRANStTASKR�R6Rc(R
RR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7ys			N(RR
R�R�R�RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�ns
tPortConcBseZdd�Zd�ZRS(cCs/tj||�d|_d|_d|_dS(NR;(R=Rt	port_typetport_numberRRc(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s		cCs d|j|jt|j�fS(Nsportcon %s %s %s(R�R�R6Rc(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��stNodeConcBseZdd�Zd�ZRS(cCs/tj||�d|_d|_d|_dS(NR;(R=RtstarttendRRc(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s		cCs d|j|jt|j�fS(Nsnodecon %s %s %s(R�R�R6Rc(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��stNetifConcBseZdd�Zd�ZRS(cCs/tj||�d|_d|_d|_dS(NR;(R=Rt	interfaceRtinterface_contexttpacket_context(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s		cCs&d|jt|j�t|j�fS(Nsnetifcon %s %s %s(R�R6R�R�(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��stPirqConcBseZdd�Zd�ZRS(cCs&tj||�d|_d|_dS(NR;(R=Rtpirq_numberRRc(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s	cCsd|jt|j�fS(Ns
pirqcon %s %s(R�R6Rc(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��stIomemConcBseZdd�Zd�ZRS(cCs&tj||�d|_d|_dS(NR;(R=Rt
device_memRRc(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s	cCsd|jt|j�fS(Nsiomemcon %s %s(R�R6Rc(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��st	IoportConcBseZdd�Zd�ZRS(cCs&tj||�d|_d|_dS(NR;(R=RtioportRRc(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s	cCsd|jt|j�fS(Nsioportcon %s %s(R�R6Rc(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��stPciDeviceConcBseZdd�Zd�ZRS(cCs&tj||�d|_d|_dS(NR;(R=RtdeviceRRc(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s	cCsd|jt|j�fS(Nspcidevicecon %s %s(R�R6Rc(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��st
DeviceTreeConcBseZdd�Zd�ZRS(cCs&tj||�d|_d|_dS(NR;(R=RR�RRc(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s	cCsd|jt|j�fS(Nsdevicetreecon %s %s(R�R6Rc(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��scCs]xVt|dt�D]B\}}d}xt|�D]}|d}q2W|t|�GHqWdS(NRDR;s	(RtTruetrangeR6(theadRBRIRRRK((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt
print_tree�s
tHeaderscBseZdd�Zd�ZRS(cCstj||�dS(N(RR(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�scCsdS(Ns	[Headers]((R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��sRcBseZdd�Zd�ZRS(cCstj||�dS(N(RR(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�scCsdS(NR;((R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�sRcBs&eZdZddd�Zd�ZRS(sqA reference policy interface definition.

    This class represents a reference policy interface definition.
    R;cCstj||�||_dS(N(RRRp(R
RpR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�scCsd|jS(Ns[Interface name: %s](Rp(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
R<RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�st
TunablePolicycBseZdd�Zd�ZRS(cCstj||�g|_dS(N(RRR�(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�scCsdt|jdd�S(Ns[Tunable Policy %s]RSR;(R;R;(RUR�(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��sRcBs eZddd�Zd�ZRS(R;cCstj||�||_dS(N(RRRp(R
RpR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�scCsd|jS(Ns[Template name: %s](Rp(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�stIfDefcBs eZddd�Zd�ZRS(R;cCstj||�||_dS(N(RRRp(R
RpR((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRscCsd|jS(Ns[Ifdef name: %s](Rp(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7	sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�sR"cBs)eZddd�Zd�Zd�ZRS(R;cCs/tj||�||_g|_g|_dS(N(R=Rtifnametargstcomments(R
R�R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR
s		cCsr|j|jkrtSt|j�t|j�kr8tSx3t|j|j�D]\}}||krNtSqNWtS(N(R�RYR>R�tzipR�(R
Rjtatb((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytmatchess"cCs�d|j}d}xf|jD][}t|t�rAt|�}n|}|dkrd|d|}n
||}|d7}qW|dS(Ns%s(is, %sit)(R�R�RR[RU(R
RRRKR�R6((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7s

N(RR
RRR�R7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR"s	
tOptionalPolicycBseZdd�Zd�ZRS(cCstj||�dS(N(RR(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR.scCsdS(Ns[Optional Policy]((R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR71sN(RR
RRR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�-sRcBsAeZdd�Zd�Zd�Zd�Zd�Zd�ZRS(cCstj||�d|_dS(N(RRRtmap(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR5scCsdS(Ns[Support Macros]((R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR79scCs\t�}||jkrKx=|j|�D]}|j|j|��q(Wn
|j|�|S(N(RXR�tby_nameR�t_SupportMacros__expand_permR�(R
tpermRRtp((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt
__expand_perm<s	
cCsai|_xQ|D]I}t�}x'|jD]}|j|j|��q)W||j|j<qWdS(N(R�RXRqR�R�Rp(R
Rt	exp_permsR�((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt	__gen_mapHs	
	cCs!|js|j�n|j|S(N(R�t_SupportMacros__gen_map(R
Rp((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�Ps	
cCs#|js|j�n||jkS(N(R�R�(R
Rp((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pythas_keyUs	
N(	RR
RRR7R�R�R�R�(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR4s				R.cBs&eZdd�Zd�Zd�ZRS(cCsMtj||�t�|_i|_t�|_t�|_t�|_dS(N(R=RRWRsR}R1tdatatusers(R
R((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR[s	cCs)|jj|t��}|j|�dS(N(R}t
setdefaultRWR�(R
R�RqR�((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt
add_obj_classcscCsg}|jd�x"|jD]}|jd|�qWx:|jj�D])\}}|jd||j�f�qHWx"|jD]}|jd|�qWx"|jD]}|jd|�q�Wx"|jD]}|jd|�q�W|jd�t|�dkrd	Sd
j	|�S(Ns	require {s		type %s;s
	class %s %s;s		role %s;s		bool %s;s		user %s;RNiR;s
(
R@RsR}RJR]R1R�R�R>RQ(R
RRRER�RqRtboolR`((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7hs 
!
N(RR
RRR�R7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR.Zs	t
ObjPermSetcBseZd�Zd�ZRS(cCs||_t�|_dS(N(RpRXRq(R
Rp((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyRs	cCsd|j|jj�fS(Nsdefine(`%s', `%s')(RpRqR](R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�s(RR
RR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�~s	tClassMapcBseZd�Zd�ZRS(cCs||_||_dS(N(R�Rq(R
R�Rq((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�s	cCs|jd|jS(Ns: (R�Rq(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�s(RR
RR7(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��s	tCommentcBs/eZdd�Zd�Zd�Zd�ZRS(cCs|r||_n	g|_dS(N(tlines(R
RT((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR�scCsUt|j�dkrdSg}x"|jD]}|jd|�q)Wdj|�SdS(NiR;t#s
(R>R�R@RQ(R
touttline((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR7�scCsIt|j�rEx3|jD]%}|dkr|jj|�qqWndS(NR;(R>R�R@(R
RjR�((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pytmerge�scCs
|j�S(N(R7(R
((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR8�sN(RR
RRR7R�R8(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyR��s		((RMRN((((@tstringRetSRC_TYPEtTGT_TYPEt	OBJ_CLASStPERMStROLEt	DEST_TYPEtfield_to_strtstr_to_fieldRRR=R�RYRRRLRURVRXRWR_RoR*R,R0RuRxRyRzR$R&R(R2R4R R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RRR�RR�R"R�RR.R�R�R�(((s8/usr/lib64/python2.7/site-packages/sepolgen/refpolicy.pyt<module>sx^&
		P
	=!


	



					!&$