summaryrefslogtreecommitdiff
path: root/server/access.c
diff options
context:
space:
mode:
authorGravatar John Kohl <jtkohl@mit.edu>1987-07-01 00:16:12 +0000
committerGravatar John Kohl <jtkohl@mit.edu>1987-07-01 00:16:12 +0000
commitc4dd1be5e2bbaad5401ce5d1d89fa47c7ddae9a4 (patch)
tree3c75d078cb3f61acbecd14999c51702e7c29cccc /server/access.c
parent478c419fa7eefc83ef1f92c18ca1d62dd78130c4 (diff)
really write the routine
Diffstat (limited to 'server/access.c')
-rw-r--r--server/access.c24
1 files changed, 19 insertions, 5 deletions
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 <zephyr/mit-copyright.h>
#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 <sys/param.h>
/*
* 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));
}