From: Howard Chu Date: Wed, 26 Dec 2001 08:17:44 +0000 (+0000) Subject: Changed search attrs to struct berval **. X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~513 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=68b1bbb89d6914fe412e4d56a51ab38f3453c891;p=openldap Changed search attrs to struct berval **. Use typedefs for all backend functions, to minimize work in future API updates. (back-*/external.h will never need updating in the future.) --- diff --git a/servers/slapd/aclparse.c b/servers/slapd/aclparse.c index 0fc89c294c..e9039552ad 100644 --- a/servers/slapd/aclparse.c +++ b/servers/slapd/aclparse.c @@ -210,12 +210,8 @@ parse_acl( } } else if ( strncasecmp( left, "attr", 4 ) == 0 ) { - char **alist; - - alist = str2charray( right, "," ); - charray_merge( &a->acl_attrs, alist ); - charray_free( alist ); - + a->acl_attrs = str2bvec( a->acl_attrs, + right, "," ); } else { fprintf( stderr, "%s: line %d: expecting got \"%s\"\n", @@ -1281,7 +1277,7 @@ acl_free( AccessControl *a ) if ( a->acl_dn_pat.bv_len ) free ( a->acl_dn_pat.bv_val ); if ( a->acl_attrs ) - charray_free( a->acl_attrs ); + ber_bvecfree( a->acl_attrs ); for (; a->acl_access; a->acl_access = n) { n = a->acl_access->a_next; access_free( a->acl_access ); @@ -1494,7 +1490,7 @@ print_acl( Backend *be, AccessControl *a ) if ( ! first ) { fprintf( stderr, "," ); } - fprintf( stderr, a->acl_attrs[i] ); + fputs( a->acl_attrs[i]->bv_val, stderr ); first = 0; } fprintf( stderr, "\n" ); diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 7136b420b5..219b66b9b1 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -266,7 +266,7 @@ int is_ad_subtype( int ad_inlist( AttributeDescription *desc, - char **attrs ) + struct berval **attrs ) { int i; for( i=0; attrs[i] != NULL; i++ ) { @@ -275,7 +275,7 @@ int ad_inlist( const char *text; int rc; - rc = slap_str2ad( attrs[i], &ad, &text ); + rc = slap_bv2ad( attrs[i], &ad, &text ); if( rc == LDAP_SUCCESS ) { rc = is_ad_subtype( desc, ad ); if( rc ) return 1; @@ -286,7 +286,7 @@ int ad_inlist( * EXTENSION: see if requested description is an object class * if so, return attributes which the class requires/allows */ - oc = oc_find( attrs[i] ); + oc = oc_bvfind( attrs[i] ); if( oc != NULL ) { if ( oc == slap_schema.si_oc_extensibleObject ) { /* extensibleObject allows the return of anything */ diff --git a/servers/slapd/back-bdb/extended.c b/servers/slapd/back-bdb/extended.c index 3af4d650d7..90ccabdcf0 100644 --- a/servers/slapd/back-bdb/extended.c +++ b/servers/slapd/back-bdb/extended.c @@ -15,7 +15,7 @@ static struct exop { char *oid; - SLAP_EXTENDED_FN extended; + BI_op_extended *extended; } exop_table[] = { { LDAP_EXOP_X_MODIFY_PASSWD, bdb_exop_passwd }, { NULL, NULL } diff --git a/servers/slapd/back-bdb/external.h b/servers/slapd/back-bdb/external.h index 0784a7cdd3..6d7c52a2bc 100644 --- a/servers/slapd/back-bdb/external.h +++ b/servers/slapd/back-bdb/external.h @@ -9,59 +9,29 @@ LDAP_BEGIN_DECL -extern int bdb_initialize LDAP_P(( BackendInfo *bi )); - -extern int bdb_db_config LDAP_P(( BackendDB *bd, - const char *fname, int lineno, - int argc, char **argv )); - -extern int bdb_add LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, Entry *e )); - -extern int bdb_bind LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, int method, - struct berval *cred, char** edn )); - -extern int bdb_compare LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, - AttributeAssertion *ava )); - -extern int bdb_delete LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn )); - -extern int bdb_abandon LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, ber_int_t msgid )); - -extern int bdb_modify LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, Modifications *ml )); - -extern int bdb_modrdn LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, - const char* newrdn, int deleteoldrdn, - const char *newSuperior )); - -extern int bdb_search LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *base, const char *nbase, - int scope, int deref, int sizelimit, int timelimit, - Filter *filter, const char *filterstr, - char **attrs, int attrsonly )); - -extern int bdb_unbind LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op )); - -extern int bdb_referrals( - BackendDB *be, - Connection *conn, - Operation *op, - const char *dn, - const char *ndn, - const char **text ); +extern BI_init bdb_initialize; + +extern BI_db_config bdb_db_config; + +extern BI_op_add bdb_add; + +extern BI_op_bind bdb_bind; + +extern BI_op_compare bdb_compare; + +extern BI_op_delete bdb_delete; + +extern BI_op_abandon bdb_abandon; + +extern BI_op_modify bdb_modify; + +extern BI_op_modrdn bdb_modrdn; + +extern BI_op_search bdb_search; + +extern BI_op_unbind bdb_unbind; + +extern BI_chk_referrals bdb_referrals; LDAP_END_DECL diff --git a/servers/slapd/back-bdb/proto-bdb.h b/servers/slapd/back-bdb/proto-bdb.h index 88e9bb87f1..5323b643b9 100644 --- a/servers/slapd/back-bdb/proto-bdb.h +++ b/servers/slapd/back-bdb/proto-bdb.h @@ -43,10 +43,7 @@ void bdb_attr_index_destroy LDAP_P(( Avlnode *tree )); * attribute.c */ -int -bdb_attribute LDAP_P(( Backend *be, Connection *conn, Operation *op, - Entry *target, const char *entry_ndn, AttributeDescription *entry_at, - struct berval ***vals )); +BI_acl_attribute bdb_attribute; /* * dbcache.c @@ -107,7 +104,7 @@ bdb_dn2idl( * entry.c */ int bdb_entry_return( BackendDB *be, Entry *e ); -int bdb_entry_release( BackendDB *, Connection *, Operation *, Entry *, int ); +BI_entry_release_rw bdb_entry_release; /* * error.c @@ -127,15 +124,7 @@ int bdb_filter_candidates( * group.c */ -int bdb_group( - Backend *be, - Connection *conn, - Operation *op, - Entry *target, - const char *gr_ndn, - const char *op_ndn, - ObjectClass *group_oc, - AttributeDescription *group_at); +BI_acl_group bdb_group; /* * id2entry @@ -286,28 +275,17 @@ int bdb_modify_internal( /* * passwd.c */ -int -bdb_exop_passwd( - Backend *be, - Connection *conn, - Operation *op, - const char *reqoid, - struct berval *reqdata, - char **rspoid, - struct berval **rspdata, - LDAPControl *** rspctrls, - const char **text, - struct berval *** refs ); +BI_op_extended bdb_exop_passwd; /* * tools.c */ -int bdb_tool_entry_open( BackendDB *be, int mode ); -int bdb_tool_entry_close( BackendDB *be ); -ID bdb_tool_entry_next( BackendDB *be ); -Entry* bdb_tool_entry_get( BackendDB *be, ID id ); -ID bdb_tool_entry_put( BackendDB *be, Entry *e ); -int bdb_tool_entry_reindex( BackendDB *be, ID id ); +BI_tool_entry_open bdb_tool_entry_open; +BI_tool_entry_close bdb_tool_entry_close; +BI_tool_entry_next bdb_tool_entry_next; +BI_tool_entry_get bdb_tool_entry_get; +BI_tool_entry_put bdb_tool_entry_put; +BI_tool_entry_reindex bdb_tool_entry_reindex; LDAP_END_DECL diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 849077ba0e..12bf7373eb 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -40,7 +40,7 @@ bdb_search( int tlimit, Filter *filter, const char *filterstr, - char **attrs, + struct berval **attrs, int attrsonly ) { struct bdb_info *bdb = (struct bdb_info *) be->be_private; diff --git a/servers/slapd/back-dnssrv/search.c b/servers/slapd/back-dnssrv/search.c index ba1d6816b7..40a5f294be 100644 --- a/servers/slapd/back-dnssrv/search.c +++ b/servers/slapd/back-dnssrv/search.c @@ -30,7 +30,7 @@ dnssrv_back_search( int time, Filter *filter, const char *filterstr, - char **attrs, + struct berval **attrs, int attrsonly ) { int i; diff --git a/servers/slapd/back-ldap/external.h b/servers/slapd/back-ldap/external.h index 570250e128..86f2e23803 100644 --- a/servers/slapd/back-ldap/external.h +++ b/servers/slapd/back-ldap/external.h @@ -9,74 +9,38 @@ LDAP_BEGIN_DECL -extern int ldap_back_initialize LDAP_P(( BackendInfo *bi )); -extern int ldap_back_open LDAP_P(( BackendInfo *bi )); -extern int ldap_back_close LDAP_P(( BackendInfo *bi )); -extern int ldap_back_destroy LDAP_P(( BackendInfo *bi )); - -extern int ldap_back_db_init LDAP_P(( BackendDB *bd )); -extern int ldap_back_db_destroy LDAP_P(( BackendDB *bd )); - -extern int ldap_back_db_config LDAP_P(( BackendDB *bd, - const char *fname, int lineno, int argc, char **argv )); - -extern int ldap_back_bind LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, int method, - struct berval *cred, char** edn )); - -extern int ldap_back_conn_destroy LDAP_P(( BackendDB *bd, - Connection *conn )); - -extern int ldap_back_search LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *base, const char *nbase, - int scope, int deref, int sizelimit, int timelimit, - Filter *filter, const char *filterstr, - char **attrs, int attrsonly )); - -extern int ldap_back_compare LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, - AttributeAssertion *ava )); - -extern int ldap_back_modify LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, Modifications *ml )); - -extern int ldap_back_modrdn LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, - const char *newrdn, int deleteoldrdn, - const char *newSuperior )); - -extern int ldap_back_add LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, Entry *e )); - -extern int ldap_back_delete LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn )); - -extern int ldap_back_abandon LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, int msgid )); - -extern int ldap_back_group LDAP_P(( BackendDB *bd, - Connection *conn, - Operation *op, - Entry *target, - const char* gr_ndn, - const char* op_ndn, - ObjectClass* group_oc, - AttributeDescription* group_at)); - -extern int ldap_back_attribute LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - Entry *target, - const char* ndn, - AttributeDescription* entry_at, - struct berval ***vals)); +extern BI_init ldap_back_initialize; +extern BI_open ldap_back_open; +extern BI_close ldap_back_close; +extern BI_destroy ldap_back_destroy; + +extern BI_db_init ldap_back_db_init; +extern BI_db_destroy ldap_back_db_destroy; + +extern BI_db_config ldap_back_db_config; + +extern BI_op_bind ldap_back_bind; + +extern BI_connection_destroy ldap_back_conn_destroy; + +extern BI_op_search ldap_back_search; + +extern BI_op_compare ldap_back_compare; + +extern BI_op_modify ldap_back_modify; + +extern BI_op_modrdn ldap_back_modrdn; + +extern BI_op_add ldap_back_add; + +extern BI_op_delete ldap_back_delete; + +extern BI_op_abandon ldap_back_abandon; + +extern BI_acl_group ldap_back_group; + +extern BI_acl_attribute ldap_back_attribute; LDAP_END_DECL #endif /* _LDAP_EXTERNAL_H */ - diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index 2801d7c1a2..8ede770591 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -47,7 +47,7 @@ #include "back-ldap.h" static void ldap_send_entry( Backend *be, Operation *op, struct ldapconn *lc, - LDAPMessage *e, char **attrs, int attrsonly ); + LDAPMessage *e, struct berval **attrs, int attrsonly ); int ldap_back_search( @@ -62,7 +62,7 @@ ldap_back_search( int tlimit, Filter *filter, const char *filterstr, - char **attrs, + struct berval **attrs, int attrsonly ) { @@ -363,7 +363,7 @@ ldap_send_entry( Operation *op, struct ldapconn *lc, LDAPMessage *e, - char **attrs, + struct berval **attrs, int attrsonly ) { diff --git a/servers/slapd/back-ldbm/extended.c b/servers/slapd/back-ldbm/extended.c index e5971db87b..0981699241 100644 --- a/servers/slapd/back-ldbm/extended.c +++ b/servers/slapd/back-ldbm/extended.c @@ -18,7 +18,7 @@ struct exop { char *oid; - SLAP_EXTENDED_FN extended; + BI_op_extended *extended; } exop_table[] = { { LDAP_EXOP_X_MODIFY_PASSWD, ldbm_back_exop_passwd }, { NULL, NULL } diff --git a/servers/slapd/back-ldbm/external.h b/servers/slapd/back-ldbm/external.h index 9e1e33a635..464d56d4ac 100644 --- a/servers/slapd/back-ldbm/external.h +++ b/servers/slapd/back-ldbm/external.h @@ -9,109 +9,57 @@ LDAP_BEGIN_DECL -extern int ldbm_back_initialize LDAP_P(( BackendInfo *bi )); -extern int ldbm_back_open LDAP_P(( BackendInfo *bi )); -extern int ldbm_back_close LDAP_P(( BackendInfo *bi )); -extern int ldbm_back_destroy LDAP_P(( BackendInfo *bi )); - -extern int ldbm_back_db_init LDAP_P(( BackendDB *bd )); -extern int ldbm_back_db_open LDAP_P(( BackendDB *bd )); -extern int ldbm_back_db_close LDAP_P(( BackendDB *bd )); -extern int ldbm_back_db_destroy LDAP_P(( BackendDB *bd )); - -extern int ldbm_back_db_config LDAP_P(( BackendDB *bd, - const char *fname, int lineno, - int argc, char **argv )); - -extern int ldbm_back_extended LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *reqoid, - struct berval *reqdata, - char **rspoid, - struct berval **rspdata, - LDAPControl *** rspctrls, - const char **text, - struct berval *** refs )); - -extern int ldbm_back_bind LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, int method, - struct berval *cred, char** edn )); - -extern int ldbm_back_unbind LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op )); - -extern int ldbm_back_search LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *base, const char *nbase, - int scope, int deref, int sizelimit, int timelimit, - Filter *filter, const char *filterstr, - char **attrs, int attrsonly )); - -extern int ldbm_back_compare LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, - AttributeAssertion *ava )); - -extern int ldbm_back_modify LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, Modifications *ml )); - -extern int ldbm_back_modrdn LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, - const char* newrdn, int deleteoldrdn, - const char *newSuperior )); - -extern int ldbm_back_add LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, Entry *e )); - -extern int ldbm_back_delete LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn )); - -extern int ldbm_back_abandon LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, ber_int_t msgid )); - -extern int ldbm_back_group LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - Entry *target, - const char* gr_ndn, - const char* op_ndn, - ObjectClass* group_oc, - AttributeDescription* group_at)); - -extern int ldbm_back_attribute LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - Entry *target, - const char* entry_ndn, - AttributeDescription* entry_at, - struct berval ***vals)); - -extern int ldbm_back_operational LDAP_P((BackendDB *bd, - Connection *conn, Operation *op, - Entry *e, - char **attrs, - int opattrs, - Attribute **a )); +extern BI_init ldbm_back_initialize; +extern BI_open ldbm_back_open; +extern BI_close ldbm_back_close; +extern BI_destroy ldbm_back_destroy; + +extern BI_db_init ldbm_back_db_init; +extern BI_db_open ldbm_back_db_open; +extern BI_db_close ldbm_back_db_close; +extern BI_db_destroy ldbm_back_db_destroy; + +extern BI_db_config ldbm_back_db_config; + +extern BI_op_extended ldbm_back_extended; + +extern BI_op_bind ldbm_back_bind; + +extern BI_op_unbind ldbm_back_unbind; + +extern BI_op_search ldbm_back_search; + +extern BI_op_compare ldbm_back_compare; + +extern BI_op_modify ldbm_back_modify; + +extern BI_op_modrdn ldbm_back_modrdn; + +extern BI_op_add ldbm_back_add; + +extern BI_op_delete ldbm_back_delete; + +extern BI_op_abandon ldbm_back_abandon; + +extern BI_acl_group ldbm_back_group; + +extern BI_acl_attribute ldbm_back_attribute; + +extern BI_operational ldbm_back_operational; /* hooks for slap tools */ -extern int ldbm_tool_entry_open LDAP_P(( BackendDB *be, int mode )); -extern int ldbm_tool_entry_close LDAP_P(( BackendDB *be )); -extern ID ldbm_tool_entry_first LDAP_P(( BackendDB *be )); -extern ID ldbm_tool_entry_next LDAP_P(( BackendDB *be )); -extern Entry* ldbm_tool_entry_get LDAP_P(( BackendDB *be, ID id )); -extern ID ldbm_tool_entry_put LDAP_P(( BackendDB *be, Entry *e )); +extern BI_tool_entry_open ldbm_tool_entry_open; +extern BI_tool_entry_close ldbm_tool_entry_close; +extern BI_tool_entry_first ldbm_tool_entry_first; +extern BI_tool_entry_next ldbm_tool_entry_next; +extern BI_tool_entry_get ldbm_tool_entry_get; +extern BI_tool_entry_put ldbm_tool_entry_put; -extern int ldbm_tool_entry_reindex LDAP_P(( BackendDB *be, ID id )); -extern int ldbm_tool_sync LDAP_P(( BackendDB *be )); +extern BI_tool_entry_reindex ldbm_tool_entry_reindex; +extern BI_tool_sync ldbm_tool_sync; -extern int ldbm_back_referrals LDAP_P(( BackendDB *bd, - Connection *conn, Operation *op, - const char *dn, const char *ndn, - const char **text )); +extern BI_chk_referrals ldbm_back_referrals; LDAP_END_DECL #endif /* _LDBM_EXTERNAL_H */ - diff --git a/servers/slapd/back-ldbm/operational.c b/servers/slapd/back-ldbm/operational.c index b553a677d3..6ee99cb312 100644 --- a/servers/slapd/back-ldbm/operational.c +++ b/servers/slapd/back-ldbm/operational.c @@ -25,7 +25,7 @@ ldbm_back_operational( Connection *conn, Operation *op, Entry *e, - char **attrs, + struct berval **attrs, int opattrs, Attribute **a ) { diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 031012433c..861581f387 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -37,7 +37,7 @@ ldbm_back_search( int tlimit, Filter *filter, const char *filterstr, - char **attrs, + struct berval **attrs, int attrsonly ) { struct ldbminfo *li = (struct ldbminfo *) be->be_private; diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index 4fa5390097..e27f988b16 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -84,7 +84,7 @@ meta_send_entry( struct metaconn *lc, int i, LDAPMessage *e, - char **attrs, + struct berval **attrs, int attrsonly ); @@ -107,7 +107,7 @@ meta_back_search( int tlimit, Filter *filter, const char *filterstr, - char **attrs, + struct berval **attrs, int attrsonly ) { @@ -569,7 +569,7 @@ meta_send_entry( struct metaconn *lc, int target, LDAPMessage *e, - char **attrs, + struct berval **attrs, int attrsonly ) { diff --git a/servers/slapd/back-monitor/search.c b/servers/slapd/back-monitor/search.c index 000369d29b..5ccceb907c 100644 --- a/servers/slapd/back-monitor/search.c +++ b/servers/slapd/back-monitor/search.c @@ -51,7 +51,7 @@ monitor_send_children( Connection *conn, Operation *op, Filter *filter, - char **attrs, + struct berval **attrs, int attrsonly, Entry *e_parent, int sub, @@ -149,7 +149,7 @@ monitor_back_search( int tlimit, Filter *filter, const char *filterstr, - char **attrs, + struct berval **attrs, int attrsonly ) { diff --git a/servers/slapd/back-passwd/search.c b/servers/slapd/back-passwd/search.c index 295bdbbac6..8054077f6b 100644 --- a/servers/slapd/back-passwd/search.c +++ b/servers/slapd/back-passwd/search.c @@ -34,7 +34,7 @@ passwd_back_search( int tlimit, Filter *filter, const char *filterstr, - char **attrs, + struct berval **attrs, int attrsonly ) { diff --git a/servers/slapd/back-perl/search.c b/servers/slapd/back-perl/search.c index f40a367750..129b1975a2 100644 --- a/servers/slapd/back-perl/search.c +++ b/servers/slapd/back-perl/search.c @@ -39,7 +39,7 @@ perl_back_search( int timelimit, Filter *filter, const char *filterstr, - char **attrs, + struct berval **attrs, int attrsonly ) { @@ -66,7 +66,7 @@ perl_back_search( XPUSHs(sv_2mortal(newSViv( attrsonly ))); for ( i = 0; attrs != NULL && attrs[i] != NULL; i++ ) { - XPUSHs(sv_2mortal(newSVpv( attrs[i] , 0))); + XPUSHs(sv_2mortal(newSVpv( attrs[i]->bv_val , 0))); } PUTBACK; diff --git a/servers/slapd/back-shell/search.c b/servers/slapd/back-shell/search.c index 15560870c8..e4f676e5da 100644 --- a/servers/slapd/back-shell/search.c +++ b/servers/slapd/back-shell/search.c @@ -28,7 +28,7 @@ shell_back_search( int time, Filter *filter, const char *filterstr, - char **attrs, + struct berval **attrs, int attrsonly ) { @@ -62,7 +62,7 @@ shell_back_search( fprintf( wfp, "attrsonly: %d\n", attrsonly ? 1 : 0 ); fprintf( wfp, "attrs:%s", attrs == NULL ? " all" : "" ); for ( i = 0; attrs != NULL && attrs[i] != NULL; i++ ) { - fprintf( wfp, " %s", attrs[i] ); + fprintf( wfp, " %s", attrs[i]->bv_val ); } fprintf( wfp, "\n" ); fclose( wfp ); diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index 23af5819d5..708b0ed643 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -46,9 +46,9 @@ int backsql_attrlist_add(backsql_srch_info *bsi,char *at_name) void backsql_init_search(backsql_srch_info *bsi,backsql_info *bi,char *nbase,int scope, int slimit,int tlimit,time_t stoptime,Filter *filter, - SQLHDBC dbh,BackendDB *be,Connection *conn,Operation *op,char **attrs) + SQLHDBC dbh,BackendDB *be,Connection *conn,Operation *op,struct berval **attrs) { - char **p; + struct berval **p; bsi->base_dn=nbase; bsi->scope=scope; bsi->slimit=slimit; @@ -63,7 +63,7 @@ void backsql_init_search(backsql_srch_info *bsi,backsql_info *bi,char *nbase,int bsi->attrs=(char**)ch_calloc(1,sizeof(char*)); bsi->attrs[0]=NULL; for(p=attrs;*p!=NULL;p++) - backsql_attrlist_add(bsi,*p); + backsql_attrlist_add(bsi,(*p)->bv_val); } else bsi->attrs=attrs; @@ -518,7 +518,7 @@ SQL_SUCCESS) int backsql_search(BackendDB *be,Connection *conn,Operation *op, const char *base, const char *nbase, int scope,int deref,int slimit,int tlimit, - Filter *filter, const char *filterstr,char **attrs,int attrsonly) + Filter *filter, const char *filterstr,struct berval **attrs,int attrsonly) { backsql_info *bi=(backsql_info*)be->be_private; SQLHDBC dbh; diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 9ca34811b6..391500f501 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -1086,7 +1086,7 @@ Attribute *backend_operational( Connection *conn, Operation *op, Entry *e, - char **attrs, + struct berval **attrs, int opattrs ) { Attribute *a = NULL, **ap = &a; diff --git a/servers/slapd/backglue.c b/servers/slapd/backglue.c index 8062fd42c7..02b6f96841 100644 --- a/servers/slapd/backglue.c +++ b/servers/slapd/backglue.c @@ -260,7 +260,7 @@ glue_back_search ( int tlimit, Filter *filter, const char *filterstr, - char **attrs, + struct berval **attrs, int attrsonly ) { diff --git a/servers/slapd/charray.c b/servers/slapd/charray.c index c8790791be..06276dedee 100644 --- a/servers/slapd/charray.c +++ b/servers/slapd/charray.c @@ -124,6 +124,26 @@ charray_inlist( return( 0 ); } +int +bvec_inlist( + struct berval **a, + struct berval *s +) +{ + int i; + + if( a == NULL ) return 0; + + for ( i = 0; a[i] != NULL; i++ ) { + if ( a[i]->bv_len != s->bv_len) continue; + if ( strcasecmp( s->bv_val, a[i]->bv_val ) == 0 ) { + return( 1 ); + } + } + + return( 0 ); +} + char ** charray_dup( char **a ) { @@ -179,6 +199,52 @@ str2charray( const char *str_in, const char *brkstr ) return( res ); } +/* Convert a delimited string into an array of bervals; Add on + * to an existing array if it was given. + */ +struct berval ** +str2bvec( struct berval **vec, const char *in, const char *brkstr ) +{ + char *str; + struct berval **res; + char *s; + char *lasts; + int i, old; + + /* protect the input string from strtok */ + str = ch_strdup( in ); + + for (old = 0; vec && vec[old]; old++); + + i = 1; + for ( s = str; *s; s++ ) { + if ( strchr( brkstr, *s ) != NULL ) { + i++; + } + } + + if (vec) { + res = (struct berval **) ch_realloc( vec, (old + i + 1) * sizeof(struct berval *) ); + vec = res + old; + } else { + res = (struct berval **) ch_malloc( (i + 1) * sizeof(struct berval *) ); + vec = res; + } + i = 0; + + for ( s = ldap_pvt_strtok( str, brkstr, &lasts ); + s != NULL; + s = ldap_pvt_strtok( NULL, brkstr, &lasts ) ) + { + vec[i++] = ber_bvstrdup( s ); + } + + vec[i] = NULL; + + free( str ); + return( res ); +} + int charray_strcmp( const char **a1, const char **a2 ) diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 4387d2c174..b9f3183502 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -37,7 +37,7 @@ LDAP_SLAPD_F (int) is_ad_subtype LDAP_P(( LDAP_SLAPD_F (int) ad_inlist LDAP_P(( AttributeDescription *desc, - char **attrs )); + struct berval **attrs )); LDAP_SLAPD_F (int) slap_str2undef_ad LDAP_P(( const char *, @@ -225,7 +225,7 @@ LDAP_SLAPD_F (Attribute *) backend_operational( Connection *conn, Operation *op, Entry *e, - char **attrs, + struct berval **attrs, int opattrs ); @@ -271,6 +271,7 @@ LDAP_SLAPD_F (void) charray_free LDAP_P(( char **array )); LDAP_SLAPD_F (int) charray_inlist LDAP_P(( char **a, const char *s )); LDAP_SLAPD_F (char **) charray_dup LDAP_P(( char **a )); LDAP_SLAPD_F (char **) str2charray LDAP_P(( const char *str, const char *brkstr )); +LDAP_SLAPD_F (struct berval **) str2bvec LDAP_P(( struct berval **vec, const char *str, const char *brkstr )); LDAP_SLAPD_F (int) charray_strcmp LDAP_P(( const char **a1, const char **a2 )); LDAP_SLAPD_F (int) charray_strcasecmp LDAP_P(( const char **a1, const char **a2 )); @@ -635,7 +636,7 @@ LDAP_SLAPD_F (int) send_search_reference LDAP_P(( LDAP_SLAPD_F (int) send_search_entry LDAP_P(( Backend *be, Connection *conn, Operation *op, - Entry *e, char **attrs, int attrsonly, + Entry *e, struct berval **attrs, int attrsonly, LDAPControl **ctrls )); LDAP_SLAPD_F (int) str2result LDAP_P(( char *s, diff --git a/servers/slapd/result.c b/servers/slapd/result.c index e9b066a5e6..e6f16ae79b 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -618,6 +618,10 @@ send_search_result( } } +static struct berval AllUser = { sizeof(LDAP_ALL_USER_ATTRIBUTES)-1, + LDAP_ALL_USER_ATTRIBUTES }; +static struct berval AllOper = { sizeof(LDAP_ALL_OPERATIONAL_ATTRIBUTES)-1, + LDAP_ALL_OPERATIONAL_ATTRIBUTES }; int send_search_entry( @@ -625,7 +629,7 @@ send_search_entry( Connection *conn, Operation *op, Entry *e, - char **attrs, + struct berval **attrs, int attrsonly, LDAPControl **ctrls ) @@ -701,13 +705,13 @@ send_search_entry( } } if (conn->c_is_udp && op->o_protocol == LDAP_VERSION2) { - rc = ber_printf( ber, "{is{t{s{" /*}}}*/, - op->o_msgid, "", LDAP_RES_SEARCH_ENTRY, e->e_dn ); + rc = ber_printf( ber, "{is{t{O{" /*}}}*/, + op->o_msgid, "", LDAP_RES_SEARCH_ENTRY, &e->e_name ); } else #endif { - rc = ber_printf( ber, "{it{s{" /*}}}*/, op->o_msgid, - LDAP_RES_SEARCH_ENTRY, e->e_dn ); + rc = ber_printf( ber, "{it{O{" /*}}}*/, op->o_msgid, + LDAP_RES_SEARCH_ENTRY, &e->e_name ); } if ( rc == -1 ) { @@ -727,24 +731,23 @@ send_search_entry( /* check for special all user attributes ("*") type */ userattrs = ( attrs == NULL ) ? 1 - : charray_inlist( attrs, LDAP_ALL_USER_ATTRIBUTES ); + : bvec_inlist( attrs, &AllUser ); /* check for special all operational attributes ("+") type */ opattrs = ( attrs == NULL ) ? 0 - : charray_inlist( attrs, LDAP_ALL_OPERATIONAL_ATTRIBUTES ); + : bvec_inlist( attrs, &AllOper ); for ( a = e->e_attrs; a != NULL; a = a->a_next ) { AttributeDescription *desc = a->a_desc; - char *type = desc->ad_cname.bv_val; if ( attrs == NULL ) { - /* all addrs request, skip operational attributes */ + /* all attrs request, skip operational attributes */ if( is_at_operational( desc->ad_type ) ) { continue; } } else { - /* specific addrs requested */ + /* specific attrs requested */ if ( is_at_operational( desc->ad_type ) ) { if( !opattrs && !ad_inlist( desc, attrs ) ) { continue; @@ -770,7 +773,7 @@ send_search_entry( continue; } - if (( rc = ber_printf( ber, "{s[" /*]}*/ , type )) == -1 ) { + if (( rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname )) == -1 ) { #ifdef NEW_LOGGING LDAP_LOG(( "operation", LDAP_LEVEL_ERR, "send_search_entry: conn %d ber_printf failed\n", @@ -845,13 +848,13 @@ send_search_entry( AttributeDescription *desc = a->a_desc; if ( attrs == NULL ) { - /* all addrs request, skip operational attributes */ + /* all attrs request, skip operational attributes */ if( is_at_operational( desc->ad_type ) ) { continue; } } else { - /* specific addrs requested */ + /* specific attrs requested */ if( is_at_operational( desc->ad_type ) ) { if( !opattrs && !ad_inlist( desc, attrs ) ) { continue; @@ -877,7 +880,7 @@ send_search_entry( continue; } - rc = ber_printf( ber, "{s[" /*]}*/ , desc->ad_cname.bv_val ); + rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname ); if ( rc == -1 ) { #ifdef NEW_LOGGING LDAP_LOG(( "operation", LDAP_LEVEL_ERR, diff --git a/servers/slapd/schema.c b/servers/slapd/schema.c index f28c99161e..da4b968f98 100644 --- a/servers/slapd/schema.c +++ b/servers/slapd/schema.c @@ -65,29 +65,28 @@ schema_info( Entry **entry, const char **text ) { int rc; AttributeDescription *desc = NULL; - char *rdn = ch_strdup( SLAPD_SCHEMA_DN ); - val.bv_val = strchr( rdn, '=' ); + struct berval rdn = { sizeof(SLAPD_SCHEMA_DN)-1, + SLAPD_SCHEMA_DN }; + val.bv_val = strchr( rdn.bv_val, '=' ); if( val.bv_val == NULL ) { - free( rdn ); *text = "improperly configured subschema subentry"; return LDAP_OTHER; } - *val.bv_val = '\0'; - val.bv_len = strlen( ++val.bv_val ); + val.bv_val++; + val.bv_len = rdn.bv_len - (val.bv_val - rdn.bv_val); + rdn.bv_len -= val.bv_len + 1; - rc = slap_str2ad( rdn, &desc, text ); + rc = slap_bv2ad( &rdn, &desc, text ); if( rc != LDAP_SUCCESS ) { - free( rdn ); entry_free( e ); *text = "improperly configured subschema subentry"; return LDAP_OTHER; } attr_merge( e, desc, vals ); - free( rdn ); } if ( syn_schema_info( e ) diff --git a/servers/slapd/search.c b/servers/slapd/search.c index a6d6e36c15..97927bf4b5 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -38,7 +38,7 @@ do_search( struct berval *nbase = NULL; char *fstr = NULL; Filter *filter = NULL; - char **attrs = NULL; + struct berval **attrs = NULL; Backend *be; int rc; const char *text; @@ -172,7 +172,7 @@ do_search( /* attributes */ - if ( ber_scanf( op->o_ber, /*{*/ "{v}}", &attrs ) == LBER_ERROR ) { + if ( ber_scanf( op->o_ber, /*{*/ "{V}}", &attrs ) == LBER_ERROR ) { send_ldap_disconnect( conn, op, LDAP_PROTOCOL_ERROR, "decoding attrs error" ); rc = SLAPD_DISCONNECT; @@ -205,9 +205,9 @@ do_search( for ( i = 0; attrs[i] != NULL; i++ ) { #ifdef NEW_LOGGING LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "do_search: %s", attrs[i] )); + "do_search: %s", attrs[i]->bv_val )); #else - Debug( LDAP_DEBUG_ARGS, " %s", attrs[i], 0, 0 ); + Debug( LDAP_DEBUG_ARGS, " %s", attrs[i]->bv_val, 0, 0 ); #endif } @@ -343,7 +343,7 @@ return_results:; if( fstr != NULL) free( fstr ); if( filter != NULL) filter_free( filter ); if ( attrs != NULL ) { - charray_free( attrs ); + ber_bvecfree( attrs ); } return rc; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 6d02e839e1..c7bb5c1067 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -823,7 +823,7 @@ typedef struct slap_acl { slap_style_t acl_dn_style; regex_t acl_dn_re; struct berval acl_dn_pat; - char **acl_attrs; + struct berval **acl_attrs; /* "by" part: list of who has what access to the entries */ Access *acl_access; @@ -1016,7 +1016,57 @@ struct slap_backend_db { struct slap_conn; struct slap_op; -typedef int (*SLAP_EXTENDED_FN) LDAP_P(( +/* Backend function typedefs */ +typedef int (BI_init) LDAP_P((BackendInfo *bi)); +typedef int (BI_config) LDAP_P((BackendInfo *bi, const char *fname, + int lineno, int argc, char **argv)); +typedef int (BI_open) LDAP_P((BackendInfo *bi)); +typedef int (BI_close) LDAP_P((BackendInfo *bi)); +typedef int (BI_destroy) LDAP_P((BackendInfo *bi)); + +typedef int (BI_db_init) LDAP_P((Backend *bd)); +typedef int (BI_db_config) LDAP_P((Backend *bd, const char *fname, + int lineno, int argc, char **argv)); +typedef int (BI_db_open) LDAP_P((Backend *bd)); +typedef int (BI_db_close) LDAP_P((Backend *bd)); +typedef int (BI_db_destroy) LDAP_P((Backend *bd)); + +typedef int (BI_op_bind) LDAP_P(( BackendDB *bd, + struct slap_conn *c, struct slap_op *o, + const char *dn, const char *ndn, int method, + struct berval *cred, char** edn )); +typedef int (BI_op_unbind) LDAP_P((BackendDB *bd, + struct slap_conn *c, struct slap_op *o )); +typedef int (BI_op_search) LDAP_P((BackendDB *bd, + struct slap_conn *c, struct slap_op *o, + const char *base, const char *nbase, + int scope, int deref, + int slimit, int tlimit, + Filter *f, const char *filterstr, + struct berval **attrs, int attrsonly)); +typedef int (BI_op_compare)LDAP_P((BackendDB *bd, + struct slap_conn *c, struct slap_op *o, + const char *dn, const char *ndn, + AttributeAssertion *ava)); +typedef int (BI_op_modify) LDAP_P((BackendDB *bd, + struct slap_conn *c, struct slap_op *o, + const char *dn, const char *ndn, Modifications *m)); +typedef int (BI_op_modrdn) LDAP_P((BackendDB *bd, + struct slap_conn *c, struct slap_op *o, + const char *dn, const char *ndn, + const char *newrdn, int deleteoldrdn, + const char *newSuperior)); +typedef int (BI_op_add) LDAP_P((BackendDB *bd, + struct slap_conn *c, struct slap_op *o, + Entry *e)); +typedef int (BI_op_delete) LDAP_P((BackendDB *bd, + struct slap_conn *c, struct slap_op *o, + const char *dn, const char *ndn)); +typedef int (BI_op_abandon) LDAP_P((BackendDB *bd, + struct slap_conn *c, struct slap_op *o, + ber_int_t msgid)); + +typedef int (BI_op_extended) LDAP_P(( BackendDB *be, struct slap_conn *conn, struct slap_op *op, @@ -1028,6 +1078,44 @@ typedef int (*SLAP_EXTENDED_FN) LDAP_P(( const char ** text, struct berval *** refs )); +typedef int (BI_entry_release_rw) LDAP_P((BackendDB *bd, + struct slap_conn *c, struct slap_op *o, + Entry *e, int rw)); + +typedef int (BI_chk_referrals) LDAP_P((BackendDB *bd, + struct slap_conn *c, struct slap_op *o, + const char *dn, const char *ndn, + const char **text )); + +typedef int (BI_acl_group) LDAP_P((Backend *bd, + struct slap_conn *c, struct slap_op *o, + Entry *e, const char *bdn, const char *edn, + ObjectClass *group_oc, + AttributeDescription *group_at )); +typedef int (BI_acl_attribute) LDAP_P((Backend *bd, + struct slap_conn *c, struct slap_op *o, + Entry *e, const char *edn, + AttributeDescription *entry_at, + struct berval ***vals )); + +typedef int (BI_operational) LDAP_P((Backend *bd, + struct slap_conn *c, struct slap_op *o, + Entry *e, struct berval **attrs, int opattrs, Attribute **a )); + +typedef int (BI_connection_init) LDAP_P((BackendDB *bd, + struct slap_conn *c)); +typedef int (BI_connection_destroy) LDAP_P((BackendDB *bd, + struct slap_conn *c)); + +typedef int (BI_tool_entry_open) LDAP_P(( BackendDB *be, int mode )); +typedef int (BI_tool_entry_close) LDAP_P(( BackendDB *be )); +typedef ID (BI_tool_entry_first) LDAP_P(( BackendDB *be )); +typedef ID (BI_tool_entry_next) LDAP_P(( BackendDB *be )); +typedef Entry* (BI_tool_entry_get) LDAP_P(( BackendDB *be, ID id )); +typedef ID (BI_tool_entry_put) LDAP_P(( BackendDB *be, Entry *e )); +typedef int (BI_tool_entry_reindex) LDAP_P(( BackendDB *be, ID id )); +typedef int (BI_tool_sync) LDAP_P(( BackendDB *be )); + struct slap_backend_info { char *bi_type; /* type of backend */ @@ -1051,12 +1139,11 @@ struct slap_backend_info { * once during shutdown after all bi_db_destroy calls. * bi_destory() is called from backend_destroy() */ - int (*bi_init) LDAP_P((BackendInfo *bi)); - int (*bi_config) LDAP_P((BackendInfo *bi, - const char *fname, int lineno, int argc, char **argv )); - int (*bi_open) LDAP_P((BackendInfo *bi)); - int (*bi_close) LDAP_P((BackendInfo *bi)); - int (*bi_destroy) LDAP_P((BackendInfo *bi)); + BI_init *bi_init; + BI_config *bi_config; + BI_open *bi_open; + BI_close *bi_close; + BI_destroy *bi_destroy; /* * per database routines: @@ -1079,91 +1166,47 @@ struct slap_backend_info { * bi_close calls but before bi_destory calls. * called only by backend_destory() */ - int (*bi_db_init) LDAP_P((Backend *bd)); - int (*bi_db_config) LDAP_P((Backend *bd, - const char *fname, int lineno, int argc, char **argv )); - int (*bi_db_open) LDAP_P((Backend *bd)); - int (*bi_db_close) LDAP_P((Backend *bd)); - int (*bi_db_destroy) LDAP_P((Backend *db)); + BI_db_init *bi_db_init; + BI_db_config *bi_db_config; + BI_db_open *bi_db_open; + BI_db_close *bi_db_close; + BI_db_destroy *bi_db_destroy; /* LDAP Operations Handling Routines */ - int (*bi_op_bind) LDAP_P(( BackendDB *bd, - struct slap_conn *c, struct slap_op *o, - const char *dn, const char *ndn, int method, - struct berval *cred, char** edn )); - int (*bi_op_unbind) LDAP_P((BackendDB *bd, - struct slap_conn *c, struct slap_op *o )); - int (*bi_op_search) LDAP_P((BackendDB *bd, - struct slap_conn *c, struct slap_op *o, - const char *base, const char *nbase, - int scope, int deref, - int slimit, int tlimit, - Filter *f, const char *filterstr, - char **attrs, int attrsonly)); - int (*bi_op_compare)LDAP_P((BackendDB *bd, - struct slap_conn *c, struct slap_op *o, - const char *dn, const char *ndn, - AttributeAssertion *ava)); - int (*bi_op_modify) LDAP_P((BackendDB *bd, - struct slap_conn *c, struct slap_op *o, - const char *dn, const char *ndn, Modifications *m)); - int (*bi_op_modrdn) LDAP_P((BackendDB *bd, - struct slap_conn *c, struct slap_op *o, - const char *dn, const char *ndn, - const char *newrdn, int deleteoldrdn, - const char *newSuperior)); - int (*bi_op_add) LDAP_P((BackendDB *bd, - struct slap_conn *c, struct slap_op *o, - Entry *e)); - int (*bi_op_delete) LDAP_P((BackendDB *bd, - struct slap_conn *c, struct slap_op *o, - const char *dn, const char *ndn)); - int (*bi_op_abandon) LDAP_P((BackendDB *bd, - struct slap_conn *c, struct slap_op *o, - ber_int_t msgid)); + BI_op_bind *bi_op_bind; + BI_op_unbind *bi_op_unbind; + BI_op_search *bi_op_search; + BI_op_compare *bi_op_compare; + BI_op_modify *bi_op_modify; + BI_op_modrdn *bi_op_modrdn; + BI_op_add *bi_op_add; + BI_op_delete *bi_op_delete; + BI_op_abandon *bi_op_abandon; /* Extended Operations Helper */ - SLAP_EXTENDED_FN bi_extended; + BI_op_extended *bi_extended; /* Auxilary Functions */ - int (*bi_entry_release_rw) LDAP_P((BackendDB *bd, - struct slap_conn *c, struct slap_op *o, - Entry *e, int rw)); - - int (*bi_chk_referrals) LDAP_P((BackendDB *bd, - struct slap_conn *c, struct slap_op *o, - const char *dn, const char *ndn, - const char **text )); + BI_entry_release_rw *bi_entry_release_rw; + BI_chk_referrals *bi_chk_referrals; - int (*bi_acl_group) LDAP_P((Backend *bd, - struct slap_conn *c, struct slap_op *o, - Entry *e, const char *bdn, const char *edn, - ObjectClass *group_oc, - AttributeDescription *group_at )); - int (*bi_acl_attribute) LDAP_P((Backend *bd, - struct slap_conn *c, struct slap_op *o, - Entry *e, const char *edn, - AttributeDescription *entry_at, - struct berval ***vals )); + BI_acl_group *bi_acl_group; + BI_acl_attribute *bi_acl_attribute; - int (*bi_operational) LDAP_P((Backend *bd, - struct slap_conn *c, struct slap_op *o, - Entry *e, char **attrs, int opattrs, Attribute **a )); + BI_operational *bi_operational; - int (*bi_connection_init) LDAP_P((BackendDB *bd, - struct slap_conn *c)); - int (*bi_connection_destroy) LDAP_P((BackendDB *bd, - struct slap_conn *c)); + BI_connection_init *bi_connection_init; + BI_connection_destroy *bi_connection_destroy; /* hooks for slap tools */ - int (*bi_tool_entry_open) LDAP_P(( BackendDB *be, int mode )); - int (*bi_tool_entry_close) LDAP_P(( BackendDB *be )); - ID (*bi_tool_entry_first) LDAP_P(( BackendDB *be )); - ID (*bi_tool_entry_next) LDAP_P(( BackendDB *be )); - Entry* (*bi_tool_entry_get) LDAP_P(( BackendDB *be, ID id )); - ID (*bi_tool_entry_put) LDAP_P(( BackendDB *be, Entry *e )); - int (*bi_tool_entry_reindex) LDAP_P(( BackendDB *be, ID id )); - int (*bi_tool_sync) LDAP_P(( BackendDB *be )); + BI_tool_entry_open *bi_tool_entry_open; + BI_tool_entry_close *bi_tool_entry_close; + BI_tool_entry_first *bi_tool_entry_first; + BI_tool_entry_next *bi_tool_entry_next; + BI_tool_entry_get *bi_tool_entry_get; + BI_tool_entry_put *bi_tool_entry_put; + BI_tool_entry_reindex *bi_tool_entry_reindex; + BI_tool_sync *bi_tool_sync; #define SLAP_INDEX_ADD_OP 0x0001 #define SLAP_INDEX_DELETE_OP 0x0002 diff --git a/servers/slapd/tools/mimic.c b/servers/slapd/tools/mimic.c index 528504de2b..05a8e16529 100644 --- a/servers/slapd/tools/mimic.c +++ b/servers/slapd/tools/mimic.c @@ -108,7 +108,7 @@ send_search_entry( Connection *conn, Operation *op, Entry *e, - char **attrs, + struct berval **attrs, int attrsonly, LDAPControl **ctrls )