X-Git-Url: http://andersk.mit.edu/gitweb/gssapi-openssh.git/blobdiff_plain/510132b69d4fdceca750f6de39b2be84c49006c8..b0cdeed6156550c079c347aedc961145c6e1b856:/openssh/loginrec.c diff --git a/openssh/loginrec.c b/openssh/loginrec.c index 7aa1025..87c336d 100644 --- a/openssh/loginrec.c +++ b/openssh/loginrec.c @@ -564,11 +564,6 @@ line_abbrevname(char *dst, const char *src, int dstsize) if (strncmp(src, "/dev/", 5) == 0) src += 5; -#ifdef WITH_ABBREV_NO_TTY - if (strncmp(src, "tty", 3) == 0) - src += 3; -#endif - len = strlen(src); if (len > 0) { @@ -706,8 +701,6 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx) 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; @@ -717,6 +710,8 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx) * 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 @@ -947,7 +942,9 @@ utmpx_perform_logout(struct logininfo *li) { struct utmpx utx; - construct_utmpx(li, &utx); + memset(&utx, '\0', sizeof(utx)); + set_utmpx_time(li, &utx); + line_stripname(utx.ut_line, li->line, sizeof(utx.ut_line)); # ifdef HAVE_ID_IN_UTMPX line_abbrevname(utx.ut_id, li->line, sizeof(utx.ut_id)); # endif