Commit 80327de8 authored by Per Cederqvist's avatar Per Cederqvist

(plain_ol_fast_access_perm): Assert that viewer_conn is never NULL.

(access_perm): Log a warning if called with an unexpected
	wanted_access argument.
parent 8b85a490
/*
* $Id: membership.c,v 0.51 1999/07/01 21:24:31 ceder Exp $
* $Id: membership.c,v 0.52 1999/07/04 13:10:49 ceder Exp $
* Copyright (C) 1991-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -38,7 +38,7 @@
#define DEBUG_MARK_AS_READ
static const char *
rcsid = "$Id: membership.c,v 0.51 1999/07/01 21:24:31 ceder Exp $";
rcsid = "$Id: membership.c,v 0.52 1999/07/04 13:10:49 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -780,6 +780,7 @@ fast_access_perm(Conf_no victim,
if (viewer_conn == NULL)
{
assert(0);
kom_errno = KOM_LOGIN;
err_stat = 0;
return error;
......@@ -828,6 +829,21 @@ access_perm(Conf_no victim,
{
Access result;
if (wanted_access != read_protected
|| wanted_access != limited
|| wanted_access != unlimited)
{
static int ctr = 0;
if (ctr < 10)
{
kom_log("WNG: access_perm called with wanted_access=%d\n",
(int)wanted_access);
ctr++;
if (ctr == 10)
kom_log("WNG: won't log the above warning any more.\n");
}
}
/* FIXME: implement something faster than this! This is just a quick
implementation to check if all edits outside this function are
performed correctly. */
......
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