HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib64/python3.9/site-packages/setools/diff/__pycache__/genfscon.cpython-39.pyc
a

q�qe�
�@s|ddlmZddlmZmZddlmZddlmZddl	m
Z
mZGdd	�d	e�ZGd
d�de
�Z
Gdd
�d
ee�ZdS)�)�
NamedTuple�)�Context�Genfscon�)�ContextWrapper)�DiffResultDescriptor)�
Difference�Wrapperc@s*eZdZUdZeed<eed<eed<dS)�ModifiedGenfsconz,Difference details for a modified genfscons.�ruleZ
added_contextZremoved_contextN)�__name__�
__module__�__qualname__�__doc__r�__annotations__r�rr�;/usr/lib64/python3.9/site-packages/setools/diff/genfscon.pyrs
rc@sDeZdZdZed�Zed�Zed�Zdd�dd�Zdd�dd�Z	dS)	�GenfsconsDifferencez@Determine the difference in genfscon rules between two policies.�diff_genfsconsN)�returncCs�|j�d�|��|�dd�|j��D�dd�|j��D��\|_|_}g|_	|D]4\}}t
|j�t
|j�krR|j	�t
||j|j��qRdS)z?Generate the difference in genfscon rules between the policies.zHGenerating genfscon differences from {0.left_policy} to {0.right_policy}css|]}t|�VqdS�N��GenfsconWrapper��.0�fsrrr�	<genexpr>'�z5GenfsconsDifference.diff_genfscons.<locals>.<genexpr>css|]}t|�VqdSrrrrrrr(rN)�log�info�formatZ	_set_diffZleft_policyZ	genfsconsZright_policy�added_genfscons�removed_genfscons�modified_genfsconsr�context�appendr)�selfZmatchedZ	left_ruleZ
right_rulerrrrs ���
�z"GenfsconsDifference.diff_genfsconscCs"|j�d�d|_d|_d|_dS)z%Reset diff results on policy changes.z#Resetting genfscon rule differencesN)r�debugr"r#r$�r'rrr�_reset_diff7szGenfsconsDifference._reset_diff)
r
rrrrr"r#r$rr*rrrrrsrc@s<eZdZdZdZedd�dd�Zdd�Zd	d
�Zdd�Z	dS)
rz,Wrap genfscon rules to allow set operations.)r�path�filetyper%N)rrcCs8||_|j|_|j|_|j|_t|j�|_t|�|_dSr)�originrr+r,rr%�hash�key)r'rrrr�__init__EszGenfsconWrapper.__init__cCs|jSr�r/r)rrr�__hash__MszGenfsconWrapper.__hash__cCs|j|jkSrr1�r'�otherrrr�__lt__PszGenfsconWrapper.__lt__cCs$|j|jko"|j|jko"|j|jkSr)rr+r,r3rrr�__eq__Ss

�
�zGenfsconWrapper.__eq__)
r
rrr�	__slots__rr0r2r5r6rrrrr?srN)�typingrZ	policyreprrr%rZdescriptorsr�
differencer	r
rrrrrrr�<module>s	(