On Fri, 21 Jan 2011 00:08:30 -0000, Martin Pool <email address hidden> wrote:
> On 19 January 2011 19:29, Michael Hudson-Doyle
> <email address hidden> wrote:
> > I think this might be a little tricky to achieve, sadly.
> >
> > The failed to authenticate message is produced when the client
> > disconnects without authenticating. Â Which usernames were presented is
> > known by the "UserDetailsMind" object, which is attached to the
> > SSHUserAuthServer object. Â So I guess we need to somehow record on the
> > transport passed to SSHUserAuthServer.__init__ the usernames that have
> > been recorded, and read them out again in
> > lp.services.sshserver.service.Factory.connectionLost (maybe a
> > WeakKeyDict mapping transports to lists of usernames?)
>
> Couldn't we just log them at the time the username is sent, and then
> later log that the same client disconnected?
Yeah, that would be simpler. All log messages from the same connection
are identified already (id(transport) is part of the log message) so
this should be fairly easy.
On Fri, 21 Jan 2011 00:08:30 -0000, Martin Pool <email address hidden> wrote: er.__init_ _ the usernames that have sshserver. service. Factory. connectionLost (maybe a
> On 19 January 2011 19:29, Michael Hudson-Doyle
> <email address hidden> wrote:
> > I think this might be a little tricky to achieve, sadly.
> >
> > The failed to authenticate message is produced when the client
> > disconnects without authenticating. Â Which usernames were presented is
> > known by the "UserDetailsMind" object, which is attached to the
> > SSHUserAuthServer object. Â So I guess we need to somehow record on the
> > transport passed to SSHUserAuthServ
> > been recorded, and read them out again in
> > lp.services.
> > WeakKeyDict mapping transports to lists of usernames?)
>
> Couldn't we just log them at the time the username is sent, and then
> later log that the same client disconnected?
Yeah, that would be simpler. All log messages from the same connection
are identified already (id(transport) is part of the log message) so
this should be fairly easy.
Cheers,
mwh