Skip to content
Snippets Groups Projects
Commit f0f7324e authored by Howard Chu's avatar Howard Chu
Browse files

Keep hardcoded schema together in lists

parent ecd7c785
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,9 @@ static Avlnode *attr_cache = NULL;
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
......@@ -525,6 +528,10 @@ at_insert(
}
}
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 {
......
......@@ -134,6 +134,7 @@ static Avlnode *oc_index = NULL;
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(
......@@ -669,7 +670,15 @@ oc_insert(
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;
}
......
......@@ -29,6 +29,8 @@
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.
......@@ -98,7 +100,7 @@ parse_oidm(
OidMacro **rom)
{
char *oid;
OidMacro *om = NULL;
OidMacro *om = NULL, *prev = NULL;
struct berval bv;
oid = oidm_find( c->argv[1] );
......@@ -144,10 +146,16 @@ parse_oidm(
}
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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment