MOON
Server: Apache
System: Linux server.cny.com.sg 4.18.0-477.21.1.el8_8.x86_64 #1 SMP Thu Aug 10 13:51:50 EDT 2023 x86_64
User: tissuegurucom (1020)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3.6/site-packages/cloudinit/__pycache__/temp_utils.cpython-36.pyc
3

��b��@sjddlZddlZddlZddlZddlZdadZdZddd�Zdd�Z	ej
dd	d
��Zdd�Zd
d�Z
dS)�Nz/run/cloud-init/tmpz/var/tmp/cloud-initFcCs�|dk	r|S|r:t}tjj|�s6tj|�tj|d�|StrBtStj�dkrTt}ntj	j
dd�}tjj|�s�tj|�tj|d�|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.
    Ni�rZTMPDIRz/tmp)�_EXE_ROOT_TMPDIR�os�path�isdir�makedirs�chmod�_TMPDIR�getuid�_ROOT_TMPDIR�environ�get)Zodir�	needs_exe�tdir�r� /usr/lib/python3.6/temp_utils.py�_tempfile_dir_args$

rcsTt|jdd�|jdd��|d<tjf|��dd�}|�_�fdd�}t�d|��S)	N�dirr
FcSsFytj|�Wn2tk
r@}z|jtjkr0|�WYdd}~XnXdS)N)r�unlink�OSError�errno�ENOENT)r�errr�_unlink_if_exists?s
z0ExtendedTemporaryFile.<locals>._unlink_if_existscs�j�j�dS)N)r�namer)�fhrr�
unlink_nowMsz)ExtendedTemporaryFile.<locals>.unlink_nowr)r�pop�tempfileZNamedTemporaryFiler�setattr)�kwargsrrr)rr�ExtendedTemporaryFile6sr c
ks*tf|�}z
|VWdtj||d�XdS)N)�
ignore_errors)�mkdtemp�shutilZrmtree)Zrmtree_ignore_errorsrrrrr�tempdirTs

r$cKs*t|jdd�|jdd��|d<tjf|�S)Nrr
F)rrrr")rrrrr"`sr"cKs*t|jdd�|jdd��|d<tjf|�S)Nrr
F)rrr�mkstemp)rrrrr%gsr%)NF)F)�
contextlibrrr#rrr
rrr �contextmanagerr$r"r%rrrr�<module>s
(