403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/cloudinit/handlers/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/cloudinit/handlers/__pycache__/__init__.cpython-36.pyc
3

��b�&�@s"ddlZddlZddlmZddlmZddlmZmZddlm	Z	m
Z
mZeje
�ZdZdZdZd	ZeegZd
gZdZdZd
ddddd
dddddddd�
Zeeej��dd�d�ZGdd�dejd�Zd d!�Zd"d#�Zd$d%�Z d&d'�Z!d(d)�Z"d*d+�Z#d,d-�Z$d.d/�Z%efd0d1�Z&d4d2d3�Z'dS)5�N)�importer)�log)�
type_utils�util)�FREQUENCIES�
PER_ALWAYS�PER_INSTANCEztext/x-not-multipartzapplication/octet-streamZ__end__Z	__begin__ztext/part-handlerzpart-handler-%03dz	part-%03dztext/x-include-urlztext/x-include-once-urlztext/x-shellscriptztext/cloud-configztext/upstart-jobztext/cloud-boothookztext/cloud-config-archiveztext/cloud-config-jsonpztext/jinja2ztext/x-shellscript-per-bootztext/x-shellscript-per-instanceztext/x-shellscript-per-once)
z#includez
#include-oncez#!z
#cloud-configz#upstart-jobz
#part-handlerz#cloud-boothookz#cloud-config-archivez#cloud-config-jsonpz## template: jinjaztext/x-shellscript-per-bootztext/x-shellscript-per-instanceztext/x-shellscript-per-oncecCsdt|�S)Nr)�len)�e�r�/usr/lib/python3.6/__init__.py�<lambda>@sr
)�keyc@s4eZdZddd�Zdd�Zdd�Zejdd	��Zd
S)�Handler�cCs||_||_dS)N)�handler_version�	frequency)�selfr�versionrrr�__init__EszHandler.__init__cCsdtj|�|j�fS)Nz%s: [%s])rZobj_name�
list_types)rrrr�__repr__IszHandler.__repr__cCs,t|d�std��ndd�t|d�D�SdS)N�prefixesz#Missing prefixes subclass attributecSsg|]}t|�qSr)�INCLUSION_TYPES_MAP)�.0�prefixrrr�
<listcomp>Rsz&Handler.list_types.<locals>.<listcomp>)�hasattr�NotImplementedError�getattr)rrrrrLs

zHandler.list_typescOs
t��dS)N)r)r�args�kwargsrrr�handle_partVszHandler.handle_partN)r)	�__name__�
__module__�__qualname__rrr�abc�abstractmethodr"rrrrrDs

r)�	metaclassc	Cs|j}|tkp|tko|tks"dSy|j}t|�}Wntttfk
rRd}YnX|d}yxtj	d|||||�|dkr�|j
||||||�nB|dkr�|j
|||||�n&|dkr�|j
||||�ntd|��Wn,tk
�rtj
td|||||�YnXdS)N�zContent-Typez1Calling handler %s (%s, %s, %s) with frequency %s�rzUnknown module version %sz8Failed calling handler %s (%s, %s, %s) with frequency %s)rrrr�int�	TypeError�
ValueError�AttributeError�LOG�debugr"�	Exceptionr�logexc)	�mod�data�filename�payloadr�headersZmod_freqZmod_ver�content_typerrr�run_part[sF
r9cCsdti}t||dd||�dS)NzContent-Type)�
CONTENT_STARTr9)r3r4rr7rrr�
call_begin�sr;cCsdti}t||dd||�dS)NzContent-Type)�CONTENT_ENDr9)r3r4rr7rrr�call_end�sr=c
Cs�|d}t|}|d}tjj|dd|�}|jd�s@d|}tj||d�|d}y<ttj	|��}	t
|	|d	|�|j|	d
d�|d|d<Wn$tk
r�tj
td
||�YnXdS)NZhandlercountrZ
handlerdirz%sz.pyz%s.pyi��handlersr4T)Zinitializedr)z7Failed at registering python file: %s (part handler %s))�PART_HANDLER_FN_TMPL�os�path�join�endswithrZ
write_file�
fixup_handlerr�
import_moduler;�registerr1r2r/)
ZpdataZ_ctypeZ	_filenamer6Zcurcount�modnamerZmodfnamer>r3rrr�walker_handle_handler�s&
rHcCs�y\t|t�r|jdd�d}n$|dd|�jdd�jdd�d}t|�|krZ|d|�}Wn tk
r||d|�}YnX|S)N�
r)r��ignore)�errors)�
isinstance�str�split�decoder	�UnicodeDecodeError)Zblob�size�startrrr�_extract_first_or_bytes�s
$rTcCsZy
|jd�Sttfk
rBy
|jd�Stk
r<YnXYntk
rTYnX|S)NZ
string_escapeZunicode_escape)�encode�LookupErrorr,r.)�textrrr�_escape_string�s


rXcCs�|d}||jd�kr&tjd|�dS|tkr@t||||�dS|d}||krpt|||d|||d|�nN|r�t|d�}dt|�}|tkr�tj	d	||�q�tj	d
||�ntjd|�dS)NzContent-TypeZexcludedzcontent_type "%s" is excludedr>r4r�z'%s...'z)Unhandled non-multipart (%s) userdata: %sz0Unhandled unknown content-type (%s) userdata: %szEmpty payload of type %s)
�getr/r0�PART_CONTENT_TYPESrHr9rTrX�NOT_MULTIPART_TYPE�warning)r4r5r6r7r8r>rSZdetailsrrr�walker_callback�s:
r^c	Cs�d}x�|j�D]t}|j�dkr q|j�}|dkr4t}|j�}|sHt|}t|�}tj|�||d<t	j
|�}|||||�|d}qWdS)NrZ	multipartzContent-Typer))�walkZget_content_maintypeZget_content_type�
OCTET_TYPE�get_filename�PART_FN_TPL�dictr/r0rZfully_decoded_payload)	�msg�callbackr4Zpartnum�partZctyper5r7r6rrrr_s 

r_cCsRt|d�st|dd�t|d�s.t|d|�n |j}|rN|tkrNtjd||�|S)Nrr)rz&Handler %s has an unknown frequency %s)r�setattrrrr/r])r3Zdef_freqZfreqrrrrDs

rDcCsTytj|�j�}Wntk
r&|SX|j�}xtD]}|j|�r6t|Sq6W|S)N)rZ
decode_binary�lowerrQ�lstrip�INCLUSION_SRCH�
startswithr)r6�defaultZ
payload_lcrWrrr�type_from_starts_with%s

rm)N)(r&r@Z	cloudinitrrZloggingrrZcloudinit.settingsrrrZ	getLoggerr#r/r\r`r<r:ZCONTENT_SIGNALSr[r?rbr�sorted�list�keysrj�ABCMetarr9r;r=rHrTrXr^r_rDrmrrrr�<module>sP
0)

Youez - 2016 - github.com/yon3zu
LinuXploit