Bug 2644 - [PATCH] set uid for functions that use it to seek in lastlog and wtmp files
Summary: [PATCH] set uid for functions that use it to seek in lastlog and wtmp files
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 7.2p2
Hardware: amd64 Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-27 07:09 AEDT by Alexander Naumov
Modified: 2021-04-23 14:58 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Naumov 2016-11-27 07:09:17 AEDT
Set uid for functions that use it to seek in lastlog and wtmp files:


diff --git a/sshlogin.c b/sshlogin.c
index cea3e76..0fcae4c 100644
--- a/sshlogin.c
+++ b/sshlogin.c
@@ -134,6 +134,7 @@ record_login(pid_t pid, const char *tty, const char *user, uid_t 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);
 }
Comment 1 Damien Miller 2018-01-05 13:31:42 AEDT
This shouldn't necessary - login_alloc_entry() calls login_init_entry() that sets li->uid from the username.
Comment 2 Damien Miller 2021-04-23 14:58:48 AEST
closing resolved bugs as of 8.6p1 release