HEX
Server: LiteSpeed
System: Linux atali.colombiahosting.com.co 5.14.0-570.12.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 13 06:11:55 EDT 2025 x86_64
User: coopserp (1713)
PHP: 8.2.29
Disabled: dl,exec,passthru,proc_open,proc_close,shell_exec,memory_limit,system,popen,curl_multi_exec,show_source,symlink,link,leak,listen,diskfreespace,tmpfile,ignore_user_abord,highlight_file,source,show_source,fpaththru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setid,posix_times,posix_ttyname,posix_uname,proc_get_status,proc_nice,proc_terminate
Upload Files
File: //lib64/python3.9/site-packages/setools/diff/__pycache__/objclass.cpython-39.pyc
a

q�qeT�@s�UddlmZddlmZddlmZmZddlmZddl	m
Z
ddlmZdd	l
mZmZdd
lmZee�Zee
ed<Gdd
�d
e�Ze
ee
d�dd�ZGdd�de�ZdS)�)�defaultdict)�suppress)�
NamedTuple�Set�)�NoCommon)�ObjClass�)�DiffResultDescriptor)�
Difference�
SymbolWrapper)�SymbolCache�_class_cachec@s6eZdZUdZeeed<eeed<eeed<dS)�ModifiedObjClassz/Difference details for a modified object class.�added_perms�
removed_perms�
matched_permsN)�__name__�
__module__�__qualname__�__doc__r�str�__annotations__�rr�;/usr/lib64/python3.9/site-packages/setools/diff/objclass.pyrs
r)�class_�returncCsBzt|j|WSty<t|�}|t|j|<|YS0dS)z|
    Wrap class from the specified policy.

    This caches results to prevent duplicate wrapper
    objects in memory.
    N)rZpolicy�KeyErrorr)r�crrr�class_wrapper_factorysrc@sDeZdZdZed�Zed�Zed�Zdd�dd�Zdd�dd�Z	dS)	�ObjClassDifferencezN
    Determine the difference in object classes
    between two policies.
    �diff_classesN)rc		Cs|j�d�|��|�dd�|j��D�dd�|j��D��\|_|_}t	�|_
|D]�\}}|j}tt
��||jjO}Wd�n1s�0Y|j}tt
��||jjO}Wd�n1s�0Y|j||dd�\}}}|s�|rTt|||�|j
|<qTdS)z?Generate the difference in object classes between the policies.zEGenerating class differences from {0.left_policy} to {0.right_policy}css|]}t|�VqdS�N�r��.0rrrr�	<genexpr>?�z2ObjClassDifference.diff_classes.<locals>.<genexpr>css|]}t|�VqdSr"r#r$rrrr&@r'NF)�unwrap)�log�info�formatZ	_set_diffZleft_policy�classesZright_policy�
added_classes�removed_classes�dict�modified_classesZpermsrr�commonr)	�selfZmatched_classesZ
left_classZright_classZ
left_permsZright_permsrrrrrrr!8s0��
*
*��zObjClassDifference.diff_classescCs"|j�d�d|_d|_d|_dS)z%Reset diff results on policy changes.z"Resetting object class differencesN)r)�debugr-r.r0)r2rrr�_reset_diff\szObjClassDifference._reset_diff)
rrrrr
r-r.r0r!r4rrrrr -s$r N)�collectionsr�
contextlibr�typingrr�	exceptionrZ	policyreprZdescriptorsr
�
differencerrr
r/rrrrr rrrr�<module>s