Commit 86a30481 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Pass the new argument wanted_access to access_perm().

Use access_perm() instead of fast_access_perm().
parent 3a356c30
/*
* $Id: admin.c,v 0.40 1999/06/03 22:11:04 ceder Exp $
* $Id: admin.c,v 0.41 1999/07/01 21:23:36 ceder Exp $
* Copyright (C) 1991, 1993-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -33,7 +33,7 @@
#endif
static const char *
rcsid = "$Id: admin.c,v 0.40 1999/06/03 22:11:04 ceder Exp $";
rcsid = "$Id: admin.c,v 0.41 1999/07/01 21:23:36 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -267,7 +267,8 @@ send_message (Conf_no recipient,
/* Check that the conference is not secret */
if (access_perm(recipient, conf_c, active_connection) <= none)
if (access_perm(recipient, conf_c, active_connection, read_protected)
<= none)
{
err_stat = recipient;
kom_errno = KOM_UNDEF_CONF;
......
/*
* $Id: conference.c,v 0.54 1999/06/24 12:25:12 ceder Exp $
* $Id: conference.c,v 0.55 1999/07/01 21:23:36 ceder Exp $
* Copyright (C) 1991-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -35,7 +35,7 @@
static const char *
rcsid = "$Id: conference.c,v 0.54 1999/06/24 12:25:12 ceder Exp $";
rcsid = "$Id: conference.c,v 0.55 1999/07/01 21:23:36 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -389,7 +389,7 @@ change_name (Conf_no conf_no,
CHK_LOGIN(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
acc = access_perm (conf_no, conf_c, active_connection);
acc = access_perm(conf_no, conf_c, active_connection, unlimited);
if ( acc <= none )
{
......@@ -561,7 +561,7 @@ delete_conf (Conf_no conf_no )
CHK_LOGIN(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
acc = access_perm (conf_no, conf_c, active_connection);
acc = access_perm(conf_no, conf_c, active_connection, unlimited);
if ( acc != unlimited )
{
......@@ -609,7 +609,7 @@ lookup_name (const String name,
for ( i = result->no_of_conf_nos; i > 0; i-- )
{
if ( fast_access_perm (*no, active_connection) <= none )
if (access_perm(*no, NULL, active_connection, read_protected) <= none)
--result->no_of_conf_nos;
else
{
......@@ -649,7 +649,8 @@ lookup_z_name (const String name,
restart_kom("Internal error detected in lookup_z_name");
if ((type->letter_box ? want_persons : want_confs) == 0
|| fast_access_perm(*no, active_connection) <= none)
|| access_perm(*no, NULL, active_connection,
read_protected) <= none)
{
*no = 0;
n_filtered--;
......@@ -723,7 +724,8 @@ do_lookup (Connection *conn,
for (i = 0; i < raw_match.no_of_conf_nos; i++)
{
if (raw_match.type_of_conf[i].letter_box == want_persons
&& fast_access_perm (raw_match.conf_nos[i], conn) > none )
&& access_perm(raw_match.conf_nos[i], NULL, conn,
read_protected) > none)
{
result->conf_nos[result->no_of_confs++] = raw_match.conf_nos[i];
if (result->no_of_confs > retsize)
......@@ -785,7 +787,7 @@ get_conf_stat_old (Conf_no conf_no,
CHK_CONNECTION(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
acc = access_perm (conf_no, conf_c, active_connection);
acc = access_perm(conf_no, conf_c, active_connection, read_protected);
if ( acc == error )
return FAILURE;
......@@ -804,9 +806,6 @@ get_conf_stat_old (Conf_no conf_no,
/*
* Get small status for a conference
*
* This call should not result in reading the conference from disk, hence
* the use of fast_access_perm. Please keep it that way.
*/
extern Success
......@@ -819,7 +818,7 @@ get_uconf_stat (Conf_no conf_no,
CHK_CONNECTION(FAILURE);
conf_c = cached_get_small_conf_stat(conf_no);
if (conf_c != NULL)
acc = fast_access_perm (conf_no, active_connection);
acc = access_perm(conf_no, NULL, active_connection, read_protected);
else
acc = error;
......@@ -839,7 +838,7 @@ get_uconf_stat (Conf_no conf_no,
extern Success
get_conf_stat_older (Conf_no conf_no,
int mask,
int mask,
Conference * result )
{
Conference * conf_c;
......@@ -848,7 +847,7 @@ get_conf_stat_older (Conf_no conf_no,
CHK_CONNECTION(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
acc = access_perm (conf_no, conf_c, active_connection);
acc = access_perm(conf_no, conf_c, active_connection, read_protected);
if ( acc == error )
return FAILURE;
......@@ -901,7 +900,7 @@ set_presentation (Conf_no conf_no,
CHK_LOGIN(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
acc = access_perm(conf_no, conf_c, active_connection);
acc = access_perm(conf_no, conf_c, active_connection, unlimited);
if ( acc < unlimited )
{
......@@ -933,7 +932,8 @@ set_etc_motd( Conf_no conf_no,
CHK_LOGIN(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
if ( (acc = access_perm(conf_no, conf_c, active_connection)) < unlimited )
if ((acc = access_perm(conf_no, conf_c, active_connection, unlimited))
< unlimited)
{
err_stat = conf_no;
kom_errno = (acc <= none ) ? KOM_UNDEF_CONF : KOM_PERM;
......@@ -1092,7 +1092,7 @@ set_conf_type (Conf_no conf_no,
return FAILURE;
}
acc = access_perm (conf_no, conf_c, active_connection) ;
acc = access_perm(conf_no, conf_c, active_connection, unlimited);
/*
* Can't change type without privs
......@@ -1160,7 +1160,7 @@ set_garb_nice( Conf_no conf_no,
CHK_LOGIN(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
acc = access_perm (conf_no, conf_c, active_connection);
acc = access_perm(conf_no, conf_c, active_connection, unlimited);
if ( acc < unlimited )
{
......@@ -1191,7 +1191,7 @@ set_expire( Conf_no conf_no,
CHK_LOGIN(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
acc = access_perm (conf_no, conf_c, active_connection);
acc = access_perm(conf_no, conf_c, active_connection, unlimited);
if ( acc < unlimited )
{
......@@ -1222,7 +1222,7 @@ set_keep_commented(Conf_no conf_no,
CHK_LOGIN(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
acc = access_perm (conf_no, conf_c, active_connection);
acc = access_perm(conf_no, conf_c, active_connection, unlimited);
if ( acc < unlimited )
{
......@@ -1383,7 +1383,7 @@ modify_conf_info(Conf_no conf_no,
}
GET_C_STAT(conf, conf_no, FAILURE);
if (fast_access_perm(conf_no, active_connection) <= none)
if (access_perm(conf_no, conf, active_connection, read_protected) <= none)
{
err_stat = conf_no;
kom_errno = KOM_UNDEF_CONF;
......
/*
* $Id: person.c,v 0.56 1999/06/29 10:18:51 byers Exp $
* $Id: person.c,v 0.57 1999/07/01 21:23:37 ceder Exp $
* Copyright (C) 1991-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -35,7 +35,7 @@
#endif
static const char *
rcsid = "$Id: person.c,v 0.56 1999/06/29 10:18:51 byers Exp $";
rcsid = "$Id: person.c,v 0.57 1999/07/01 21:23:37 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -734,7 +734,7 @@ create_person(const String name,
*/
extern Success
get_person_stat (Pers_no person,
get_person_stat (Pers_no person,
Person * result)
{
Person *p_orig;
......@@ -745,7 +745,7 @@ get_person_stat (Pers_no person,
GET_P_STAT(p_orig, person, FAILURE);
GET_C_STAT(pers_c, person, FAILURE);
acc = access_perm (person, pers_c, active_connection);
acc = access_perm(person, pers_c, active_connection, unlimited);
if ( acc == error )
return FAILURE;
......@@ -784,7 +784,7 @@ get_person_stat_old (Pers_no person,
GET_P_STAT(p_orig, person, FAILURE);
GET_C_STAT(pers_c, person, FAILURE);
acc = access_perm (person, pers_c, active_connection);
acc = access_perm(person, pers_c, active_connection, unlimited);
if ( acc == error )
return FAILURE;
......@@ -827,7 +827,7 @@ get_created_texts(Pers_no pers_no,
GET_P_STAT(pers_p, pers_no, FAILURE);
acc = access_perm(pers_no, NULL, active_connection);
acc = access_perm(pers_no, NULL, active_connection, read_protected);
if (acc == error)
return FAILURE;
......@@ -888,7 +888,7 @@ map_created_texts(Pers_no pers_no,
CHK_CONNECTION(FAILURE);
CHK_LOGIN(FAILURE);
acc = access_perm(pers_no, NULL, active_connection);
acc = access_perm(pers_no, NULL, active_connection, read_protected);
if (acc == error)
return FAILURE;
......@@ -1017,7 +1017,7 @@ do_query_read_texts(Pers_no victim,
CHK_CONNECTION(FAILURE);
GET_P_STAT( victim_p, victim, FAILURE);
victim_acc = access_perm(victim, NULL, active_connection);
victim_acc = access_perm(victim, NULL, active_connection, unlimited);
if ( victim_acc <= none )
{
err_stat = victim;
......@@ -1025,7 +1025,7 @@ do_query_read_texts(Pers_no victim,
return FAILURE;
}
if ( access_perm(conf_no, NULL, active_connection) <= none )
if (access_perm(conf_no, NULL, active_connection, read_protected) <= none)
{
err_stat = conf_no;
kom_errno = KOM_UNDEF_CONF;
......@@ -1108,7 +1108,7 @@ set_user_area(Pers_no pers_no,
CHK_LOGIN(FAILURE);
GET_P_STAT(pers_p, pers_no, FAILURE);
acc = access_perm(pers_no, NULL, active_connection);
acc = access_perm(pers_no, NULL, active_connection, unlimited);
if (acc <= none)
{
err_stat = pers_no;
......@@ -1142,7 +1142,7 @@ set_pers_flags(Pers_no pers_no,
GET_P_STAT(pers_p, pers_no, FAILURE);
acc = access_perm(pers_no, NULL, active_connection);
acc = access_perm(pers_no, NULL, active_connection, unlimited);
if (acc <= none)
{
err_stat = pers_no;
......
/*
* $Id: regex-match.c,v 1.25 1999/06/24 12:59:14 ceder Exp $
* $Id: regex-match.c,v 1.26 1999/07/01 21:23:37 ceder Exp $
* Copyright (C) 1992-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -33,7 +33,7 @@
#endif
static const char *
rcsid = "$Id: regex-match.c,v 1.25 1999/06/24 12:59:14 ceder Exp $";
rcsid = "$Id: regex-match.c,v 1.26 1999/07/01 21:23:37 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -127,7 +127,7 @@ lookup_regexp (Connection *conn,
{
type = cached_get_conf_type(conf_no);
if ((type.letter_box ? want_persons : want_confs)
&& fast_access_perm (conf_no, conn) > none )
&& access_perm(conf_no, NULL, conn, read_protected) > none)
{
name = cached_get_name(conf_no);
switch ( re_search (&pat_buf, name.string, s_strlen(name), 0,
......
/*
* $Id: send-async.c,v 0.31 1999/06/03 22:11:12 ceder Exp $
* $Id: send-async.c,v 0.32 1999/07/01 21:23:38 ceder Exp $
* Copyright (C) 1991, 1993-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -34,7 +34,7 @@
#endif
static const char *
rcsid = "$Id: send-async.c,v 0.31 1999/06/03 22:11:12 ceder Exp $";
rcsid = "$Id: send-async.c,v 0.32 1999/07/01 21:23:38 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -203,7 +203,7 @@ async_new_name(Conf_no conf_no,
/* Check that cptr has enough privileges to know
anything about the conference. */
if (cptr->username_valid == TRUE &&
(fast_access_perm(conf_no, cptr) > none ||
(access_perm(conf_no, NULL, cptr, read_protected) > none ||
ENA_C(cptr, admin, 2) || /* OK -- Uses ENA_C */
ENA_C(cptr, wheel, 8))) /* OK -- Uses ENA_C */
{
......
/*
* $Id: text.c,v 0.73 1999/06/28 21:41:08 ceder Exp $
* $Id: text.c,v 0.74 1999/07/01 21:23:38 ceder Exp $
* Copyright (C) 1991-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -34,7 +34,7 @@
#endif
static const char *
rcsid = "$Id: text.c,v 0.73 1999/06/28 21:41:08 ceder Exp $";
rcsid = "$Id: text.c,v 0.74 1999/07/01 21:23:38 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -311,7 +311,7 @@ submit_to(Conf_no conf_no, /* The conference the user is trying to */
for ( i=0; i < param.max_super_conf_loop; i++)
{
acc = access_perm (conf_no, conf_c, active_connection);
acc = access_perm(conf_no, conf_c, active_connection, unlimited);
if ( acc <= none )
{
......@@ -629,7 +629,7 @@ send_async_sub_recipient (Text_no text_no, Text_stat *text_s,
*/
if (cptr->person != NULL
&& is_member_in_recpt(cptr->person, text_s, TRUE) == TRUE
&& fast_access_perm(conf_no, cptr) > none)
&& access_perm(conf_no, NULL, cptr, read_protected) > none)
{
async_sub_recipient(cptr, text_no, conf_no, type);
}
......@@ -1236,8 +1236,8 @@ filter_secret_info(Text_stat *result,
switch( orig->type )
{
case recpt:
if ( (fast_access_perm (orig->datum.recipient, viewer_conn)
<= none )
if ((access_perm(orig->datum.recipient, NULL, viewer_conn,
read_protected) <= none)
&& !ENA_C(viewer_conn, admin, 4))
{
skip_recp ( &orig, original );
......@@ -1250,8 +1250,8 @@ filter_secret_info(Text_stat *result,
break;
case cc_recpt:
if ( (fast_access_perm (orig->datum.cc_recipient, viewer_conn)
<= none)
if ((access_perm(orig->datum.cc_recipient, NULL, viewer_conn,
read_protected) <= none)
&& !ENA_C(viewer_conn, admin, 4))
{
skip_recp ( &orig, original );
......@@ -1273,8 +1273,8 @@ filter_secret_info(Text_stat *result,
*/
if (viewer_p != NULL &&
(fast_access_perm(orig->datum.bcc_recipient,
viewer_conn) >= limited ||
(access_perm(orig->datum.bcc_recipient, NULL, viewer_conn,
limited) >= limited ||
locate_membership(orig->datum.bcc_recipient, viewer_p) ||
ENA_C(viewer_conn, admin, 4) ||
recp_sent_by(orig,
......@@ -2865,7 +2865,7 @@ send_async_add_recipient (Text_no text_no, Text_stat *text_s,
cptr = get_conn_by_number(i);
if (cptr->person != NULL
&& is_member_in_recpt(cptr->person, text_s, TRUE) == TRUE
&& fast_access_perm(conf_no, cptr) > none)
&& access_perm(conf_no, NULL, cptr, read_protected) > none)
{
async_new_recipient(cptr, text_no, conf_no, type);
}
......@@ -2890,7 +2890,8 @@ add_recipient( Text_no text_no,
/* Get the conference */
GET_C_STAT(conf_c, conf_no, FAILURE);
if (access_perm(conf_no, conf_c, active_connection) <= none)
if (access_perm(conf_no, conf_c, active_connection,
read_protected) <= none)
{
err_stat = conf_no;
kom_errno = KOM_UNDEF_CONF;
......@@ -3068,7 +3069,7 @@ sub_recipient( Text_no text_no,
return FAILURE;
}
if (fast_access_perm(conf_no, active_connection) <= none)
if (access_perm(conf_no, NULL, active_connection, read_protected) <= none)
{
err_stat = conf_no;
kom_errno = KOM_UNDEF_CONF;
......@@ -3335,7 +3336,7 @@ get_map(Conf_no conf_no,
CHK_LOGIN(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
acc = access_perm(conf_no, conf_c, active_connection);
acc = access_perm(conf_no, conf_c, active_connection, limited);
if (acc <= none)
{
......@@ -3409,7 +3410,7 @@ local_to_global(Conf_no conf_no,
CHK_LOGIN(FAILURE);
GET_C_STAT(conf_c, conf_no, FAILURE);
acc = access_perm (conf_no, conf_c, active_connection);
acc = access_perm(conf_no, conf_c, active_connection, limited);
if (acc <= none)
{
......
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