shell bypass 403

Cubjrnet7 Shell


name : atomic_helper.cpython-39.pyc
a

'�Dg,�@s�ddlZddlZddlZddlZddlZddlmZmZddlm	Z	m
Z
dZe�e
�Ze	�d�dd��Ze	�d�d	d
��Zeddfd
d�Zeddfdd�Zdd�Ze	�d�dd��Zefdd�ZdS)�N)�	b64decode�	b64encode)�performance�utili�zBase64 decodingcCs0t|�}z|�d�WSty*|YS0dS)z�base64 decode data

    :param source: a bytes or str to decode
    :return: base64 as a decoded str if utf-8 encoded, otherwise bytes
    �utf-8N)r�decode�UnicodeDecodeError)�sourceZdecoded�r
�;/usr/lib/python3.9/site-packages/cloudinit/atomic_helper.py�b64ds
rzBase64 encodingcCs"t|t�s|�d�}t|��d�S)zdbase64 encode data

    :param source: a bytes or str to decode
    :return: base64 encoded str
    r)�
isinstance�bytes�encoderr)r	r
r
r�b64es

r�wbFcCsDt�d|���� t|||||�Wd�S1s60YdS)zCopen filename in mode omode, write content, set permissions to modezWriting N)rZTimed�_write_file)�filename�content�mode�omode�
preserve_moder
r
r�
write_file*src	
Cs�|r2zt�|�}t�|j�}Wnty0Yn0d}zrtj�|�}t�|�t	j
|d|d�}t�d||j
||t|��|�|�|��t�|j
|�t�|j
|�Wn<ty�}z$|dur�t�|j
�|�WYd}~n
d}~00dS)NF)�dir�deleterzOAtomically writing to file %s (via temporary file %s) - %s: [%o] %d bytes/chars)�os�stat�S_IMODE�st_mode�OSError�path�dirnamerZ
ensure_dir�tempfileZNamedTemporaryFile�LOG�debug�name�len�write�close�chmod�rename�	Exception�unlink)	rrrrrZ	file_statZtfr!�er
r
rr3s6

�	
rcCs6zd�t|��WSty0d�t|��YS0dS)z1Handler for types which aren't json serializable.z
ci-b64:{0}z)Warning: redacted unserializable type {0}N)�formatr�AttributeError�type)Z_objr
r
r�json_serialize_defaultUsr1zDumping jsoncCstj|dddtd�S)z%Return data in nicely formatted json.�T)�,z: )�indentZ	sort_keysZ
separators�default)�json�dumpsr1)�datar
r
r�
json_dumps]s�r9cCst|t|�dd|d�S)N�
�w)rr)rr9)rr8rr
r
r�
write_jsonis
�r<)r6Zloggingrrr"�base64rrZ	cloudinitrrZ
_DEF_PERMSZ	getLogger�__name__r#Ztimedrrrrr1r9r<r
r
r
r�<module>s(



�

�
"


© 2025 Cubjrnet7