관리-도구
편집 파일: app_version_detector.cpython-311.pyc
� ��gy � � � d Z ddlZddlmZ ddlmZ ddlmZ ddlm Z ddl mZ ddlm Z dd lmZ G d � de � � 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 <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)�CancelledError)�suppress)�Iterator)�FileBasedResourceLimits)�"APP_VERSION_DETECTOR_INTENSITY_KEY)�ScanFailedError)�resource_limitsc � � e Zd ZdS )�AVDExecutionErrorN)�__name__� __module__�__qualname__� � �^/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/scan/app_version_detector.pyr r ! s � � � � � ��Dr r c �8 � e Zd Zg d�Zd� Zdee ddfd�ZdS )�AppVersionDetector)z9/opt/app-version-detector/app-version-detector-wrapper.shzW--sqlite-db-report=/var/lib/cloudlinux-app-version-detector/components_versions.sqlite3z--stdin-dirsz--paths-in-base64z--scan-depth=3c � � d | _ d S )N)�_proc)�selfs r �__init__zAppVersionDetector.__init__2 s � ��� � � r �paths�returnNc � � K � d� |� � }t j | j t j t j t j t j t j t �� � � d {V ��| _ d x}} | j � |�� � � d {V ��\ }}nt# t $ rg t t � � 5 | j � � � | j � � � � d {V �� d d d � � n# 1 swxY w Y Y nw xY w| j j dk r%t% d| j | j j ||d d �� � �d S )N� )� intensity_cpu�intensity_io�stdout�stderr�stdin�key)�inputr z$AVD exited with non-zero return code)�message�command�return_code�out�err�path�scan_id)�joinr �create_subprocess�_cmdr �CPU�IO� subprocess�PIPEr r �communicater r �ProcessLookupError�kill�wait� returncoder )r r r r&