From: Karel Zak Date: Mon, 4 Mar 2024 12:30:10 +0000 (+0100) Subject: su, agetty: don't use program_invocation_short_name for openlog() X-Git-Tag: v2.42-start~494 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=677a3168b261f3289e282a02dfd85d7f37de0447;p=thirdparty%2Futil-linux.git su, agetty: don't use program_invocation_short_name for openlog() Make sure the program name is hardcoded when write to the log. Reported-by: "Serge E. Hallyn" Reported-by: "Skyler Ferrante (RIT Student)" Signed-off-by: Karel Zak --- diff --git a/login-utils/su-common.c b/login-utils/su-common.c index 4cc24e34c..242b6ce4e 100644 --- a/login-utils/su-common.c +++ b/login-utils/su-common.c @@ -290,7 +290,7 @@ static void log_syslog(struct su_context *su, bool successful) { DBG(LOG, ul_debug("syslog logging")); - openlog(program_invocation_short_name, LOG_PID, LOG_AUTH); + openlog(su->runuser ? "runuser" : "su", LOG_PID, LOG_AUTH); syslog(LOG_NOTICE, "%s(to %s) %s on %s", successful ? "" : su->runuser ? "FAILED RUNUSER " : "FAILED SU ", diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 6059b01d0..0fc6f1514 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -2519,7 +2519,7 @@ static void dolog(int priority * automatically prepended to the message. If we write directly to * /dev/console, we must prepend the process name ourselves. */ - openlog(program_invocation_short_name, LOG_PID, LOG_AUTHPRIV); + openlog("agetty", LOG_PID, LOG_AUTHPRIV); vsyslog(priority, fmt, ap); closelog(); #else