CasperSecurity

Current Path : /lib/python3/dist-packages/cloudinit/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/cloudinit/__pycache__/temp_utils.cpython-310.pyc

o

쑛h��@s�ddlZddlZddlZddlZddlZddlZddlmZe�e	�Z
dZdZdde
fdd�Zdde
fd	d
�Zdd�Zejdd
d��Zdde
fdd�Zdde
fdd�ZdS)�N)�utilz/run/cloud-init/tmpz/var/tmp/cloud-initF�	needs_execCs2|dur|S|r
tSt��dkrtStj�dd�S)Nr�TMPDIRz/tmp)�_EXE_ROOT_TMPDIR�os�getuid�_ROOT_TMPDIR�environ�get)�odirr�r�6/usr/lib/python3/dist-packages/cloudinit/temp_utils.py�get_tmp_ancestorsrcCsLt||�}tj�|�st�|�t�|d�|r$t�|d�r$t�	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��noexeczDRequested temporal dir with exe permission `%s` is mounted as noexec)
rr�path�isdir�makedirs�chmodr�
has_mount_opt�LOG�warning)rr�tdirrrr
�_tempfile_dir_args

�rcsDt�|d<tjdi|���dd�}|�_�fdd�}t�d|��S)N�dirc
SsHzt�|�WdSty#}z|jtjkr|�WYd}~dSd}~ww�N)r�unlink�OSError�errno�ENOENT)r�errr
�_unlink_if_exists?s���z0ExtendedTemporaryFile.<locals>._unlink_if_existscs���j�dSr)r�namer��fhrr
�
unlink_nowMsz)ExtendedTemporaryFile.<locals>.unlink_nowr$r)r�tempfile�NamedTemporaryFiler�setattr)�kwargsr r$rr"r
�ExtendedTemporaryFile8s
r)c
ks<�tdi|��}z
|VWtj||d�dStj||d�w)N)�
ignore_errorsr)�mkdtemp�shutil�rmtree)�rmtree_ignore_errorsr(rrrr
�tempdirTs
�"r/cK�t||�}tjdd|i|��S�Nrr)rr%r+�rrr(rrr
r+`�
r+cKr0r1)rr%�mkstempr2rrr
r4er3r4)NF)F)�
contextlibr�loggingrr,r%�	cloudinitr�	getLogger�__name__rrr�boolrrr)�contextmanagerr/r+r4rrrr
�<module>s"


Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY