HEX
Server: Apache
System: Linux dinesh8189 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: cgmgerenciamento1 (814285)
PHP: 8.1.26
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/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