1
0
This commit is contained in:
Daniel Tartavel 2020-05-08 13:12:40 +02:00
parent 0349a10ba7
commit a1d404435d

2
main.c
View File

@ -38,7 +38,7 @@ void getutmp( int pid, char user[], char host_ip[], char host_ipv6[], time_t * t
if ( utmp->ut_pid == pid ) if ( utmp->ut_pid == pid )
{ {
sprintf(user, "%s", utmp->ut_user); //got user login sprintf(user, "%s", utmp->ut_user); //got user login
sprintf(host_ip, "%s", utmp->ut_host); //got ip of origin //sprintf(host_ip, "%s", utmp->ut_host); //got ip of origin
if((utmp->ut_addr_v6[1] && utmp->ut_addr_v6[2] && utmp->ut_addr_v6[3]) == 0) if((utmp->ut_addr_v6[1] && utmp->ut_addr_v6[2] && utmp->ut_addr_v6[3]) == 0)
{ {
ipv4 = utmp->ut_addr_v6[0] & 0x00000000000000ff; ipv4 = utmp->ut_addr_v6[0] & 0x00000000000000ff;