Ҹ q d Z ddlZddlZddlmZmZmZ ddlmZ ddl m
Z
mZ ddlm
Z
ddlmZ ej e Z G d d 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 .
Copyright © 2019 Cloud Linux Software Inc.
This software is also available under ImunifyAV commercial license,
see
N)MalwareScanResourceTypeMalwareScanTypeQueuedScanState)
DetachedState)QueuedScanBase ScanQueue)create_task_and_log_exceptions)MessageTypec ~ e Zd Z e ZddZ ddefdZd Zd Z ddZ
d Zd
Zd Z
d Zd
ZdefdZd ZdS )QueueSupervisorSyncNc |pt j | _ || _ | j j }|rD|j t j t j
fv rt j |_
d S d S d S N)asyncioget_event_looploopsinkqueuecurrent_scan
detached_scanget_detached_process_stater RUNNINGFINISHEDr runningstate)selfr r r s _/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/scan/queue_supervisor_sync.py__init__zQueueSupervisorSync.__init__) s 4G244 z. 9*EEGG%& "1!8L 9 9 F
resource_typec K t d|j d | | j j }|D ]:}| j || x}r| j | ;|rA|j |v r8|j |k r-|j
| j d|j
d {V | j j |f||d| d {V | d S )NzQueuing %s scan for %s, )pathr T)r killscan_started)r
prioritize)loggerinfovaluejoinr r findremover" r r handle_aborted_processr startedputrecheck)r pathsr r% scan_argsrunning_scanr" scans r r. zQueueSupervisorSync.put8 s^ $m&9499U;K;K
z. ( (DzD
NNNt
(
!!$'''
!U***m;;,CCYT8L D
djn
'!
r c X | j r"| j | j d S d S r )r r+ r s r clearzQueueSupervisorSync.clear[ s@ j J j r c | j t j }|sd S | j | D)NT) scan_type)r r* r
BACKGROUNDr+ r r3 s r clear_backgroundz$QueueSupervisorSync.clear_background_ sG $:??_-G?HHD
Jd### $r c @ |r| j | }n| j j x}r|gng }d |D }t dd | |D ]}| j | | d S )Nc g | ] }|j
S )r" ).0ss r
z.QueueSupervisorSync.remove..l s '''A'''r z$Removing scans from the queue for %sr! )r find_allr r&