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

⟦d55722b89⟧ TextFile

    Length: 3918 (0xf4e)
    Types: TextFile
    Names: »ds_bind.c«

Derivation

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

TextFile

/* ds_bind.c - */

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

/*
 * $Header: /f/osi/quipu/RCS/ds_bind.c,v 6.0 89/03/18 23:41:15 mrose Rel $
 *
 *
 * $Log:	ds_bind.c,v $
 * Revision 6.0  89/03/18  23:41:15  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/commonarg.h"
#include "quipu/bind.h"
#include "quipu/compare.h"
#include "quipu/dua.h"
#include "quipu/connection.h"

extern LLog * log_dsap;
extern DN	mydsadn;
struct activity	* task_alloc();

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

do_ds_bind (arg, error, result, tk, dsp)
    struct ds_bind_arg          *arg;
    struct ds_bind_arg          *result;
    struct ds_bind_error        *error;
    struct activity		**tk;
    char			  dsp;
{
Attr_Sequence as;
Entry  entryptr;
extern AttributeType at_password;
struct ds_compare_arg	*cma;
static struct common_args	ca_def = default_common_args;

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

#ifndef NO_STATS
	dn_decode (arg->dba_dn);
	pslog (log_stat,LLOG_NOTICE,"bind",dn_print,(caddr_t)arg->dba_dn);
#endif

	if (arg->dba_version != DBA_VERSION_V1988) {
		error->dbe_version = DBA_VERSION_V1988;
		error->dbe_type = DBE_TYPE_SERVICE;
		error->dbe_value = DSE_SV_UNAVAILABLE;
		return (DS_ERROR_CONNECT);
	}

	if ((dsp == TRUE) || (arg->dba_dn == NULLDN)) {
		make_dsa_bind_arg(result);
		return (DS_OK);
	}

	(*tk) = task_alloc();
	if ((entryptr = really_find_entry (arg->dba_dn,
	     &((*tk)->act_resp.resp_err),TRUE)) == NULLENTRY) {

	    if((*tk)->act_resp.resp_err.dse_type != DSE_REFERRAL)
	    {
		act_free((*tk));
		(*tk) = NULLACTIVITY;
		error->dbe_version = DBA_VERSION_V1988;
		error->dbe_type = DBE_TYPE_SECURITY;
		error->dbe_value = DSE_SC_AUTHENTICATION;
		return (DS_ERROR_CONNECT);
	    }

/*
		Generate compare op in a task block for the connection
		from the DUA , which will then be used as the basis
		for a DSP compare.
*/

		(*tk)->act_class = ACTIVITY_DSA_WORK;
		(*tk)->act_type = ACT_TYPE_CHN;

		(*tk)->act_req.dca_dsarg.arg_type = OP_COMPARE;
		cma = &((*tk)->act_req.dca_dsarg.arg_cm);

		cma->cma_common = ca_def;

		cma->cma_common.ca_requestor = dn_cpy(arg->dba_dn);
		cma->cma_object = dn_cpy(arg->dba_dn);

		cma->cma_purported.ava_type = AttrT_cpy (at_password);
		cma->cma_purported.ava_value = str2AttrV (arg->dba_passwd,AV_CASEEXACTSTRING);

		return(DS_CONTINUE);
	}

	act_free((*tk));
	(*tk) = NULLACTIVITY;

	if ((as = as_find_type (entryptr->e_attributes,at_password)) == NULLATTR) {
		if ( arg->dba_passwd_len == 0 ) {
			make_dsa_bind_arg(result);
			return (DS_OK);
		}
		/* no password -> can't verify !!! */
		error->dbe_version = DBA_VERSION_V1988;
		error->dbe_type = DBE_TYPE_SECURITY;
		error->dbe_value = DSE_SC_AUTHENTICATION;
		return (DS_ERROR_CONNECT);
	}


	if (arg->dba_passwd_len != 0 )
	   if (lexequ (as->attr_value->avseq_av->av_un.av_str, arg->dba_passwd) == 0) {
		make_dsa_bind_arg(result);
		return (DS_OK);
	   }

	error->dbe_version = DBA_VERSION_V1988;
	error->dbe_type  = DBE_TYPE_SECURITY;
	error->dbe_value = DSE_SC_AUTHENTICATION;
	return (DS_ERROR_CONNECT);
}


do_ds_unbind (conn)
register        struct connection       * conn;
{
#ifndef NO_STATS
	if(conn->cn_initiator == INITIATED_BY_THIS)
	{
	    dn_decode (conn->cn_what);
	    pslog (log_stat,LLOG_NOTICE,"unbind (by this)",dn_print,(caddr_t)conn->cn_what);
	}
	else
	{
	    dn_decode (conn->cn_who);
	    pslog (log_stat,LLOG_NOTICE,"unbind (by that)",dn_print,(caddr_t)conn->cn_who);
	}
#endif
	DLOG (log_dsap,LLOG_TRACE,("ds_un_bind"));
}