HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/twisted/conch/__pycache__/manhole_ssh.cpython-38.pyc
U


W[��@s�dZddlmZddlmZmZmZddl	m
Z
mZddlm
Z
ddlmZGdd�d�ZGd	d
�d
�Zeej�Gdd�de
j��ZGd
d�deje
j�ZGdd�d�ZGdd�de
j�ZdS)z9
insults/SSH integration support.

@author: Jp Calderone
�)�implementer)�avatar�
interfaces�error)�factory�session)�
components)�insultsc@s eZdZdZdd�Zdd�ZdS)�_Gluez�
    A feeble class for making one attribute look like another.

    This should be replaced with a real class at some point, probably.
    Try not to write new code that uses it.
    cKs|j�|�dS�N)�__dict__�update)�self�kw�r�;/usr/lib/python3/dist-packages/twisted/conch/manhole_ssh.py�__init__sz_Glue.__init__cCst|jd|��dS)Nzhas no attribute)�AttributeError�name)rrrrr�__getattr__sz_Glue.__getattr__N)�__name__�
__module__�__qualname__�__doc__rrrrrrr
sr
c@seZdZdd�ZdS)�TerminalSessionTransportcsx|�_��_|�_�jj��j�t�jj��fdd�dd���fdd�}�j�t�jj|dd���jj�	||�dS)Ncs�j���Sr)ZconnZ	sendCloser)r�protoSessionrr�<lambda>.�z3TerminalSessionTransport.__init__.<locals>.<lambda>zSSH Proto Transport)�write�loseConnectionrcs�j��dSr)�protorr�rrrr1sz9TerminalSessionTransport.__init__.<locals>.loseConnectionzChained Proto Transport)
r r�chainedProtocolrZmakeConnectionr
ZdataReceivedrZterminalProtocolZterminalSize)rr r"r�width�heightrr)rrrrr%s$����z!TerminalSessionTransport.__init__N�rrrrrrrrr$src@s6eZdZeZejZdd�Zdd�Z	dd�Z
dd�Zd	S)
�TerminalSessioncCs|dd�\|_|_dS)N�)r$r#)rZtermZ
windowSizeZattrsrrr�getPtyHszTerminalSession.getPtycCs&|�||��t�|j�|j|j�dSr)�transportFactory�chainedProtocolFactory�iconch�
IConchUser�originalr#r$)rr rrr�	openShellLs
�zTerminalSession.openShellcCst�d��dS)NzCannot execute commands)�econchZ
ConchError)rr �cmdrrr�execCommandSszTerminalSession.execCommandcCsdSrrr!rrr�closedWszTerminalSession.closedN)rrrrr)r	�ServerProtocolr*r(r.r1r2rrrrr&Csr&c@seZdZdd�ZdS)�TerminalUsercCs*tj�||�tj�|�tj|jd<dS)Nssession)r�Adapterrr�	ConchUserrZ
SSHSessionZ
channelLookup)rr-�avatarIdrrrr]szTerminalUser.__init__Nr%rrrrr4\sr4c@s8eZdZeZeZeZe	j
Zdd�Zddd�Z
dd�ZdS)	�
TerminalRealmcCsNt��}|�||�}|�|�}|j|_|j|_|�tj|�|�tj	|�|Sr)
rZ
Componentized�userFactory�sessionFactoryr)r*ZsetComponentr+r,�ISession)rr7�comp�userZsessrrr�
_getAvatarks
zTerminalRealm._getAvatarNcCs|dk	r||_dSr)r))rr)rrrryszTerminalRealm.__init__cGs8|D](}|tjkrtj|�|�dd�fSqt��dS)NcSsdSrrrrrrr�rz-TerminalRealm.requestAvatar.<locals>.<lambda>)r+r,r>�NotImplementedError)rr7Zmindr�irrr�
requestAvatar~s
�
zTerminalRealm.requestAvatar)N)rrrr4r9r&r:rr)r	r3r*r>rrArrrrr8ds
r8c@seZdZiZiZdd�ZdS)�ConchFactorycCs
||_dSr)�portal)rrCrrrr�szConchFactory.__init__N)rrrZ
publicKeysZprivateKeysrrrrrrB�srBN)rZzope.interfacerZ
twisted.conchrrr+rr/Ztwisted.conch.sshrrZtwisted.pythonrZtwisted.conch.insultsr	r
rr;r5r&r6r4r8Z
SSHFactoryrBrrrr�<module>s$