From c4dd1be5e2bbaad5401ce5d1d89fa47c7ddae9a4 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Wed, 1 Jul 1987 00:16:12 +0000 Subject: really write the routine --- server/access.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'server/access.c') diff --git a/server/access.c b/server/access.c index ab45146..bedeb75 100644 --- a/server/access.c +++ b/server/access.c @@ -14,28 +14,42 @@ #include #ifndef lint +#ifndef SABER static char rcsid_acl_s_c[] = "$Header$"; +#endif SABER #endif lint /* * * External routines: * - * int access_check(notice, acltype) + * int access_check(notice, acl, accesstype) * ZNotice_t *notice; - * ZAclType acltype; + * ZAcl_t *acl; + * ZAccess_t accesstype; */ #include "zserver.h" +#include /* * check access. return 1 if ok, 0 if not ok. */ int -access_check(notice, acltype) +access_check(notice, acl, accesstype) ZNotice_t *notice; -ZAclType acltype; +ZAcl_t *acl; +ZAccess_t accesstype; { - return(1); + char buf[MAXPATHLEN]; /* holds the real acl name */ + + if (accesstype != TRANSMIT && accesstype != SUBSCRIBE) { + syslog(LOG_ERR, "unknown access type %d", accesstype); + return(0); + } + (void) sprintf(buf, "%s.%s", acl->acl_filename, + (accesstype == TRANSMIT) ? "xmt" : "sub"); + + return(acl_check(buf, notice->z_sender)); } -- cgit v1.2.3