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 d

⟦51d715502⟧ TextFile

    Length: 2576 (0xa10)
    Types: TextFile
    Names: »ds_read.c«

Derivation

└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
    └─⟦eba4602b1⟧ »./isode-5.0.tar.Z« 
        └─⟦d3ac74d73⟧ 
            └─⟦this⟧ »isode-5.0/quipu/ds_read.c« 

TextFile

/* ds_read.c - */

#ifndef lint
static char *rcsid = "$Header: /f/osi/quipu/RCS/ds_read.c,v 6.0 89/03/18 23:41:22 mrose Rel $";
#endif

/*
 * $Header: /f/osi/quipu/RCS/ds_read.c,v 6.0 89/03/18 23:41:22 mrose Rel $
 *
 *
 * $Log:	ds_read.c,v $
 * Revision 6.0  89/03/18  23:41:22  mrose
 * Release 5.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"
#include "quipu/read.h"

extern LLog * log_dsap;

#ifndef NO_STATS
extern LLog * log_stat;
extern int dn_print ();
#endif

Attr_Sequence eis_select ();

do_ds_read (arg, error, result, binddn, target)
    struct ds_read_arg          *arg;
    struct ds_read_result       *result;
    struct DSError              *error;
    DN                          binddn;
    DN                          target;
{
Entry  entryptr;

	DLOG (log_dsap,LLOG_TRACE,("ds_read"));

	if (target == NULLDN)
		target = arg->rda_object;

#ifndef NO_STATS
	dn_decode (target);
	pslog (log_stat,LLOG_NOTICE,"read",dn_print,(caddr_t)target);
#endif

	if ((entryptr = find_entry (target,&arg->rda_common,error,binddn)) != NULLENTRY) {
		if (entryptr->e_parent == NULLENTRY) {
			/* can't read from the root */
			error->dse_type = DSE_NAMEERROR;
			error->ERR_NAME.DSE_na_problem = DSE_NA_NOSUCHOBJECT;
			error->ERR_NAME.DSE_na_matched = NULLDN;
			return (DS_ERROR_REMOTE);
		}
		/* entry has got a full list of attributes,  eventually
		   select one required */
		if (check_acl (binddn,ACL_READ,entryptr->e_acl->ac_default, target) == NOTOK) {
			error->dse_type = DSE_SECURITYERROR;
			error->ERR_SECURITY.DSE_sc_problem = DSE_SC_ACCESSRIGHTS;
			return (DS_ERROR_REMOTE);
		}

		result->rdr_entry.ent_dn = get_copy_dn (entryptr);
		result->rdr_entry.ent_attr = eis_select (arg->rda_eis,entryptr,binddn);
		result->rdr_entry.ent_iscopy = entryptr->e_data;
		result->rdr_entry.ent_age = (time_t) 0;
		result->rdr_entry.ent_next = NULLENTRYINFO;
		result->rdr_common.cr_requestor = NULLDN;
		/* if no error and NOT SVC_OPT_DONTDEREFERENCEALIASES then */
		/* the alias will have been derefeferenced -signified by   */
		/* NO_ERROR !!! */
		result->rdr_common.cr_aliasdereferenced = (error->dse_type == DSE_NOERROR) ? FALSE : TRUE;
		return (DS_OK);

	} else if (error->dse_type == DSE_REFERRAL)
		return (DS_ERROR_CONNECT);

	return (DS_ERROR_REMOTE);
}