assert( be != NULL );
/* grant database root access */
- if ( be != NULL && be_isroot( be, op->o_ndn.bv_val ) ) {
+ if ( be != NULL && be_isroot( be, &op->o_ndn ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_INFO,
"access_allowed: conn %d root access granted\n",
buf[sizeof(buf) - 1] = 0;
}
- if (backend_group(be, conn, op, e, buf, op->o_ndn.bv_val,
+ if (backend_group(be, conn, op, e, buf, &op->o_ndn,
b->a_group_oc, b->a_group_at) != 0)
{
continue;
assert( be != NULL );
/* short circuit root database access */
- if ( be_isroot( be, op->o_ndn.bv_val ) ) {
+ if ( be_isroot( be, &op->o_ndn ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"acl_check_modlist: conn %d access granted to root user\n",
const char *text;
AttributeDescription *desc = NULL;
if (slap_str2ad(attr, &desc, &text) == LDAP_SUCCESS) {
- backend_attribute(cp->be, NULL /*cp->conn*/,
- NULL /*cp->op*/, cp->e,
- ndn, desc, &bvals);
+ backend_attribute(cp->be, NULL, NULL,
+ cp->e, ndn, desc, &bvals);
if (bvals != NULL) {
for (i = 0; bvals[i] != NULL; i++) { }
vals = ch_calloc(i + 1, sizeof(char *));
&& slap_str2ad(setat, &desc, &text) == LDAP_SUCCESS )
{
backend_attribute(be, NULL, NULL, e,
- subjdn, desc, &bvals);
+ subjdn, desc, &bvals);
if ( bvals != NULL ) {
if ( bvals[0] != NULL )
set = ch_strdup(bvals[0]->bv_val);
if (grp_oc != NULL && grp_ad != NULL && grpdn != NULL) {
string_expand(grpdn, 1024, subjdn, e->e_ndn, matches);
if ( dn_normalize(grpdn) != NULL ) {
- rc = (backend_group(be, conn, op, e, grpdn, op->o_ndn.bv_val, grp_oc, grp_ad) == 0);
+ rc = (backend_group(be, conn, op, e, grpdn, &op->o_ndn, grp_oc, grp_ad) == 0);
}
}
}
/* check for referrals */
- rc = backend_check_referrals( be, conn, op, e->e_dn, e->e_ndn );
+ rc = backend_check_referrals( be, conn, op, &e->e_name, &e->e_nname );
if ( rc != LDAP_SUCCESS ) {
goto done;
}
* must be adding entry to at suffix
* or with parent ""
*/
- if ( !be_isroot( be, op->o_ndn.bv_val )) {
+ if ( !be_isroot( be, &op->o_ndn )) {
if ( be_issuffix( be, "" ) || be_isupdate( be, &op->o_ndn ) ) {
p = (Entry *)&slap_entry_root;
} else {
/* no parent, must be root to delete */
- if( ! be_isroot( be, op->o_ndn.bv_val ) ) {
+ if( ! be_isroot( be, &op->o_ndn ) ) {
if ( be_issuffix( be, "" ) || be_isupdate( be, &op->o_ndn ) ) {
p = (Entry *)&slap_entry_root;
* Note that this code always uses be_suffix[0], so defining
* multiple suffixes for a single backend won't work!
*/
- bdb->bi_sufflen = strlen(be->be_suffix[0]);
+ bdb->bi_sufflen = be->be_suffix[0]->bv_len;
rdns = ldap_explode_dn(be->be_nsuffix[0]->bv_val, 0);
for (i=0; rdns[i]; i++);
ptr--;
nptr--;
- strcpy(ptr, be->be_suffix[0]);
+ strcpy(ptr, be->be_suffix[0]->bv_val);
strcpy(nptr, be->be_nsuffix[0]->bv_val);
return 0;
Debug( LDAP_DEBUG_ARGS,
"bdb_db_open: %s\n",
- be->be_suffix[0], 0, 0 );
+ be->be_suffix[0]->bv_val, 0, 0 );
/* we should check existance of dbenv_home and db_directory */
bdb->bi_txn_cp = 0;
}
- bdb->bi_dbenv->set_errpfx( bdb->bi_dbenv, be->be_suffix[0] );
+ bdb->bi_dbenv->set_errpfx( bdb->bi_dbenv, be->be_suffix[0]->bv_val );
bdb->bi_dbenv->set_errcall( bdb->bi_dbenv, bdb_errcall );
#ifdef BDB_SUBDIRS
} else {
/* no parent, modrdn entry directly under root */
- isroot = be_isroot( be, op->o_ndn.bv_val );
+ isroot = be_isroot( be, &op->o_ndn );
if ( ! isroot ) {
if ( be_issuffix( be, "" ) || be_isupdate( be, &op->o_ndn ) ) {
} else {
if ( isroot == -1 ) {
- isroot = be_isroot( be, op->o_ndn.bv_val );
+ isroot = be_isroot( be, &op->o_ndn );
}
np_dn = ch_strdup( "" );
}
/* if not root, get appropriate limits */
- if ( be_isroot( be, op->o_ndn.bv_val ) ) {
+ if ( be_isroot( be, &op->o_ndn ) ) {
isroot = 1;
} else {
( void ) get_limits( be, op->o_ndn.bv_val, &limit );
}
/* if not root, get appropriate limits */
- if ( be_isroot( be, op->o_ndn.bv_val ) ) {
+ if ( be_isroot( be, &op->o_ndn ) ) {
isroot = 1;
} else {
( void ) get_limits( be, op->o_ndn.bv_val, &limit );
}
/* no parent, must be adding entry to root */
- if ( !be_isroot( be, op->o_ndn.bv_val ) ) {
+ if ( !be_isroot( be, &op->o_ndn ) ) {
if ( be_issuffix( be, "" ) || be_isupdate( be, &op->o_ndn ) ) {
p = (Entry *)&slap_entry_root;
} else {
/* no parent, must be root to delete */
- if( ! be_isroot( be, op->o_ndn.bv_val ) ) {
+ if( ! be_isroot( be, &op->o_ndn ) ) {
if ( be_issuffix( be, "" ) || be_isupdate( be, &op->o_ndn ) ) {
p = (Entry *)&slap_entry_root;
} else {
/* no parent, must be root to modify rdn */
- isroot = be_isroot( be, op->o_ndn.bv_val );
- if ( ! be_isroot ) {
+ isroot = be_isroot( be, &op->o_ndn );
+ if ( ! isroot ) {
if ( be_issuffix( be, "" ) || be_isupdate( be, &op->o_ndn ) ) {
p = (Entry *)&slap_entry_root;
/* no parent, must be root to modify newSuperior */
if ( isroot == -1 ) {
- isroot = be_isroot( be, op->o_ndn.bv_val );
+ isroot = be_isroot( be, &op->o_ndn );
}
- if ( ! be_isroot ) {
+ if ( ! isroot ) {
if ( be_issuffix( be, "" ) || be_isupdate( be, &op->o_ndn ) ) {
np = (Entry *)&slap_entry_root;
}
/* if not root, get appropriate limits */
- if ( be_isroot( be, op->o_ndn.bv_val ) ) {
+ if ( be_isroot( be, &op->o_ndn ) ) {
isroot = 1;
} else {
( void ) get_limits( be, op->o_ndn.bv_val, &limit );
nbaselen = strlen( nbase );
/* if not root, get appropriate limits */
- if ( be_isroot( be, op->o_ndn.bv_val ) ) {
+ if ( be_isroot( be, &op->o_ndn ) ) {
isroot = 1;
} else {
( void ) get_limits( be, op->o_ndn.bv_val, &limit );
attr_merge( e, monitor_ad_desc, bv );
for ( j = 0; be->be_suffix[j]; j++ ) {
- val.bv_val = be->be_suffix[j];
- val.bv_len = strlen( val.bv_val );
+ val = *be->be_suffix[j];
attr_merge( e, ad_nc, bv );
attr_merge( e_database, ad_nc, bv );
struct monitorinfo *mi;
Entry *e, *e_tmp;
struct monitorentrypriv *mp;
- int i;
- char buf[1024], *ndn, *end_of_line;
+ int i, rc;
+ char buf[1024], *end_of_line;
+ struct berval dn, *ndn;
const char *text;
struct berval val, *bv[2] = { &val, NULL };
}
monitor_defined++;
- ndn = ch_strdup( SLAPD_MONITOR_DN );
- charray_add( &be->be_suffix, ndn );
- dn_normalize( ndn );
- ber_bvecadd( &be->be_nsuffix, ber_bvstr( ndn ) );
+ ndn = NULL;
+ dn.bv_val = SLAPD_MONITOR_DN;
+ dn.bv_len = sizeof( SLAPD_MONITOR_DN ) - 1;
+
+ rc = dnNormalize( NULL, &dn, &ndn );
+ if( rc != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+ "monitor DN \"" SLAPD_MONITOR_DN "\" backend is allowed\n" ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "monitor DN \"" SLAPD_MONITOR_DN "\" backend is allowed\n",
+ 0, 0, 0 );
+#endif
+ return -1;
+ }
+
+ ber_bvecadd( &be->be_nsuffix, ndn );
mi = ( struct monitorinfo * )ch_calloc( sizeof( struct monitorinfo ), 1 );
ldap_pvt_thread_mutex_init( &mi->mi_cache_mutex );
int i;
for( i=0; be->be_nsuffix[i] != NULL; i++ ) {
if( dn_issuffix( nbase, be->be_nsuffix[i]->bv_val ) ) {
- matched = be->be_suffix[i];
+ matched = be->be_suffix[i]->bv_val;
break;
}
}
attr_merge( e, ad_objectClass, vals );
/* rdn attribute type should be a configuratable item */
- sprintf( buf, "uid=%s,%s", pw->pw_name, be->be_suffix[0] );
- e->e_dn = ch_strdup( buf );
- e->e_ndn = ch_strdup( buf );
- (void) dn_normalize( e->e_ndn );
+ sprintf( buf, "uid=%s,%s", pw->pw_name, be->be_suffix[0]->bv_val );
+ e->e_name.bv_val = ch_strdup( buf );
+ e->e_name.bv_len = strlen( e->e_name.bv_val );
+
+ e->e_nname.bv_val = ch_strdup( buf );
+ (void) dn_normalize( e->e_nname );
+ e->e_nname.bv_len = strlen( e->e_name.bv_val );
val.bv_val = pw->pw_name;
val.bv_len = strlen( pw->pw_name );
int i;
for ( i = 0; be->be_suffix[i] != NULL; i++ ) {
- fprintf( fp, "suffix: %s\n", be->be_suffix[i] );
+ fprintf( fp, "suffix: %s\n", be->be_suffix[i].bv_val );
}
}
/* TimesTen : Pass it along to the lower level routines */
srch_info.isTimesTen = bi->isTimesTen;
- if (tlimit == 0 && be_isroot(be,op->o_ndn.bv_val))
+ if (tlimit == 0 && be_isroot(be,&op->o_ndn))
{
tlimit = -1; /* allow root to set no limit */
}
stoptime = op->o_time + tlimit;
}
- if (slimit == 0 && be_isroot(be,op->o_ndn.bv_val))
+ if (slimit == 0 && be_isroot(be,&op->o_ndn))
{
slimit = -1; /* allow root to set no limit */
}
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
"backend_startup: starting \"%s\"\n",
- be->be_suffix[0] ));
+ be->be_suffix[0]->bv_val ));
#else
Debug( LDAP_DEBUG_TRACE,
"backend_startup: starting \"%s\"\n",
- be->be_suffix[0], 0, 0 );
+ be->be_suffix[0]->bv_val, 0, 0 );
#endif
if ( be->bd_info->bi_open ) {
backendDB[i].bd_info->bi_db_destroy(
&backendDB[i] );
}
- charray_free( backendDB[i].be_suffix );
+ ber_bvecfree( backendDB[i].be_suffix );
ber_bvecfree( backendDB[i].be_nsuffix );
free( backendDB[i].be_rootdn.bv_val );
free( backendDB[i].be_rootndn.bv_val );
}
int
-be_isroot( Backend *be, const char *ndn )
+be_isroot( Backend *be, struct berval *ndn )
{
- int rc;
-
- if ( ndn == NULL || *ndn == '\0' ) {
+ if ( !ndn->bv_len ) {
return( 0 );
}
return( 0 );
}
- rc = strcmp( be->be_rootndn.bv_val, ndn ) ? 0 : 1;
-
- return(rc);
+ return strcmp( be->be_rootndn.bv_val, ndn->bv_val ) ? 0 : 1;
}
int
int
be_isroot_pw( Backend *be,
Connection *conn,
- const char *ndn,
+ const char *dn,
struct berval *cred )
{
int result;
- if ( ! be_isroot( be, ndn ) ) {
+ struct berval ndn;
+ ndn.bv_val = (char *) dn;
+ ndn.bv_len = dn ? strlen( dn ) : 0;
+
+ if ( ! be_isroot( be, &ndn ) ) {
return 0;
}
Backend *be,
Connection *conn,
Operation *op,
- const char *dn,
- const char *ndn )
+ struct berval *dn,
+ struct berval *ndn )
{
int rc = LDAP_SUCCESS;
const char *text;
rc = be->be_chk_referrals( be,
- conn, op, dn, ndn, &text );
+ conn, op, dn->bv_val, ndn->bv_val, &text );
if( rc != LDAP_SUCCESS && rc != LDAP_REFERRAL ) {
send_ldap_result( conn, op, rc,
Operation *op,
Entry *target,
const char *gr_ndn,
- const char *op_ndn,
+ struct berval *op_ndn,
ObjectClass *group_oc,
AttributeDescription *group_at
)
if( be->be_group ) {
int res = be->be_group( be, conn, op,
- target, gr_ndn, op_ndn,
+ target, gr_ndn, op_ndn->bv_val,
group_oc, group_at );
if (op->o_tag != LDAP_REQ_BIND) {
* add them to the attribute list
*/
if ( ( opattrs || attrs ) && be && be->be_operational != NULL ) {
- ( void )be->be_operational( be, conn, op, e,
- attrs, opattrs, ap );
+ ( void )be->be_operational( be, conn, op, e, attrs, opattrs, ap );
}
return a;
if (scope == LDAP_SCOPE_ONELEVEL &&
!strcmp (gi->n[i].pdn, ndn)) {
rc = be->be_search (be, conn, op,
- be->be_suffix[0],
+ be->be_suffix[0]->bv_val,
be->be_nsuffix[0]->bv_val,
LDAP_SCOPE_BASE, deref,
s2limit, t2limit, filter, filterstr,
} else if (scope == LDAP_SCOPE_SUBTREE &&
dnIsSuffix(be->be_nsuffix[0], &bv)) {
rc = be->be_search (be, conn, op,
- be->be_suffix[0],
+ be->be_suffix[0]->bv_val,
be->be_nsuffix[0]->bv_val,
scope, deref,
s2limit, t2limit, filter, filterstr,
}
/* check for referrals */
- rc = backend_check_referrals( be, conn, op, pdn->bv_val, ndn->bv_val );
+ rc = backend_check_referrals( be, conn, op, pdn, ndn );
if ( rc != LDAP_SUCCESS ) {
goto cleanup;
}
LDAP_LOG(( "config", LDAP_LEVEL_INFO,
"%s: line %d: suffix already served by a preceding "
"backend \"%s\"\n", fname, lineno,
- tmp_be->be_suffix[0] ));
+ tmp_be->be_suffix[0]->bv_val ));
#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix "
"already served by a preceeding backend \"%s\"\n",
- fname, lineno, tmp_be->be_suffix[0] );
+ fname, lineno, tmp_be->be_suffix[0]->bv_val );
#endif
ber_bvfree( pdn );
ber_bvfree( ndn );
#endif
}
- charray_add( &be->be_suffix, pdn->bv_val );
+ ber_bvecadd( &be->be_suffix, pdn );
ber_bvecadd( &be->be_nsuffix, ndn );
/* set database suffixAlias */
LDAP_LOG(( "config", LDAP_LEVEL_INFO,
"%s: line %d: suffixAlias served by a preceeding "
"backend \"%s\"\n",
- fname, lineno, tmp_be->be_suffix[0] ));
+ fname, lineno, tmp_be->be_suffix[0]->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: suffixAlias served by"
" a preceeding backend \"%s\"\n",
- fname, lineno, tmp_be->be_suffix[0] );
+ fname, lineno, tmp_be->be_suffix[0]->bv_val );
#endif
ber_bvfree( palias );
return -1;
#ifdef NEW_LOGGING
LDAP_LOG(( "config", LDAP_LEVEL_INFO,
"%s: line %d: suffixAlias derefs to a different backend "
- "a preceeding backend \"%s\" (ignored)\n",
- fname, lineno, tmp_be->be_suffix[0] ));
+ "a preceeding backend \"%s\"\n",
+ fname, lineno, tmp_be->be_suffix[0]->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: suffixAlias derefs to differnet backend"
- " a preceeding backend \"%s\" (ignored)\n",
- fname, lineno, tmp_be->be_suffix[0] );
+ " a preceeding backend \"%s\"\n",
+ fname, lineno, tmp_be->be_suffix[0]->bv_val );
#endif
ber_bvfree( palias );
ber_bvfree( paliased );
strcpy( buf, backends[i].be_type );
for ( j = 0; backends[i].be_suffix[j] != NULL; j++ ) {
strcat( buf, " : " );
- strcat( buf, backends[i].be_suffix[j] );
+ strcat( buf, backends[i].be_suffix[j]->bv_val );
}
val.bv_val = buf;
val.bv_len = strlen( buf );
}
/* check for referrals */
- rc = backend_check_referrals( be, conn, op, pdn->bv_val, ndn->bv_val );
+ rc = backend_check_referrals( be, conn, op, pdn, ndn );
if ( rc != LDAP_SUCCESS ) {
goto cleanup;
}
}
/* check for referrals */
- rc = backend_check_referrals( be, conn, op, pdn->bv_val, ndn->bv_val );
+ rc = backend_check_referrals( be, conn, op, pdn, ndn );
if ( rc != LDAP_SUCCESS ) {
goto cleanup;
}
}
/* check for referrals */
- rc = backend_check_referrals( be, conn, op, pdn->bv_val, ndn->bv_val );
+ rc = backend_check_referrals( be, conn, op, pdn, ndn );
if ( rc != LDAP_SUCCESS ) {
goto cleanup;
}
* at.c
*/
-LDAP_SLAPD_F (void) at_config LDAP_P(( const char *fname, int lineno, int argc, char **argv ));
-LDAP_SLAPD_F (AttributeType *) at_find LDAP_P(( const char *name ));
-LDAP_SLAPD_F (int) at_find_in_list LDAP_P(( AttributeType *sat, AttributeType **list ));
-LDAP_SLAPD_F (int) at_append_to_list LDAP_P(( AttributeType *sat, AttributeType ***listp ));
-LDAP_SLAPD_F (int) at_delete_from_list LDAP_P(( int pos, AttributeType ***listp ));
+LDAP_SLAPD_F (void) at_config LDAP_P((
+ const char *fname, int lineno,
+ int argc, char **argv ));
+LDAP_SLAPD_F (AttributeType *) at_find LDAP_P((
+ const char *name ));
+LDAP_SLAPD_F (int) at_find_in_list LDAP_P((
+ AttributeType *sat, AttributeType **list ));
+LDAP_SLAPD_F (int) at_append_to_list LDAP_P((
+ AttributeType *sat, AttributeType ***listp ));
+LDAP_SLAPD_F (int) at_delete_from_list LDAP_P((
+ 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, const char **err ));
+LDAP_SLAPD_F (int) at_add LDAP_P((
+ LDAPAttributeType *at, const char **err ));
LDAP_SLAPD_F (int) is_at_subtype LDAP_P((
AttributeType *sub,
LDAP_SLAPD_F (int) attr_merge LDAP_P(( Entry *e,
AttributeDescription *desc,
struct berval **vals ));
-LDAP_SLAPD_F (Attribute *) attrs_find LDAP_P(( Attribute *a, AttributeDescription *desc ));
-LDAP_SLAPD_F (Attribute *) attr_find LDAP_P(( Attribute *a, AttributeDescription *desc ));
-LDAP_SLAPD_F (int) attr_delete LDAP_P(( Attribute **attrs, AttributeDescription *desc ));
+LDAP_SLAPD_F (Attribute *) attrs_find LDAP_P((
+ Attribute *a, AttributeDescription *desc ));
+LDAP_SLAPD_F (Attribute *) attr_find LDAP_P((
+ Attribute *a, AttributeDescription *desc ));
+LDAP_SLAPD_F (int) attr_delete LDAP_P((
+ Attribute **attrs, AttributeDescription *desc ));
LDAP_SLAPD_F (void) attrs_free LDAP_P(( Attribute *a ));
LDAP_SLAPD_F (Attribute *) attrs_dup LDAP_P(( Attribute *a ));
int manageDSAit,
int noSubordinates ));
-LDAP_SLAPD_F (int) be_issuffix LDAP_P(( Backend *be, const char *suffix ));
-LDAP_SLAPD_F (int) be_isroot LDAP_P(( Backend *be, const char *ndn ));
+LDAP_SLAPD_F (int) be_issuffix LDAP_P(( Backend *be,
+ const char *suffix ));
+LDAP_SLAPD_F (int) be_isroot LDAP_P(( Backend *be,
+ struct berval *ndn ));
LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Backend *be,
Connection *conn, const char *ndn, struct berval *cred ));
LDAP_SLAPD_F (int) be_isupdate LDAP_P(( Backend *be, struct berval *ndn ));
BackendDB *be,
Connection *conn,
Operation *op,
- const char *dn,
- const char *ndn ));
+ struct berval *dn,
+ struct berval *ndn ));
LDAP_SLAPD_F (int) backend_connection_init LDAP_P((Connection *conn));
LDAP_SLAPD_F (int) backend_connection_destroy LDAP_P((Connection *conn));
Operation *op,
Entry *target,
const char *gr_ndn,
- const char *op_ndn,
+ struct berval *op_ndn,
ObjectClass *group_oc,
AttributeDescription *group_at
));
LDAP_SLAPD_F (void) connection_closing LDAP_P(( Connection *c ));
LDAP_SLAPD_F (int) connection_state_closing LDAP_P(( Connection *c ));
-LDAP_SLAPD_F (const char *) connection_state2str LDAP_P(( int state )) LDAP_GCCATTR((const));
+LDAP_SLAPD_F (const char *) connection_state2str LDAP_P(( int state ))
+ LDAP_GCCATTR((const));
LDAP_SLAPD_F (int) connection_write LDAP_P((ber_socket_t s));
LDAP_SLAPD_F (int) connection_read LDAP_P((ber_socket_t s));
LDAP_SLAPD_F (unsigned long) connections_nextid(void);
-LDAP_SLAPD_F (Connection *) connection_first LDAP_P((ber_socket_t *));
-LDAP_SLAPD_F (Connection *) connection_next LDAP_P((Connection *, ber_socket_t *));
+LDAP_SLAPD_F (Connection *) connection_first LDAP_P(( ber_socket_t * ));
+LDAP_SLAPD_F (Connection *) connection_next LDAP_P((
+ Connection *, ber_socket_t *));
LDAP_SLAPD_F (void) connection_done LDAP_P((Connection *));
LDAP_SLAPD_F (void) connection2anonymous LDAP_P((Connection *));
typedef int (*SLAP_EXTOP_GETOID_FN) LDAP_P((
int index, char *oid, int blen ));
-LDAP_SLAPD_F (int) load_extension LDAP_P((const void *module, const char *file_name));
+LDAP_SLAPD_F (int) load_extension LDAP_P((
+ const void *module, const char *file_name));
LDAP_SLAPD_F (char *) get_supported_extension LDAP_P((int index));
LDAP_SLAPD_F (int) load_extop LDAP_P((
Backend *be, int type, const char *pattern,
struct slap_limits_set *limit ));
LDAP_SLAPD_F (int) parse_limits LDAP_P((
- Backend *be, const char *fname, int lineno, int argc, char **argv ));
+ Backend *be, const char *fname, int lineno, int argc, char **argv ));
LDAP_SLAPD_F (int) parse_limit LDAP_P(( const char *arg,
struct slap_limits_set *limit ));
ObjectClass *sup ));
-LDAP_SLAPD_F (Syntax *) syn_find LDAP_P((const char *synname));
-LDAP_SLAPD_F (Syntax *) syn_find_desc LDAP_P((const char *syndesc, int *slen));
+LDAP_SLAPD_F (Syntax *) syn_find LDAP_P((
+ const char *synname ));
+LDAP_SLAPD_F (Syntax *) syn_find_desc LDAP_P((
+ const char *syndesc, int *slen ));
#ifdef SLAPD_BINARY_CONVERSION
LDAP_SLAPD_F (int) syn_add LDAP_P((
LDAPSyntax *syn,
slap_syntax_transform_func *pretty,
slap_syntax_transform_func *ber2str,
slap_syntax_transform_func *str2ber,
- const char **err));
+ const char **err ));
#else
LDAP_SLAPD_F (int) syn_add LDAP_P((
LDAPSyntax *syn,
slap_syntax_validate_func *validate,
slap_syntax_transform_func *normalize,
slap_syntax_transform_func *pretty,
- const char **err));
+ const char **err ));
#endif
LDAP_SLAPD_F (MatchingRule *) mr_find LDAP_P((const char *mrname));
-LDAP_SLAPD_F (int) mr_add LDAP_P((LDAPMatchingRule *mr,
+LDAP_SLAPD_F (int) mr_add LDAP_P(( LDAPMatchingRule *mr,
unsigned usage,
slap_mr_convert_func *convert,
slap_mr_normalize_func *normalize,
slap_mr_indexer_func *indexer,
slap_mr_filter_func *filter,
MatchingRule * associated,
- const char **err));
+ const char **err ));
LDAP_SLAPD_F (int) register_syntax LDAP_P((
const char *desc,
LDAP_SLAPD_F (int) is_entry_objectclass LDAP_P((
Entry *, ObjectClass *oc ));
-#define is_entry_alias(e) is_entry_objectclass((e), slap_schema.si_oc_alias)
-#define is_entry_referral(e) is_entry_objectclass((e), slap_schema.si_oc_referral)
+#define is_entry_alias(e) \
+ is_entry_objectclass((e), slap_schema.si_oc_alias)
+#define is_entry_referral(e) \
+ is_entry_objectclass((e), slap_schema.si_oc_referral)
/*
if ( backends[i].be_glueflags & SLAP_GLUE_SUBORDINATE )
continue;
for ( j = 0; backends[i].be_suffix[j] != NULL; j++ ) {
- val.bv_val = backends[i].be_suffix[j];
- val.bv_len = strlen( val.bv_val );
+ val = *backends[i].be_suffix[j];
attr_merge( e, ad_namingContexts, vals );
}
}
}
/* check for referrals */
- rc = backend_check_referrals( be, conn, op, pbase->bv_val, nbase->bv_val );
+ rc = backend_check_referrals( be, conn, op, pbase, nbase );
if ( rc != LDAP_SUCCESS ) {
goto return_results;
}
LDAP_SLAPD_V (int) nBackendInfo;
LDAP_SLAPD_V (int) nBackendDB;
-LDAP_SLAPD_V (BackendInfo *) backendInfo;
+LDAP_SLAPD_V (BackendInfo *) backendInfo;
LDAP_SLAPD_V (BackendDB *) backendDB;
LDAP_SLAPD_V (int) slapMode;
#define SLAP_LIMITS_ANONYMOUS 0x0006
#define SLAP_LIMITS_USERS 0x0007
regex_t lm_dn_regex; /* regex data for REGEX */
- struct berval *lm_dn_pat; /* ndn for EXACT, BASE, ONE, SUBTREE,
- * CHILDREN; pattern for REGEX; NULL
- * for ANONYMOUS, USERS */
+
+ /*
+ * normalized DN for EXACT, BASE, ONE, SUBTREE, CHILDREN;
+ * pattern for REGEX; NULL for ANONYMOUS, USERS
+ */
+ struct berval *lm_dn_pat;
+
struct slap_limits_set lm_limits;
};
slap_ssf_set_t be_ssf_set;
/* these should be renamed from be_ to bd_ */
- char **be_suffix; /* the DN suffixes of data in this backend */
+ struct berval **be_suffix; /* the DN suffixes of data in this backend */
struct berval **be_nsuffix; /* the normalized DN suffixes in this backend */
struct berval **be_suffixAlias; /* pairs of DN suffix aliases and deref values */
struct berval be_rootdn; /* the magic "root" name (DN) for this db */
char *be_replogfile; /* replication log file (in master) */
struct berval be_update_ndn; /* allowed to make changes (in replicas) */
struct berval **be_update_refs; /* where to refer modifying clients to */
+ char *be_realm;
int be_lastmod; /* keep track of lastmodified{by,time} */
#define SLAP_GLUE_INSTANCE 0x01 /* a glue backend */
#define SLAP_GLUE_LINKED 0x04 /* child is connected to parent */
int be_glueflags; /* */
-
- char *be_realm;
-
void *be_private; /* anything the backend database needs */
};
fprintf( stderr, "%s: line %d: "
"database (%s) not configured to hold \"%s\"\n",
progname, lineno,
- be ? be->be_suffix[0] : "<none>",
+ be ? be->be_suffix[0]->bv_val : "<none>",
e->e_dn );
fprintf( stderr, "%s: line %d: "
"database (%s) not configured to hold \"%s\"\n",