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

�^��@slddlmZmZddlmZddlmZmZddlm	Z	edddd	g�Z
ee�Zd
d�Z
Gdd
�d
e�ZdS)�)�defaultdict�
namedtuple�)�DiffResultDescriptor)�
Difference�
SymbolWrapper)�type_wrapper_factoryZ
modified_role�added_types�
removed_types�
matched_typescCs>yt|j|Stk
r8t|�}|t|j|<|SXdS)z|
    Wrap roles from the specified policy.

    This caches results to prevent duplicate wrapper
    objects in memory.
    N)�_roles_cacheZpolicy�KeyErrorr)Zrole�r�r�/usr/lib64/python3.6/roles.py�role_wrapper_factory"src@s8eZdZdZed�Zed�Zed�Zdd�Zdd�Z	dS)�RolesDifferencez7Determine the difference in roles between two policies.�
diff_rolescCs�|jjdj|��|jdd�|jj�D�dd�|jj�D��\|_|_}t	�|_
xX|D]P\}}|jdd�|j�D�dd�|j�D��\}}}|s�|rVt|||�|j
|<qVWdS)z6Generate the difference in roles between the policies.zDGenerating role differences from {0.left_policy} to {0.right_policy}css|]}t|�VqdS)N)r)�.0rrrr�	<genexpr>@sz-RolesDifference.diff_roles.<locals>.<genexpr>css|]}t|�VqdS)N)r)rrrrrrAscss|]}t|�VqdS)N)r)r�trrrrJscss|]}t|�VqdS)N)r)rrrrrrKsN)
�log�info�formatZ	_set_diffZleft_policyZrolesZright_policy�added_roles�
removed_roles�dict�modified_roles�types�modified_roles_record)�selfZ
matched_rolesZ	left_roleZ
right_roler	r
rrrrr9s zRolesDifference.diff_rolescCs"|jjd�d|_d|_d|_dS)z%Reset diff results on policy changes.zResetting role differencesN)r�debugrrr)r rrr�_reset_diffUszRolesDifference._reset_diffN)
�__name__�
__module__�__qualname__�__doc__rrrrrr"rrrrr1srN)�collectionsrrZdescriptorsr�
differencerrrrrrrrrrrrr�<module>s