404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.216.89.144: ~ $
3

\�me�9�@sddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZmZeje�ZejZejZejZdZd	d
gZddgZd
gZd	ZdZdZddddddddgZdZdgZ dd�Z!dd�Z"d%dd�Z#Gdd �d �Z$d!d"�Z%efd#d$�Z&dS)&�N)�MIMEBase)�
MIMEMultipart)�MIMENonMultipart)�MIMEText)�features�handlers�util)�UrlError�read_file_or_urlzContent-Typez
text/plainztext/x-not-multipartztext/x-include-urlztext/x-include-once-urlztext/cloud-config-archiveztext/cloud-configzapplication/octet-streamzapplication/gzipzapplication/gzip-compressedzapplication/gzippedzapplication/x-compresszapplication/x-compressedzapplication/x-gunzipzapplication/x-gzipzapplication/x-gzip-compressedzNumber-AttachmentscCs||=|||<dS)N�)�msg�key�valuerr�/usr/lib/python3.6/user_data.py�_replace_header;srcCs|d=|jddt|�d�dS)NzContent-DispositionZ
attachment)�filename)�
add_header�str)rrrrr�
_set_filename@srcCs tjrt|�|�n
tj|�dS)N)rZERROR_ON_USER_DATA_FAILURE�RuntimeError�LOGZwarning)�
error_messageZsource_exceptionrrr�
_handle_errorEsrc@s^eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zdd�ZdS)�UserDataProcessorcCs||_tj|�|_dS)N)�pathsrZfetch_ssl_details�ssl_details)�selfrrrr�__init__MszUserDataProcessor.__init__cCsDt�}t|t�r0x.|D]}|jt|�|�qWn|jt|�|�|S)N)r�
isinstance�list�_process_msg�convert_string)rZblobZaccumulating_msg�brrr�processQs

zUserDataProcessor.processcCs�dd�}�x�|j�D�]�}t|�r$qd}|j�}tj|�}d}|tkr�ytj|dd�}d}d}WnBtjk
r�}	z$dj|t	|�|	�}
t
|
|	�wWYdd}	~	XnX|s�t}|tdgkr�||�}|dkr�|}|�rB|j
dd	�\}}t||�}
|
j|�|j��rt|
|j��x,dD]$}||k�rt|
|t||���qW|
}||k�rXt|t|�|tk�rp|j||�q|tk�r�|j||�qt|t|�|j||�qWdS)NcSs
tj|�S)N)r�type_from_starts_with)�payloadrrr�
find_ctype[sz2UserDataProcessor._process_msg.<locals>.find_ctypeF)�quietTz<Failed decompressing payload from {} of length {} due to: {}ztext/x-shellscript�/��Launch-Index)r*)�walk�is_skippable�get_content_typerZfully_decoded_payload�DECOMP_TYPES�decomp_gzipZDecompressionError�format�lenr�
UNDEF_TYPE�TYPE_NEEDED�splitr�set_payload�get_filenamerrr�CONTENT_TYPE�
INCLUDE_TYPES�_do_include�
ARCHIVE_TYPES�_explode_archive�_attach_part)rZbase_msg�
append_msgr&�partZctypeZ
ctype_origr%Zwas_compressed�er�maintype�subtypeZn_part�hrrrr ZsX









zUserDataProcessor._process_msgcCs�|jdd�}d}|j�tkrVy$tj|jdd��}|r>|jd�}Wntk
rTYnX|dk	rb|}|dkrn|}|dk	r�y|jdtt	|���Wnt
tfk
r�YnXdS)NzLaunch-IndexT)�decodezlaunch-index)�getr-�EXAMINE_FOR_LAUNCH_INDEXr�	load_yamlZget_payload�	Exceptionrr�int�
ValueError�	TypeError)rrZ
header_idxZpayload_idxr%rrr�_attach_launch_index�s$z&UserDataProcessor._attach_launch_indexcCs&tj|dd�}tjj|jjd�d|�S)NZmd5�@�dataZurlcache)rZ	hash_blob�os�path�joinrZ
get_ipath_cur)r�entryZentry_fnrrr�_get_include_once_filename�sz,UserDataProcessor._get_include_once_filenamecCs$|j�st|t|�|j|�dS)N)r6r�PART_FN_TPLrK)rrZattached_idrrr�_process_before_attach�sz(UserDataProcessor._process_before_attachcCs�d}�x�|j�D�]�}|j�}|jd�rB|td�d�j�}d}n"|jd�rd|td�d�j�}d}|jd�rpq|j�}|s~qd}d}|r�|j|�}|r�tjj	|�r�t
j|�}n�yZt|dd|j
d�}|r�|j�r�t
j||jd	d
�|j�r�|j}ndj||j�}	t|	�Wn�tk
�rX}
z0t|
�}||k�r>|dj|�7}t||
�WYdd}
~
Xn:tk
�r�}zd
j||�}	t|	|�WYdd}~XnX|dk	rt|�}
|j|
|�qWdS)NFz
#include-onceTz#include�#��
)ZtimeoutZretriesri�)�modez6Fetching from {} resulted in a invalid http code of {}z
 for url: {0}zFetching from {} resulted in {})�
splitlines�lower�
startswithr1�lstrip�striprRrNrO�isfilerZ	load_filer
r�okZ
write_file�contentsr0�coderr	r�IOErrorr!r )r�contentr=Zinclude_once_on�lineZlc_lineZinclude_urlZinclude_once_fnZresprZurle�messageZioeZnew_msgrrrr9�s\






zUserDataProcessor._do_includec
CsZtj|gttfd�}�x>|D�]4}t|t�r4d|i}t|t�s@q|jdd�}|jd�}|sxt}t|t	�rlt
}tj||�}|j
dd�\}}	|dkr�t|t	�r�|j�}t||	d�}
nt||	�}
|
j|�d	|kr�t|
|d	�d
|kr�|
jdt|d
��xNt|j��D]>}|j�dd	dd
dtj�tj�fk�r0�q|
j|||��qW|j||
�qWdS)
N)�defaultZallowedrc��typer(r)�text)Z_subtyperzlaunch-indexzLaunch-Indexzcontent-disposition)rrFr�setrr�dictrD�ARCHIVE_UNDEF_TYPE�bytes�ARCHIVE_UNDEF_BINARY_TYPErr$r4rCrrr5rr�keysrZ�ATTACHMENT_FIELDr7r<)r�archiver=ZentriesZentrcZmtyperfr@rAr�headerrrrr;sH






z"UserDataProcessor._explode_archiveNcCslt|krd|t<|dk	r(t|tt|��d}yt|jt��}Wn(ttfk
rft|tt|��YnX|S)z
        Return the number of attachments to this MIMEMultipart by looking
        at its 'Number-Attachments' header.
        �0Nr)rprrrHrDrIrJ)r�	outer_msgZ	new_countZ
fetched_countrrr�_multi_part_countFsz#UserDataProcessor._multi_part_countcCs8|j|�}|j||d�|j|�|j||d�dS)z�
        Attach a message to an outer message. outermsg must be a MIMEMultipart.
        Modifies a header in the outer message to keep track of number of
        attachments.
        r)N)rurTZattach)rrtr>Z
part_countrrrr<Xs

zUserDataProcessor._attach_part)N)
�__name__�
__module__�__qualname__rr#r rKrRrTr9r;rur<rrrrrLs	PE4
rcCs |j�p
d}|j�dkrdSdS)NrgZ	multipartTF)Zget_content_maintyperZ)r>Z
part_maintyperrrr,dsr,cCsl|sd}dd�}t|t�r&|jd�}n|}tj|dd�}d|dd	�j�kr^tj|jd��}n
|||�}|S)
zJconvert a string (more likely bytes) or a message into
    a mime message.�cSs(|jdd�\}}t||�}|j|�|S)Nr(r))r4rr5)rM�content_typer@rArrrr�
create_binmsgss

z%convert_string.<locals>.create_binmsgzutf-8F)rCs
mime-version:ri)rr�encoderr/rZZmessage_from_stringrC)Zraw_datarzr{Zbdatarrrrr!ms

r!)N)'ZloggingrNZemail.mime.baserZemail.mime.multipartrZemail.mime.nonmultipartrZemail.mime.textrZ	cloudinitrrrZcloudinit.url_helperr	r
Z	getLoggerrvrZNOT_MULTIPART_TYPErSZ
OCTET_TYPEr7r3r8r:r2rlrnr.rprErrrrr,r!rrrr�<module>sH

	

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 113 B 0644
__init__.cpython-36.pyc File 113 B 0644
apport.cpython-36.opt-1.pyc File 5.92 KB 0644
apport.cpython-36.pyc File 5.96 KB 0644
atomic_helper.cpython-36.opt-1.pyc File 2.05 KB 0644
atomic_helper.cpython-36.pyc File 2.05 KB 0644
cloud.cpython-36.opt-1.pyc File 3.08 KB 0644
cloud.cpython-36.pyc File 3.08 KB 0644
dmi.cpython-36.opt-1.pyc File 5.32 KB 0644
dmi.cpython-36.pyc File 5.32 KB 0644
event.cpython-36.opt-1.pyc File 1.97 KB 0644
event.cpython-36.pyc File 1.97 KB 0644
features.cpython-36.opt-1.pyc File 1.47 KB 0644
features.cpython-36.pyc File 1.47 KB 0644
gpg.cpython-36.opt-1.pyc File 3.76 KB 0644
gpg.cpython-36.pyc File 3.76 KB 0644
helpers.cpython-36.opt-1.pyc File 13.31 KB 0644
helpers.cpython-36.pyc File 13.31 KB 0644
importer.cpython-36.opt-1.pyc File 1.68 KB 0644
importer.cpython-36.pyc File 1.68 KB 0644
log.cpython-36.opt-1.pyc File 4.61 KB 0644
log.cpython-36.pyc File 4.61 KB 0644
netinfo.cpython-36.opt-1.pyc File 12.67 KB 0644
netinfo.cpython-36.pyc File 12.67 KB 0644
persistence.cpython-36.opt-1.pyc File 2.82 KB 0644
persistence.cpython-36.pyc File 2.82 KB 0644
registry.cpython-36.opt-1.pyc File 1.38 KB 0644
registry.cpython-36.pyc File 1.38 KB 0644
safeyaml.cpython-36.opt-1.pyc File 8 KB 0644
safeyaml.cpython-36.pyc File 8 KB 0644
settings.cpython-36.opt-1.pyc File 1.14 KB 0644
settings.cpython-36.pyc File 1.14 KB 0644
signal_handler.cpython-36.opt-1.pyc File 1.58 KB 0644
signal_handler.cpython-36.pyc File 1.58 KB 0644
simpletable.cpython-36.opt-1.pyc File 2.53 KB 0644
simpletable.cpython-36.pyc File 2.53 KB 0644
ssh_util.cpython-36.opt-1.pyc File 15.36 KB 0644
ssh_util.cpython-36.pyc File 15.36 KB 0644
stages.cpython-36.opt-1.pyc File 25.15 KB 0644
stages.cpython-36.pyc File 25.15 KB 0644
subp.cpython-36.opt-1.pyc File 9.97 KB 0644
subp.cpython-36.pyc File 9.97 KB 0644
temp_utils.cpython-36.opt-1.pyc File 2.81 KB 0644
temp_utils.cpython-36.pyc File 2.81 KB 0644
templater.cpython-36.opt-1.pyc File 4.55 KB 0644
templater.cpython-36.pyc File 4.55 KB 0644
type_utils.cpython-36.opt-1.pyc File 437 B 0644
type_utils.cpython-36.pyc File 437 B 0644
url_helper.cpython-36.opt-1.pyc File 21.03 KB 0644
url_helper.cpython-36.pyc File 21.03 KB 0644
user_data.cpython-36.opt-1.pyc File 8.25 KB 0644
user_data.cpython-36.pyc File 8.25 KB 0644
util.cpython-36.opt-1.pyc File 73.64 KB 0644
util.cpython-36.pyc File 73.64 KB 0644
version.cpython-36.opt-1.pyc File 429 B 0644
version.cpython-36.pyc File 429 B 0644
warnings.cpython-36.opt-1.pyc File 3.25 KB 0644
warnings.cpython-36.pyc File 3.25 KB 0644