mirror of
https://github.com/evennia/evennia.git
synced 2026-03-22 07:46:30 +01:00
Fix error in SSH TTYPE parsing that made text not go through correctly on an SSH connection.
This commit is contained in:
parent
da4e35ee9a
commit
301efe4467
1 changed files with 15 additions and 6 deletions
|
|
@ -17,13 +17,22 @@ from twisted.cred.checkers import credentials
|
|||
from twisted.cred.portal import Portal
|
||||
from twisted.conch.interfaces import IConchUser
|
||||
|
||||
_SSH_IMPORT_ERROR = """
|
||||
ERROR: Missing crypto library for SSH. Install it with
|
||||
|
||||
pip install cryptography
|
||||
|
||||
(On older Twisted versions you may have to do 'pip install pycrypto pyasn1 instead).
|
||||
|
||||
If you get a compilation error you must install a C compiler and the
|
||||
SSL dev headers (On Debian-derived systems this is the gcc and libssl-dev
|
||||
packages).
|
||||
"""
|
||||
|
||||
try:
|
||||
from twisted.conch.ssh.keys import Key
|
||||
except ImportError:
|
||||
raise ImportError ("To use SSH, you need to install the crypto libraries:\n"
|
||||
" pip install cryptography\n"
|
||||
"(on older Twisted versions you may instead have to try "
|
||||
"pip install pycrypto pyasn1)\n")
|
||||
raise ImportError (_SSH_IMPORT_ERROR)
|
||||
|
||||
from twisted.conch.ssh.userauth import SSHUserAuthServer
|
||||
from twisted.conch.ssh import common
|
||||
|
|
@ -256,8 +265,8 @@ class SshProtocol(Manhole, session.Session):
|
|||
# handle arguments
|
||||
options = kwargs.get("options", {})
|
||||
flags = self.protocol_flags
|
||||
xterm256 = options.get("xterm256", flags.get('XTERM256', False) if flags["TTYPE"] else True)
|
||||
useansi = options.get("ansi", flags.get('ANSI', False) if flags["TTYPE"] else True)
|
||||
xterm256 = options.get("xterm256", flags.get('XTERM256', False) if flags.get("TTYPE") else True)
|
||||
useansi = options.get("ansi", flags.get('ANSI', False) if flags.get("TTYPE") else True)
|
||||
raw = options.get("raw", flags.get("RAW", False))
|
||||
nomarkup = options.get("nomarkup", flags.get("NOMARKUP", not (xterm256 or useansi)))
|
||||
#echo = options.get("echo", None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue