sftp: log ip on inbound connection failure

This commit is contained in:
Matthew Penner 2023-12-02 21:11:24 -07:00
parent d30ab7b9bd
commit 579278b4de
No known key found for this signature in database

View File

@ -107,7 +107,7 @@ func (c *SFTPServer) Run() error {
go func(conn net.Conn) { go func(conn net.Conn) {
defer conn.Close() defer conn.Close()
if err := c.AcceptInbound(conn, conf); err != nil { if err := c.AcceptInbound(conn, conf); err != nil {
log.WithField("error", err).Error("sftp: failed to accept inbound connection") log.WithField("error", err).WithField("ip", conn.RemoteAddr().String()).Error("sftp: failed to accept inbound connection")
} }
}(conn) }(conn)
} }