|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /proc/self/root/lib/python2.7/site-packages/paramiko/ |
Upload File : |
�
x�\c @ s� d d l Z d d l m Z d d l Z d d l m Z d d l Z d d l Z d d l m Z d d l
m Z d e f d � � YZ d S( i����N( t split( t select( t ProxyCommandFailure( t ClosingContextManagert ProxyCommandc B sY e Z d Z d � Z d � Z d � Z d � Z e d � � Z e d � � Z d � Z
RS( s�
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
C s\ d d l m } m } t | � | _ | | j d | d | d | d d �| _ d | _ d S( s
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.
i����( t Popent PIPEt stdint stdoutt stderrt bufsizei N( t
subprocessR R t shlsplitt cmdt processt Nonet timeout( t selft command_lineR R ( ( s2 /tmp/pip-install-A1qMVe/paramiko/paramiko/proxy.pyt __init__+ s
'c C sU y | j j j | � Wn1 t k
rJ } t d j | j � | j � � n Xt | � S( s�
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
t ( R R t writet IOErrorR t joinR
t strerrort len( R t contentt e( ( s2 /tmp/pip-install-A1qMVe/paramiko/paramiko/proxy.pyt send= s
"c
C sP y� d } t j � } x� t | � | k r� d } | j d k r} t j � | } | | j k rm t j � � n | j | } n t | j j g g g | � \ } } } | r | d | j j k r | t j | j j j
� | t | � � 7} q q W| SWnQ t j k
r| r| S� n1 t k
rK} t d j
| j � | j � � n Xd S( s�
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
t i R N( t timeR R R t socketR R R t ost readt filenoR R R R
R (
R t sizet buffert startt select_timeoutt elapsedt rt wt xR ( ( s2 /tmp/pip-install-A1qMVe/paramiko/paramiko/proxy.pyt recvN s* ' *c C s t j | j j t j � d S( N( R t killR t pidt signalt SIGTERM( R ( ( s2 /tmp/pip-install-A1qMVe/paramiko/paramiko/proxy.pyt closeo s c C s | j j d k S( N( R t
returncodeR ( R ( ( s2 /tmp/pip-install-A1qMVe/paramiko/paramiko/proxy.pyt closedr s c C s | j S( N( R2 ( R ( ( s2 /tmp/pip-install-A1qMVe/paramiko/paramiko/proxy.pyt _closedv s c C s
| | _ d S( N( R ( R R ( ( s2 /tmp/pip-install-A1qMVe/paramiko/paramiko/proxy.pyt
settimeout{ s ( t __name__t
__module__t __doc__R R R+ R0 t propertyR2 R3 R4 ( ( ( s2 /tmp/pip-install-A1qMVe/paramiko/paramiko/proxy.pyR s
! (
R t shlexR R R. R R R t paramiko.ssh_exceptionR t
paramiko.utilR R ( ( ( s2 /tmp/pip-install-A1qMVe/paramiko/paramiko/proxy.pyt <module> s