View | Details | Raw Unified | Return to bug 84
Collapse All | Expand All

(-)loginrec.c~ (-4 / +2 lines)
Lines 701-706 Link Here
701
	line_stripname(utx->ut_line, li->line, sizeof(utx->ut_line));
701
	line_stripname(utx->ut_line, li->line, sizeof(utx->ut_line));
702
	set_utmpx_time(li, utx);
702
	set_utmpx_time(li, utx);
703
	utx->ut_pid = li->pid;
703
	utx->ut_pid = li->pid;
704
	strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username));
704
705
705
	if (li->type == LTYPE_LOGOUT)
706
	if (li->type == LTYPE_LOGOUT)
706
		return;
707
		return;
Lines 711-717 Link Here
711
	 */
712
	 */
712
713
713
	/* strncpy(): Don't necessarily want null termination */
714
	/* strncpy(): Don't necessarily want null termination */
714
	strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username));
715
# ifdef HAVE_HOST_IN_UTMPX
715
# ifdef HAVE_HOST_IN_UTMPX
716
	strncpy(utx->ut_host, li->hostname, MIN_SIZEOF(utx->ut_host, li->hostname));
716
	strncpy(utx->ut_host, li->hostname, MIN_SIZEOF(utx->ut_host, li->hostname));
717
# endif
717
# endif
Lines 942-950 Link Here
942
{
942
{
943
	struct utmpx utx;
943
	struct utmpx utx;
944
944
945
	memset(&utx, '\0', sizeof(utx));
945
	construct_utmpx(li, &utx);
946
	set_utmpx_time(li, &utx);
947
	line_stripname(utx.ut_line, li->line, sizeof(utx.ut_line));
948
# ifdef HAVE_ID_IN_UTMPX
946
# ifdef HAVE_ID_IN_UTMPX
949
	line_abbrevname(utx.ut_id, li->line, sizeof(utx.ut_id));
947
	line_abbrevname(utx.ut_id, li->line, sizeof(utx.ut_id));
950
# endif
948
# endif
(-)session.c~ (-1 / +1 lines)
Lines 1866-1872 Link Here
1866
1866
1867
	/* Record that the user has logged out. */
1867
	/* Record that the user has logged out. */
1868
	if (s->pid != 0)
1868
	if (s->pid != 0)
1869
		record_logout(s->pid, s->tty);
1869
		record_logout(s->pid, s->tty, s->pw->pw_name);
1870
1870
1871
	/* Release the pseudo-tty. */
1871
	/* Release the pseudo-tty. */
1872
	pty_release(s->tty);
1872
	pty_release(s->tty);
(-)sshlogin.c~ (-2 / +2 lines)
Lines 94-104 Link Here
94
/* Records that the user has logged out. */
94
/* Records that the user has logged out. */
95
95
96
void
96
void
97
record_logout(pid_t pid, const char *ttyname)
97
record_logout(pid_t pid, const char *ttyname, const char *user)
98
{
98
{
99
  struct logininfo *li;
99
  struct logininfo *li;
100
100
101
  li = login_alloc_entry(pid, NULL, NULL, ttyname);
101
  li = login_alloc_entry(pid, user, NULL, ttyname);
102
  login_logout(li);
102
  login_logout(li);
103
  login_free_entry(li);
103
  login_free_entry(li);
104
}
104
}
(-)sshlogin.h~ (-1 / +1 lines)
Lines 17-23 Link Here
17
void
17
void
18
record_login(pid_t, const char *, const char *, uid_t,
18
record_login(pid_t, const char *, const char *, uid_t,
19
    const char *, struct sockaddr *);
19
    const char *, struct sockaddr *);
20
void   record_logout(pid_t, const char *);
20
void   record_logout(pid_t, const char *, const char *);
21
u_long         get_last_login_time(uid_t, const char *, char *, u_int);
21
u_long         get_last_login_time(uid_t, const char *, char *, u_int);
22
22
23
#endif
23
#endif

Return to bug 84