shell bypass 403

Cubjrnet7 Shell


name : temp_utils.cpython-39.pyc
a

'�Dg��@s�ddlZddlZddlZddlZddlZddlZddlmZe�e	�Z
dZdZde
d�dd�Zde
d�d	d
�Zdd�Zejdd
d��Zde
d�dd�Zde
d�dd�ZdS)�N)�utilz/run/cloud-init/tmpz/var/tmp/cloud-initF)�	needs_execCs2|dur|S|rtSt��dkr$tStj�dd�S)NrZTMPDIRz/tmp)�_EXE_ROOT_TMPDIR�os�getuid�_ROOT_TMPDIR�environ�get)�odirr�r�8/usr/lib/python3.9/site-packages/cloudinit/temp_utils.py�get_tmp_ancestorsr
cCsLt||�}tj�|�s,t�|�t�|d�|rHt�|d�rHt�	d|�|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�ZnoexeczDRequested temporal dir with exe permission `%s` is mounted as noexec)
r
r�path�isdir�makedirs�chmodrZ
has_mount_opt�LOGZwarning)r
r�tdirrrr�_tempfile_dir_args

�rcsDt�|d<tjfi|���dd�}|�_�fdd�}t�d|��S)N�dirc
SsHzt�|�Wn4tyB}z|jtjkr.|�WYd}~n
d}~00dS�N)r�unlink�OSError�errno�ENOENT)r�errr�_unlink_if_exists?s
z0ExtendedTemporaryFile.<locals>._unlink_if_existscs���j�dSr)r�namer�Zfhrr�
unlink_nowMsz)ExtendedTemporaryFile.<locals>.unlink_nowr)r�tempfileZNamedTemporaryFiler�setattr)�kwargsrrrrr�ExtendedTemporaryFile8s
r#c
ks<tfi|��}z|VWtj||d�ntj||d�0dS)N)�
ignore_errors)�mkdtemp�shutil�rmtree)Zrmtree_ignore_errorsr"rrrr�tempdirTsr(cKst||�}tjfd|i|��S�Nr)rr r%�rrr"rrrr%`s
r%cKst||�}tjfd|i|��Sr))rr �mkstempr*rrrr+es
r+)NF)NF)F)NF)NF)�
contextlibrZloggingrr&r Z	cloudinitrZ	getLogger�__name__rrr�boolr
rr#�contextmanagerr(r%r+rrrr�<module>s 



© 2025 Cubjrnet7