From b371dca158d411a79ec74120d644406ec3812c78 Mon Sep 17 00:00:00 2001 From: = Date: Fri, 17 Sep 2021 15:00:47 +0200 Subject: [PATCH] Fix All() for postgres store --- honeypot/store/postgres.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/honeypot/store/postgres.go b/honeypot/store/postgres.go index 5876f26..4a33e4c 100644 --- a/honeypot/store/postgres.go +++ b/honeypot/store/postgres.go @@ -73,9 +73,11 @@ func (s *PostgresStore) All() ([]models.LoginAttempt, error) { var attempts []models.LoginAttempt for rows.Next() { var a models.LoginAttempt - if err := rows.Scan(&a.Date, &a.RemoteIP, &a.Username, &a.Password, &a.SSHClientVersion, &a.SSHClientVersion, &a.Country); err != nil { + var ip string + if err := rows.Scan(&a.Date, &ip, &a.Username, &a.Password, &a.SSHClientVersion, &a.SSHClientVersion, &a.Country); err != nil { return nil, err } + a.RemoteIP = net.ParseIP(ip) attempts = append(attempts, a) }