1 /* schema_init.c - init builtin schema */
4 * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
13 #include <ac/string.h>
14 #include <ac/socket.h>
24 /* any value allowed */
35 unsigned char *u = in->bv_val;
37 for( count = in->bv_len; count > 0; count+=len, u+=len ) {
38 /* get the length indicated by the first byte */
39 len = LDAP_UTF8_CHARLEN( u );
41 /* should not be zero */
42 if( len == 0 ) return -1;
44 /* make sure len corresponds with the offset
45 to the next character */
46 if( LDAP_UTF8_OFFSET( u ) != len ) return -1;
49 if( count != 0 ) return -1;
60 struct berval **normalized )
62 struct berval *newval;
65 newval = ch_malloc( sizeof( struct berval ) );
69 /* Ignore initial whitespace */
70 while ( ldap_utf8_isspace( p ) ) {
79 newval->bv_val = ch_strdup( p );
80 p = q = newval->bv_val;
86 if ( ldap_utf8_isspace( p ) ) {
87 len = LDAP_UTF8_COPY(q,p);
92 /* Ignore the extra whitespace */
93 while ( ldap_utf8_isspace( p ) ) {
97 len = LDAP_UTF8_COPY(q,p);
104 assert( *newval->bv_val );
105 assert( newval->bv_val < p );
108 /* cannot start with a space */
109 assert( !ldap_utf8_isspace(newval->bv_val) );
112 * If the string ended in space, backup the pointer one
113 * position. One is enough because the above loop collapsed
114 * all whitespace to a single space.
121 /* cannot end with a space */
122 assert( !ldap_utf8_isspace( LDAP_UTF8_PREV(q) ) );
127 newval->bv_len = q - newval->bv_val;
128 normalized = &newval;
140 for(i=0; i < val->bv_len; i++) {
141 if( !isascii(val->bv_val[i]) ) return -1;
151 struct berval **out )
154 struct berval *bv = ch_malloc( sizeof(struct berval) );
155 bv->bv_len = (in->bv_len+1) * sizeof( ldap_unicode_t );
156 bv->bv_val = ch_malloc( bv->bv_len );
158 for(i=0; i < in->bv_len; i++ ) {
160 * IA5StringValidate should have been called to ensure
161 * input is limited to IA5.
163 bv->bv_val[i] = in->bv_val[i];
176 struct berval **normalized )
178 struct berval *newval;
181 newval = ch_malloc( sizeof( struct berval ) );
185 /* Ignore initial whitespace */
186 while ( isspace( *p++ ) ) {
195 newval->bv_val = ch_strdup( p );
196 p = q = newval->bv_val;
199 if ( isspace( *p ) ) {
202 /* Ignore the extra whitespace */
203 while ( isspace( *p++ ) ) {
211 assert( *newval->bv_val );
212 assert( newval->bv_val < p );
215 /* cannot start with a space */
216 assert( !isspace(*newval->bv_val) );
219 * If the string ended in space, backup the pointer one
220 * position. One is enough because the above loop collapsed
221 * all whitespace to a single space.
224 if ( isspace( q[-1] ) ) {
228 /* cannot end with a space */
229 assert( !isspace( q[-1] ) );
234 newval->bv_len = q - newval->bv_val;
235 normalized = &newval;
245 struct berval *value,
246 void *assertedValue )
248 return strcmp( value->bv_val,
249 ((struct berval *) assertedValue)->bv_val );
257 struct berval *value,
258 void *assertedValue )
260 return strcasecmp( value->bv_val,
261 ((struct berval *) assertedValue)->bv_val );
264 struct syntax_defs_rec {
267 slap_syntax_validate_func *sd_validate;
268 slap_syntax_transform_func *sd_ber2str;
269 slap_syntax_transform_func *sd_str2ber;
272 struct syntax_defs_rec syntax_defs[] = {
273 {"( 1.3.6.1.4.1.1466.115.121.1.3 DESC 'AttributeTypeDescription' )",
274 0, NULL, NULL, NULL},
275 {"( 1.3.6.1.4.1.1466.115.121.1.4 DESC 'Audio' )",
276 0, NULL, NULL, NULL},
277 {"( 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' )",
280 {"( 1.3.6.1.4.1.1466.115.121.1.6 DESC 'BitString' )",
281 0, NULL, NULL, NULL},
282 {"( 1.3.6.1.4.1.1466.115.121.1.7 DESC 'Boolean' )",
283 0, NULL, NULL, NULL},
284 {"( 1.3.6.1.4.1.1466.115.121.1.8 DESC 'Certificate' )",
287 {"( 1.3.6.1.4.1.1466.115.121.1.9 DESC 'CertificateList' )",
290 {"( 1.3.6.1.4.1.1466.115.121.1.10 DESC 'CertificatePair' )",
293 {"( 1.3.6.1.4.1.1466.115.121.1.12 DESC 'DN' )",
294 0, NULL, NULL, NULL},
295 {"( 1.3.6.1.4.1.1466.115.121.1.13 DESC 'DataQuality' )",
296 0, NULL, NULL, NULL},
297 {"( 1.3.6.1.4.1.1466.115.121.1.14 DESC 'DeliveryMethod' )",
298 0, NULL, NULL, NULL},
299 {"( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'DirectoryString' )",
300 0, UTF8StringValidate, NULL, NULL},
301 {"( 1.3.6.1.4.1.1466.115.121.1.16 DESC 'DITContentRuleDescription' )",
302 0, NULL, NULL, NULL},
303 {"( 1.3.6.1.4.1.1466.115.121.1.17 DESC 'DITStructureRuleDescription' )",
304 0, NULL, NULL, NULL},
305 {"( 1.3.6.1.4.1.1466.115.121.1.19 DESC 'DSAQuality' )",
306 0, NULL, NULL, NULL},
307 {"( 1.3.6.1.4.1.1466.115.121.1.21 DESC 'EnhancedGuide' )",
308 0, NULL, NULL, NULL},
309 {"( 1.3.6.1.4.1.1466.115.121.1.22 DESC 'FacsimileTelephoneNumber' )",
310 0, NULL, NULL, NULL},
311 {"( 1.3.6.1.4.1.1466.115.121.1.23 DESC 'Fax' )",
312 0, NULL, NULL, NULL},
313 {"( 1.3.6.1.4.1.1466.115.121.1.24 DESC 'GeneralizedTime' )",
314 0, NULL, NULL, NULL},
315 {"( 1.3.6.1.4.1.1466.115.121.1.25 DESC 'Guide' )",
316 0, NULL, NULL, NULL},
317 {"( 1.3.6.1.4.1.1466.115.121.1.26 DESC 'IA5String' )",
318 0, IA5StringValidate, NULL, NULL},
319 {"( 1.3.6.1.4.1.1466.115.121.1.27 DESC 'Integer' )",
320 0, NULL, NULL, NULL},
321 {"( 1.3.6.1.4.1.1466.115.121.1.28 DESC 'JPEG' )",
322 0, NULL, NULL, NULL},
323 {"( 1.3.6.1.4.1.1466.115.121.1.30 DESC 'MatchingRuleDescription' )",
324 0, NULL, NULL, NULL},
325 {"( 1.3.6.1.4.1.1466.115.121.1.31 DESC 'MatchingRuleUseDescription' )",
326 0, NULL, NULL, NULL},
327 {"( 1.3.6.1.4.1.1466.115.121.1.32 DESC 'MailPreference' )",
328 0, NULL, NULL, NULL},
329 {"( 1.3.6.1.4.1.1466.115.121.1.34 DESC 'NameAndOptionalUID' )",
330 0, NULL, NULL, NULL},
331 {"( 1.3.6.1.4.1.1466.115.121.1.35 DESC 'NameFormDescription' )",
332 0, NULL, NULL, NULL},
333 {"( 1.3.6.1.4.1.1466.115.121.1.36 DESC 'NumericString' )",
334 0, NULL, NULL, NULL},
335 {"( 1.3.6.1.4.1.1466.115.121.1.37 DESC 'ObjectClassDescription' )",
336 0, NULL, NULL, NULL},
337 {"( 1.3.6.1.4.1.1466.115.121.1.38 DESC 'OID' )",
338 0, NULL, NULL, NULL},
339 {"( 1.3.6.1.4.1.1466.115.121.1.39 DESC 'OtherMailbox' )",
340 0, NULL, NULL, NULL},
341 {"( 1.3.6.1.4.1.1466.115.121.1.40 DESC 'OctetString' )",
342 0, octetStringValidate, NULL, NULL},
343 {"( 1.3.6.1.4.1.1466.115.121.1.41 DESC 'PostalAddress' )",
344 0, NULL, NULL, NULL},
345 {"( 1.3.6.1.4.1.1466.115.121.1.42 DESC 'ProtocolInformation' )",
346 0, NULL, NULL, NULL},
347 {"( 1.3.6.1.4.1.1466.115.121.1.43 DESC 'PresentationAddress' )",
348 0, NULL, NULL, NULL},
349 {"( 1.3.6.1.4.1.1466.115.121.1.44 DESC 'PrintableString' )",
350 0, NULL, NULL, NULL},
351 {"( 1.3.6.1.4.1.1466.115.121.1.49 DESC 'SupportedAlgorithm' )",
352 SLAP_SYNTAX_BINARY, NULL, NULL, NULL},
353 {"( 1.3.6.1.4.1.1466.115.121.1.50 DESC 'TelephoneNumber' )",
354 0, NULL, NULL, NULL},
355 {"( 1.3.6.1.4.1.1466.115.121.1.51 DESC 'TeletexTerminalIdentifier' )",
356 0, NULL, NULL, NULL},
357 {"( 1.3.6.1.4.1.1466.115.121.1.52 DESC 'TelexNumber' )",
358 0, NULL, NULL, NULL},
359 {"( 1.3.6.1.4.1.1466.115.121.1.53 DESC 'UTCTime' )",
360 0, NULL, NULL, NULL},
361 {"( 1.3.6.1.4.1.1466.115.121.1.54 DESC 'LDAPSyntaxDescription' )",
362 0, NULL, NULL, NULL},
363 {"( 1.3.6.1.4.1.1466.115.121.1.58 DESC 'SubstringAssertion' )",
364 0, NULL, NULL, NULL},
366 /* OpenLDAP Experimental Syntaxes */
367 {"( " SLAPD_OID_ACI_SYNTAX " DESC 'OpenLDAPexperimentalACI' )",
368 0, NULL, NULL, NULL},
370 {NULL, 0, NULL, NULL, NULL}
373 struct mrule_defs_rec {
376 slap_mr_convert_func * mrd_convert;
377 slap_mr_normalize_func * mrd_normalize;
378 slap_mr_match_func * mrd_match;
379 slap_mr_indexer_func * mrd_indexer;
380 slap_mr_filter_func * mrd_filter;
384 * Other matching rules in X.520 that we do not use:
386 * 2.5.13.9 numericStringOrderingMatch
387 * 2.5.13.13 booleanMatch
388 * 2.5.13.15 integerOrderingMatch
389 * 2.5.13.18 octetStringOrderingMatch
390 * 2.5.13.19 octetStringSubstringsMatch
391 * 2.5.13.25 uTCTimeMatch
392 * 2.5.13.26 uTCTimeOrderingMatch
393 * 2.5.13.31 directoryStringFirstComponentMatch
394 * 2.5.13.32 wordMatch
395 * 2.5.13.33 keywordMatch
396 * 2.5.13.34 certificateExactMatch
397 * 2.5.13.35 certificateMatch
398 * 2.5.13.36 certificatePairExactMatch
399 * 2.5.13.37 certificatePairMatch
400 * 2.5.13.38 certificateListExactMatch
401 * 2.5.13.39 certificateListMatch
402 * 2.5.13.40 algorithmIdentifierMatch
403 * 2.5.13.41 storedPrefixMatch
404 * 2.5.13.42 attributeCertificateMatch
405 * 2.5.13.43 readerAndKeyIDMatch
406 * 2.5.13.44 attributeIntegrityMatch
409 /* recycled matching functions */
410 #define caseIgnoreMatch caseIgnoreIA5Match
411 #define caseExactMatch caseExactIA5Match
413 /* unimplemented matching functions */
414 #define objectIdentifierMatch NULL
415 #define distinguishedNameMatch NULL
416 #define caseIgnoreOrderingMatch NULL
417 #define caseIgnoreSubstringsMatch NULL
418 #define caseExactOrderingMatch NULL
419 #define caseExactSubstringsMatch NULL
420 #define numericStringMatch NULL
421 #define numericStringSubstringsMatch NULL
422 #define caseIgnoreListMatch NULL
423 #define caseIgnoreListSubstringsMatch NULL
424 #define integerMatch NULL
425 #define bitStringMatch NULL
426 #define octetStringMatch NULL
427 #define telephoneNumberMatch NULL
428 #define telephoneNumberSubstringsMatch NULL
429 #define presentationAddressMatch NULL
430 #define uniqueMemberMatch NULL
431 #define protocolInformationMatch NULL
432 #define generalizedTimeMatch NULL
433 #define generalizedTimeOrderingMatch NULL
434 #define integerFirstComponentMatch NULL
435 #define objectIdentifierFirstComponentMatch NULL
436 #define caseIgnoreIA5SubstringsMatch NULL
438 struct mrule_defs_rec mrule_defs[] = {
439 {"( 2.5.13.0 NAME 'objectIdentifierMatch' "
440 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )",
441 SLAP_MR_EQUALITY | SLAP_MR_EXT,
442 NULL, NULL, objectIdentifierMatch, NULL, NULL},
444 {"( 2.5.13.1 NAME 'distinguishedNameMatch' "
445 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )",
446 SLAP_MR_EQUALITY | SLAP_MR_EXT,
447 NULL, NULL, distinguishedNameMatch, NULL, NULL},
449 {"( 2.5.13.2 NAME 'caseIgnoreMatch' "
450 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )",
451 SLAP_MR_EQUALITY | SLAP_MR_EXT,
452 NULL, UTF8StringNormalize, caseIgnoreMatch, NULL, NULL},
454 {"( 2.5.13.3 NAME 'caseIgnoreOrderingMatch' "
455 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )",
457 NULL, UTF8StringNormalize, caseIgnoreOrderingMatch, NULL, NULL},
459 {"( 2.5.13.4 NAME 'caseIgnoreSubstringsMatch' "
460 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )",
461 SLAP_MR_SUBSTR | SLAP_MR_EXT,
462 NULL, UTF8StringNormalize, caseIgnoreSubstringsMatch, NULL, NULL},
464 /* Next three are not in the RFC's, but are needed for compatibility */
465 {"( 2.5.13.5 NAME 'caseExactMatch' "
466 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )",
467 SLAP_MR_EQUALITY | SLAP_MR_EXT,
468 NULL, UTF8StringNormalize, caseExactMatch, NULL, NULL},
470 {"( 2.5.13.6 NAME 'caseExactOrderingMatch' "
471 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )",
473 NULL, UTF8StringNormalize, caseExactOrderingMatch, NULL, NULL},
475 {"( 2.5.13.7 NAME 'caseExactSubstringsMatch' "
476 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )",
477 SLAP_MR_SUBSTR | SLAP_MR_EXT,
478 NULL, UTF8StringNormalize, caseExactSubstringsMatch, NULL, NULL},
480 {"( 2.5.13.8 NAME 'numericStringMatch' "
481 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.36 )",
482 SLAP_MR_EQUALITY | SLAP_MR_EXT,
483 NULL, NULL, numericStringMatch, NULL, NULL},
485 {"( 2.5.13.10 NAME 'numericStringSubstringsMatch' "
486 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )",
487 SLAP_MR_SUBSTR | SLAP_MR_EXT,
488 NULL, NULL, numericStringSubstringsMatch, NULL, NULL},
490 {"( 2.5.13.11 NAME 'caseIgnoreListMatch' "
491 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )",
492 SLAP_MR_EQUALITY | SLAP_MR_EXT,
493 NULL, NULL, caseIgnoreListMatch, NULL, NULL},
495 {"( 2.5.13.12 NAME 'caseIgnoreListSubstringsMatch' "
496 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )",
497 SLAP_MR_SUBSTR | SLAP_MR_EXT,
498 NULL, NULL, caseIgnoreListSubstringsMatch, NULL, NULL},
500 {"( 2.5.13.14 NAME 'integerMatch' "
501 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )",
502 SLAP_MR_NONE | SLAP_MR_EXT,
503 NULL, NULL, integerMatch, NULL, NULL},
505 {"( 2.5.13.16 NAME 'bitStringMatch' "
506 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.6 )",
507 SLAP_MR_NONE | SLAP_MR_EXT,
508 NULL, NULL, bitStringMatch, NULL, NULL},
510 {"( 2.5.13.17 NAME 'octetStringMatch' "
511 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )",
512 SLAP_MR_EQUALITY | SLAP_MR_EXT,
513 NULL, NULL, octetStringMatch, NULL, NULL},
515 {"( 2.5.13.20 NAME 'telephoneNumberMatch' "
516 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )",
517 SLAP_MR_EQUALITY | SLAP_MR_EXT,
518 NULL, NULL, telephoneNumberMatch, NULL, NULL},
520 {"( 2.5.13.21 NAME 'telephoneNumberSubstringsMatch' "
521 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )",
522 SLAP_MR_SUBSTR | SLAP_MR_EXT,
523 NULL, NULL, telephoneNumberSubstringsMatch, NULL, NULL},
525 {"( 2.5.13.22 NAME 'presentationAddressMatch' "
526 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.43 )",
527 SLAP_MR_NONE | SLAP_MR_EXT,
528 NULL, NULL, presentationAddressMatch, NULL, NULL},
530 {"( 2.5.13.23 NAME 'uniqueMemberMatch' "
531 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.34 )",
532 SLAP_MR_NONE | SLAP_MR_EXT,
533 NULL, NULL, uniqueMemberMatch, NULL, NULL},
535 {"( 2.5.13.24 NAME 'protocolInformationMatch' "
536 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.42 )",
537 SLAP_MR_NONE | SLAP_MR_EXT,
538 NULL, NULL, protocolInformationMatch, NULL, NULL},
540 {"( 2.5.13.27 NAME 'generalizedTimeMatch' "
541 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )",
542 SLAP_MR_EQUALITY | SLAP_MR_EXT,
543 NULL, NULL, generalizedTimeMatch, NULL, NULL},
545 {"( 2.5.13.28 NAME 'generalizedTimeOrderingMatch' "
546 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )",
548 NULL, NULL, generalizedTimeOrderingMatch, NULL, NULL},
550 {"( 2.5.13.29 NAME 'integerFirstComponentMatch' "
551 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )",
552 SLAP_MR_EQUALITY | SLAP_MR_EXT,
553 NULL, NULL, integerFirstComponentMatch, NULL, NULL},
555 {"( 2.5.13.30 NAME 'objectIdentifierFirstComponentMatch' "
556 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )",
557 SLAP_MR_EQUALITY | SLAP_MR_EXT,
558 NULL, NULL, objectIdentifierFirstComponentMatch, NULL, NULL},
560 {"( 1.3.6.1.4.1.1466.109.114.1 NAME 'caseExactIA5Match' "
561 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )",
562 SLAP_MR_EQUALITY | SLAP_MR_EXT,
563 NULL, IA5StringNormalize, caseExactIA5Match, NULL, NULL},
565 {"( 1.3.6.1.4.1.1466.109.114.2 NAME 'caseIgnoreIA5Match' "
566 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )",
567 SLAP_MR_EQUALITY | SLAP_MR_EXT,
568 NULL, IA5StringNormalize, caseIgnoreIA5Match, NULL, NULL},
570 {"( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch' "
571 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )",
573 NULL, IA5StringNormalize, caseIgnoreIA5SubstringsMatch, NULL, NULL},
575 {NULL, SLAP_MR_NONE, NULL, NULL, NULL}
578 static int schema_init_done = 0;
586 /* we should only be called once (from main) */
587 assert( schema_init_done == 0 );
589 for ( i=0; syntax_defs[i].sd_desc != NULL; i++ ) {
590 res = register_syntax( syntax_defs[i].sd_desc,
591 syntax_defs[i].sd_flags,
592 syntax_defs[i].sd_validate,
593 syntax_defs[i].sd_ber2str,
594 syntax_defs[i].sd_str2ber );
597 fprintf( stderr, "schema_init: Error registering syntax %s\n",
598 syntax_defs[i].sd_desc );
603 for ( i=0; mrule_defs[i].mrd_desc != NULL; i++ ) {
604 if( mrule_defs[i].mrd_usage == SLAP_MR_NONE ) {
606 "schema_init: Ingoring unusable matching rule %s\n",
607 mrule_defs[i].mrd_desc );
611 res = register_matching_rule(
612 mrule_defs[i].mrd_desc,
613 mrule_defs[i].mrd_usage,
614 mrule_defs[i].mrd_convert,
615 mrule_defs[i].mrd_normalize,
616 mrule_defs[i].mrd_match,
617 mrule_defs[i].mrd_indexer,
618 mrule_defs[i].mrd_filter );
622 "schema_init: Error registering matching rule %s\n",
623 mrule_defs[i].mrd_desc );
627 schema_init_done = 1;
631 #ifdef SLAPD_SCHEMA_NOT_COMPAT
632 struct slap_internal_schema slap_schema;
634 struct slap_schema_ad_map {
639 offsetof(struct slap_internal_schema, si_ad_objectClass) },
642 offsetof(struct slap_internal_schema, si_ad_creatorsName) },
644 offsetof(struct slap_internal_schema, si_ad_createTimestamp) },
646 offsetof(struct slap_internal_schema, si_ad_modifiersName) },
648 offsetof(struct slap_internal_schema, si_ad_modifyTimestamp) },
650 { "subschemaSubentry",
651 offsetof(struct slap_internal_schema, si_ad_subschemaSubentry) },
654 offsetof(struct slap_internal_schema, si_ad_namingContexts) },
655 { "supportedControl",
656 offsetof(struct slap_internal_schema, si_ad_supportedControl) },
657 { "supportedExtension",
658 offsetof(struct slap_internal_schema, si_ad_supportedExtension) },
659 { "supportedLDAPVersion",
660 offsetof(struct slap_internal_schema, si_ad_supportedLDAPVersion) },
661 { "supportedSASLMechanisms",
662 offsetof(struct slap_internal_schema, si_ad_supportedSASLMechanisms) },
665 offsetof(struct slap_internal_schema, si_ad_attributeTypes) },
667 offsetof(struct slap_internal_schema, si_ad_ldapSyntaxes) },
669 offsetof(struct slap_internal_schema, si_ad_matchingRules) },
671 offsetof(struct slap_internal_schema, si_ad_objectClasses) },
674 offsetof(struct slap_internal_schema, si_ad_ref) },
677 offsetof(struct slap_internal_schema, si_ad_entry) },
679 offsetof(struct slap_internal_schema, si_ad_children) },
688 #ifdef SLAPD_SCHEMA_NOT_COMPAT
692 /* we should only be called once after schema_init() was called */
693 assert( schema_init_done == 1 );
695 #ifdef SLAPD_SCHEMA_NOT_COMPAT
696 for( i=0; ad_map[i].ssm_type; i++ ) {
699 AttributeDescription ** adp = (AttributeDescription **)
700 &(((char *) &slap_schema)[ad_map[i].ssm_offset]);
704 rc = slap_str2ad( ad_map[i].ssm_type, adp, &text );
706 if( rc != LDAP_SUCCESS ) {
708 "No attribute \"%s\" defined in schema\n",
709 ad_map[i].ssm_type );