From: Thomas Weißschuh Date: Fri, 19 Jan 2024 02:12:21 +0000 (+0100) Subject: login: ignore return of audit_log_acct_message X-Git-Tag: v2.40-rc1~39^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a0f319f1ed37dfc587cf9a227e7ff06e16bdb1f;p=thirdparty%2Futil-linux.git login: ignore return of audit_log_acct_message 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 --- 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); }