1
0

some bugs

This commit is contained in:
Daniel Tartavel 2020-05-27 23:10:25 +02:00
parent aa186662ee
commit f9bc01f14a

8
main.c
View File

@ -310,8 +310,8 @@ void getutmp( struct connexion * conn, time_t * time )
char str[6]; char str[6];
char strlog[128]; char strlog[128];
//conn->host_ip[0]='\0'; conn->host_ip[0]='\0';
//conn->host_ipv6[0]='\0'; conn->host_ipv6[0]='\0';
setutent(); setutent();
while ( (utmp = getutent()) != NULL ) while ( (utmp = getutent()) != NULL )
{ {
@ -474,7 +474,7 @@ int getprocinfo( struct connexion * conn )
sprintf(conn->cmdline, "%s", str); sprintf(conn->cmdline, "%s", str);
fclose(fh1); fclose(fh1);
printlog(conn->cmdline, DEBUG, 0); printlog(conn->cmdline, DEBUG, 0);
if ((strstr(conn->cmdline, "pam") || strstr(conn->cmdline, "net") || strstr(conn->cmdline, "accepted")) != 0) if ((strstr(conn->cmdline, "pam") || strstr(conn->cmdline, "net") ) != 0)
{ {
printlog("comdline is pam or net or accepted", DEBUG, 0); printlog("comdline is pam or net or accepted", DEBUG, 0);
retval = -1; retval = -1;
@ -635,7 +635,7 @@ int main()
} }
}else }else
{ {
sprintf(strlog, "%s: %s Connecté depuis %s - %s %s", conn.date, conn.user, ip, conn.cmd, conn.cmdline); sprintf(strlog, "%s Connecté depuis %s ip=%s - %s %s", conn.user, conn.date, ip, conn.cmd, conn.cmdline);
printlog(strlog, INFO, 0); printlog(strlog, INFO, 0);
} }
}else if (rinfo == -1) }else if (rinfo == -1)