관리-도구
편집 파일: cleanup_revert.cpython-311.pyc
� ��g� � � � d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m Z ddlmZ ddl mZ dd lmZ dd lmZ ddlmZ ddlmZ d Z G d� de� � ZdS )u This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see <https://www.imunify360.com/legal/eula> � N)�suppress)�Path)�CleanupRevertAPI)�Core)� LicenseCLN)� MessageSource)�restore_hits)�MalwareHitStatus)� MalwareHit)�recurring_checki0* c �2 � e Zd ZdZdxZZd� Zd� Zd� Zd� Z dS )�CleanupRevertPlugin�imunifyNc �H � t t j � � dz | _ d S )N�cleanup_revert)r r �TMPDIR�_cleanup_revert_flag��selfs �[/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/plugins/cleanup_revert.py�__init__zCleanupRevertPlugin.__init__+ s � �$(���$5�$5�8H�$H��!�!�!� c � � K � || _ |� t t � � | j � � � � � � | _ d S �N)�_sink�create_taskr �PERIOD�process_cleanup_revert�_task)r �loop�sinks r � create_sourcez!CleanupRevertPlugin.create_source. sI � � � ��� ��%�%�@�#�O�F�#�#�D�$?�@�@�B�B� � �� � � r c � �� K � | j rZ| j � � � t t j � � 5 | j � d {V �� d d d � � d S # 1 swxY w Y d S d S r )r �cancelr �asyncio�CancelledErrorr s r �shutdownzCleanupRevertPlugin.shutdown4 s� � � � ��:� !��J�������'�0�1�1� !� !��j� � � � � � � � !� !� !� !� !� !� !� !� !� !� !� !���� !� !� !� !� !� !� !� !s �A�A�Ac � �� K � | j � � � r=| j � � � j t z t j � � k rd S t j � � rd S t j � � � d {V ��x}rPt t j |t j �� � � � x}r!t || j | j � � � d {V �� | j � dd�� � d S )N)�statusesi� T)�mode�exist_ok)r �exists�stat�st_mtimer �timer �is_freer �paths�listr �get_hitsr � RESTORABLEr r � initiator�touch)r �files�hitss r r z*CleanupRevertPlugin.process_cleanup_revert: s � � � ��%�,�,�.�.� ��*�/�/�1�1�:�V�C��i�k�k�� � �F����� ��F�*�0�2�2�2�2�2�2�2�2�2�5� E���#��$4�$?�� � �� � �t� E� #�4���T�^�D�D�D�D�D�D�D�D�D��!�'�'�U�T�'�B�B�B�B�Br ) �__name__� __module__�__qualname__r5 r r r r"