From 6e57502a2964b45d68ba1b9f38c7a4e3f782fe99 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Wed, 27 May 2020 23:59:50 +0200 Subject: [PATCH] some bugs --- main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.c b/main.c index cc9cc7b..e082dc7 100644 --- a/main.c +++ b/main.c @@ -21,9 +21,9 @@ struct connexion { int pid; - char cmd[24]; + char cmd[128]; char cmdline[1000]; - char user[24]; + char user[128]; char hostname[128]; char host_ip[42]; char host_ipv6[42]; @@ -429,7 +429,7 @@ int getpids(int pid, int exploded[]) int getprocinfo( struct connexion * conn ) { FILE *fh1; - char child_path[128]; + char child_path[1024]; char str[1024]; int child_pid[10]; int flag = 0; @@ -476,7 +476,7 @@ int getprocinfo( struct connexion * conn ) printlog(conn->cmdline, DEBUG, 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", DEBUG, 0); retval = -1; } // get the command name @@ -495,7 +495,7 @@ int getprocinfo( struct connexion * conn ) int main() { FILE *fh = NULL; - FILE *fh1; + //FILE *fh1; int n_ssh=10; int id; int pid; @@ -606,10 +606,10 @@ int main() // date of connexion if (conn.user[0] == '\0') { - sprintf( str, "%s \"%s: tunnel ouvert depuis %s pid: %d avec la commande: %s %s\"", cfg.commande, cfg.hostname, ip, conn.pid, conn.cmd, conn.cmdline ); + sprintf( str, "%s \"%s: tunnel ouvert depuis %s pid: %d\"", cfg.commande, cfg.hostname, ip, conn.pid ); }else { - sprintf( str, "%s \"%s: %s s'est connecté depuis %s pid: %d avec la commande: %s %s\"", cfg.commande, cfg.hostname, conn.user, ip, conn.pid, conn.cmd, conn.cmdline ); + sprintf( str, "%s \"%s: %s s'est connecté depuis %s pid: %d\"", cfg.commande, cfg.hostname, conn.user, ip, conn.pid); } if ( start != 1 ) {