404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.220.227.250: ~ $
3

Kl�f��@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

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