HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux ns565604.ip-54-39-133.net 4.18.0-553.50.1.el8_10.x86_64 #1 SMP Tue Apr 15 08:09:22 EDT 2025 x86_64
User: greer489 (1034)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: //lib64/python3.6/site-packages/setools/diff/__pycache__/commons.cpython-36.pyc
3

�^C�@sLddlmZddlmZddlmZmZeddddg�ZGd	d
�d
e�ZdS)�)�
namedtuple�)�DiffResultDescriptor)�
Difference�
SymbolWrapperZmodified_common�added_perms�
removed_perms�
matched_permsc@s8eZdZdZed�Zed�Zed�Zdd�Zdd�Z	dS)�CommonDifferencezV
    Determine the difference in common permission sets
    between two policies.
    �diff_commonscCs�|jjdj|��|jdd�|jj�D�dd�|jj�D��\|_|_}t	�|_
xD|D]<\}}|j|j|jdd�\}}}|s�|rVt|||�|j
|<qVWdS)z8Generate the difference in commons between the policies.zFGenerating common differences from {0.left_policy} to {0.right_policy}css|]}t|�VqdS)N)r)�.0�c�r�/usr/lib64/python3.6/commons.py�	<genexpr>0sz0CommonDifference.diff_commons.<locals>.<genexpr>css|]}t|�VqdS)N)r)rr
rrrr1sF)ZunwrapN)
�log�info�formatZ	_set_diffZleft_policyZcommonsZright_policy�
added_commons�removed_commons�dict�modified_commonsZperms�modified_commons_record)�selfZmatched_commonsZleft_commonZright_commonrrr	rrrr)s zCommonDifference.diff_commonscCs"|jjd�d|_d|_d|_dS)z%Reset diff results on policy changes.zResetting common differencesN)r�debugrrr)rrrr�_reset_diffDszCommonDifference._reset_diffN)
�__name__�
__module__�__qualname__�__doc__rrrrrrrrrrr
sr
N)	�collectionsrZdescriptorsr�
differencerrrr
rrrr�<module>s