h dZddlZddlZddlZddlmZddlmZmZddl m Z ddl m Z ddl mZejeZGdd 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)suppress)MalwareMalwareSignatures)MDS_PATH)MDSDetachedCleanupDir) storage_pathcFeZdZdZedZedZdZdS)MalwareDatabaseCleanerc|std|std||_||_||_t |j|_dS)Nz'Cannot instantiate cleaner without pathz,Cannot instantiate cleaner without app names) ValueError cleanup_idpathapp_namerwork_dir)selfr rrs U/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/scan/mds/cleaner.py__init__zMalwareDatabaseCleaner.__init__$s\ HFGG G MKLL L$   -do>> c6t|j|jS)N)rrrrs rrz#MalwareDatabaseCleaner.storage_path.sDIt}555rcdtdd|jdtjdt |jjd|jdt |jjd|j d |j d tj d t tj gS) Nz/opt/ai-bolit/wrapperz--cleanz--pathz--avdbz --report-filez --detachedz --progressz --backup-filez --app-namez --procudbz --db-timeout)rrrMDS_AI_BOLIT_HOSTERstrr report_filer progress_filerr MDS_PROCU_DBrMDS_DB_TIMEOUTrs rcmdzMalwareDatabaseCleaner.cmd2s $    I   1   ) * *  O   + , ,     M   *  & ' '+  rc VK|j5|jjd5}|jjd5}td|jtt5tj |j dddn #1swxYwYtj |jd||t|jdd{Vdddn #1swxYwYdddn #1swxYwYddddS#1swxYwYdS)Nw)modezRunning MDS Cleaner with: %sT)start_new_sessionstdoutstderrcwd)rlog_fileopenerr_fileloggerinforrFileNotFoundErrorosunlinkrasynciocreate_subprocess_execr)rl_fe_fs rstartzMalwareDatabaseCleaner.startLs9 ]  ',,- dm,11s1;; ?B :DHEEE/0011Id/0001111111111111114X&*DM**                                                 s|!D!D 5C/B'  C/'B+ +C/.B+ /4C/# D/C3 3D6C3 7D: DD D D DD"%D"N)__name__ __module__ __qualname__rpropertyrrr2rrr r #sh???66X6  X 2rr )__doc__r.loggingr, contextlibr defence360agent.contracts.configrrimav.malwarelib.scan.mdsr!imav.malwarelib.scan.mds.detachedr imav.malwarelib.scan.mds.restorer getLoggerr3r)r r7rrr@s* GGGGGGGG------CCCCCC999999  8 $ $9999999999r