Edit File: clcagefs.cpython-311.pyc
� P6h' � � � d dl Z d dlZd dlZdZdZ G d� de� � Z G d� d� � Zd� Zdd �Z dd �Z d� Zd� Zdd�Z dS )� Nz/etc/cagefs/cagefs.mpz/usr/sbin/cagefsctlc � � e Zd Zd� Zd� ZdS )�CagefsMpConflictc �2 � d|�dt �d|�d�| _ d S )NzConflict in adding 'z' to z5 because of pre-existing alternative specification: '�')�CAGEFS_MP_FILENAME�_msg)�self�new_item� existing_items �J/opt/imunify360/venv/lib/python3.11/site-packages/im360/subsys/clcagefs.py�__init__zCagefsMpConflict.__init__ s, � � � �x�x�+�+�+�]�]�]� <� � � � � c � � | j S �N)r �r s r �__str__zCagefsMpConflict.__str__ s � ��y�r N)�__name__� __module__�__qualname__r r � r r r r s2 � � � � � � � � �� � � � r r c � � e Zd ZdZdZdZd� Zd� Zd� Ze d� � � Z d� Zd � Zd � Z e d� � � Ze d� � � Ze d � � � Zd� Zd� Zd� ZdS )�CagefsMpItems @!%r � !c � � |dd� dk r d| _ dS |� � � dk r d| _ dS || _ dS )z�Constructor :param arg: Is either path to add to cagefs.mp or a raw line is read from cagefs.mp :param prefix: The same as adding prefix '!' to arg before passing it to ctorN� � #r )� _path_spec�strip)r �args r r zCagefsMpItem.__init__# sI � � �r��r�7�d�?�?�"�D�O�O�O� �Y�Y�[�[�C� � �"�D�O�O�O�!�D�O�O�Or c �\ � | � � � dk r|�d| j |fz | _ | S )z%Specify mode as in fluent constructor� @Ns %s,%03o)�prefixr )r �modes r r# zCagefsMpItem.mode2 s4 � � �;�;�=�=�D� � �T�%5�(�D�O�T�+B�B�D�O��r c �4 � t j | j � � S r )�os�fsdecoder r s r r zCagefsMpItem.__str__: s � ��{�4�?�+�+�+r c �8 � | dk rdS | d dk r| dz S | S )Nr � /����/ r )�paths r � _add_slashzCagefsMpItem._add_slash= s. � ��3�;�;��4���8�w����$�;���r c �d � t � |� � }| � � � s|� � � rdS t � | � � � � � }t � |� � � � � }|� |� � S )NF)r �_adopt�is_dummyr, r+ � startswith)r �another�adopted� this_path�test_preexist_in_paths r �pre_exist_inzCagefsMpItem.pre_exist_inE s� � ��%�%�g�.�.�� �=�=�?�?� �g�.�.�0�0� ��5� �+�+�D�I�I�K�K�8�8� � ,� 7� 7������ G� G���#�#�$9�:�:�:r c � � t � |� � }| � � � s|� � � rdS | � � � |� � � k rdS t j t j gi}g }| � � � |� |� � � |� � v S )NFT)r r. r/ r"