CasperSecurity

Current Path : /lib/python3/dist-packages/certbot/plugins/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/certbot/plugins/__pycache__/util.cpython-310.pyc

o

6��a��@sNdZddlZddlmZddlmZddlmZe�e	�Z
dd�Zdd	�ZdS)
zPlugin utilities.�N)�util)�os)�STANDARD_BINARY_DIRScCsHtj�|�}g}|r"|�|�tj�|�\}}||dkr 	|S|s
|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
�6/usr/lib/python3/dist-packages/certbot/plugins/util.py�get_prefixess
�rcCs�tjd}g}tD]}||vr|tj|7}|�|�q	t|�r0t�d|tj�|��|tjd<t	�
|�r7dSt|�r=dnd}t�d|||�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�joinr�
exe_exists)�cmdr�added�d�expandedr
r
r�path_surgery"s&
	
��

�r)
�__doc__�logging�certbotr�certbot.compatr�certbot.compat.miscr�	getLogger�__name__rrrr
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