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

⟦31b0db51c⟧ TextFile

    Length: 2847 (0xb1f)
    Types: TextFile
    Names: »control.c«

Derivation

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

TextFile

/* control.c - */

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

/*
 * $Header: /f/osi/quipu/RCS/control.c,v 6.0 89/03/18 23:41:11 mrose Rel $
 *
 *
 * $Log:	control.c,v $
 * Revision 6.0  89/03/18  23:41:11  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.
 *
 */


/* 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;
extern DN super_user;
DN dn2;
Entry theentry;

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

	str = as->attr_value->avseq_av->av_un.av_str;

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

	switch (*str) {
	case 'd':
		str = SkipSpace (++str);
		directory_dump (str, NULLENTRY, EDBOUT,'w');
		return (DS_OK);
	case 't':
		str = SkipSpace (++str);
		if (dsa_tai_string (str) == OK) {
			isodexport ();
			return (DS_OK);
		}
		break;
	case 'a':
		LLOG (log_dsap,LLOG_FATAL,("*** abort signal ***"));
		stop_listeners();
		exit(0);
	case 'r':
		str = SkipSpace (++str);
		if (refresh_from_disk (str) == OK)
			return (DS_OK);
		break;
	case 'f':
		str = SkipSpace (++str);
		dn2 = str2dn (str);

		if ((theentry = local_find_entry (dn2,FALSE)) != NULLENTRY)
			if (journal (theentry->e_child) == OK)
				return (DS_OK);

	case 'l':
		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':
		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_update();
		return (DS_OK);
	default:
		break;
	}

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