The su(1) logging code mix ups "old" and "new" passwd structs. The
result is things like
Sep 9 11:50:45 x2 su: (to kzak) kzak on none
in /var/log/messages. The right log entry is
Sep 9 11:50:45 x2 su: (to root) kzak on pts/3
The bug has been introduced by commit
c74a7af17c7a176c358dfaa8e1814786c89ebc14.
References: https://bugzilla.redhat.com/show_bug.cgi?id=
1005194
Signed-off-by: Karel Zak <kzak@redhat.com>
old_user = pwd ? pwd->pw_name : "";
}
- if (get_terminal_name(STDERR_FILENO, NULL, &tty, NULL) == 0 && tty)
+ if (get_terminal_name(STDERR_FILENO, NULL, &tty, NULL) != 0 || !tty)
tty = "none";
openlog (program_invocation_short_name, 0 , LOG_AUTH);
done:
- if (lpw && lpw->pw_name)
- pw = lpw;
-
log_syslog(pw, !is_pam_failure(retval));
if (is_pam_failure(retval))