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 : |
� ���c� � � � d dl mZmZmZ eZd dlZd dlZd dlm Z d dl mZ d dlm Z mZmZ ddgZdd �Zdd �Zd� Zdd �Zdd�ZdS )� )�absolute_import�division�print_functionN)�EEXIST)�AnsibleError)�to_bytes� to_native�to_text�unfrackpath� makedirs_safeTc � � t |dd�� � }|�#t t j � � d�� � }n>t j � |� � rt j � |� � }t j � t j � t | d�� � � � � � }t j � |� � s t j � ||� � }|rt j � |� � }t t j � |� � 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.pyr r s � � ��)>�*�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 |� � }t j � |� � s� |rt j ||� � dS t j |� � dS # t $ rJ}|j t k r/t dt |� � �dt |� � ��� � �Y d}~dS d}~ww xY wdS )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)r r r r �exists�makedirs�OSError�errnor r r )r �mode�rpath�b_rpath�es r"