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 c

⟦63b601ca3⟧ TextFile

    Length: 3755 (0xeab)
    Types: TextFile
    Names: »control.c«

Derivation

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

TextFile

/* control.c - */

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

/*
 * $Header: /f/osi/quipu/RCS/control.c,v 7.0 89/11/23 22:16:58 mrose Rel $
 *
 *
 * $Log:	control.c,v $
 * Revision 7.0  89/11/23  22:16:58  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.
 *
 */


/* the routine dsa_control is called when the modifyentry operation
   is performed, with and 'add attribute' request and the attribute type
   is 'control'.  The value decides what to control
   This is strictly non standard, but gives the dua control of the dsa.
*/

#include "quipu/util.h"
#include "quipu/entry.h"
#include "quipu/dsp.h"
#include "quipu/ds_error.h"
#include "tailor.h"

extern LLog * log_dsap;
#ifndef NO_STATS
extern LLog * log_stat;
#endif

dsa_control (as,error,dn)
Attr_Sequence as;
struct DSError *error;
DN dn;
{
char * str;
DN dn2;
Entry theentry;
extern Entry database_root;
SFD attempt_restart();

	if ( ! manager(dn) ) {
		error->dse_type = DSE_SECURITYERROR;
		error->ERR_SECURITY.DSE_sc_problem = DSE_SC_ACCESSRIGHTS;
		return (DS_ERROR_REMOTE);
	}

	str = (char *) as->attr_value->avseq_av.av_struct;

#ifndef NO_STATS
	LLOG (log_stat,LLOG_NOTICE,("DSA control: %s",str));
#endif

	switch (*str) {
	case 'd':	/* -dump <directory> */
		str = SkipSpace (++str);
/* 
		directory_dump (str, database_root);
*/
		return (DS_OK);
	case 't':	/* -tailor <string> */
		str = SkipSpace (++str);
		if (dsa_tai_string (str) == OK) {
			isodexport ();
			return (DS_OK);
		}
		break;
	case 'a':	/* -abort */
		LLOG (log_dsap,LLOG_FATAL,("*** abort signal ***"));
		stop_listeners();
		exit(0);
	case 'b':	/* -restart */
		LLOG (log_dsap,LLOG_FATAL,("*** restart signal ***"));
		attempt_restart (NOTOK);
		exit(0);		/* should not be reached */
	case 'r':	/* -refresh <entry> */
		str = SkipSpace (++str);
		if (lexequ (str,"root") == 0)
		    dn2= NULLDN;
		else
		    if ((dn2 = str2dn (str)) == NULLDN)
			break;

		if (refresh_from_disk (dn2) == OK)
			return (DS_OK);
		break;
	case 'f':	/* -resync <entry> */
		str = SkipSpace (++str);
		if (lexequ (str,"root") == 0)
		    dn2= NULLDN;
		else
		    if ((dn2 = str2dn (str)) == NULLDN)
			break;

		if ((theentry = local_find_entry (dn2,FALSE)) != NULLENTRY)
			if (journal (theentry->e_child) == OK)
				return (DS_OK);
		break;
	case 'l':	/* -lock <entry> */
		str = SkipSpace (++str);
		if (lexequ (str,"root") == 0)
			dn2 = NULLDN;
		else if ((dn2 = str2dn (str)) == NULLDN)
			break;

		if ((theentry = local_find_entry (dn2,FALSE)) != NULLENTRY) {
			theentry->e_lock = TRUE;
			return (DS_OK);
		}
		break;
	case 'u':	/* -unlock <entry> */
		str = SkipSpace (++str);
		if (lexequ (str,"root") == 0)
			dn2 = NULLDN;
		else if ((dn2 = str2dn (str)) == NULLDN)
			break;

		if ((theentry = local_find_entry (dn2,FALSE)) != NULLENTRY) {
			theentry->e_lock = FALSE;
			return (DS_OK);
		}
		break;
	case 's':	/* -slave */
		/*
		 * When we go async return of OK will mean that a getedb
		 * operation has been scheduled, NOT that it has succeeded.
		 */
		str = SkipSpace (++str);
		if (*str == NULL) {
		    slave_update();
		    return DS_OK;
		}

		if (lexequ (str, "root") == 0)
			dn2 = NULLDN;
		else if ((dn2 = str2dn (str)) == NULLDN)
			break;

		if (update_aux (dn2, dn2 == NULLDN) == OK)
			return DS_OK;
		break;
	default:
		break;
	}

	error->dse_type = DSE_SERVICEERROR;
	error->ERR_SERVICE.DSE_sv_problem = DSE_SV_UNWILLINGTOPERFORM;
	return (DS_ERROR_REMOTE);
}