%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/paramiko/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/paramiko/__pycache__/proxy.cpython-312.pyc

�

�ec(���ddlZddlZddlZddlmZddlZddlZd\ZZ	ddlZddl
mZddlm
Z
Gd�de
�Zy#e$rZ	e	ZYdZ	[	�$dZ	[	wwxYw)�N)�select)NN)�ProxyCommandFailure)�ClosingContextManagerc�N�eZdZdZd�Zd�Zd�Zd�Zed��Z	ed��Z
d�Zy	)
�ProxyCommanda�
    Wraps a subprocess running ProxyCommand-driven programs.

    This class implements a the socket-like interface needed by the
    `.Transport` and `.Packetizer` classes. Using this class instead of a
    regular socket makes it possible to talk with a Popen'd command that will
    proxy traffic between the client and a server hosted in another machine.

    Instances of this class may be used as context managers.
    c��t�t�tj|�|_tj
|jtjtjtjd��|_d|_y)a
        Create a new CommandProxy instance. The instance created by this
        class can be passed as an argument to the `.Transport` class.

        :param str command_line:
            the command that should be executed and used as the proxy.
        Nr)�stdin�stdout�stderr�bufsize)	�
subprocess�subprocess_import_error�shlex�split�cmd�Popen�PIPE�process�timeout)�self�command_lines  �0/usr/lib/python3/dist-packages/paramiko/proxy.py�__init__zProxyCommand.__init__3sZ����)�)��;�;�|�,���!�'�'��H�H��/�/��?�?��?�?��
������c���	|jjj|�t|�S#t$r4}t	dj|j�|j��d}~wwxYw)z�
        Write the content received from the SSH client to the standard
        input of the forked command.

        :param str content: string to be sent to the forked command
        � N)	rr	�write�IOErrorr�joinr�strerror�len)r�content�es   r�sendzProxyCommand.sendGs`��	F��L�L���$�$�W�-��7�|���
�	F�
&�c�h�h�t�x�x�&8�!�*�*�E�E��	F�s�%2�	A/�/A*�*A/c���	d}tj�}t|�|kr�d}|j�Itj�|z
}||jk\rtj��|j|z
}t	|j
jggg|�\}}}|rc|d|j
jk(rG|tj|j
jj�|t|�z
�z
}t|�|kr��|S#tj$rr|cYS�t$r4}	tdj|j�|	j��d}	~	wwxYw)z�
        Read from the standard output of the forked program.

        :param int size: how many chars should be read

        :return: the string of bytes read, which may be shorter than requested
        rNrr)�timer!r�socketrrr
�os�read�filenorrrrr )
r�size�buffer�start�select_timeout�elapsed�r�w�xr#s
          r�recvzProxyCommand.recvXs7��	F��F��I�I�K�E��f�+��$�!%���<�<�+�"�i�i�k�E�1�G��$�,�,�.�$�n�n�.�.�%)�\�\�G�%;�N� �$�,�,�"5�"5�!6��B��O���1�a���1�����!4�!4�4��b�g�g����+�+�2�2�4�d�S��[�6H���F��f�+��$��M���~�~�	���
���	F�%�c�h�h�t�x�x�&8�!�*�*�E�E��	F�s$�DD�D�E0�3	E0�</E+�+E0c�t�tj|jjtj
�y�N)r(�killr�pid�signal�SIGTERM�rs r�closezProxyCommand.closeys��
������ � �&�.�.�1rc�2�|jjduSr5)r�
returncoder:s r�closedzProxyCommand.closed|s���|�|�&�&�d�2�2rc��|jSr5)r>r:s r�_closedzProxyCommand._closed�s���{�{�rc��||_yr5)r)rrs  r�
settimeoutzProxyCommand.settimeout�s	����rN)�__name__�
__module__�__qualname__�__doc__rr$r3r;�propertyr>r@rB�rrrr'sJ��	��(�"F�B2��3��3�����rr)r(rr8rr'r&r
r�ImportErrorr#�paramiko.ssh_exceptionr�
paramiko.utilrrrHrr�<module>rLs]��(
��
��
��'1�#�
�#� ��7�/�_�(�_��� ���� �s�=�A�A	�	A

Zerion Mini Shell 1.0