Beispiel #1
0
int
vernum_initialize(void)
{
	int code, i;

	for ( i = 0; as[ i ].desc != NULL; i++ ) {
		code = register_at( as[ i ].desc, as[ i ].adp, 0 );
		if ( code ) {
			Debug( LDAP_DEBUG_ANY,
				"vernum_initialize: register_at #%d failed\n",
				i, 0, 0 );
			return code;
		}

		/* Allow Manager to set these as needed */
		if ( is_at_no_user_mod( (*as[ i ].adp)->ad_type ) ) {
			(*as[ i ].adp)->ad_type->sat_flags |=
				SLAP_AT_MANAGEABLE;
		}
	}

	vernum.on_bi.bi_type = "vernum";

	vernum.on_bi.bi_op_add = vernum_op_add;
	vernum.on_bi.bi_op_modify = vernum_op_modify;

	vernum.on_bi.bi_db_init = vernum_db_init;
	vernum.on_bi.bi_db_open = vernum_db_open;
	vernum.on_bi.bi_db_destroy = vernum_db_destroy;

	return overlay_register( &vernum );
}
Beispiel #2
0
int
pguid_initialize(void)
{
	int code, i;

	for ( i = 0; as[ i ].desc != NULL; i++ ) {
		code = register_at( as[ i ].desc, as[ i ].adp, 0 );
		if ( code ) {
			Debug( LDAP_DEBUG_ANY,
				"pguid_initialize: register_at #%d failed\n",
				i, 0, 0 );
			return code;
		}

		/* Allow Manager to set these as needed */
		if ( is_at_no_user_mod( (*as[ i ].adp)->ad_type ) ) {
			(*as[ i ].adp)->ad_type->sat_flags |=
				SLAP_AT_MANAGEABLE;
		}
	}

	pguid.on_bi.bi_type = "pguid";

	pguid.on_bi.bi_op_add = pguid_op_add;
	pguid.on_bi.bi_op_modrdn = pguid_op_rename;

	pguid.on_bi.bi_db_init = pguid_db_init;
	pguid.on_bi.bi_db_open = pguid_db_open;

	return overlay_register( &pguid );
}
Beispiel #3
0
/*
 * No-user-modification constraint checking.
 */
int
slap_mods_no_user_mod_check(
	Operation *op,
	Modifications *ml,
	const char **text,
	char *textbuf,
	size_t textlen )
{
	for ( ; ml != NULL; ml = ml->sml_next ) {
		if ( !is_at_no_user_mod( ml->sml_desc->ad_type ) ) {
			continue;
		}

		if ( ml->sml_flags & SLAP_MOD_INTERNAL ) {
			continue;
		}

		if ( get_relax( op ) ) {
			if ( ml->sml_desc->ad_type->sat_flags & SLAP_AT_MANAGEABLE ) {
				ml->sml_flags |= SLAP_MOD_MANAGING;
				continue;
			}

			/* attribute not manageable */
			snprintf( textbuf, textlen,
				"%s: no-user-modification attribute not manageable",
				ml->sml_type.bv_val );

		} else {
			/* user modification disallowed */
			snprintf( textbuf, textlen,
				"%s: no user modification allowed",
				ml->sml_type.bv_val );
		}

		*text = textbuf;
		return LDAP_CONSTRAINT_VIOLATION;
	}

	return LDAP_SUCCESS;
}
Beispiel #4
0
int
rdnval_initialize(void)
{
	int code, i;

	for ( i = 0; as[ i ].desc != NULL; i++ ) {
		code = register_at( as[ i ].desc, as[ i ].adp, 0 );
		if ( code ) {
			Debug( LDAP_DEBUG_ANY,
				"rdnval_initialize: register_at #%d failed\n",
				i, 0, 0 );
			return code;
		}

		/* Allow Manager to set these as needed */
		if ( is_at_no_user_mod( (*as[ i ].adp)->ad_type ) ) {
			(*as[ i ].adp)->ad_type->sat_flags |=
				SLAP_AT_MANAGEABLE;
		}
	}

	syn_IA5String = syn_find( "1.3.6.1.4.1.1466.115.121.1.26" );
	if ( syn_IA5String == NULL ) {
		Debug( LDAP_DEBUG_ANY,
			"rdnval_initialize: unable to find syntax '1.3.6.1.4.1.1466.115.121.1.26' (IA5String)\n",
			0, 0, 0 );
		return LDAP_OTHER;
	}

	rdnval.on_bi.bi_type = "rdnval";

	rdnval.on_bi.bi_op_add = rdnval_op_add;
	rdnval.on_bi.bi_op_modrdn = rdnval_op_rename;

	rdnval.on_bi.bi_db_init = rdnval_db_init;
	rdnval.on_bi.bi_db_open = rdnval_db_open;

	return overlay_register( &rdnval );
}