(AVL_DUP) avl_dup_error ) ) {
*err = sat->sat_oid;
ldap_memfree(air);
- return SLAP_SCHERR_DUP_ATTR;
+ return SLAP_SCHERR_ATTR_DUP;
}
/* FIX: temporal consistency check */
at_bvfind(&air->air_name);
(AVL_DUP) avl_dup_error ) ) {
*err = *names;
ldap_memfree(air);
- return SLAP_SCHERR_DUP_ATTR;
+ return SLAP_SCHERR_ATTR_DUP;
}
/* FIX: temporal consistency check */
at_bvfind(&air->air_name);
MatchingRule *mr;
Syntax *syn;
int code;
- char *cname;
+ char *cname;
+ char *oid;
+
+ if ( !OID_LEADCHAR( at->at_oid[0] )) {
+ /* Expand OID macros */
+ oid = oidm_find( at->at_oid );
+ if ( !oid ) {
+ *err = at->at_oid;
+ return SLAP_SCHERR_OIDM;
+ }
+ if ( oid != at->at_oid ) {
+ ldap_memfree( at->at_oid );
+ at->at_oid = oid;
+ }
+ }
+
+ if ( at->at_syntax_oid && !OID_LEADCHAR( at->at_syntax_oid[0] )) {
+ /* Expand OID macros */
+ oid = oidm_find( at->at_syntax_oid );
+ if ( !oid ) {
+ *err = at->at_syntax_oid;
+ return SLAP_SCHERR_OIDM;
+ }
+ if ( oid != at->at_syntax_oid ) {
+ ldap_memfree( at->at_syntax_oid );
+ at->at_syntax_oid = oid;
+ }
+
+ }
if ( at->at_names && at->at_names[0] ) {
int i;
}
if ( at->at_collective ) {
-#ifdef SLAP_COLLECTIVE
if( at->at_usage ) {
/* collective attributes cannot be operational */
- return SLAP_SCHERR_NOT_SUPPORTED;
+ return SLAP_SCHERR_ATTR_BAD_USAGE;
}
+
if( at->at_single_value ) {
/* collective attributes cannot be single-valued */
- return SLAP_SCHERR_NOT_SUPPORTED;
+ return SLAP_SCHERR_ATTR_BAD_USAGE;
}
-#else
- return SLAP_SCHERR_NOT_SUPPORTED;
-#endif
}
sat = (AttributeType *) ch_calloc( 1, sizeof(AttributeType) );
/* subtypes must have same usage as their SUP */
return SLAP_SCHERR_ATTR_BAD_USAGE;
}
+
+ if ( sat->sat_flags & SLAP_AT_FINAL ) {
+ /* cannot subtype a "final" attribute type */
+ return SLAP_SCHERR_ATTR_BAD_SUP;
+ }
}
/*
if ( ldap_attributetype2bv( &at->sat_atype, vals ) == NULL ) {
return -1;
}
+
+ if( at->sat_flags & SLAP_AT_HIDE ) continue;
+
#if 0
Debug( LDAP_DEBUG_TRACE, "Merging at [%ld] %s\n",
(long) vals[0].bv_len, vals[0].bv_val, 0 );