403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib/python3.11/site-packages/ansible/utils/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.11/site-packages/ansible/utils/__pycache__/path.cpython-311.pyc
�

���c����ddlmZmZmZeZddlZddlZddlm	Z	ddl
mZddlm
Z
mZmZddgZdd	�Zdd
�Zd�Zdd
�Zdd�ZdS)�)�absolute_import�division�print_functionN)�EEXIST)�AnsibleError)�to_bytes�	to_native�to_text�unfrackpath�
makedirs_safeTc��t|dd���}|�#ttj��d���}n>tj�|��rtj�|��}tj�tj�t|d�������}tj�|��s tj�	||��}|rtj�
|��}ttj�|��d���S)a�
    Returns a path that is free of symlinks (if follow=True), environment variables, relative path traversals and symbols (~)

    :arg path: A byte or text string representing a path to be canonicalized
    :arg follow: A boolean to indicate of symlinks should be resolved or not
    :raises UnicodeDecodeError: If the canonicalized version of the path
        contains non-utf8 byte sequences.
    :rtype: A text string (unicode on pyyhon2, str on python3).
    :returns: An absolute path with symlinks, environment variables, and tilde
        expanded.  Note that this does not check whether a path exists.

    example::
        '$HOME/../../var/mail' becomes '/var/spool/mail'
    �surrogate_or_strict�passthru)�errors�	nonstringN�r)
r�os�getcwd�path�isfile�dirname�
expanduser�
expandvars�isabs�join�realpathr
�normpath)r�follow�basedir�	b_basedir�b_final_paths     �7/usr/lib/python3.11/site-packages/ansible/utils/path.pyrrs�� ��)>�*�U�U�U�I����R�Y�[�[�1F�G�G�G�	�	�	����	�	"�	"�/��G�O�O�I�.�.�	��7�%�%�b�g�&8�&8��$�Od�9e�9e�9e�&f�&f�g�g�L�
�7�=�=��&�&�=��w�|�|�I�|�<�<��
�6��w�'�'��5�5���2�7�#�#�L�1�1�:O�P�P�P�P�c	��t|��}t|��}tj�|��s�	|rtj||��dStj|��dS#t$rJ}|jtkr/tdt|���dt|�������Yd}~dSd}~wwxYwdS)a�
    A *potentially insecure* way to ensure the existence of a directory chain. The "safe" in this function's name
    refers only to its ability to ignore `EEXIST` in the case of multiple callers operating on the same part of
    the directory chain. This function is not safe to use under world-writable locations when the first level of the
    path to be created contains a predictable component. Always create a randomly-named element first if there is any
    chance the parent directory might be world-writable (eg, /tmp) to prevent symlink hijacking and potential
    disclosure or modification of sensitive file contents.

    :arg path: A byte or text string representing a directory chain to be created
    :kwarg mode: If given, the mode to set the directory to
    :raises AnsibleError: If the directory cannot be created and does not already exist.
    :raises UnicodeDecodeError: if the path is not decodable in the utf-8 encoding.
    z#Unable to create local directories(z): N)rrrr�exists�makedirs�OSError�errnorrr	)r�mode�rpath�b_rpath�es     r"rrAs���
����E��u�o�o�G�
�7�>�>�'�"�"�t�	t��
%���G�T�*�*�*�*�*���G�$�$�$�$�$���	t�	t�	t��w�&� � �"�l�S\�]b�Sc�Sc�Sc�Sc�en�op�eq�eq�eq�#r�s�s�s�!� � � � � �����	t����
t�ts�A.�A.�.
C�8?B=�=Cc�|�t|d���}d}tj�|��r|}nV|dvrtj��}n>tj�|��rtj�|��}|rtj�|��}t|d���S)z- returns directory for inventory or playbook rrN)N��.)	rrr�isdirrrr�abspathr
)�source�dnames  r"rr]s���
�f�%:�
;�
;�
;�F��E�	�w�}�}�V���(����	�?�	"�	"��	�����	�����	�	�(������'�'���'������&�&���5�!6�7�7�7�7r#Fc��	tj�|��r�	tj�|��rt	j|��n7tj�|��rtj|��dSdSdS#t$rX}|rKddl	m
}|��}|�d�t|������Yd}~dSYd}~dSd}~wwxYwdS#t$rYdSwxYw)a
    Removes temporary file or directory. Optionally display a warning if unable
    to remove the file or directory.

    :arg path: Path to file or directory to be removed
    :kwarg warn: Whether or not to display a warning when the file or directory
        cannot be removed
    r)�Displayz#Unable to remove temporary file {0}N)rrr%r0�shutil�rmtreer�unlink�	Exception�ansible.utils.displayr5�display�formatr
)r�warnr,r5r;s     r"�cleanup_tmp_filer>osb��
�
�7�>�>�$���	_�

_��7�=�=��&�&�$��M�$�'�'�'�'��W�^�^�D�)�)�$��I�d�O�O�O�O�O�$�$�(�'���
_�
_�
_��_�=�=�=�=�=�=�%�g�i�i�G��O�O�$J�$Q�$Q�RY�Z[�R\�R\�$]�$]�^�^�^�^�^�^�^�^�^�	_�_�_�_�_�_�����
_����
	_�	_���
�
�
����
���s<�C6�A'B�
C1�AC,� C6�&C6�,C1�1C6�6
D�Dc��d}t|d���}t|d���}|r>tj�|��}tj�|��}|�tjj��}|�tjj��}	|dt
|���|k}n#t$rYnwxYw|S)z�
    Compares paths to check if one is contained in the other
    :arg: child: Path to test
    :arg parent; Path to test against
     F)rN)rrrr�split�sep�len�
IndexError)�child�parent�real�test�	abs_child�
abs_parent�c�ps        r"�
is_subpathrL�s����D��E�%�0�0�0�I��V�E�2�2�2�J��2��G�$�$�Y�/�/�	��W�%�%�j�1�1�
�������$�$�A�������%�%�A�
���#�a�&�&��z�Q������
�
�
���
�����Ks�.C
�

C�C)TN)N)F)�
__future__rrr�type�
__metaclass__rr6r(r�ansible.errorsr�ansible.module_utils._textrr	r
�__all__rrrr>rL�r#r"�<module>rTs���"C�B�B�B�B�B�B�B�B�B��
�	�	�	�	�
�
�
�
�������'�'�'�'�'�'�C�C�C�C�C�C�C�C�C�C��/�
*��Q�Q�Q�Q�Dt�t�t�t�88�8�8�$
�
�
�
�4�����r#

Youez - 2016 - github.com/yon3zu
LinuXploit