corrected the code for session connecting
This commit is contained in:
parent
32920d49cc
commit
2f03f2fcdd
11
main.c
11
main.c
@ -387,11 +387,7 @@ int getprocinfo( struct connexion * conn )
|
||||
while ( flag == 0)
|
||||
{
|
||||
r = getpids( conn->pid, child_pid );
|
||||
if( level == 0 && r == 2 )
|
||||
{
|
||||
flag = 1;
|
||||
retval = -1;
|
||||
}else if ( r != -1 )
|
||||
if ( r != -1 )
|
||||
{
|
||||
level++;
|
||||
strcat(tab," ");
|
||||
@ -413,6 +409,10 @@ int getprocinfo( struct connexion * conn )
|
||||
null2space( str );
|
||||
sprintf(conn->cmdline, "%s", str);
|
||||
fclose(fh1);
|
||||
if ((strstr(conn->cmdline, "pam") || strstr(conn->cmdline, "net")) != 0)
|
||||
{
|
||||
retval = -1;
|
||||
}
|
||||
// get the command name
|
||||
sprintf( child_path, "/proc/%d/comm", conn->pid );
|
||||
if ( (fh1= fopen(child_path, "r" )) == NULL)
|
||||
@ -422,6 +422,7 @@ int getprocinfo( struct connexion * conn )
|
||||
}
|
||||
fscanf( fh1, "%s", conn->cmd );
|
||||
fclose(fh1);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user