[project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-71]
remove redundant 'auth_complete' member remove the redundant 'auth_complete' field and just use 'authenticated' for both client and server mode. this makes the repr() string look correct in server mode instead of always claiming that the transport is un-auth'd.
This commit is contained in:
parent
aba7e37a38
commit
6cef2f1259
|
@ -55,7 +55,6 @@ class Transport (BaseTransport):
|
||||||
# for server mode:
|
# for server mode:
|
||||||
self.auth_username = None
|
self.auth_username = None
|
||||||
self.auth_fail_count = 0
|
self.auth_fail_count = 0
|
||||||
self.auth_complete = 0
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
out = '<paramiko.Transport at %s' % hex(id(self))
|
out = '<paramiko.Transport at %s' % hex(id(self))
|
||||||
|
@ -242,7 +241,7 @@ class Transport (BaseTransport):
|
||||||
m.add_boolean(0)
|
m.add_boolean(0)
|
||||||
self._send_message(m)
|
self._send_message(m)
|
||||||
return
|
return
|
||||||
if self.auth_complete:
|
if self.authenticated:
|
||||||
# ignore
|
# ignore
|
||||||
return
|
return
|
||||||
username = m.get_string()
|
username = m.get_string()
|
||||||
|
@ -308,7 +307,7 @@ class Transport (BaseTransport):
|
||||||
if result == AUTH_SUCCESSFUL:
|
if result == AUTH_SUCCESSFUL:
|
||||||
self._log(DEBUG, 'Auth granted.')
|
self._log(DEBUG, 'Auth granted.')
|
||||||
m.add_byte(chr(MSG_USERAUTH_SUCCESS))
|
m.add_byte(chr(MSG_USERAUTH_SUCCESS))
|
||||||
self.auth_complete = 1
|
self.authenticated = True
|
||||||
else:
|
else:
|
||||||
self._log(DEBUG, 'Auth rejected.')
|
self._log(DEBUG, 'Auth rejected.')
|
||||||
m.add_byte(chr(MSG_USERAUTH_FAILURE))
|
m.add_byte(chr(MSG_USERAUTH_FAILURE))
|
||||||
|
|
Loading…
Reference in New Issue