From 70f3d83dfc7018a4a4e8d06a19fe562ba6d1a0d9 Mon Sep 17 00:00:00 2001 From: gulams <64251312+gulams@users.noreply.github.com> Date: Fri, 16 Apr 2021 22:44:43 +0530 Subject: Log error message when auth debug status is set Log the correct error message in /var/log/messages when the debug status is set when there is an authentication error. The change is made in check_security_stage_status() function. This issue was identified when one of the customer was trying to login to the iscsi target after configuring the mutual CHAP authentication. They set the same password for both side authentication. This is not allowed as per the code as it was returning AUTH_DBG_STATUS_PASSWD_IDENTICAL. The error logged in /var/log/messages was not obvious. This change will help to understand the correct error message so that required action can be taken. --- usr/login.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/login.c b/usr/login.c index 2508c48..8af8756 100644 --- a/usr/login.c +++ b/usr/login.c @@ -624,7 +624,7 @@ check_security_stage_status(iscsi_session_t *session, case AUTH_STATUS_ERROR: case AUTH_STATUS_FAIL: default: - if (acl_get_dbg_status(auth_client, &debug_status) != + if (acl_get_dbg_status(auth_client, &debug_status) == AUTH_STATUS_NO_ERROR) log_error("Login authentication failed " "with target %s, %s", -- cgit v1.2.1