diff options
author | John Kohl <jtkohl@mit.edu> | 1987-09-28 11:36:22 +0000 |
---|---|---|
committer | John Kohl <jtkohl@mit.edu> | 1987-09-28 11:36:22 +0000 |
commit | 61ab615b2ea5fec494026792e7e5d537de61c837 (patch) | |
tree | 4d5ef03148ff2f2d0908c7b1752a4e562045121b /server/access.c | |
parent | 2e0a0c29619ba1760f51bf695fa8d7a1fcf1d643 (diff) |
modification for new access scheme
Diffstat (limited to 'server/access.c')
-rw-r--r-- | server/access.c | 26 |
1 files changed, 21 insertions, 5 deletions
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 <sys/file.h> */ #include <sys/param.h> /* @@ -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)); } |