HEX
Server: nginx/1.30.4
System: Linux d-twindigital-web-1.host-ed.eu 4.18.0-553.141.2.el8_10.x86_64 #1 SMP Wed Jul 8 10:28:18 EDT 2026 x86_64
User: u_twindigital_html (1009)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/certbot/plugins/__pycache__/util.cpython-36.pyc
3

ߦ)_��@sNdZddlZddlmZddlmZddlmZeje	�Z
dd�Zdd	�ZdS)
zPlugin utilities.�N)�util)�os)�STANDARD_BINARY_DIRScCsFtjj|�}g}x0|r@|j|�tjj|�\}}||dkrPqW|S)a�Retrieves all possible path prefixes of a path, in descending order
    of length. For instance,
        (linux) /a/b/c returns ['/a/b/c', '/a/b', '/a', '/']
        (windows) C:\a\b\c returns ['C:\a\b\c', 'C:\a\b', 'C:\a', 'C:']
    :param str path: the path to break into prefixes

    :returns: all possible path prefixes of given path in descending order
    :rtype: `list` of `str`
    ����)r�path�normpath�append�split)r�prefix�prefixes�_�r�/usr/lib/python3.6/util.py�get_prefixess

rcCs�tjd}g}x,tD]$}||kr|tj|7}|j|�qWt|�rdtjd|tjj|��|tjd<t	j
|�rrdSt|�r~dnd}tjd|||�dS)z�Attempt to perform PATH surgery to find cmd

    Mitigates https://github.com/certbot/certbot/issues/1833

    :param str cmd: the command that is being searched for in the PATH

    :returns: True if the operation succeeded, False otherwise
    �PATHz6Can't find %s, attempting PATH mitigation by adding %sTz	 expanded�z*Failed to find executable %s in%s PATH: %sF)r�environr�pathsepr	�any�logger�debug�joinrZ
exe_exists)�cmdrZadded�dZexpandedrrr�path_surgery s 	



r)
�__doc__ZloggingZcertbotrZcertbot.compatrZcertbot.compat.miscrZ	getLogger�__name__rrrrrrr�<module>s