From 5a0f319f1ed37dfc587cf9a227e7ff06e16bdb1f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Fri, 19 Jan 2024 03:12:21 +0100 Subject: [PATCH] login: ignore return of audit_log_acct_message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The function is marked with `warn_unused_result` so handle the return value. Failures of `audit_open()` are also silently ignored so do the same for `audit_log_acct_message()` itself. Signed-off-by: Thomas Weißschuh --- login-utils/login.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/login-utils/login.c b/login-utils/login.c index 552cafbfb1..c8544f6a17 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -645,16 +645,16 @@ static void log_audit(struct login_context *cxt, int status) if (!pwd && cxt->username) pwd = getpwnam(cxt->username); - audit_log_acct_message(audit_fd, - AUDIT_USER_LOGIN, - NULL, - "login", - cxt->username ? cxt->username : "(unknown)", - pwd ? pwd->pw_uid : (unsigned int)-1, - cxt->hostname, - NULL, - cxt->tty_name, - status); + ignore_result( audit_log_acct_message(audit_fd, + AUDIT_USER_LOGIN, + NULL, + "login", + cxt->username ? cxt->username : "(unknown)", + pwd ? pwd->pw_uid : (unsigned int)-1, + cxt->hostname, + NULL, + cxt->tty_name, + status) ); close(audit_fd); } -- 2.47.2