static Avlnode *attr_index = NULL;
static Avlnode *attr_cache = NULL;
-static LDAP_SLIST_HEAD(ATList, slap_attribute_type) attr_list
- = LDAP_SLIST_HEAD_INITIALIZER(&attr_list);
+static LDAP_STAILQ_HEAD(ATList, slap_attribute_type) attr_list
+ = LDAP_STAILQ_HEAD_INITIALIZER(attr_list);
int at_oc_cache;
AttributeType *a;
avl_free(attr_index, ldap_memfree);
- while( !LDAP_SLIST_EMPTY(&attr_list) ) {
- a = LDAP_SLIST_FIRST(&attr_list);
- LDAP_SLIST_REMOVE_HEAD(&attr_list, sat_next);
+ while( !LDAP_STAILQ_EMPTY(&attr_list) ) {
+ a = LDAP_STAILQ_FIRST(&attr_list);
+ LDAP_STAILQ_REMOVE_HEAD(&attr_list, sat_next);
if (a->sat_subtypes) ldap_memfree(a->sat_subtypes);
ad_destroy(a->sat_ad);
{
assert( at );
- *at = LDAP_SLIST_FIRST(&attr_list);
+ *at = LDAP_STAILQ_FIRST(&attr_list);
return (*at != NULL);
}
{
AttributeType *tmp = NULL;
- LDAP_SLIST_FOREACH(tmp,&attr_list,sat_next) {
+ LDAP_STAILQ_FOREACH(tmp,&attr_list,sat_next) {
if ( tmp == *at ) {
break;
}
}
#endif
- *at = LDAP_SLIST_NEXT(*at,sat_next);
+ *at = LDAP_STAILQ_NEXT(*at,sat_next);
return (*at != NULL);
}
struct aindexrec *air;
char **names;
- LDAP_SLIST_NEXT( sat, sat_next ) = NULL;
- LDAP_SLIST_INSERT_HEAD( &attr_list, sat, sat_next );
-
if ( sat->sat_oid ) {
air = (struct aindexrec *)
ch_calloc( 1, sizeof(struct aindexrec) );
}
}
+ LDAP_STAILQ_INSERT_TAIL( &attr_list, sat, sat_next );
+
return 0;
}
at_add(
LDAPAttributeType *at,
int user,
+ AttributeType **rsat,
const char **err )
{
AttributeType *sat;
}
code = at_insert(sat,err);
+ if ( code == 0 && rsat )
+ *rsat = sat;
return code;
}
}
#endif
+void
+at_unparse( BerVarray *res, AttributeType *start, AttributeType *end, int sys )
+{
+ AttributeType *at;
+ int i, num;
+ struct berval bv, *bva = NULL, idx;
+ char ibuf[32], *ptr;
+
+ if ( !start )
+ start = LDAP_STAILQ_FIRST( &attr_list );
+
+ /* count the result size */
+ i = 0;
+ for ( at=start; at && at!=end; at=LDAP_STAILQ_NEXT(at, sat_next)) {
+ if ( sys && !(at->sat_flags & SLAP_AT_HARDCODE)) continue;
+ i++;
+ }
+ if (!i) return;
+
+ num = i;
+ bva = ch_malloc( (num+1) * sizeof(struct berval) );
+ BER_BVZERO( bva );
+ idx.bv_val = ibuf;
+ if ( sys ) {
+ idx.bv_len = 0;
+ ibuf[0] = '\0';
+ }
+ i = 0;
+ for ( at=start; at && at!=end; at=LDAP_STAILQ_NEXT(at, sat_next)) {
+ if ( sys && !(at->sat_flags & SLAP_AT_HARDCODE)) continue;
+ if ( ldap_attributetype2bv( &at->sat_atype, &bv ) == NULL ) {
+ ber_bvarray_free( bva );
+ }
+ if ( !sys ) {
+ idx.bv_len = sprintf(idx.bv_val, "{%02d}", i);
+ }
+ bva[i].bv_len = idx.bv_len + bv.bv_len;
+ bva[i].bv_val = ch_malloc( bva[i].bv_len + 1 );
+ strcpy( bva[i].bv_val, ibuf );
+ strcpy( bva[i].bv_val + idx.bv_len, bv.bv_val );
+ i++;
+ bva[i].bv_val = NULL;
+ ldap_memfree( bv.bv_val );
+ }
+ *res = bva;
+}
+
int
at_schema_info( Entry *e )
{
struct berval val;
struct berval nval;
- LDAP_SLIST_FOREACH(at,&attr_list,sat_next) {
+ LDAP_STAILQ_FOREACH(at,&attr_list,sat_next) {
if( at->sat_flags & SLAP_AT_HIDE ) continue;
if ( ldap_attributetype2bv( &at->sat_atype, &val ) == NULL ) {
return -1;
}
- nval.bv_val = at->sat_oid;
- nval.bv_len = strlen(at->sat_oid);
+ ber_str2bv( at->sat_oid, 0, 0, &nval );
if( attr_merge_one( e, ad_attributeTypes, &val, &nval ) )
{
return -1;
}
- code = at_add(at, 0, &err);
+ code = at_add(at, 0, NULL, &err);
if ( code ) {
Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: "
"%s in attributeType \"%s\"\n",
return -1;
}
- code = oc_add(oc, 0, &err);
+ code = oc_add(oc, 0, NULL, &err);
if ( code ) {
Debug( LDAP_DEBUG_ANY,
"objectclass \"%s\": %s \"%s\"\n" ,
#include "config.h"
static struct berval config_rdn = BER_BVC("cn=config");
+static struct berval schema_rdn = BER_BVC("cn=schema");
#ifdef SLAPD_MODULES
typedef struct modpath_s {
struct berval mp_path;
BerVarray mp_loads;
} ModPaths;
+
+static ModPaths modpaths, *modlast = &modpaths, *modcur = &modpaths;
#endif
typedef struct ConfigFile {
struct ConfigFile *c_sibs;
struct ConfigFile *c_kids;
struct berval c_file;
-#ifdef SLAPD_MODULES
- ModPaths c_modpaths;
- ModPaths *c_modlast;
-#endif
+ AttributeType *c_at_head, *c_at_tail;
+ ContentRule *c_cr_head, *c_cr_tail;
+ ObjectClass *c_oc_head, *c_oc_tail;
+ OidMacro *c_om_head, *c_om_tail;
BerVarray c_dseFiles;
} ConfigFile;
} CfOcInfo;
typedef struct CfEntryInfo {
+ struct CfEntryInfo *ce_parent;
struct CfEntryInfo *ce_sibs;
struct CfEntryInfo *ce_kids;
Entry *ce_entry;
*cfAd_include;
static ObjectClass *cfOc_schema, *cfOc_global, *cfOc_backend, *cfOc_database,
- *cfOc_include, *cfOc_overlay;
+ *cfOc_include, *cfOc_overlay, *cfOc_module;
static ConfigFile cf_prv, *cfn = &cf_prv;
"DESC 'File for slapd command line options' "
"EQUALITY caseIgnoreMatch "
"SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
- /* Use standard 'attributeTypes' attr */
{ "attribute", "attribute", 2, 0, 9, ARG_PAREN|ARG_MAGIC|CFG_ATTR,
- &config_generic, NULL, NULL, NULL },
+ &config_generic, "( OLcfgAt:4 NAME 'olcAttributeTypes' "
+ "DESC 'OpenLDAP attributeTypes' "
+ "EQUALITY objectIdentifierFirstComponentMatch "
+ "SYNTAX 1.3.6.1.4.1.1466.115.121.1.3 X-ORDERED 'VALUES' )",
+ NULL, NULL },
{ "attributeoptions", NULL, 0, 0, 0, ARG_MAGIC|CFG_ATOPT,
&config_generic, "( OLcfgAt:5 NAME 'olcAttributeOptions' "
"EQUALITY caseIgnoreMatch "
&config_disallows, "( OLcfgAt:15 NAME 'olcDisallows' "
"EQUALITY caseIgnoreMatch "
"SYNTAX OMsDirectoryString )", NULL, NULL },
- /* use standard schema */
{ "ditcontentrule", NULL, 0, 0, 0, ARG_MAGIC|CFG_DIT,
- &config_generic, NULL, NULL, NULL },
+ &config_generic, "( OLcfgAt:16 NAME 'olcDitContentRules' "
+ "DESC 'OpenLDAP DIT content rules' "
+ "EQUALITY objectIdentifierFirstComponentMatch "
+ "SYNTAX 1.3.6.1.4.1.1466.115.121.1.16 X-ORDERED 'VALUES' )",
+ NULL, NULL },
{ "gentlehup", "on|off", 2, 2, 0,
#ifdef SIGHUP
ARG_ON_OFF, &global_gentlehup,
#endif
"( OLcfgAt:31 NAME 'olcModulePath' "
"SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
- /* use standard schema */
{ "objectclass", "objectclass", 2, 0, 0, ARG_PAREN|ARG_MAGIC|CFG_OC,
- &config_generic, NULL, NULL, NULL },
+ &config_generic, "( OLcfgAt:32 NAME 'olcObjectClasses' "
+ "DESC 'OpenLDAP object classes' "
+ "EQUALITY objectIdentifierFirstComponentMatch "
+ "SYNTAX 1.3.6.1.4.1.1466.115.121.1.37 X-ORDERED 'VALUES' )",
+ NULL, NULL },
{ "objectidentifier", NULL, 0, 0, 0, ARG_MAGIC|CFG_OID,
&config_generic, "( OLcfgAt:33 NAME 'olcObjectIdentifier' "
"SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
"olcDefaultSearchBase $ olcDisallows $ olcGentleHUP $ "
"olcIdleTimeout $ olcIndexSubstrIfMaxLen $ olcIndexSubstrIfMinLen $ "
"olcIndexSubstrAnyLen $ olcIndexSubstrAnyStep $ olcLocalSSF $ "
- "olcLogLevel $ olcModuleLoad $ olcModulePath $ olcObjectIdentifier $ "
+ "olcLogLevel $ olcModulePath $ olcObjectIdentifier $ "
"olcPasswordCryptSaltFormat $ olcPasswordHash $ olcPidFile $ "
"olcPlugin $ olcPluginLogFile $ olcReadOnly $ olcReferral $ "
"olcReplicaPidFile $ olcReplicaArgsFile $ olcReplicationInterval $ "
"NAME 'olcSchemaConfig' "
"DESC 'OpenLDAP schema object' "
"SUP olcConfig STRUCTURAL "
- "MAY ( olcObjectIdentifier $ attributeTypes $ objectClasses $ "
- "ditContentRules ) )", Cft_Schema, &cfOc_schema },
+ "MAY ( olcObjectIdentifier $ olcAttributeTypes $ olcObjectClasses $ "
+ "olcDitContentRules ) )", Cft_Schema, &cfOc_schema },
{ "( OLcfgOc:4 "
"NAME 'olcBackendConfig' "
"DESC 'OpenLDAP Backend-specific options' "
"NAME 'olcIncludeFile' "
"DESC 'OpenLDAP configuration include file' "
"SUP olcConfig STRUCTURAL "
- "MAY ( olcInclude $ olcModuleLoad $ olcModulePath $ olcRootDSE ) )",
+ "MAY ( olcInclude $ olcRootDSE ) )",
Cft_Include, &cfOc_include },
+#ifdef SLAPD_MODULES
+ { "( OLcfgOc:8 "
+ "NAME 'olcModuleList' "
+ "DESC 'OpenLDAP dynamic module info' "
+ "SUP olcConfig STRUCTURAL "
+ "MUST olcModuleLoad )",
+ Cft_Module, &cfOc_module },
+#endif
{ NULL, 0, NULL }
};
case CFG_DEPTH:
c->value_int = c->be->be_max_deref_depth;
break;
- case CFG_OID:
- oidm_unparse( &c->rvalue_vals );
+ case CFG_OID: {
+ ConfigFile *cf = c->private;
+ if ( !cf )
+ oidm_unparse( &c->rvalue_vals, NULL, NULL, 1 );
+ else if ( cf->c_om_head )
+ oidm_unparse( &c->rvalue_vals, cf->c_om_head,
+ cf->c_om_tail, 0 );
+ if ( !c->rvalue_vals )
+ rc = 1;
+ }
+ break;
+ case CFG_OC: {
+ ConfigFile *cf = c->private;
+ if ( !cf )
+ oc_unparse( &c->rvalue_vals, NULL, NULL, 1 );
+ else if ( cf->c_oc_head )
+ oc_unparse( &c->rvalue_vals, cf->c_oc_head,
+ cf->c_oc_tail, 0 );
if ( !c->rvalue_vals )
rc = 1;
+ }
break;
+ case CFG_ATTR: {
+ ConfigFile *cf = c->private;
+ if ( !cf )
+ at_unparse( &c->rvalue_vals, NULL, NULL, 1 );
+ else if ( cf->c_at_head )
+ at_unparse( &c->rvalue_vals, cf->c_at_head,
+ cf->c_at_tail, 0 );
+ if ( !c->rvalue_vals )
+ rc = 1;
+ }
+ break;
+ case CFG_DIT: {
+ ConfigFile *cf = c->private;
+ if ( !cf )
+ cr_unparse( &c->rvalue_vals, NULL, NULL, 1 );
+ else if ( cf->c_cr_head )
+ cr_unparse( &c->rvalue_vals, cf->c_cr_head,
+ cf->c_cr_tail, 0 );
+ if ( !c->rvalue_vals )
+ rc = 1;
+ }
+ break;
+
case CFG_CHECK:
c->value_int = global_schemacheck;
break;
c->value_string = ch_strdup( c->be->be_replogfile );
break;
case CFG_ROOTDSE: {
- ConfigFile *cf = (ConfigFile *)c->line;
+ ConfigFile *cf = c->private;
if ( cf->c_dseFiles ) {
value_add( &c->rvalue_vals, cf->c_dseFiles );
} else {
break;
#ifdef SLAPD_MODULES
case CFG_MODLOAD: {
- ConfigFile *cf = (ConfigFile *)c->line;
- ModPaths *mp;
- for (i=0, mp=&cf->c_modpaths; mp; mp=mp->mp_next, i++) {
- int j;
- if (!mp->mp_loads) continue;
- for (j=0; !BER_BVISNULL(&mp->mp_loads[j]); j++) {
+ ModPaths *mp = c->private;
+ if (mp->mp_loads) {
+ int i;
+ for (i=0; !BER_BVISNULL(&mp->mp_loads[i]); i++) {
struct berval bv;
bv.bv_val = c->log;
- bv.bv_len = sprintf( bv.bv_val, "{%d}{%d}%s", i, j,
- mp->mp_loads[j].bv_val );
+ bv.bv_len = sprintf( bv.bv_val, "{%d}%s", i,
+ mp->mp_loads[i].bv_val );
value_add_one( &c->rvalue_vals, &bv );
}
}
+
rc = c->rvalue_vals ? 0 : 1;
}
break;
case CFG_MODPATH: {
- ConfigFile *cf = (ConfigFile *)c->line;
ModPaths *mp;
- for (i=0, mp=&cf->c_modpaths; mp; mp=mp->mp_next, i++) {
+ for (i=0, mp=&modpaths; mp; mp=mp->mp_next, i++) {
struct berval bv;
if ( BER_BVISNULL( &mp->mp_path ) && !mp->mp_loads )
continue;
c->be->be_max_deref_depth = c->value_int;
break;
- case CFG_OID:
- if(parse_oidm(c->fname, c->lineno, c->argc, c->argv, 1)) return(0);
+ case CFG_OID: {
+ OidMacro *om;
+
+ if(parse_oidm(c->fname, c->lineno, c->argc, c->argv, 1, &om))
+ return(1);
+ if (!cfn->c_om_head) cfn->c_om_head = om;
+ cfn->c_om_tail = om;
+ }
break;
- case CFG_OC:
- if(parse_oc(c->fname, c->lineno, p, c->argv)) return(1);
+ case CFG_OC: {
+ ObjectClass *oc;
+
+ if(parse_oc(c->fname, c->lineno, p, c->argv, &oc)) return(1);
+ if (!cfn->c_oc_head) cfn->c_oc_head = oc;
+ cfn->c_oc_tail = oc;
+ }
break;
- case CFG_DIT:
- if(parse_cr(c->fname, c->lineno, p, c->argv)) return(1);
+ case CFG_DIT: {
+ ContentRule *cr;
+
+ if(parse_cr(c->fname, c->lineno, p, c->argv, &cr)) return(1);
+ if (!cfn->c_cr_head) cfn->c_cr_head = cr;
+ cfn->c_cr_tail = cr;
+ }
break;
- case CFG_ATTR:
- if(parse_at(c->fname, c->lineno, p, c->argv)) return(1);
+ case CFG_ATTR: {
+ AttributeType *at;
+
+ if(parse_at(c->fname, c->lineno, p, c->argv, &at)) return(1);
+ if (!cfn->c_at_head) cfn->c_at_head = at;
+ cfn->c_at_tail = at;
+ }
break;
case CFG_ATOPT:
{
struct berval bv;
ber_str2bv(c->line, 0, 1, &bv);
- ber_bvarray_add( &cfn->c_modlast->mp_loads, &bv );
+ ber_bvarray_add( &modcur->mp_loads, &bv );
}
break;
{
ModPaths *mp;
- if (!cfn->c_modpaths.mp_loads) {
- mp = &cfn->c_modpaths;
+ if (!modpaths.mp_loads) {
+ mp = &modpaths;
} else {
mp = ch_malloc( sizeof( ModPaths ));
- cfn->c_modlast->mp_next = mp;
+ modlast->mp_next = mp;
}
ber_str2bv(c->argv[1], 0, 1, &mp->mp_path);
mp->mp_next = NULL;
mp->mp_loads = NULL;
- cfn->c_modlast = mp;
+ modlast = mp;
+ if ( c->op == SLAP_CONFIG_ADD )
+ modcur = mp;
}
break;
static int
config_fname(ConfigArgs *c) {
if(c->op == SLAP_CONFIG_EMIT) {
- if (c->line) {
- ConfigFile *cf = (ConfigFile *)c->line;
+ if (c->private) {
+ ConfigFile *cf = c->private;
value_add_one( &c->rvalue_vals, &cf->c_file );
return 0;
}
return 1;
}
cf = ch_calloc( 1, sizeof(ConfigFile));
-#ifdef SLAPD_MODULES
- cf->c_modlast = &cf->c_modpaths;
-#endif
if ( cfn->c_kids ) {
for (cf2=cfn->c_kids; cf2 && cf2->c_sibs; cf2=cf2->c_sibs) ;
cf2->c_sibs = cf;
rc = LDAP_CONSTRAINT_VIOLATION;
goto leave;
}
+#ifdef SLAPD_MODULES
+ case Cft_Module:
+ if ( !last || last->ce_type != Cft_Global ) {
+ rc = LDAP_CONSTRAINT_VIOLATION;
+ goto leave;
+ }
+#endif
break;
}
* performing any set actions.
*/
switch (colst[0]->co_type) {
- case Cft_Global: /* */
case Cft_Schema:
+ /* The cn=schema entry is all hardcoded, so never reparse it */
+ if (last->ce_type == Cft_Global )
+ goto ok;
+ /* FALLTHRU */
+ case Cft_Global:
ca.be = cfb->cb_be;
break;
+
case Cft_Backend:
if ( last->ce_type == Cft_Backend )
ca.bi = last->ce_bi;
if ( !rs ) /* ignored */
break;
type_ad = cfAd_include;
+#ifdef SLAPD_MODULES
+ case Cft_Module: {
+ ModPaths *mp;
+ char *ptr;
+ ptr = strchr( e->e_name.bv_val, '{' );
+ if ( !ptr ) {
+ rc = LDAP_NAMING_VIOLATION;
+ goto leave;
+ }
+ j = atoi(ptr+1);
+ for (i=0, mp=&modpaths; mp && i<j; mp=mp->mp_next);
+ /* There is no corresponding modpath for this load? */
+ if ( i != j ) {
+ rc = LDAP_NAMING_VIOLATION;
+ goto leave;
+ }
+ module_path( mp->mp_path.bv_val );
+ ca.private = mp;
+ }
+ break;
+#endif
}
init_config_argv( &ca );
if ( type_ad ) {
if ( rc ) goto leave;
}
}
+ok:
ce = ch_calloc( 1, sizeof(CfEntryInfo) );
+ ce->ce_parent = last;
ce->ce_entry = entry_dup( e );
ce->ce_entry->e_private = ce;
ce->ce_type = colst[0]->co_type;
}
static Entry *
-config_alloc_entry( struct berval *pdn, struct berval *rdn )
+config_alloc_entry( CfEntryInfo *parent, struct berval *rdn )
{
Entry *e = ch_calloc( 1, sizeof(Entry) );
CfEntryInfo *ce = ch_calloc( 1, sizeof(CfEntryInfo) );
+ struct berval pdn;
+
e->e_private = ce;
ce->ce_entry = e;
- build_new_dn( &e->e_name, pdn, rdn, NULL );
+ ce->ce_parent = parent;
+ if ( parent ) {
+ pdn = parent->ce_entry->e_nname;
+ } else {
+ BER_BVZERO( &pdn );
+ }
+
+ build_new_dn( &e->e_name, &pdn, rdn, NULL );
ber_dupbv( &e->e_nname, &e->e_name );
return e;
}
}
static CfEntryInfo *
-config_build_includes( ConfigArgs *c, Entry *parent,
+config_build_includes( ConfigArgs *c, CfEntryInfo *ceparent,
Operation *op, SlapReply *rs )
{
Entry *e;
int i;
- ConfigFile *cf = (ConfigFile *)c->line;
- CfEntryInfo *ce, *ceparent, *ceprev;
+ ConfigFile *cf = c->private;
+ CfEntryInfo *ce, *ceprev;
- ceparent = parent->e_private;
+ if ( ceparent->ce_kids ) {
+ for ( ceprev = ceparent->ce_kids; ceprev->ce_sibs;
+ ceprev = ceprev->ce_sibs );
+ }
for (i=0; cf; cf=cf->c_sibs, i++) {
c->value_dn.bv_val = c->log;
- c->value_dn.bv_len = sprintf(c->value_dn.bv_val, "cn=include{%d}", i);
- e = config_alloc_entry( &parent->e_nname, &c->value_dn );
- c->line = (char *)cf;
+ c->value_dn.bv_len = sprintf(c->value_dn.bv_val, "cn=include{%02d}", i);
+ e = config_alloc_entry( ceparent, &c->value_dn );
+ c->private = cf;
config_build_entry( c, e, cfOc_include, &c->value_dn,
c->bi->bi_cf_table, NO_TABLE );
op->ora_e = e;
}
ceprev = ce;
if ( cf->c_kids ) {
- c->line = (char *)cf->c_kids;
- config_build_includes( c, e, op, rs );
+ c->private = cf->c_kids;
+ config_build_includes( c, ce, op, rs );
}
}
return ce;
}
+#ifdef SLAPD_MODULES
+
+static CfEntryInfo *
+config_build_modules( ConfigArgs *c, CfEntryInfo *ceparent,
+ Operation *op, SlapReply *rs )
+{
+ Entry *e;
+ int i;
+ CfEntryInfo *ce, *ceprev;
+ ModPaths *mp;
+
+ if ( ceparent->ce_kids ) {
+ for ( ceprev = ceparent->ce_kids; ceprev->ce_sibs;
+ ceprev = ceprev->ce_sibs );
+ }
+
+ for (i=0, mp=&modpaths; mp; mp=mp->mp_next, i++) {
+ if ( BER_BVISNULL( &mp->mp_path ) && !mp->mp_loads )
+ continue;
+ c->value_dn.bv_val = c->log;
+ c->value_dn.bv_len = sprintf(c->value_dn.bv_val, "cn=module{%02d}", i);
+ e = config_alloc_entry( ceparent, &c->value_dn );
+ ce = e->e_private;
+ ce->ce_type = Cft_Include;
+ c->private = mp;
+ config_build_entry( c, e, cfOc_module, &c->value_dn,
+ c->bi->bi_cf_table, NO_TABLE );
+ op->ora_e = e;
+ op->o_bd->be_add( op, rs );
+ ce->ce_bi = c->bi;
+ if ( !ceparent->ce_kids ) {
+ ceparent->ce_kids = ce;
+ } else {
+ ceprev->ce_sibs = ce;
+ }
+ ceprev = ce;
+ }
+ return ce;
+}
+#endif
+
static int
config_back_db_open( BackendDB *be )
{
rdn = config_rdn;
e = config_alloc_entry( NULL, &rdn );
ce = e->e_private;
+ ce->ce_type = Cft_Global;
cfb->cb_root = ce;
c.be = be;
c.bi = be->bd_info;
- c.line = (char *)cfb->cb_config;
+ c.private = cfb->cb_config;
ct = c.bi->bi_cf_table;
config_build_entry( &c, e, cfOc_global, &rdn, ct, NO_TABLE );
op->ora_e = e;
op->o_bd->be_add( op, &rs );
- ce->ce_type = Cft_Global;
ce->ce_bi = c.bi;
parent = e;
* schema, read-only. Child objects will contain runtime loaded schema
* files. FIXME
*/
+ rdn = schema_rdn;
+ e = config_alloc_entry( ceparent, &rdn );
+ ce = e->e_private;
+ ce->ce_type = Cft_Schema;
+ c.private = NULL;
+ config_build_entry( &c, e, cfOc_schema, &rdn, ct, NO_TABLE );
+ op->ora_e = e;
+ op->o_bd->be_add( op, &rs );
+ if ( !ceparent->ce_kids ) {
+ ceparent->ce_kids = ce;
+ } else {
+ ceprev->ce_sibs = ce;
+ }
+ ceprev = ce;
/* Create includeFile nodes... */
if ( cfb->cb_config->c_kids ) {
- c.line = (char *)cfb->cb_config->c_kids;
- ceprev = config_build_includes( &c, parent, op, &rs );
+ c.private = cfb->cb_config->c_kids;
+ ceprev = config_build_includes( &c, ceparent, op, &rs );
+ }
+
+#ifdef SLAPD_MODULES
+ /* Create Module nodes... */
+ if ( modpaths.mp_loads ) {
+ ceprev = config_build_includes( &c, ceparent, op, &rs );
}
+#endif
/* Create backend nodes. Skip if they don't provide a cf_table.
* There usually aren't any of these.
rdn.bv_val = c.log;
rdn.bv_len = sprintf(rdn.bv_val, "%s=%s", cfAd_backend->ad_cname.bv_val, bi->bi_type);
- e = config_alloc_entry( &parent->e_nname, &rdn );
+ e = config_alloc_entry( ceparent, &rdn );
ce = e->e_private;
ce->ce_type = Cft_Backend;
ce->ce_bi = bi;
rdn.bv_val = c.log;
rdn.bv_len = sprintf(rdn.bv_val, "%s={%0x}%s", cfAd_database->ad_cname.bv_val,
i, bi->bi_type);
- e = config_alloc_entry( &parent->e_nname, &rdn );
+ e = config_alloc_entry( ceparent, &rdn );
ce = e->e_private;
c.be = bptr;
c.bi = bi;
rdn.bv_val = c.log;
rdn.bv_len = sprintf(rdn.bv_val, "%s={%0x}%s",
cfAd_overlay->ad_cname.bv_val, j, on->on_bi.bi_type );
- oe = config_alloc_entry( &e->e_nname, &rdn );
+ oe = config_alloc_entry( opar, &rdn );
ce = oe->e_private;
c.be = bptr;
c.bi = &on->on_bi;
static struct {
char *name;
AttributeDescription **desc;
- AttributeDescription *sub;
} ads[] = {
- { "attribute", NULL, NULL },
- { "backend", &cfAd_backend, NULL },
- { "database", &cfAd_database, NULL },
- { "ditcontentrule", NULL, NULL },
- { "include", &cfAd_include, NULL },
- { "objectclass", NULL, NULL },
- { "overlay", &cfAd_overlay, NULL },
+ { "backend", &cfAd_backend },
+ { "database", &cfAd_database },
+ { "include", &cfAd_include },
+ { "overlay", &cfAd_overlay },
{ NULL, NULL, NULL }
};
for (i=0; OidMacros[i].name; i++ ) {
argv[1] = OidMacros[i].name;
argv[2] = OidMacros[i].oid;
- parse_oidm( "slapd", i, 3, argv, 0 );
+ parse_oidm( "slapd", i, 3, argv, 0, NULL );
}
bi->bi_cf_table = ct;
if ( i ) return i;
/* set up the notable AttributeDescriptions */
- ads[0].sub = slap_schema.si_ad_attributeTypes;
- ads[3].sub = slap_schema.si_ad_ditContentRules;
- ads[5].sub = slap_schema.si_ad_objectClasses;
-
i = 0;
for (;ct->name;ct++) {
if (strcmp(ct->name, ads[i].name)) continue;
- if (ads[i].sub) {
- ct->ad = ads[i].sub;
- } else {
- *ads[i].desc = ct->ad;
- }
+ *ads[i].desc = ct->ad;
i++;
if (!ads[i].name) break;
}
ct[i].attribute, ldap_scherr2str(code), err );
return code;
}
- code = at_add( at, 0, &err );
+ code = at_add( at, 0, NULL, &err );
if ( code && code != SLAP_SCHERR_ATTR_DUP ) {
fprintf( stderr, "init_config_attrs: AttributeType \"%s\": %s, %s\n",
ct[i].attribute, scherr2str(code), err );
ocs[i].def, ldap_scherr2str(code), err );
return code;
}
- code = oc_add(oc,0,&err);
+ code = oc_add(oc,0,NULL,&err);
if ( code && code != SLAP_SCHERR_CLASS_DUP ) {
fprintf( stderr, "init_config_ocs: objectclass \"%s\": %s, %s\n",
ocs[i].def, scherr2str(code), err );
continue;
}
- c->op = LDAP_MOD_ADD;
+ c->op = SLAP_CONFIG_ADD;
ct = config_find_keyword( config_back_cf_table, c );
if ( ct ) {
Cft_Database,
Cft_Overlay,
Cft_Include,
+ Cft_Module
} ConfigType;
#define ARGS_USERLAND 0x00000fff
BerVarray rvalue_vals;
BerVarray rvalue_nvals;
#define SLAP_CONFIG_EMIT 0x2000 /* emit instead of set */
+#define SLAP_CONFIG_ADD 0x4000 /* config file add vs LDAP add */
int op;
int type; /* ConfigTable.arg_type & ARGS_USERLAND */
BackendDB *be;
BackendInfo *bi;
+ void *private; /* anything */
} ConfigArgs;
#define value_int values.v_int
};
static Avlnode *cr_index = NULL;
-static LDAP_SLIST_HEAD(CRList, slap_content_rule) cr_list
- = LDAP_SLIST_HEAD_INITIALIZER(&cr_list);
+static LDAP_STAILQ_HEAD(CRList, slap_content_rule) cr_list
+ = LDAP_STAILQ_HEAD_INITIALIZER(cr_list);
static int
cr_index_cmp(
avl_free(cr_index, ldap_memfree);
- while( !LDAP_SLIST_EMPTY(&cr_list) ) {
- c = LDAP_SLIST_FIRST(&cr_list);
- LDAP_SLIST_REMOVE_HEAD(&cr_list, scr_next);
+ while( !LDAP_STAILQ_EMPTY(&cr_list) ) {
+ c = LDAP_STAILQ_FIRST(&cr_list);
+ LDAP_STAILQ_REMOVE_HEAD(&cr_list, scr_next);
cr_destroy_one( c );
}
struct cindexrec *cir;
char **names;
- LDAP_SLIST_NEXT( scr, scr_next ) = NULL;
- LDAP_SLIST_INSERT_HEAD(&cr_list, scr, scr_next);
-
if ( scr->scr_oid ) {
cir = (struct cindexrec *)
ch_calloc( 1, sizeof(struct cindexrec) );
}
}
+ LDAP_STAILQ_INSERT_TAIL(&cr_list, scr, scr_next);
+
return 0;
}
cr_add(
LDAPContentRule *cr,
int user,
+ ContentRule **rscr,
const char **err
)
{
}
code = cr_insert(scr,err);
+ if ( code == 0 && rscr )
+ *rscr = scr;
return code;
}
+void
+cr_unparse( BerVarray *res, ContentRule *start, ContentRule *end, int sys )
+{
+ ContentRule *cr;
+ int i, num;
+ struct berval bv, *bva = NULL, idx;
+ char ibuf[32], *ptr;
+
+ if ( !start )
+ start = LDAP_STAILQ_FIRST( &cr_list );
+
+ /* count the result size */
+ i = 0;
+ for ( cr=start; cr && cr!=end; cr=LDAP_STAILQ_NEXT(cr, scr_next)) {
+ if ( sys && !(cr->scr_flags & SLAP_CR_HARDCODE)) continue;
+ i++;
+ }
+ if (!i) return;
+
+ num = i;
+ bva = ch_malloc( (num+1) * sizeof(struct berval) );
+ BER_BVZERO( bva );
+ idx.bv_val = ibuf;
+ if ( sys ) {
+ idx.bv_len = 0;
+ ibuf[0] = '\0';
+ }
+ i = 0;
+ for ( cr=start; cr && cr!=end; cr=LDAP_STAILQ_NEXT(cr, scr_next)) {
+ if ( sys && !(cr->scr_flags & SLAP_CR_HARDCODE)) continue;
+ if ( ldap_contentrule2bv( &cr->scr_crule, &bv ) == NULL ) {
+ ber_bvarray_free( bva );
+ }
+ if ( !sys ) {
+ idx.bv_len = sprintf(idx.bv_val, "{%02d}", i);
+ }
+ bva[i].bv_len = idx.bv_len + bv.bv_len;
+ bva[i].bv_val = ch_malloc( bva[i].bv_len + 1 );
+ strcpy( bva[i].bv_val, ibuf );
+ strcpy( bva[i].bv_val + idx.bv_len, bv.bv_val );
+ i++;
+ bva[i].bv_val = NULL;
+ ldap_memfree( bv.bv_val );
+ }
+ *res = bva;
+}
+
int
cr_schema_info( Entry *e )
{
struct berval val;
struct berval nval;
- LDAP_SLIST_FOREACH(cr, &cr_list, scr_next) {
+ LDAP_STAILQ_FOREACH(cr, &cr_list, scr_next) {
if ( ldap_contentrule2bv( &cr->scr_crule, &val ) == NULL ) {
return -1;
}
static Avlnode *oc_index = NULL;
static Avlnode *oc_cache = NULL;
-static LDAP_SLIST_HEAD(OCList, slap_object_class) oc_list
- = LDAP_SLIST_HEAD_INITIALIZER(&oc_list);
+static LDAP_STAILQ_HEAD(OCList, slap_object_class) oc_list
+ = LDAP_STAILQ_HEAD_INITIALIZER(oc_list);
static int
oc_index_cmp(
return( NULL );
}
-static LDAP_SLIST_HEAD(OCUList, slap_object_class) oc_undef_list
- = LDAP_SLIST_HEAD_INITIALIZER(&oc_undef_list);
+static LDAP_STAILQ_HEAD(OCUList, slap_object_class) oc_undef_list
+ = LDAP_STAILQ_HEAD_INITIALIZER(oc_undef_list);
ObjectClass *
oc_bvfind_undef( struct berval *ocname )
return oc;
}
- LDAP_SLIST_FOREACH( oc, &oc_undef_list, soc_next ) {
+ LDAP_STAILQ_FOREACH( oc, &oc_undef_list, soc_next ) {
int d = oc->soc_cname.bv_len - ocname->bv_len;
if ( d ) {
oc->soc_cname.bv_val = (char *)&oc[ 1 ];
AC_MEMCPY( oc->soc_cname.bv_val, ocname->bv_val, ocname->bv_len );
- LDAP_SLIST_NEXT( oc, soc_next ) = NULL;
- LDAP_SLIST_INSERT_HEAD( &oc_undef_list, oc, soc_next );
+ LDAP_STAILQ_NEXT( oc, soc_next ) = NULL;
+ LDAP_STAILQ_INSERT_HEAD( &oc_undef_list, oc, soc_next );
return oc;
}
ObjectClass *o;
avl_free(oc_index, ldap_memfree);
- while( !LDAP_SLIST_EMPTY(&oc_list) ) {
- o = LDAP_SLIST_FIRST(&oc_list);
- LDAP_SLIST_REMOVE_HEAD(&oc_list, soc_next);
+ while( !LDAP_STAILQ_EMPTY(&oc_list) ) {
+ o = LDAP_STAILQ_FIRST(&oc_list);
+ LDAP_STAILQ_REMOVE_HEAD(&oc_list, soc_next);
if (o->soc_sups) ldap_memfree(o->soc_sups);
if (o->soc_required) ldap_memfree(o->soc_required);
ldap_objectclass_free((LDAPObjectClass *)o);
}
- while( !LDAP_SLIST_EMPTY(&oc_undef_list) ) {
- o = LDAP_SLIST_FIRST(&oc_undef_list);
- LDAP_SLIST_REMOVE_HEAD(&oc_undef_list, soc_next);
+ while( !LDAP_STAILQ_EMPTY(&oc_undef_list) ) {
+ o = LDAP_STAILQ_FIRST(&oc_undef_list);
+ LDAP_STAILQ_REMOVE_HEAD(&oc_undef_list, soc_next);
ch_free( (ObjectClass *)o );
}
struct oindexrec *oir;
char **names;
- LDAP_SLIST_NEXT( soc, soc_next ) = NULL;
- LDAP_SLIST_INSERT_HEAD( &oc_list, soc, soc_next );
-
if ( soc->soc_oid ) {
oir = (struct oindexrec *)
ch_calloc( 1, sizeof(struct oindexrec) );
names++;
}
}
+ LDAP_STAILQ_INSERT_TAIL( &oc_list, soc, soc_next );
+
return 0;
}
oc_add(
LDAPObjectClass *oc,
int user,
+ ObjectClass **rsoc,
const char **err )
{
ObjectClass *soc;
if( user && op ) return SLAP_SCHERR_CLASS_BAD_USAGE;
+ if( !user ) soc->soc_flags |= SLAP_OC_HARDCODE;
+
code = oc_insert(soc,err);
+ if ( code == 0 && rsoc )
+ *rsoc = soc;
return code;
}
+void
+oc_unparse( BerVarray *res, ObjectClass *start, ObjectClass *end, int sys )
+{
+ ObjectClass *oc;
+ int i, num;
+ struct berval bv, *bva = NULL, idx;
+ char ibuf[32], *ptr;
+
+ if ( !start )
+ start = LDAP_STAILQ_FIRST( &oc_list );
+
+ /* count the result size */
+ i = 0;
+ for ( oc=start; oc && oc!=end; oc=LDAP_STAILQ_NEXT(oc, soc_next)) {
+ if ( sys && !(oc->soc_flags & SLAP_OC_HARDCODE)) continue;
+ i++;
+ }
+ if (!i) return;
+
+ num = i;
+ bva = ch_malloc( (num+1) * sizeof(struct berval) );
+ BER_BVZERO( bva );
+ idx.bv_val = ibuf;
+ if ( sys ) {
+ idx.bv_len = 0;
+ ibuf[0] = '\0';
+ }
+ i = 0;
+ for ( oc=start; oc && oc!=end; oc=LDAP_STAILQ_NEXT(oc, soc_next)) {
+ if ( sys && !(oc->soc_flags & SLAP_OC_HARDCODE)) continue;
+ if ( ldap_objectclass2bv( &oc->soc_oclass, &bv ) == NULL ) {
+ ber_bvarray_free( bva );
+ }
+ if ( !sys ) {
+ idx.bv_len = sprintf(idx.bv_val, "{%02d}", i);
+ }
+ bva[i].bv_len = idx.bv_len + bv.bv_len;
+ bva[i].bv_val = ch_malloc( bva[i].bv_len + 1 );
+ strcpy( bva[i].bv_val, ibuf );
+ strcpy( bva[i].bv_val + idx.bv_len, bv.bv_val );
+ i++;
+ bva[i].bv_val = NULL;
+ ldap_memfree( bv.bv_val );
+ }
+ *res = bva;
+}
+
int
oc_schema_info( Entry *e )
{
struct berval val;
struct berval nval;
- LDAP_SLIST_FOREACH( oc, &oc_list, soc_next ) {
+ LDAP_STAILQ_FOREACH( oc, &oc_list, soc_next ) {
if( oc->soc_flags & SLAP_OC_HIDE ) continue;
if ( ldap_objectclass2bv( &oc->soc_oclass, &val ) == NULL ) {
#include "slap.h"
#include "lutil.h"
-static LDAP_SLIST_HEAD(OidMacroList, slap_oid_macro) om_list
- = LDAP_SLIST_HEAD_INITIALIZER(om_list);
+static LDAP_STAILQ_HEAD(OidMacroList, slap_oid_macro) om_list
+ = LDAP_STAILQ_HEAD_INITIALIZER(om_list);
/* Replace an OID Macro invocation with its full numeric OID.
* If the macro is used with "macroname:suffix" append ".suffix"
return oid;
}
- LDAP_SLIST_FOREACH( om, &om_list, som_next ) {
+ LDAP_STAILQ_FOREACH( om, &om_list, som_next ) {
BerVarray names = om->som_names;
if( names == NULL ) {
oidm_destroy()
{
OidMacro *om;
- while( !LDAP_SLIST_EMPTY( &om_list )) {
- om = LDAP_SLIST_FIRST( &om_list );
- LDAP_SLIST_REMOVE_HEAD( &om_list, som_next );
+ while( !LDAP_STAILQ_EMPTY( &om_list )) {
+ om = LDAP_STAILQ_FIRST( &om_list );
+ LDAP_STAILQ_REMOVE_HEAD( &om_list, som_next );
ber_bvarray_free(om->som_names);
ber_bvarray_free(om->som_subs);
int lineno,
int argc,
char **argv,
- int user )
+ int user,
+ OidMacro **rom)
{
char *oid;
OidMacro *om;
return 1;
}
- LDAP_SLIST_NEXT( om, som_next ) = NULL;
om->som_names = NULL;
om->som_subs = NULL;
ber_str2bv( argv[1], 0, 1, &bv );
if ( !user )
om->som_flags |= SLAP_OM_HARDCODE;
- LDAP_SLIST_INSERT_HEAD( &om_list, om, som_next );
+ LDAP_STAILQ_INSERT_TAIL( &om_list, om, som_next );
+ if ( rom ) *rom = om;
return 0;
}
-void oidm_unparse( BerVarray *res )
+void oidm_unparse( BerVarray *res, OidMacro *start, OidMacro *end, int sys )
{
OidMacro *om;
int i, j, num;
struct berval bv, *bva = NULL, idx;
char ibuf[32], *ptr;
+ if ( !start )
+ start = LDAP_STAILQ_FIRST( &om_list );
+
/* count the result size */
i = 0;
- LDAP_SLIST_FOREACH( om, &om_list, som_next ) {
+ for ( om=start; om && om!=end; om=LDAP_STAILQ_NEXT(om, som_next)) {
+ if ( sys && !(om->som_flags & SLAP_OM_HARDCODE)) continue;
for ( j=0; !BER_BVISNULL(&om->som_names[j]); j++ );
i += j;
}
num = i;
+ if (!i) return;
+
bva = ch_malloc( (num+1) * sizeof(struct berval) );
BER_BVZERO( bva+num );
idx.bv_val = ibuf;
- LDAP_SLIST_FOREACH( om, &om_list, som_next ) {
- for ( j=0; !BER_BVISNULL(&om->som_names[j]); j++ );
- for ( i=num-j, j=0; i<num; i++,j++ ) {
- idx.bv_len = sprintf(idx.bv_val, "{%d}", i );
+ if ( sys ) {
+ idx.bv_len = 0;
+ ibuf[0] = '\0';
+ }
+ for ( i=0,om=start; om && om!=end; om=LDAP_STAILQ_NEXT(om, som_next)) {
+ if ( sys && !(om->som_flags & SLAP_OM_HARDCODE)) continue;
+ for ( j=0; !BER_BVISNULL(&om->som_names[j]); i++,j++ ) {
+ if ( !sys ) {
+ idx.bv_len = sprintf(idx.bv_val, "{%02d}", i );
+ }
bva[i].bv_len = idx.bv_len + om->som_names[j].bv_len +
om->som_subs[j].bv_len + 1;
bva[i].bv_val = ch_malloc( bva[i].bv_len + 1 );
ptr = lutil_strcopy( bva[i].bv_val, ibuf );
ptr = lutil_strcopy( ptr, om->som_names[j].bv_val );
*ptr++ = ' ';
- ptr = lutil_strcopy( ptr, om->som_subs[j].bv_val );
+ strcpy( ptr, om->som_subs[j].bv_val );
}
- num -= j;
+ if ( i>=num ) break;
}
*res = bva;
}
return -1;
}
- code = at_add(at, 0, &err);
+ code = at_add(at, 0, NULL, &err);
if ( code ) {
Debug( LDAP_DEBUG_ANY, "lastmod_init: "
"%s in attributeType '%s'\n",
return -1;
}
- code = oc_add(oc, 0, &err);
+ code = oc_add(oc, 0, NULL, &err);
if ( code ) {
Debug( LDAP_DEBUG_ANY,
"objectClass '%s': %s \"%s\"\n" ,
ldap_scherr2str(code), err );
return code;
}
- code = at_add( at, 0, &err );
+ code = at_add( at, 0, NULL, &err );
if ( !code ) {
slap_str2ad( at->at_names[0], &ad_queryid, &err );
}
ldap_scherr2str(code), err );
return code;
}
- code = at_add( at, 0, &err );
+ code = at_add( at, 0, NULL, &err );
if ( !code ) {
slap_str2ad( at->at_names[0], pwd_OpSchema[i].ad, &err );
}
int pos, AttributeType ***listp ));
LDAP_SLAPD_F (int) at_schema_info LDAP_P(( Entry *e ));
LDAP_SLAPD_F (int) at_add LDAP_P((
- LDAPAttributeType *at, int user, const char **err ));
+ LDAPAttributeType *at, int user,
+ AttributeType **sat, const char **err ));
LDAP_SLAPD_F (void) at_destroy LDAP_P(( void ));
LDAP_SLAPD_F (int) is_at_subtype LDAP_P((
LDAP_SLAPD_F (int) at_start LDAP_P(( AttributeType **at ));
LDAP_SLAPD_F (int) at_next LDAP_P(( AttributeType **at ));
+LDAP_SLAPD_F (void) at_unparse LDAP_P((
+ BerVarray *bva, AttributeType *start, AttributeType *end, int system ));
+
/*
* attr.c
*/
* cr.c
*/
LDAP_SLAPD_F (int) cr_schema_info( Entry *e );
+LDAP_SLAPD_F (void) cr_unparse LDAP_P((
+ BerVarray *bva, ContentRule *start, ContentRule *end, int system ));
LDAP_SLAPD_F (int) cr_add LDAP_P((
LDAPContentRule *oc,
int user,
+ ContentRule **scr,
const char **err));
+
LDAP_SLAPD_F (void) cr_destroy LDAP_P(( void ));
LDAP_SLAPD_F (ContentRule *) cr_find LDAP_P((
LDAP_SLAPD_F (int) oc_add LDAP_P((
LDAPObjectClass *oc,
int user,
+ ObjectClass **soc,
const char **err));
LDAP_SLAPD_F (void) oc_destroy LDAP_P(( void ));
: is_entry_objectclass((e), slap_schema.si_oc_syncConsumerSubentry, 1))
LDAP_SLAPD_F (int) oc_schema_info( Entry *e );
+LDAP_SLAPD_F (void) oc_unparse LDAP_P((
+ BerVarray *bva, ObjectClass *start, ObjectClass *end, int system ));
/*
* oidm.c
*/
LDAP_SLAPD_F(char *) oidm_find(char *oid);
LDAP_SLAPD_F (void) oidm_destroy LDAP_P(( void ));
-LDAP_SLAPD_F (void) oidm_unparse LDAP_P(( BerVarray *bva ));
+LDAP_SLAPD_F (void) oidm_unparse LDAP_P((
+ BerVarray *bva, OidMacro *start, OidMacro *end, int system ));
LDAP_SLAPD_F (int) parse_oidm LDAP_P((
- const char *fname, int lineno, int argc, char **argv, int user ));
+ const char *fname, int lineno, int argc, char **argv, int user,
+ OidMacro **om ));
/*
* operation.c
LDAP_SLAPD_F( int ) slap_valid_descr( const char * );
LDAP_SLAPD_F (int) parse_cr LDAP_P((
- const char *fname, int lineno, char *line, char **argv ));
+ const char *fname, int lineno, char *line, char **argv,
+ ContentRule **scr ));
LDAP_SLAPD_F (int) parse_oc LDAP_P((
- const char *fname, int lineno, char *line, char **argv ));
+ const char *fname, int lineno, char *line, char **argv,
+ ObjectClass **soc ));
LDAP_SLAPD_F (int) parse_at LDAP_P((
- const char *fname, int lineno, char *line, char **argv ));
+ const char *fname, int lineno, char *line, char **argv,
+ AttributeType **sat ));
LDAP_SLAPD_F (char *) scherr2str LDAP_P((int code)) LDAP_GCCATTR((const));
LDAP_SLAPD_F (int) dscompare LDAP_P(( const char *s1, const char *s2del,
char delim ));
return LDAP_OTHER;
}
- code = at_add( at, 0, &err );
+ code = at_add( at, 0, NULL, &err );
if ( code ) {
fprintf( stderr, "slap_schema_load: AttributeType "
"\"%s\": %s: \"%s\"\n",
return LDAP_OTHER;
}
- code = oc_add(oc,0,&err);
+ code = oc_add(oc,0,NULL,&err);
if ( code ) {
fprintf( stderr, "slap_schema_load: ObjectClass "
"\"%s\": %s: \"%s\"\n",
const char *fname,
int lineno,
char *line,
- char **argv )
+ char **argv,
+ ContentRule **scr )
{
LDAPContentRule *cr;
int code;
return 1;
}
- code = cr_add(cr,1,&err);
+ code = cr_add(cr,1,scr,&err);
if ( code ) {
fprintf( stderr, "%s: line %d: %s: \"%s\"\n",
fname, lineno, scherr2str(code), err);
const char *fname,
int lineno,
char *line,
- char **argv )
+ char **argv,
+ ObjectClass **soc )
{
LDAPObjectClass *oc;
int code;
return 1;
}
- code = oc_add(oc,1,&err);
+ code = oc_add(oc,1,soc,&err);
if ( code ) {
fprintf( stderr, "%s: line %d: %s: \"%s\"\n",
fname, lineno, scherr2str(code), err);
const char *fname,
int lineno,
char *line,
- char **argv )
+ char **argv,
+ AttributeType **sat )
{
LDAPAttributeType *at;
int code;
return 1;
}
- code = at_add(at,1,&err);
+ code = at_add(at,1,sat,&err);
if ( code ) {
fprintf( stderr, "%s: line %d: %s: \"%s\"\n",
fname, lineno, scherr2str(code), err);
BerVarray som_subs;
#define SLAP_OM_HARDCODE 0x10000U /* This is hardcoded schema */
int som_flags;
- LDAP_SLIST_ENTRY(slap_oid_macro) som_next;
+ LDAP_STAILQ_ENTRY(slap_oid_macro) som_next;
} OidMacro;
/* forward declarations */
slap_mask_t sat_flags;
- LDAP_SLIST_ENTRY(slap_attribute_type) sat_next;
+ LDAP_STAILQ_ENTRY(slap_attribute_type) sat_next;
#define sat_oid sat_atype.at_oid
#define sat_names sat_atype.at_names
#define soc_at_oids_may soc_oclass.oc_at_oids_may
#define soc_extensions soc_oclass.oc_extensions
- LDAP_SLIST_ENTRY(slap_object_class) soc_next;
+ LDAP_STAILQ_ENTRY(slap_object_class) soc_next;
} ObjectClass;
#define SLAP_OC_ALIAS 0x0001
#define scr_at_oids_may scr_crule.cr_at_oids_may
#define scr_at_oids_not scr_crule.cr_at_oids_not
- LDAP_SLIST_ENTRY( slap_content_rule ) scr_next;
+#define SLAP_CR_HARDCODE 0x10000U
+ int scr_flags;
+
+ LDAP_STAILQ_ENTRY( slap_content_rule ) scr_next;
} ContentRule;
/* Represents a recognized attribute description ( type + options ). */