Пример #1
0
static int
vc_initialize( void )
{
	int rc;

	rc = load_extop2( (struct berval *)&vc_exop_oid_bv,
		SLAP_EXOP_HIDE, vc_exop, 0 );
	if ( rc != LDAP_SUCCESS ) {
		Debug( LDAP_DEBUG_ANY,
			"vc_initialize: unable to register VerifyCredentials exop: %d.\n",
			rc, 0, 0 );
	}

	ldap_pvt_thread_mutex_init( &vc_mutex );

	return rc;
}
Пример #2
0
static
#endif /* SLAPD_OVER_DDS == SLAPD_MOD_DYNAMIC */
int
dds_initialize()
{
	int		rc = 0;
	int		i, code;

	/* Make sure we don't exceed the bits reserved for userland */
	config_check_userland( DDS_LAST );

	if ( !do_not_load_schema ) {
		static struct {
			char			*desc;
			slap_mask_t		flags;
			AttributeDescription	**ad;
		}		s_at[] = {
			{ "( 1.3.6.1.4.1.4203.666.1.57 "
				"NAME ( 'entryExpireTimestamp' ) "
				"DESC 'RFC2589 OpenLDAP extension: expire time of a dynamic object, "
					"computed as now + entryTtl' "
				"EQUALITY generalizedTimeMatch "
				"ORDERING generalizedTimeOrderingMatch "
				"SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 "
				"SINGLE-VALUE "
				"NO-USER-MODIFICATION "
				"USAGE dSAOperation )",
				SLAP_AT_HIDE,
				&ad_entryExpireTimestamp },
			{ NULL }
		};

		for ( i = 0; s_at[ i ].desc != NULL; i++ ) {
			code = register_at( s_at[ i ].desc, s_at[ i ].ad, 0 );
			if ( code ) {
				Debug( LDAP_DEBUG_ANY,
					"dds_initialize: register_at failed\n" );
				return code;
			}
			(*s_at[ i ].ad)->ad_type->sat_flags |= SLAP_AT_HIDE;
		}
	}

	if ( !do_not_load_exop ) {
		rc = load_extop2( (struct berval *)&slap_EXOP_REFRESH,
			SLAP_EXOP_WRITES|SLAP_EXOP_HIDE, slap_exop_refresh,
			!do_not_replace_exop );
		if ( rc != LDAP_SUCCESS ) {
			Log1( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR,
				"DDS unable to register refresh exop: %d.\n",
				rc );
			return rc;
		}
	}

	dds.on_bi.bi_type = "dds";

	dds.on_bi.bi_db_init = dds_db_init;
	dds.on_bi.bi_db_open = dds_db_open;
	dds.on_bi.bi_db_close = dds_db_close;
	dds.on_bi.bi_db_destroy = dds_db_destroy;

	dds.on_bi.bi_op_add = dds_op_add;
	dds.on_bi.bi_op_delete = dds_op_delete;
	dds.on_bi.bi_op_modify = dds_op_modify;
	dds.on_bi.bi_op_modrdn = dds_op_rename;
	dds.on_bi.bi_extended = dds_op_extended;

	dds.on_bi.bi_cf_ocs = dds_ocs;

	rc = config_register_schema( dds_cfg, dds_ocs );
	if ( rc ) {
		return rc;
	}

	return overlay_register( &dds );
}