static LDAP_STAILQ_HEAD(ATList, slap_attribute_type) attr_list
= LDAP_STAILQ_HEAD_INITIALIZER(attr_list);
+/* Last hardcoded attribute registered */
+static AttributeType *attr_sys_tail;
+
int at_oc_cache;
static int
}
}
+ if ( sat->sat_flags & SLAP_AT_HARDCODE ) {
+ prev = attr_sys_tail;
+ attr_sys_tail = sat;
+ }
if ( prev ) {
LDAP_STAILQ_INSERT_AFTER( &attr_list, prev, sat, sat_next );
} else {
static Avlnode *oc_cache = NULL;
static LDAP_STAILQ_HEAD(OCList, slap_object_class) oc_list
= LDAP_STAILQ_HEAD_INITIALIZER(oc_list);
+static ObjectClass *oc_sys_tail;
static int
oc_index_cmp(
names++;
}
}
- LDAP_STAILQ_INSERT_TAIL( &oc_list, soc, soc_next );
+ if ( soc->soc_flags & SLAP_OC_HARDCODE ) {
+ prev = oc_sys_tail;
+ oc_sys_tail = soc;
+ }
+ if ( prev ) {
+ LDAP_STAILQ_INSERT_AFTER( &oc_list, prev, soc, soc_next );
+ } else {
+ LDAP_STAILQ_INSERT_TAIL( &oc_list, soc, soc_next );
+ }
return 0;
}
static LDAP_STAILQ_HEAD(OidMacroList, slap_oid_macro) om_list
= LDAP_STAILQ_HEAD_INITIALIZER(om_list);
+static OidMacro *om_sys_tail;
+
/* Replace an OID Macro invocation with its full numeric OID.
* If the macro is used with "macroname:suffix" append ".suffix"
* to the expansion.
OidMacro **rom)
{
char *oid;
- OidMacro *om = NULL;
+ OidMacro *om = NULL, *prev = NULL;
struct berval bv;
oid = oidm_find( c->argv[1] );
}
om->som_oid.bv_len = strlen( om->som_oid.bv_val );
- if ( !user )
+ if ( !user ) {
om->som_flags |= SLAP_OM_HARDCODE;
+ prev = om_sys_tail;
+ }
- LDAP_STAILQ_INSERT_TAIL( &om_list, om, som_next );
+ if ( prev ) {
+ LDAP_STAILQ_INSERT_AFTER( &om_list, prev, om, som_next );
+ } else {
+ LDAP_STAILQ_INSERT_TAIL( &om_list, om, som_next );
+ }
if ( rom ) *rom = om;
return 0;
}