]_ " d Z ddlZddlZddlZddlmZ ddlmZmZ ddl m
Z
ddlmZ ddl
mZ ddlmZ dd lmZmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ej e Z G d d Zde de fdZ! dde"e de
dedz fdZ#dS )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)cast)MalwareMalwareScanIntensity)TheSink)resource_limits)MalwareDatabaseRestoreTask)CleanupRevertInitiator)RESTORE_ORIGINAL_INTENSITY_KEYMalwareScanResourceType)
MalwareHit)MDS_PATH)MDSDetachedRestoreDir) hash_pathc
L e Zd Zddddedededz dedz fdZdefd Zd
ZdS )MalwareDatabaseRestoreN)signature_id
restore_idapp_namepathr r c n || _ || _ || _ |pt j j | _ d S N)r r r uuiduuid4hexr )selfr r r r s U/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/scan/mds/restore.py__init__zMalwareDatabaseRestore.__init__- s3 !
($8
(8 work_dirc * dt d| j d| j dt |j d| j dt |j dt t j g}| j r
|d| j gz
}n|d t | j | j gz
}|S )
Nz/opt/ai-bolit/wrapperz--pathz
--app-namez
--report-filez
--detachedz
--progressz--db-timeoutz--restore-sig-idz --restore)r
r r strreport_filer
progress_filer MDS_DB_TIMEOUTr storage_path)r r commands r cmdzMalwareDatabaseRestore.cmd: s #IM$%%O&''&''
" M*D,=>>GG\$)T]%K%KLLGr c K t | j 5 }| | }|j d 5 }|j d 5 }t d| t j |t j t j d||t | t d {V d d d n# 1 swxY w Y d d d n# 1 swxY w Y d d d d S # 1 swxY w Y d S )Nw)modezRunning MDS Restore with: %sT)
intensity_cpuintensity_iostart_new_sessionstdoutstderrcwdkey)r r r' log_fileopenerr_fileloggerinfor create_subprocessr CPUIOr! r
)r r r' l_fe_fs r restorezMalwareDatabaseRestore.restoreR s
"4?
3
3 x((8$$C !&&C&00
47!&&C&00
47:C@@@%7"6":!5!8&*H
6
sZ 1DC+$A$CC+CC+CC+D+C/ /D2C/ 3DD
D)__name__
__module____qualname__r! r r r' r<