|
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 |