patch by wknox@mitre.org (William Knox).
[sshlogin.h] declare record_utmp_only for session.c
coming).
- (bal) Part two.. Drop unused AIX header, fix up missing char *cp. All
that is left is handling aix_usrinfo().
+ - (tim) [loginrec.c session.c sshlogin.c sshlogin.h] Bug 84
+ patch by wknox@mitre.org (William Knox).
+ [sshlogin.h] declare record_utmp_only for session.c
20020221
- (bal) Minor session.c fixup for cygwin. mispelt 'is_winnt' variable.
line_stripname(utx->ut_line, li->line, sizeof(utx->ut_line));
set_utmpx_time(li, utx);
utx->ut_pid = li->pid;
+ /* strncpy(): Don't necessarily want null termination */
+ strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username));
if (li->type == LTYPE_LOGOUT)
return;
* for logouts.
*/
- /* strncpy(): Don't necessarily want null termination */
- strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username));
# ifdef HAVE_HOST_IN_UTMPX
strncpy(utx->ut_host, li->hostname, MIN_SIZEOF(utx->ut_host, li->hostname));
# endif
{
struct utmpx utx;
- memset(&utx, '\0', sizeof(utx));
- set_utmpx_time(li, &utx);
- line_stripname(utx.ut_line, li->line, sizeof(utx.ut_line));
+ construct_utmpx(li, &utx);
# ifdef HAVE_ID_IN_UTMPX
line_abbrevname(utx.ut_id, li->line, sizeof(utx.ut_id));
# endif
/* Record that the user has logged out. */
if (s->pid != 0)
- record_logout(s->pid, s->tty);
+ record_logout(s->pid, s->tty, s->pw->pw_name);
/* Release the pseudo-tty. */
pty_release(s->tty);
/* Records that the user has logged out. */
void
-record_logout(pid_t pid, const char *ttyname)
+record_logout(pid_t pid, const char *ttyname, const char *user)
{
struct logininfo *li;
- li = login_alloc_entry(pid, NULL, NULL, ttyname);
+ li = login_alloc_entry(pid, user, NULL, ttyname);
login_logout(li);
login_free_entry(li);
}
void
record_login(pid_t, const char *, const char *, uid_t,
const char *, struct sockaddr *);
-void record_logout(pid_t, const char *);
+void record_logout(pid_t, const char *, const char *);
u_long get_last_login_time(uid_t, const char *, char *, u_int);
+#ifdef LOGIN_NEEDS_UTMPX
+void record_utmp_only(pid_t, const char *, const char *, const char *,
+ struct sockaddr *);
+#endif
+
#endif