You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just saw this on 22.8.0.rc1, with the equivalent of twist conch --auth=sshkey .
2022-08-29T07:31:45+0000 [twisted.conch.ssh.userauth.SSHUserAuthServer#critical] Error checking auth for user b'user'
Traceback (most recent call last):
File "/code/env/lib/pypy3.8/site-packages/twisted/conch/ssh/userauth.py", line 285, in auth_publickey
return self.portal.login(c, None, interfaces.IConchUser)
File "/code/env/lib/pypy3.8/site-packages/twisted/cred/portal.py", line 120, in login
).addCallback(self.realm.requestAvatar, mind, *interfaces)
File "/code/env/lib/pypy3.8/site-packages/twisted/internet/defer.py", line 531, in addCallback
return self.addCallbacks(callback, callbackArgs=args, callbackKeywords=kwargs)
File "/code/env/lib/pypy3.8/site-packages/twisted/internet/defer.py", line 511, in addCallbacks
self._runCallbacks()
--- <exception caught here> ---
File "/code/env/lib/pypy3.8/site-packages/twisted/internet/defer.py", line 892, in _runCallbacks
current.result, *args, **kwargs
File "/code/env/lib/pypy3.8/site-packages/twisted/conch/ssh/userauth.py", line 208, in _ebMaybeBadAuth
reason.trap(error.NotEnoughAuthentication)
File "/code/env/lib/pypy3.8/site-packages/twisted/python/failure.py", line 480, in trap
self.raiseException()
File "/code/env/lib/pypy3.8/site-packages/twisted/python/failure.py", line 504, in raiseException
raise self.value.with_traceback(self.tb)
File "/code/env/lib/pypy3.8/site-packages/twisted/internet/defer.py", line 892, in _runCallbacks
current.result, *args, **kwargs
File "/code/env/lib/pypy3.8/site-packages/twisted/conch/unix.py", line 49, in requestAvatar
user = UnixConchUser(username)
File "/code/env/lib/pypy3.8/site-packages/twisted/conch/unix.py", line 57, in __init__
self.pwdData = pwd.getpwnam(self.username)
builtins.TypeError: expected str, got bytes object
While it has a very similar consequence to #10335 / #10286 (which were duplicates of each other), those were about UNIXAuthorizedKeysFiles passing bytes to getpwnam, whereas this is about UnixConchUser passing bytes to getpwnam.
`twist conch --auth=sshkey` can now authenticate users without a traceback again, thanks to twisted.conch.unix.UnixConchUser no longer being incorrectly instantiated with `bytes`. In the course of this fix, some type hinting has also been applied to `twisted.cred.portal`.
Just saw this on 22.8.0.rc1, with the equivalent of
twist conch --auth=sshkey
.Originally posted by @glyph in #10286 (comment)
Refer to the patch for #10286 for
UserDB
typing and mocks that will be helpful.The text was updated successfully, but these errors were encountered: