DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T a

⟦62361ab76⟧ TextFile

    Length: 2159 (0x86f)
    Types: TextFile
    Names: »acl_info.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« 
        └─⟦de7628f85⟧ 
            └─⟦this⟧ »isode-6.0/quipu/acl_info.c« 

TextFile

/* acl_info.c - ? */

#ifndef lint
static char *rcsid = "$Header: /f/osi/quipu/RCS/acl_info.c,v 7.0 89/11/23 22:16:37 mrose Rel $";
#endif

/*
 * $Header: /f/osi/quipu/RCS/acl_info.c,v 7.0 89/11/23 22:16:37 mrose Rel $
 *
 *
 * $Log:	acl_info.c,v $
 * Revision 7.0  89/11/23  22:16:37  mrose
 * Release 6.0
 * 
 */

/*
 *                                NOTICE
 *
 *    Acquisition, use, and distribution of this module and related
 *    materials are subject to the restrictions of a license agreement.
 *    Consult the Preface in the User's Manual for the full terms of
 *    this agreement.
 *
 */


#include "quipu/util.h"
#include "quipu/entry.h"

extern AV_Sequence super_user;
extern LLog * log_dsap;
extern int dn_print ();

check_acl (who,mode,acl,node)
register DN     who;
register int    mode;
struct acl_info *acl;
DN     node;
{
register struct acl_info *ptr;


	(void) dn_decode (who);
	(void) dn_decode (node);

	for (ptr=acl; ptr!= NULLACL_INFO; ptr=ptr->acl_next) {
		switch (ptr->acl_selector_type) {
		case ACL_ENTRY:
			if ( mode <= ptr->acl_categories ) {
				if (who == NULLDN) {
					break;
				} if (dn_cmp (who,node) == OK)
					return (OK);
				}
			break;
		case ACL_OTHER:
			if ( mode <= ptr->acl_categories )
				return (OK);
			break;
		case ACL_PREFIX:
			if ( mode <= ptr->acl_categories ) {
				if ( who == NULLDN)
					break;
				if (check_dnseq_prefix (ptr->acl_name,who) == OK)
					return (OK);
				}
			break;
		case ACL_GROUP:
			if ( mode <= ptr->acl_categories ) {
				if ( who == NULLDN) {
					break;
				}
				if (check_dnseq (ptr->acl_name,who) == OK)
					return (OK);
				}
			break;
		}
	}

	/* one last try for access */
	if (manager(who))
		return (OK);

	pslog (log_dsap,LLOG_TRACE,"access denied for user ",
	       dn_print,(caddr_t)who);
	LLOG (log_dsap,LLOG_TRACE,("  attempting mode=%d", mode));
	pslog (log_dsap,LLOG_TRACE,"  on entry ",dn_print,(caddr_t)node);

	return (NOTOK);
}


manager (dn)
DN dn;
{
AV_Sequence avs;

	(void) dn_decode (dn);
	for (avs=super_user; avs != NULLAV;  avs=avs->avseq_next)
		if ( dn_cmp (dn,(DN) avs->avseq_av.av_struct) == OK)
			return (TRUE);

	return (FALSE);
}