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__/nodecon.cpython-36.pyc
3

�^��@shddlmZddlmZddlmZddlmZmZedddd	g�Z	Gd
d�de�Z
Gdd
�d
e�ZdS)�)�
namedtuple�)�ContextWrapper)�DiffResultDescriptor)�
Difference�WrapperZmodified_nodeconZruleZ
added_contextZremoved_contextc@s8eZdZdZed�Zed�Zed�Zdd�Zdd�Z	dS)�NodeconsDifferencez:Determine the difference in nodecons between two policies.�
diff_nodeconscCs�|jjdj|��|jdd�|jj�D�dd�|jj�D��\|_|_}g|_	x<|D]4\}}t
|j�t
|j�krT|j	jt
||j|j��qTWdS)z9Generate the difference in nodecons between the policies.zGGenerating nodecon differences from {0.left_policy} to {0.right_policy}css|]}t|�VqdS)N)�NodeconWrapper)�.0�n�r
�/usr/lib64/python3.6/nodecon.py�	<genexpr>/sz3NodeconsDifference.diff_nodecons.<locals>.<genexpr>css|]}t|�VqdS)N)r
)rrr
r
rr0sN)�log�info�formatZ	_set_diffZleft_policyZnodeconsZright_policy�added_nodecons�removed_nodecons�modified_nodeconsr�context�append�modified_nodecon_record)�selfZmatched_nodeconsZleft_nodeconZ
right_nodeconr
r
rr	(s
 
z NodeconsDifference.diff_nodeconscCs"|jjd�d|_d|_d|_dS)z%Reset diff results on policy changes.zResetting nodecon differencesN)r�debugrrr)rr
r
r�_reset_diff?szNodeconsDifference._reset_diffN)
�__name__�
__module__�__qualname__�__doc__rrrrr	rr
r
r
rr src@s4eZdZdZd
Zdd�Zdd�Zdd	�Zd
d�ZdS)r
z*Wrap nodecon statements for diff purposes.�
ip_version�networkcCs$||_|j|_|j|_t|�|_dS)N)�originr r!�hash�key)rZoconr
r
r�__init__MszNodeconWrapper.__init__cCs|jS)N)r$)rr
r
r�__hash__SszNodeconWrapper.__hash__cCs|j|jkS)N)r")r�otherr
r
r�__lt__VszNodeconWrapper.__lt__cCs|j|jko|j|jkS)N)r r!)rr'r
r
r�__eq__YszNodeconWrapper.__eq__N)r r!)	rrrr�	__slots__r%r&r(r)r
r
r
rr
Gsr
N)�collectionsrrrZdescriptorsr�
differencerrrrr
r
r
r
r�<module>s'