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 : |
3 �^h � @ st d dl mZ ddlmZ ddlmZ ddlmZmZ ddl m Z edd d dg�ZG dd � d e�ZG dd� de�Z dS )� )� namedtuple� )�BoundsRuletype� )�DiffResultDescriptor)� Difference�Wrapper)�type_wrapper_factoryZmodified_bound�ruleZadded_boundZ removed_boundc @ sH e Zd ZdZed�Zed�Zed�ZdZdZ dd� Z dd� Zdd � ZdS ) �BoundsDifferencez9Determine the difference in *bounds between two policies.�diff_typeboundsNc C s� | j jdj| �� | jdks&| jdkr.| j� | jdd� | jD �dd� | jD �dd� d�\| _| _}g | _ x<|D ]4\}}t |j�t |j�krp| j jt ||j|j�� qpW dS ) z@Generate the difference in typebound rules between the policies.zJGenerating typebounds differences from {0.left_policy} to {0.right_policy}Nc s s | ]}t |�V qd S )N)� BoundsWrapper)�.0�c� r �/usr/lib64/python3.6/bounds.py� <genexpr>5 s z3BoundsDifference.diff_typebounds.<locals>.<genexpr>c s s | ]}t |�V qd S )N)r )r r r r r r 6 s c S s t | j�S )N)�str�child)�br r r �<lambda>7 s z2BoundsDifference.diff_typebounds.<locals>.<lambda>)�key)�log�info�format�_left_typebounds�_right_typebounds�_create_typebound_listsZ _set_diff�added_typebounds�removed_typebounds�modified_typeboundsr �parent�append�modified_bounds_record)�selfZmatched_typeboundsZ left_boundZright_boundr r r r + s z BoundsDifference.diff_typeboundsc C s� g | _ x@| jj� D ]2}|jtjkr0| j j|� q| jjdj |j�� qW g | _ x@| jj� D ]2}|jtjkrx| j j|� qZ| jjdj |j�� qZW dS )z$Create rule lists for both policies.z/Unknown rule type: {0} (This is an SETools bug)N)r Zleft_policyZbounds�ruletyper Z typeboundsr"