Server IP : 184.107.3.203 / Your IP : 216.73.216.51 Web Server : Apache System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64 User : adminteladeoro ( 1015) PHP Version : 8.2.28 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/lib/python3.6/site-packages/sos/cleaner/archives/__pycache__/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
3 ~ �gK? � @ sb d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm Z dd� Z G dd� d�ZdS )� N)�ProcessPoolExecutor)�file_is_binaryc C s� t j| ���}tjj|d�}tt ddd� �|_xp|j� D ]d}tjj||j�}tjj |�}tjj |�}tjj ||g�}||kr�td|� d|� ���|j||� q6W tjj||jj d�d j d �d �S Q R X d S )NZcleanerZfully_trusted_filterc S s | S )N� )�member�pathr r �/usr/lib/python3.6/__init__.py�<lambda>! s z!extract_archive.<locals>.<lambda>z"Attempted path traversal in tarflez != �/� z.tarr ���)�tarfile�open�osr �join�getattrZextraction_filterZ getmembers�name�abspath�commonprefix� Exception�extract�split) �archive_path�tmpdir�archiver r Zmember_pathZ abs_directoryZ abs_target�prefixr r r �extract_archive s r c @ s. e Zd ZdZg ZdZdZdZdZdZ i Z dd� Zedd� �Z ed d � �Zedd� �Zd d� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zedd� �Zdd � Zd!d"� Zd#d$� ZdBd%d&�Zd'd(� Zd)d*� Zd+d,� Z d-d.� Z!d/d0� Z"d1d2� Z#d3d4� Z$d5d6� Z%d7d8� Z&d9d:� Z'd;d<� Z(d=d>� Z)d?d@� Z*dAS )C�SoSObfuscationArchivea A representation of an extracted archive or an sos archive build directory which is used by SoSCleaner. Each archive that needs to be obfuscated is loaded into an instance of this class. All report-level operations should be contained within this class. r ZundeterminedFc C s� || _ | j | _|| _| j jd�d jd�d | _| j| _tjd�| _tjd�| _ | j � | _d| _| j � d| _| jd | j � d | j� �� d S )Nr r z.tarr �sosZsos_uiF� zLoaded z as type r )r �final_archive_pathr r �archive_name�ui_name�loggingZ getLogger�soslog�ui_log�_load_skip_list� skip_list�is_extracted� _load_self�archive_root�log_info�description)�selfr r r r r �__init__A s zSoSObfuscationArchive.__init__c C s t �dS )z=Check if the archive is a well-known type we directly supportN)�NotImplementedError)�clsZarc_pathr r r � check_is_typeQ s z#SoSObfuscationArchive.check_is_typec C s d| j jj� kS )Nr )� __class__�__name__�lower)r, r r r �is_sosV s zSoSObfuscationArchive.is_sosc C s d| j kS )NZinsights)� type_name)r, r r r �is_insightsZ s z!SoSObfuscationArchive.is_insightsc C s | j rtj| j�| _d S )N)� is_tarfiler r r �tarobj)r, r r r r( ^ s z SoSObfuscationArchive._load_selfc C s g S )a/ Return a list of ObfuscationArchives that represent additional archives found within the target archive. For example, an archive from `sos collect` will return a list of ``SoSReportArchive`` objects. This should be overridden by individual types of ObfuscationArchive's r )r, r r r �get_nested_archivesc s z)SoSObfuscationArchive.get_nested_archivesc C s>