404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.133.119.72: ~ $
3

Kl�f�x�I@s�ddlZddlZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	�dZ
dddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdOdNdPdQ�4ZdRZdSZ
dTZdUZdVZdWZdXZdYZdZZd[Zd\Zd]Zd^Zd_Zd`ZdaZdbZdcZddZdedf�Zdgdh�Z didj�Z!dkdl�Z"dmdn�Z#dodp�Z$dqdr�Z%dsdt�Z&dudv�Z'da(da)dwa*da+dxa,�d	dydz�Z-d{d|�Z.d}d~�Z/dd��Z0d�d��Z1d�d��Z2d�d��Z3d�d��Z4d�d��Z5d�d��Z6d�d��Z7d�d��Z8d�d��Z9d�d��Z:d�d��Z;d�d��Z<d�d��Z=d�d��Z>d�d��Z?d�d��Z@d�d��ZAd�d��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d„ZQd�dĄZRd�dƄZSd�dȄZTd�dʄZUd�d̄ZVd�d΄ZWd�dЄZXd�d҄ZYd�dԄZZd�dքZ[d�d؄Z\d�dڄZ]d�d܄Z^d�dބZ_d�d�Z`d�d�Zad�d�Zbd�d�Zcd�d�Zdd�d�Zed�d�Zfd�d�Zgd�d�Zhd�d�Zid�d�Zjd�d��Zkd�d��Zld�d��Zmd�d��Znd�d��Zodapdaqd��d�Zr�d
�d�d�Zs�d�d�Zt�d�d�d�ZudS(�N�)�access)�defaults)�lex)�	refpolicy)�yacc�TICK�SQUOTE�OBRACE�CBRACE�SEMI�COLON�OPAREN�CPAREN�COMMA�MINUS�TILDE�ASTERISK�AMP�BAR�EXPL�EQUAL�FILENAME�
IDENTIFIER�NUMBER�PATH�	IPV6_ADDR�MODULE�
POLICY_MODULE�REQUIRE�SID�GENFSCON�FS_USE_XATTR�FS_USE_TRANS�FS_USE_TASK�PORTCON�NODECON�NETIFCON�PIRQCON�IOMEMCON�	IOPORTCON�PCIDEVICECON�
DEVICETREECON�CLASS�
TYPEATTRIBUTE�
ROLEATTRIBUTE�TYPE�	ATTRIBUTE�ATTRIBUTE_ROLE�ALIAS�	TYPEALIAS�BOOL�TRUE�FALSE�IF�ELSE�ROLE�TYPES�ALLOW�	DONTAUDIT�
AUDITALLOW�
NEVERALLOW�
PERMISSIVE�
TYPEBOUNDS�TYPE_TRANSITION�TYPE_CHANGE�TYPE_MEMBER�RANGE_TRANSITION�ROLE_TRANSITION�
OPT_POLICY�	INTERFACE�TUNABLE_POLICY�GEN_REQ�TEMPLATE�GEN_CONTEXT�IFELSE�IFDEF�IFNDEF�DEFINE)4�moduleZ
policy_moduleZrequireZsidZgenfscon�fs_use_xattr�fs_use_trans�fs_use_taskZportconZnodeconZnetifconZpirqconZiomemconZ	ioportconZpcideviceconZ
devicetreecon�classZ
typeattributeZ
roleattribute�typeZ	attributeZattribute_role�aliasZ	typealias�bool�trueZfalse�if�else�role�typesZallow�	dontaudit�
auditallow�
neverallowZ
permissiveZ
typeboundsZtype_transition�type_change�type_memberZrange_transitionZrole_transitionZoptional_policy�	interfaceZtunable_policyZgen_require�templateZgen_contextZifelseZifndef�ifdefZdefinez\`z\'z\{z\}z\;+z\:z\(z\)z\,z\-z\~z\*z\&z\|z\!z\=z[0-9\.]+z/[a-zA-Z0-9)_\.\*/\$]*z 	cCs|S)z2[a-fA-F0-9]{0,4}:[a-fA-F0-9]{0,4}:([a-fA-F0-9]|:)*�)�trfrf�/usr/lib/python3.6/refparser.py�t_IPV6_ADDR�sricCs|jjd7_dS)zdnl.*\nrN)�lexer�lineno)rgrfrfrh�t_m4comment�srlcCs|jd�dS)zdefine.*refpolicywarn\(.*\nrN)�skip)rgrfrfrh�t_refpolicywarn1�srncCs|jjd7_dS)zrefpolicywarn\(.*\nrN)rjrk)rgrfrfrh�t_refpolicywarn�srocCstj|jd�|_|S)z#[a-zA-Z_\$][a-zA-Z0-9_\-\+\.\$\*~]*r)�reserved�get�valuerV)rgrfrfrh�t_IDENTIFIER�srscCstj|jd�|_|S)z\"[a-zA-Z0-9_\-\+\.\$\*~ :]+\"r)rprqrrrV)rgrfrfrh�
t_FILENAMEsrtcCs|jjd7_dS)z\#.*\nrN)rjrk)rgrfrfrh�	t_commentsrucCs td|jd�|jd�dS)NzIllegal character '%s'rr)�printrrrm)rgrfrfrh�t_errorsrwcCs|jjt|j�7_dS)z\n+N)rjrk�lenrr)rgrfrfrh�	t_newlinesry�TcCsX|dkrdSxF|D]>}|dkr q||_|dk	rB|jjd||f�q|jjd|�qWdS)Nr)�parent�children�insert)Zstmtsr{�val�srfrfrh�collect-s
r�cCs8x2|D]*}tj|�r&|jtj|��q|j|�qWdS)N)�sptZhas_key�updateZby_name�add)Zidsr�idrfrfrh�expand9s

r�cCsNt|�dkr&|dr&tjj|d�n$t|�dkrJ|drJtjj|d�dS)z^statements : statement
                  | statements statement
                  | empty
    �rN)rx�mr|�append)�prfrfrh�p_statementsAsr�cCs|d|d<dS)z�statement : interface
                 | template
                 | obj_perm_set
                 | policy
                 | policy_module_stmt
                 | module_stmt
    rrNrf)r�rfrfrh�p_statementKsr�cCsdS)zempty :Nrf)r�rfrfrh�p_emptyUsr�cCs.tj�}|d|_|d|_d|_||d<dS)zHpolicy_module_stmt : POLICY_MODULE OPAREN IDENTIFIER COMMA NUMBER CPAREN��TrN)r�ModuleDeclaration�name�version)r�r�rfrfrh�p_policy_module_stmt`s


r�cCs(tj|d�}t|d|�||d<dS)zainterface : INTERFACE OPAREN TICK IDENTIFIER SQUOTE COMMA TICK interface_stmts SQUOTE CPAREN
    ��rN)r�	Interfacer�)r��xrfrfrh�p_interfacehsr�cCs(tj|d�}t|d|�||d<dS)z�template : TEMPLATE OPAREN TICK IDENTIFIER SQUOTE COMMA TICK interface_stmts SQUOTE CPAREN
                | DEFINE OPAREN TICK IDENTIFIER SQUOTE COMMA TICK interface_stmts SQUOTE CPAREN
    r�r�rN)rZTemplater�)r�r�rfrfrh�
p_templateosr�cCsd|d<dS)z4define : DEFINE OPAREN TICK IDENTIFIER SQUOTE CPARENNrrf)r�rfrfrh�p_definewsr�cCszt|�dkr"|dr"|d|d<nTt|�dkrv|dsL|drv|d|d<n*|dsb|d|d<n|d|d|d<dS)zlinterface_stmts : policy
                       | interface_stmts policy
                       | empty
    r�rrN)rx)r�rfrfrh�p_interface_stmts~sr�cCsFtj�}t|d|dd�t|�dkr8t|d|dd�|g|d<dS)	z�optional_policy : OPT_POLICY OPAREN TICK interface_stmts SQUOTE CPAREN
                       | OPT_POLICY OPAREN TICK interface_stmts SQUOTE COMMA TICK interface_stmts SQUOTE CPAREN
    r�T)r~�r�FrN)rZOptionalPolicyr�rx)r��orfrfrh�p_optional_policy�s
r�cCsPtj�}|d|_t|d|dd�t|�dkrBt|d|dd�|g|d<d	S)
z�tunable_policy : TUNABLE_POLICY OPAREN TICK cond_expr SQUOTE COMMA TICK interface_stmts SQUOTE CPAREN
                      | TUNABLE_POLICY OPAREN TICK cond_expr SQUOTE COMMA TICK interface_stmts SQUOTE COMMA TICK interface_stmts SQUOTE CPAREN
    r�r�T)r~��FrN)rZ
TunablePolicy�	cond_exprr�rx)r�r�rfrfrh�p_tunable_policy�s
r�cCsdS)a�ifelse : IFELSE OPAREN TICK IDENTIFIER SQUOTE COMMA COMMA TICK IDENTIFIER SQUOTE COMMA TICK interface_stmts SQUOTE CPAREN optional_semi
              | IFELSE OPAREN TICK IDENTIFIER SQUOTE COMMA TICK IDENTIFIER SQUOTE COMMA TICK interface_stmts SQUOTE COMMA TICK interface_stmts SQUOTE CPAREN optional_semi
              | IFELSE OPAREN TICK IDENTIFIER SQUOTE COMMA TICK SQUOTE COMMA TICK interface_stmts SQUOTE COMMA TICK interface_stmts SQUOTE CPAREN optional_semi
    Nrf)r�rfrfrh�p_ifelse�sr�cCsbtj|d�}|ddkr d}nd}t|d||d�t|�dkrTt|d|dd�|g|d	<d
S)aJifdef : IFDEF OPAREN TICK IDENTIFIER SQUOTE COMMA TICK statements SQUOTE CPAREN optional_semi
             | IFNDEF OPAREN TICK IDENTIFIER SQUOTE COMMA TICK statements SQUOTE CPAREN optional_semi
             | IFDEF OPAREN TICK IDENTIFIER SQUOTE COMMA TICK statements SQUOTE COMMA TICK statements SQUOTE CPAREN optional_semi
    r�rreTFr�)r~r�rN)rZIfDefr�rx)r�r��vrfrfrh�p_ifdef�sr�cCs8tj|dd�}t|�dkr,|jj|d�||d<dS)z�interface_call : IDENTIFIER OPAREN interface_call_param_list CPAREN
                      | IDENTIFIER OPAREN CPAREN
                      | IDENTIFIER OPAREN interface_call_param_list CPAREN SEMIr)Zifnamer�r�rN)rZ
InterfaceCallrx�args�extend)r��irfrfrh�p_interface_call�sr�cCs6t|�dkr|d|d<n|dd|dg|d<dS)z�interface_call_param : IDENTIFIER
                            | IDENTIFIER MINUS IDENTIFIER
                            | nested_id_set
                            | TRUE
                            | FALSE
                            | FILENAME
    r�rr�-r�N)rx)r�rfrfrh�p_interface_call_param�s
r�cCs6t|�dkr|dg|d<n|d|dg|d<dS)z�interface_call_param_list : interface_call_param
                                 | interface_call_param_list COMMA interface_call_param
    r�rrr�N)rx)r�rfrfrh�p_interface_call_param_list�sr�cCs$tj|d�}|d|_||d<dS)zRobj_perm_set : DEFINE OPAREN TICK IDENTIFIER SQUOTE COMMA TICK names SQUOTE CPARENr�r�rN)rZ
ObjPermSet�perms)r�rrfrfrh�p_obj_perm_set�s
r�cCs|d|d<dS)z�policy : policy_stmt
              | optional_policy
              | tunable_policy
              | ifdef
              | ifelse
              | conditional
    rrNrf)r�rfrfrh�p_policy�sr�cCs|dr|dg|d<dS)a�policy_stmt : gen_require
                   | avrule_def
                   | typerule_def
                   | typebound_def
                   | typeattribute_def
                   | roleattribute_def
                   | interface_call
                   | role_def
                   | role_allow
                   | permissive
                   | type_def
                   | typealias_def
                   | attribute_def
                   | attribute_role_def
                   | range_transition_def
                   | role_transition_def
                   | bool
                   | define
                   | initial_sid
                   | genfscon
                   | fs_use
                   | portcon
                   | nodecon
                   | netifcon
                   | pirqcon
                   | iomemcon
                   | ioportcon
                   | pcidevicecon
                   | devicetreecon
    rrNrf)r�rfrfrh�
p_policy_stmt�sr�cCs.tj�}|d|_|d|_d|_||d<dS)z+module_stmt : MODULE IDENTIFIER NUMBER SEMIr�r�FrN)rr�r�r�)r�r�rfrfrh�
p_module_stmts


r�cCsdS)zlgen_require : GEN_REQ OPAREN TICK requires SQUOTE CPAREN
                   | REQUIRE OBRACE requires CBRACENrf)r�rfrfrh�
p_gen_require!sr�cCsdS)zsrequires : require
                | requires require
                | ifdef
                | requires ifdef
    Nrf)r�rfrfrh�
p_requires)sr�cCsdS)z�require : TYPE comma_list SEMI
               | ROLE comma_list SEMI
               | ATTRIBUTE comma_list SEMI
               | ATTRIBUTE_ROLE comma_list SEMI
               | CLASS comma_list SEMI
               | BOOL comma_list SEMI
    Nrf)r�rfrfrh�	p_require1sr�cCsHtj�}|d|_|d|_|d|_t|�dkr<|d|_||d<dS)z�security_context : IDENTIFIER COLON IDENTIFIER COLON IDENTIFIER
                        | IDENTIFIER COLON IDENTIFIER COLON IDENTIFIER COLON mls_range_defrr�r��r�rN)rZSecurityContext�userr\rVrx�level)r�rrfrfrh�p_security_context;s



r�cCs|d}|d|_||d<dS)zQgen_context : GEN_CONTEXT OPAREN security_context COMMA mls_range_def CPAREN
    r�r�rN)r�)r�rrfrfrh�
p_gen_contextHs
r�cCs|d|d<dS)z<context : security_context
               | gen_context
    rrNrf)r�rfrfrh�	p_contextSsr�cCs(tj�}|d|_|d|_||d<dS)z$initial_sid : SID IDENTIFIER contextr�r�rN)rZ
InitialSidr��context)r�rrfrfrh�
p_initial_sidYs

r�cCs2tj�}|d|_|d|_|d|_||d<dS)z+genfscon : GENFSCON IDENTIFIER PATH contextr�r�r�rN)rZGenfsCon�
filesystem�pathr�)r��grfrfrh�
p_genfscon`s



r�cCsntj�}|ddkr tjj|_n.|ddkr8tjj|_n|ddkrNtjj|_|d|_|d|_||d<dS)	z�fs_use : FS_USE_XATTR IDENTIFIER context SEMI
              | FS_USE_TASK IDENTIFIER context SEMI
              | FS_USE_TRANS IDENTIFIER context SEMI
    rrRrTrSr�r�rN)rZ
FilesystemUseZXATTRrVZTASKZTRANSr�r�)r��frfrfrh�p_fs_usejs


r�cCs`tj�}|d|_t|�dkr4|d|_|d|_n |dd|d|_|d|_||d<dS)zkportcon : PORTCON IDENTIFIER NUMBER context
               | PORTCON IDENTIFIER NUMBER MINUS NUMBER contextr�r�r�r�r�rN)rZPortConZ	port_typerxZport_numberr�)r��crfrfrh�	p_portcon|s


r�cCs2tj�}|d|_|d|_|d|_||d<dS)zanodecon : NODECON NUMBER NUMBER context
               | NODECON IPV6_ADDR IPV6_ADDR context
    r�r�r�rN)rZNodeCon�start�endr�)r��nrfrfrh�	p_nodecon�s



r�cCs2tj�}|d|_|d|_|d|_||d<dS)z.netifcon : NETIFCON IDENTIFIER context contextr�r�r�rN)rZNetifConrcZinterface_contextZpacket_context)r�r�rfrfrh�
p_netifcon�s



r�cCs(tj�}|d|_|d|_||d<dS)z pirqcon : PIRQCON NUMBER contextr�r�rN)rZPirqConZpirq_numberr�)r�r�rfrfrh�	p_pirqcon�s

r�cCsVtj�}t|�dkr*|d|_|d|_n |dd|d|_|d|_||d<dS)zYiomemcon : IOMEMCON NUMBER context
                | IOMEMCON NUMBER MINUS NUMBER contextr�r�r�r�rN)rZIomemConrxZ
device_memr�)r�r�rfrfrh�
p_iomemcon�s

r�cCsVtj�}t|�dkr*|d|_|d|_n |dd|d|_|d|_||d<dS)z\ioportcon : IOPORTCON NUMBER context
                | IOPORTCON NUMBER MINUS NUMBER contextr�r�r�r�rN)rZ	IoportConrxZioportr�)r�r�rfrfrh�p_ioportcon�s

r�cCs(tj�}|d|_|d|_||d<dS)z*pcidevicecon : PCIDEVICECON NUMBER contextr�r�rN)rZPciDeviceConZdevicer�)r�r�rfrfrh�p_pcidevicecon�s

r�cCs(tj�}|d|_|d|_||d<dS)z,devicetreecon : DEVICETREECON NUMBER contextr�r�rN)rZ
DevicetTeeConr�r�)r�r�rfrfrh�p_devicetreecon�s

r�cCs4|d|d<t|�dkr0|dd|d|d<dS)z[mls_range_def : mls_level_def MINUS mls_level_def
                     | mls_level_def
    rrr�r�r�N)rx)r�rfrfrh�p_mls_range_def�sr�cCs:|d|d<t|�dkr6|dddj|d�|d<dS)zRmls_level_def : IDENTIFIER COLON comma_list
                     | IDENTIFIER
    rrr��:�,r�N)rx�join)r�rfrfrh�p_mls_level_def�sr�cCs�tj|d�}t|�dkrD|ddkr8|jj|d�qv|d|_n2t|�dkrv|d|_t|�dkrv|jj|d�||d<dS)	z�type_def : TYPE IDENTIFIER COMMA comma_list SEMI
                | TYPE IDENTIFIER SEMI
                | TYPE IDENTIFIER ALIAS names SEMI
                | TYPE IDENTIFIER ALIAS names COMMA comma_list SEMI
    r�r�r�r�r�r�rN)rZTyperx�
attributesr��aliases)r�rgrfrfrh�
p_type_def�s
r�cCstj|d�}||d<dS)z)attribute_def : ATTRIBUTE IDENTIFIER SEMIr�rN)rZ	Attribute)r��arfrfrh�p_attribute_def�sr�cCstj|d�}||d<dS)z3attribute_role_def : ATTRIBUTE_ROLE IDENTIFIER SEMIr�rN)rZAttribute_Role)r�r�rfrfrh�p_attribute_role_def�sr�cCs(tj�}|d|_|d|_||d<dS)z5typealias_def : TYPEALIAS IDENTIFIER ALIAS names SEMIr�r�rN)rZ	TypeAliasrVr�)r�rgrfrfrh�p_typealias_def�s

r�cCs:tj�}|d|_t|�dkr.|jj|d�||d<dS)zWrole_def : ROLE IDENTIFIER TYPES comma_list SEMI
                | ROLE IDENTIFIER SEMIr�r�rN)rZRoler\rxr]r�)r��rrfrfrh�
p_role_defs

r�cCs(tj�}|d|_|d|_||d<dS)z#role_allow : ALLOW names names SEMIr�r�rN)rZ	RoleAllowZ	src_rolesZ	tgt_roles)r�r�rfrfrh�p_role_allows

r�cCsdS)z"permissive : PERMISSIVE names SEMINrf)r�rfrfrh�p_permissivesr�cCs�tj�}|ddkr tjj|_n.|ddkr8tjj|_n|ddkrNtjj|_|d|_|d|_|d|_|d|_	||d	<d
S)z�avrule_def : ALLOW names names COLON names names SEMI
                  | DONTAUDIT names names COLON names names SEMI
                  | AUDITALLOW names names COLON names names SEMI
                  | NEVERALLOW names names COLON names names SEMI
    rr^r_r`r�r�r�r�rN)
r�AVRuler=�	rule_typer>r?�	src_types�	tgt_types�obj_classesr�)r�r�rfrfrh�p_avrule_defs




r�cCsttj�}|ddkr tjj|_n|ddkr6tjj|_|d|_|d|_|d|_|d|_|d|_	||d	<d
S)a�typerule_def : TYPE_TRANSITION names names COLON names IDENTIFIER SEMI
                    | TYPE_TRANSITION names names COLON names IDENTIFIER FILENAME SEMI
                    | TYPE_TRANSITION names names COLON names IDENTIFIER IDENTIFIER SEMI
                    | TYPE_CHANGE names names COLON names IDENTIFIER SEMI
                    | TYPE_MEMBER names names COLON names IDENTIFIER SEMI
    rrarbr�r�r�r�r�rN)
rZTypeRulerCr�rDr�r�r�Z	dest_type�	file_name)r�rgrfrfrh�p_typerule_def*s





r�cCs.tj�}|d|_|jj|d�||d<dS)z5typebound_def : TYPEBOUNDS IDENTIFIER comma_list SEMIr�r�rN)rZ	TypeBoundrVr�r�)r�rgrfrfrh�p_typebound_def=s
r�cCs8tj�}|d|_|ddkr&d|_nd|_||d<dS)zIbool : BOOL IDENTIFIER TRUE SEMI
            | BOOL IDENTIFIER FALSE SEMIr�r�rYTFrN)rZBoolr��state)r��brfrfrh�p_boolDs
r�cCsPtj�}|d|_t|d|dd�t|�dkrBt|d|dd�|g|d<d	S)
z� conditional : IF OPAREN cond_expr CPAREN OBRACE interface_stmts CBRACE
                    | IF OPAREN cond_expr CPAREN OBRACE interface_stmts CBRACE ELSE OBRACE interface_stmts CBRACE
    r�r�T)r~r��
FrN)rZConditionalr�r�rx)r�r�rfrfrh�
p_conditionalOs
r�cCs.tj�}|d|_|jj|d�||d<dS)z<typeattribute_def : TYPEATTRIBUTE IDENTIFIER comma_list SEMIr�r�rN)rZ
TypeAttributerVr�r�)r�rgrfrfrh�p_typeattribute_defZs
r�cCs.tj�}|d|_|jj|d�||d<dS)z<roleattribute_def : ROLEATTRIBUTE IDENTIFIER comma_list SEMIr�r�rN)rZ
RoleAttributer\Zroleattributesr�)r�rgrfrfrh�p_roleattribute_defas
r�cCsdS)z�range_transition_def : RANGE_TRANSITION names names COLON names mls_range_def SEMI
                            | RANGE_TRANSITION names names names SEMINrf)r�rfrfrh�p_range_transition_defhsr�cCsdS)z<role_transition_def : ROLE_TRANSITION names names names SEMINrf)r�rfrfrh�p_role_transition_defmsr�cCsjt|�}|dkr |dg|d<nF|dkr@|dg|d|d<n&|d|d|dg|d|d<dS)acond_expr : IDENTIFIER
                 | EXPL cond_expr
                 | cond_expr AMP AMP cond_expr
                 | cond_expr BAR BAR cond_expr
                 | cond_expr EQUAL EQUAL cond_expr
                 | cond_expr EXPL EQUAL cond_expr
    r�rrr�r�N)rx)r��lrfrfrh�p_cond_exprqsr�cCsrtj�}t|�dkr$t|d|�nBt|�dkrFt|d|�d|_n t|dg�|jd|d�||d<dS)z�names : identifier
             | nested_id_set
             | asterisk
             | TILDE identifier
             | TILDE nested_id_set
             | IDENTIFIER MINUS IDENTIFIER
    r�rr�Tr�rN)rZIdSetrxr�Z
complimentr�)r�rrfrfrh�p_names�sr�cCs|dg|d<dS)zidentifier : IDENTIFIERrrNrf)r�rfrfrh�p_identifier�sr�cCs|dg|d<dS)zasterisk : ASTERISKrrNrf)r�rfrfrh�
p_asterisk�sr�cCs|d|d<dS)z1nested_id_set : OBRACE nested_id_list CBRACE
    r�rNrf)r�rfrfrh�p_nested_id_set�sr�cCs2t|�dkr|d|d<n|d|d|d<dS)z`nested_id_list : nested_id_element
                      | nested_id_list nested_id_element
    r�rrN)rx)r�rfrfrh�p_nested_id_list�sr�cCs4t|�dkr|d|d<nd|d}|g|d<dS)zxnested_id_element : identifier
                         | MINUS IDENTIFIER
                         | nested_id_set
    r�rrr�N)rx)r��strrfrfrh�p_nested_id_element�sr�cCs0t|�dkr |d|d|d<|d|d<dS)zTcomma_list : nested_id_list
                  | comma_list COMMA nested_id_list
    r�rr�rN)rx)r�rfrfrh�p_comma_list�sr�cCsdS)z/optional_semi : SEMI
                   | emptyNrf)r�rfrfrh�p_optional_semi�sr�cCs&dt|j|j|jfatt�dadS)Nz(%s: Syntax error on line %d %s [type=%s]F)�
parse_filerkrrrV�errorrv�success)�tokrfrfrh�p_error�sr�cCs(|siSi}x|D]}|||j<qWdS)N)r�)r��mapr�rfrfrh�prep_spt�s

rcCsHtstj�atjd|dd�a|dk	r*|antj�a|s@tj�an|adS)NZLALRr)�method�debugZwrite_tables)	�parserrrjrr�r�Module�
SupportMacrosr�)rQ�supportrrfrfrh�create_globals�s
rFcCs�t|||�dt_daytj||td�WnBtk
rl}z&dadadt|�dtj	�a
WYdd}~XnXts�dadt
}t|��tS)NrT)rrjzinternal parser error: %s�
zcould not parse text: "%s")
rrjrkr�r�parse�	Exceptionr��	traceback�
format_excr��
ValueErrorr�)�textrQrr�e�msgrfrfrhr
�s*r
c	Cs�g}d}x�tj|�D]�\}}}x�|D]~}tjj|�}tjj||�}|ddkr�|dkr\|}q�ttjd|d��r�|j|d|f�q$|ddkr$|j|d|f�q$WqW||fS)Nrz.sptzobj_perm_sets.sptZpatternsrz.if)	�os�walkr��splitextr�rx�re�findallr�)	�root�modules�support_macros�dirpathZdirnames�	filenamesr��modname�filenamerfrfrh�list_headers
s
rcs>ddlm}tj�}g}d}tjj|�r|tjj|�d}|dkrLtd|��tjj	|�}	|j
|	d|f�ttj
��\}
}nt|�\}}|r�|r�td���fdd��d��fd	d
�	}d}|�r8�d|�tj�}|||�|jj
|�tjd�}
tjd
dddddddddg
�}|
jj
tj|��|jj
|
��d���rd��rd|jtjt|�d�}|jd�g}x�|D]�}tj�}|d|_y*|�r�||d||�n||d|�WnFtk
�r�}z(�t|�d�|j
|d��wnWYdd}~XnX|jj
|���rn��rn|j��qnWt|��r:�ddj|��|S)Nr)�utilrzzInvalid file name %srz1could not find support macros (obj_perm_sets.spt)cs�r�j|�dS)N)�write)r)�outputrfrhr�3szparse_headers.<locals>.ocs��r�d|�y.t|�}|j�}|j�|at|||��WnTtk
r^}zdSd}~Xn6tk
r�}ztd|t|�f��WYdd}~XnXdS)Nzparsing file %s
zerror parsing file %s: %s)�open�read�closer�r
�IOErrorrr�)r�rQr��fdZtxtr)rr�rfrhr�7sz!parse_headers.<locals>.parse_filezParsing support macros (%s): �can_execz$1z$2�fileZexecute_no_transr"r#�getattr�lockZexecuteZioctlzdone.
)ZstepszParsing interface filesr	z failed to parse some headers: %sz, )N)rzrrZHeadersrr��isfile�splitrrr�rr�headersrr|r�rZAccessVectorr�ZConsoleProgressBar�sys�stdoutrxr�rr�r��stepr�)rr!r�rrr-rrr�rZall_modulesr�r�r'�avZstatusZfailuresr�r�rrf)rr�r!rh�
parse_headerssb






r2)Irr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrP)N)NNF)NTF)vr.rrrrzrrrrr�tokensrpZt_TICKZt_SQUOTEZt_OBRACEZt_CBRACEZt_SEMIZt_COLONZt_OPARENZt_CPARENZt_COMMAZt_MINUSZt_TILDEZ
t_ASTERISKZt_AMPZt_BARZt_EXPLZt_EQUALZt_NUMBERZt_PATHZt_ignorerirlrnrorsrtrurwryr�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�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�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrjrr
rr2rfrfrfrh�<module> s�







"


	

		



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