Edit File: proactive.cpython-311.pyc
� P6hc � �� � d dl Z d dlZd dlZd dlmZ d dlZd dlmZmZm Z d dl mZ d dlm Z ej e� � ZdZ ed� � ZdZd Zd ZdZdZd � Zd� Zd� Zd� Zd� ZdS )� N)�Path)�atomic_rewrite� check_run� CheckRunError)�files)�ProactiveDefencez'/usr/share/i360-php-opts/autorules.yamlz/usr/share/i360-php-optsz2/usr/share/i360-php-opts/phpimunity.compiled.rulesz/usr/bin/i360-storage-mkcustomz/usr/bin/i360-storage-newz#/usr/bin/i360-storage-replacehdb-v2� c � �L K � t j t j � � } t d� | � � � D � � � � }n+# t $ r t � d� � Y d S w xY w| � |d � � }t dz }t j |dd�� � 5 }t |d� � 5 }t j ||� � d d d � � n# 1 swxY w Y d d d � � n# 1 swxY w Y t j |t � � d S ) Nc 3 �2 K � | ]}|d dk �|V � �dS )�namezautorules_opt.yaml.gzN� )�.0�is �K/opt/imunify360/venv/lib/python3.11/site-packages/im360/subsys/proactive.py� <genexpr>z,update_php_immunity_files.<locals>.<genexpr> s: � � � � � ���&� �5L�(L�(L�A�(L�(L�(L�(L� � � z)PHP Immunity rules are not found in index�urlz.tmp�rtzutf-8)�encoding�w)r �Index�PHP_IMMUNITY�next�items� StopIteration�logger�warning� localfilepath�PHP_IMMUNITY_FILENAME�gzip�open�shutil�copyfileobj�os�rename)�index�item� local_path�tmp�src�dsts r �update_php_immunity_filesr, s� � � � ��K��*�+�+�E��� � ��{�{�}�}� � � � � ���� � � � ����B�C�C�C�������� �$�$�T�%�[�1�1�J� �&� (�C� ��:�t�g� 6� 6� 6� %�#�t��S�@� @� %� ���3��$�$�$�%� %� %� %� %� %� %� %� %� %� %���� %� %� %� %� %� %� %� %� %� %� %� %� %� %� %���� %� %� %� %� �I�c�(�)�)�)�)�)sG �+A �$A6�5A6�5C?�C(�C?�(C, �,C?�/C, �0C?�?D�Dc � � K � t t t g� � � d {V �� d S # t $ r&} t � d| � � Y d } ~ d S d } ~ wt $ r&} t � d| � � Y d } ~ d S d } ~ ww xY w)Nzi360-storage is not found: %sz*Failed to apply new php immunity rules: %s)r �I360_STORAGE_BINr �FileNotFoundErrorr �errorr )�errs r �apply_php_immunity_rulesr2 + s� � � � �H��)�+@�A�B�B�B�B�B�B�B�B�B�B�B��� ;� ;� ;����4�c�:�:�:�:�:�:�:�:�:������ H� H� H����A�3�G�G�G�G�G�G�G�G�G�����H���s �!'