Fix issue in SSH protocol preventing connection. Resolve #3411

This commit is contained in:
Griatch 2024-03-09 21:38:32 +01:00
parent 78385d7155
commit fd2cfd3781
2 changed files with 9 additions and 8 deletions

View file

@ -26,11 +26,13 @@
Evennia core's version (michaelfaith84, Griatch) Evennia core's version (michaelfaith84, Griatch)
- [Fix][issue3438]: Limiting search by tag didn't take search-string into - [Fix][issue3438]: Limiting search by tag didn't take search-string into
account (Griatch) account (Griatch)
- [Fix][issue4311]: SSH connection caused a traceback in protocol (Griatch)
- Fix: Resolve a bug when loading on-demand-handler data from database (Griatch) - Fix: Resolve a bug when loading on-demand-handler data from database (Griatch)
- Doc fixes (iLPdev, Griatch, CloudKeeper) - Doc fixes (iLPdev, Griatch, CloudKeeper)
[pull3420]: https://github.com/evennia/evennia/pull/3420 [pull3420]: https://github.com/evennia/evennia/pull/3420
[issue3438]: https://github.com/evennia/evennia/issues/3438 [issue3438]: https://github.com/evennia/evennia/issues/3438
[issue3411]: https://github.com/evennia/evennia/issues/3411
## Evennia 3.2.0 ## Evennia 3.2.0

View file

@ -34,6 +34,9 @@ except ImportError:
raise ImportError(_SSH_IMPORT_ERROR) raise ImportError(_SSH_IMPORT_ERROR)
from django.conf import settings from django.conf import settings
from evennia.accounts.models import AccountDB
from evennia.utils import ansi
from evennia.utils.utils import class_from_module, to_str
from twisted.conch import interfaces as iconch from twisted.conch import interfaces as iconch
from twisted.conch.insults import insults from twisted.conch.insults import insults
from twisted.conch.manhole import Manhole, recvline from twisted.conch.manhole import Manhole, recvline
@ -43,10 +46,6 @@ from twisted.conch.ssh.userauth import SSHUserAuthServer
from twisted.internet import defer, protocol from twisted.internet import defer, protocol
from twisted.python import components from twisted.python import components
from evennia.accounts.models import AccountDB
from evennia.utils import ansi
from evennia.utils.utils import class_from_module, to_str
_RE_N = re.compile(r"\|n$") _RE_N = re.compile(r"\|n$")
_RE_SCREENREADER_REGEX = re.compile( _RE_SCREENREADER_REGEX = re.compile(
r"%s" % settings.SCREENREADER_REGEX_STRIP, re.DOTALL + re.MULTILINE r"%s" % settings.SCREENREADER_REGEX_STRIP, re.DOTALL + re.MULTILINE
@ -127,15 +126,15 @@ class SshProtocol(Manhole, _BASE_SESSION_CLASS):
self.width = width self.width = width
self.height = height self.height = height
# Set color defaults
for color in ("ANSI", "XTERM256", "TRUECOLOR"):
self.protocol_flags[color] = True
# initialize the session # initialize the session
client_address = self.getClientAddress() client_address = self.getClientAddress()
client_address = client_address.host if client_address else None client_address = client_address.host if client_address else None
self.init_session("ssh", client_address, self.cfactory.sessionhandler) self.init_session("ssh", client_address, self.cfactory.sessionhandler)
# Set color defaults
for color in ("ANSI", "XTERM256", "TRUECOLOR"):
self.protocol_flags[color] = True
# since we might have authenticated already, we might set this here. # since we might have authenticated already, we might set this here.
if self.authenticated_account: if self.authenticated_account:
self.logged_in = True self.logged_in = True