Commit 83333f38 authored by Per Cederqvist's avatar Per Cederqvist

who_is_on*: Don't return invisible logins.

Fixed malloc bug in who_is_on_ident.
parent b3ec5bfa
Mon Apr 6 23:11:29 1992 Per Cederqvist (ceder@ruben)
* session.c (who_is_on_ident): Fix malloc bug.
* session.c (who_is_on, who_is_on_ident, who_is_on_old): Don't
return invisible sessions.
Sat Apr 4 19:24:27 1992 Per Cederqvist (ceder@lysator)
* person.c: (get_person_stat): It is allowed to get the person
* person.c (get_person_stat): It is allowed to get the person
status before logging in so that it is possible to print a "last
login from:" message.
......
/*
* $Id: session.c,v 0.7 1992/04/04 17:33:46 ceder Exp $
* $Id: session.c,v 0.8 1992/04/06 21:19:12 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Session control and miscellaneous.
*/
static char *rcsid = "$Id: session.c,v 0.7 1992/04/04 17:33:46 ceder Exp $";
static char *rcsid = "$Id: session.c,v 0.8 1992/04/06 21:19:12 ceder Exp $";
#include <time.h>
......@@ -370,7 +370,7 @@ who_is_on( Who_info_list *result )
{
cptr = get_conn_by_number(session);
if ( cptr->person != NULL )
if ( cptr->person != NULL && cptr->invisible == FALSE )
++no_of_clients;
}
......@@ -382,7 +382,7 @@ who_is_on( Who_info_list *result )
{
cptr = get_conn_by_number(session);
if ( cptr->person != NULL )
if ( cptr->person != NULL && cptr->invisible == FALSE )
{
result->info[ i ] = EMPTY_WHO_INFO;
result->info[ i ].person = cptr->pers_no;
......@@ -431,19 +431,19 @@ who_is_on_ident( Who_info_ident_list *result )
{
cptr = get_conn_by_number(session);
if ( cptr->person != NULL )
if ( cptr->person != NULL && cptr->invisible == FALSE )
++no_of_clients;
}
result->no_of_persons = no_of_clients;
result->info = tmp_alloc ( no_of_clients * sizeof(Who_info));
result->info = tmp_alloc ( no_of_clients * sizeof(Who_info_ident));
for ( session = 0, i = 0;
i < no_of_clients && (session = traverse_connections(session)) != 0; )
{
cptr = get_conn_by_number(session);
if ( cptr->person != NULL )
if ( cptr->person != NULL && cptr->invisible == FALSE )
{
result->info[i] = EMPTY_WHO_INFO_IDENT;
result->info[i].person = cptr->pers_no;
......@@ -595,7 +595,7 @@ who_is_on_old( Who_info_list_old *result )
{
cptr = get_conn_by_number(session);
if ( cptr->person != NULL )
if ( cptr->person != NULL && cptr->invisible == FALSE )
++no_of_clients;
}
......@@ -607,7 +607,7 @@ who_is_on_old( Who_info_list_old *result )
{
cptr = get_conn_by_number(session);
if ( cptr->person != NULL )
if ( cptr->person != NULL && cptr->invisible == FALSE )
{
result->info[ i ] = EMPTY_WHO_INFO_OLD;
result->info[ i ].person = cptr->pers_no;
......@@ -618,7 +618,7 @@ who_is_on_old( Who_info_list_old *result )
}
if ( i != no_of_clients )
log("who_is_on: i == %d, no_of_clients == %d\n",
log("who_is_on_old: i == %d, no_of_clients == %d\n",
i, no_of_clients);
return OK;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment