관리-도구
편집 파일: 112_hardened_php.cpython-311.opt-1.pyc
� IMgk � � � d dl Z d dlZd dlZd dlZd dlmZ ej ddd�� � Z ej e � � Z dZdZdZ d � Zd � Zd� Zdd �Zdd�ZdS )� N)�importerzimav.malwarelib.utils�chattr)�module�name�defaultzimunify360-alt-php.repozimunify360-ea-php-hardened.repoz/etc/yum.repos.d/c � � d| v rt t hS t j � d� � rt t g� � S t t g� � S )N� cloudlinuxz/usr/local/cpanel/cpanel)�ALT_PHP�EA_PHP�os�path�exists�set)�releases �`/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/migrations/112_hardened_php.py�irrelevant_reposr sM � ��w����� � � ����2� 3� 3� ��G�9�~�~�� �F�8�}�}�� c � � t t fD ]�} t | z }t j � |� � s�,t |� � 5 }t � |� � � t j � � t j |� � � d� � d d d � � n# 1 swxY w Y ��d S )Ni� )r r � REPOS_DIRr r r �openr �subtract_flags�fileno�FS_IMMUTABLE_FL�chmod)� repo_namer �fs r �fix_permissionsr s� � ��v�&� (� (� ��9�$���w�~�~�d�#�#� �� �$�Z�Z� (�1��!�!�!�(�(�*�*�f�.D�E�E�E��H�Q�X�X�Z�Z��'�'�'� (� (� (� (� (� (� (� (� (� (� (���� (� (� (� (�� (� (s � AB5�5B9 �<B9 c � � t j � d� � sd S t d� � 5 } | � � � � � � }d d d � � n# 1 swxY w Y t � � t |� � D ]O}t j t � � 5 t j t |z � � d d d � � n# 1 swxY w Y �Pd S )Nz/etc/redhat-release) r r r r �read�lowerr r � contextlib�suppress�FileNotFoundError�unlinkr )r r r s r � do_migrater% ) s@ � � �7�>�>�/�0�0� ��� �#� $� $� #���&�&�(�(�.�.�"�"��#� #� #� #� #� #� #� #� #� #� #���� #� #� #� #�����%�g�.�.� -� -� � � �!2� 3� 3� -� -��I�i�)�+�,�,�,� -� -� -� -� -� -� -� -� -� -� -���� -� -� -� -��-� -s# �'A$�$A(�+A(�'C�C �C Fc � � |rd S t � � d S # t $ r t � d� � Y d S w xY w)Nz+Failed to clean up HardenedPHP repositories)r% � Exception�logger� exception��migrator�database�fake�kwargss r �migrater/ 5 s_ � �� ���H��������� H� H� H����F�G�G�G�G�G�G�H���s � �$>�>c � � d S )N� r* s r �rollbackr2 >