openssh/openssh-7.6p1-lastlog.patch

27 lines
798 B
Diff
Raw Normal View History

# HG changeset patch
2017-11-06 15:50:53 +01:00
# Parent b26f93cf21e4cfff1212ad2e61696ad099cfaf5e
# set uid for functions that use it to seek in lastlog and wtmp files
# bnc#18024 (was suse #3024)
2017-11-06 15:50:53 +01:00
diff --git a/openssh-7.6p1/sshlogin.c b/openssh-7.6p1/sshlogin.c
--- a/openssh-7.6p1/sshlogin.c
+++ b/openssh-7.6p1/sshlogin.c
@@ -129,16 +129,17 @@ record_login(pid_t pid, const char *tty,
{
struct logininfo *li;
/* save previous login details before writing new */
store_lastlog_message(user, uid);
li = login_alloc_entry(pid, user, host, tty);
login_set_addr(li, addr, addrlen);
+ li->uid = uid;
login_login(li);
login_free_entry(li);
}
#ifdef LOGIN_NEEDS_UTMPX
void
record_utmp_only(pid_t pid, const char *ttyname, const char *user,
const char *host, struct sockaddr *addr, socklen_t addrlen)