From 61ab615b2ea5fec494026792e7e5d537de61c837 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Mon, 28 Sep 1987 11:36:22 +0000 Subject: modification for new access scheme --- server/access.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'server/access.c') diff --git a/server/access.c b/server/access.c index 34e310f..9b126a4 100644 --- a/server/access.c +++ b/server/access.c @@ -36,7 +36,7 @@ static char rcsid_acl_s_c[] = "$Header$"; * routines and the support needed by the Zephyr server. */ -#include "zserver.h" +#include "zserver.h" /* includes */ #include /* @@ -50,15 +50,31 @@ ZAcl_t *acl; ZAccess_t accesstype; { char buf[MAXPATHLEN]; /* holds the real acl name */ + char *prefix; - if (accesstype != TRANSMIT && accesstype != SUBSCRIBE) { - syslog(LOG_ERR, "unknown access type %d", accesstype); + switch (accesstype) { + case TRANSMIT: + prefix = "xmt"; + break; + case SUBSCRIBE: + prefix = "sub"; + break; + case INSTWILD: + prefix = "iws"; + break; + case INSTUID: + prefix = "iui"; + break; + default: + syslog(LOG_ERR, "unknown access type %d", (int) accesstype); return(0); } (void) sprintf(buf, "%s%s-%s", ZEPHYR_ACL_DIR, - (accesstype == TRANSMIT) ? "xmt" : "sub", + prefix, acl->acl_filename); - + if (access(buf, F_OK)) /* no acl ==> no restriction + ==> thumbs up */ + return(1); return(acl_check(buf, notice->z_sender)); } -- cgit v1.2.3