From a15f28cc65c0a98e0054c48971e40c4779bc6fe0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 30 Dec 2024 17:56:05 +0700 Subject: [PATCH] Re-add host to "Login attempt with wrong user" log As discussed and fixed in #316 for "nonexistent user" logs, this commit additionally reverts #83 for "wrong user" logs, to re-add the remote host to the those log entries. Signed-off-by: MichaIng --- src/svr-auth.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/svr-auth.c b/src/svr-auth.c index 98cc518f..b66d29d8 100644 --- a/src/svr-auth.c +++ b/src/svr-auth.c @@ -276,8 +276,9 @@ static int checkusername(const char *username, unsigned int userlen) { if (!(DROPBEAR_SVR_MULTIUSER && uid == 0) && uid != ses.authstate.pw_uid) { TRACE(("running as nonroot, only server uid is allowed")) dropbear_log(LOG_WARNING, - "Login attempt with wrong user %s", - ses.authstate.pw_name); + "Login attempt with wrong user %s from %s", + ses.authstate.pw_name, + svr_ses.addrstring); ses.authstate.checkusername_failed = 1; return DROPBEAR_FAILURE; }