Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /proc/17567/root/usr/src/cloud-init/cloudinit/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/17567/root/usr/src/cloud-init/cloudinit/__pycache__/temp_utils.cpython-36.pyc
3

$%we��@s�ddlZddlZddlZddlZddlZddlmZddlmZej	e
�ZdadZ
dZded�dd	�Zded�d
d�Zdd
�Zejddd��Zded�dd�Zded�dd�ZdS)�N)�log)�utilz/run/cloud-init/tmpz/var/tmp/cloud-initF)�	needs_execCs:|dk	r|S|rtStrtStj�dkr,tStjjdd�S)Nr�TMPDIRz/tmp)�_EXE_ROOT_TMPDIR�_TMPDIR�os�getuid�_ROOT_TMPDIR�environ�get)�odirr�r�+/usr/src/cloud-init/cloudinit/temp_utils.py�get_tmp_ancestorsrcCs^t||�}tjj|�s,tj|�tj|d�|rHtj|d�rHtj	d|�|dkrZ|rZ|a
|S)a%Return the proper 'dir' argument for tempfile functions.

    When root, cloud-init will use /run/cloud-init/tmp to avoid
    any cleaning that a distro boot might do on /tmp (such as
    systemd-tmpfiles-clean).

    If the caller of this function (mkdtemp or mkstemp) was provided
    with a 'dir' argument, then that is respected.

    @param odir: original 'dir' arg to 'mkdtemp' or other.
    @param needs_exe: Boolean specifying whether or not exe permissions are
        needed for tempdir. This is needed because /run is mounted noexec.
    i��noexeczDRequested temporal dir with exe permission `%s` is mounted as noexecN)rr�path�isdir�makedirs�chmodr�
has_mount_opt�LOG�warningr)r
r�tdirrrr�_tempfile_dir_args

rcsTt|jdd�|jdd��|d<tjf|��dd�}|�_�fdd�}t�d|��S)	N�dirrFcSsFytj|�Wn2tk
r@}z|jtjkr0|�WYdd}~XnXdS)N)r�unlink�OSError�errno�ENOENT)r�errr�_unlink_if_existsIs
z0ExtendedTemporaryFile.<locals>._unlink_if_existscs�j�j�dS)N)r�namer)�fhrr�
unlink_nowWsz)ExtendedTemporaryFile.<locals>.unlink_nowr$)r�pop�tempfile�NamedTemporaryFiler�setattr)�kwargsr!r$r)r#r�ExtendedTemporaryFile@sr*c
ks*tf|�}z
|VWdtj||d�XdS)N)�
ignore_errors)�mkdtemp�shutil�rmtree)Zrmtree_ignore_errorsr)rrrr�tempdir^s

r/cKst||�}tjfd|i|��S)Nr)rr&r,)rrr)rrrr,js
r,cKst||�}tjfd|i|��S)Nr)rr&�mkstemp)rrr)rrrr0os
r0)NF)NF)F)NF)NF)�
contextlibrrr-r&�	cloudinitr�loggingr�	getLogger�__name__rrr
r�boolrrr*�contextmanagerr/r,r0rrrr�<module>s"
"

haha - 2025