hr dZddlZddlZddlmZddlmZddlmZ ddl m Z ddl m Z ddlmZdd lmZdd lmZdd lmZdd lmZd ZGddeZdS)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)Path)CleanupRevertAPI)Core)%ms_imunify_patch_eligible_to_purchase) MessageSource) restore_hits)VulnerabilityHitStatus)VulnerabilityHit)recurring_checki0*c&eZdZdZdZdZdZdS)PatchRevertPlugincdttjdz |_d|_d|_dS)N patch_revertimunify)rrTMPDIR_patch_revert_flag initiator_taskselfs `/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/plugins/remote_patch_revert.py__init__zPatchRevertPlugin.__init__,s+"&t{"3"3n"D" cK||_|tt|j|_dSN)_sink create_taskr PERIODprocess_patch_revertr)rloopsinks r create_sourcezPatchRevertPlugin.create_source1sI %% > #OF # #D$= > > @ @   rcK|jrZ|jttj5|jd{VddddS#1swxYwYdSdSr)rcancelrasyncioCancelledErrorrs rshutdownzPatchRevertPlugin.shutdown7s : ! J     '011 ! !j        ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !sAAAcKtsdS|jr=|jjt zt jkrdStjd{Vx}rKttj |tj gx}rt||jd{V|jdddS)N)statusesiT)modeexist_ok)rrexistsstatst_mtimertimePatchRevertAPIpathslistr get_hitsr PATCHEDr rtouch)rfileshitss rr z&PatchRevertPlugin.process_patch_revert=s466  F  # * * , , (--//86Aikk F(.00000000 05 9 )%;%C$Dt 9 #4888888888 %%54%@@@@@rN)__name__ __module__ __qualname__rr#r(r rrrr+sU    !!! AAAAArr)__doc__r&r0 contextlibrpathlibr)defence360agent.api.server.cleanup_revertrr1 defence360agent.contracts.configr%defence360agent.contracts.permissionsr!defence360agent.contracts.pluginsr'imav.malwarelib.vulnerabilities.storager imav.malwarelib.configr imav.malwarelib.modelr defence360agent.utilsr rrr<rrrHs6* 211111<;;;;;@@@@@@999999222222111111 %A%A%A%A%A %A%A%A%A%Ar