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

�^4�@s�ddlmZmZddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
dd	lmZed
ddd
g�ZGdd�de�ZGdd�de	�ZdS)�)�defaultdict�
namedtuple�)�MLSRuletype�)�DiffResultDescriptor)�
Difference�Wrapper)�RangeWrapper)�class_wrapper_factory)�type_or_attr_wrapper_factoryZmodified_mlsrule�ruleZ
added_defaultZremoved_defaultc@sPeZdZdZed�Zed�Zed�Zee	�Z
ee	�Zdd�Zdd�Z
dd�Zd	S)
�MLSRulesDifferencez;Determine the difference in MLS rules between two policies.�diff_range_transitionscCs�|jjdj|��|js"|jr*|j�|j|j|jtj	t
�|j|jtj	t
��\}}}g}x:|D]2\}}t|j�t|j�krf|j
t||j|j��qfW||_||_||_dS)zGGenerate the difference in range_transition rules between the policies.zPGenerating range_transition differences from {0.left_policy} to {0.right_policy}N)�log�info�format�_left_mls_rules�_right_mls_rules�_create_mls_rule_listsZ	_set_diffZ_expand_generatorrZrange_transition�MLSRuleWrapperr
�default�append�modified_mlsrule_record�added_range_transitions�removed_range_transitions�modified_range_transitions)�selfZaddedZremovedZmatchedZmodifiedZ	left_ruleZ
right_rule�r� /usr/lib64/python3.6/mlsrules.pyr/s&z)MLSRulesDifference.diff_range_transitionscCs�|jjdj|��x$|jj�D]}|j|jj|�qW|jjdj|��x$|jj�D]}|j	|jj|�qVW|jjd�dS)z$Create rule lists for both policies.z,Building MLS rule lists from {0.left_policy}z-Building MLS rule lists from {0.right_policy}z"Completed building MLS rule lists.N)
r�debugrZleft_policyZmlsrulesr�ruletyperZright_policyr)rr
rrrrPsz)MLSRulesDifference._create_mls_rule_listscCs6|jjd�d|_d|_d|_|jj�|jj�dS)z%Reset diff results on policy changes.zResetting MLS rule differencesN)rr rrrr�clearr)rrrr�_reset_diff^s
zMLSRulesDifference._reset_diffN)�__name__�
__module__�__qualname__�__doc__rrrrr�listrrrrr#rrrrr#s!rc@s4eZdZdZdZdd�Zdd	�Zd
d�Zdd
�ZdS)rz'Wrap MLS rules to allow set operations.r!�source�target�tclasscCs8||_t|j�|_t|j�|_t|j�|_t|�|_dS)N)�originrr)r*rr+�hash�key)rr
rrr�__init__ps
zMLSRuleWrapper.__init__cCs|jS)N)r.)rrrr�__hash__wszMLSRuleWrapper.__hash__cCs|j|jkS)N)r.)r�otherrrr�__lt__zszMLSRuleWrapper.__lt__cCs$|j|jko"|j|jko"|j|jkS)N)r)r*r+)rr1rrr�__eq__}szMLSRuleWrapper.__eq__N)r!r)r*r+)	r$r%r&r'�	__slots__r/r0r2r3rrrrrjsrN)�collectionsrr�rZdescriptorsr�
differencerr	Zmlsr
Zobjclassr�typesrrrrrrrr�<module>sG

Youez - 2016 - github.com/yon3zu
LinuXploit