Add connection and operation arguments to backend callbacks.

Needed for transactions.
This commit is contained in:
Kurt Zeilenga 2000-09-29 05:25:44 +00:00
parent abf6bdaeb5
commit 7c96f629ee
9 changed files with 40 additions and 18 deletions

View file

@ -619,7 +619,7 @@ acl_mask(
buf[sizeof(buf) - 1] = 0;
}
if (backend_group(be, e, buf, op->o_ndn,
if (backend_group(be, conn, op, e, buf, op->o_ndn,
b->a_group_oc, b->a_group_at) != 0)
{
continue;

View file

@ -237,7 +237,7 @@ do_add( Connection *conn, Operation *op )
{
replog( be, op, e->e_dn, e );
}
be_entry_release_w( be, e );
be_entry_release_w( be, conn, op, e );
e = NULL;
}

View file

@ -28,8 +28,7 @@ ldbm_back_attribute(
Entry *target,
const char *e_ndn,
AttributeDescription *entry_at,
struct berval ***vals
)
struct berval ***vals )
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
Entry *e;

View file

@ -74,6 +74,7 @@ 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,

View file

@ -24,6 +24,8 @@
int
ldbm_back_group(
Backend *be,
Connection *conn,
Operation *op,
Entry *target,
const char *gr_ndn,
const char *op_ndn,

View file

@ -539,11 +539,16 @@ be_isroot_pw( Backend *be,
}
int
be_entry_release_rw( Backend *be, Entry *e, int rw )
be_entry_release_rw(
BackendDB *be,
Connection *conn,
Operation *op,
Entry *e,
int rw )
{
if ( be->be_release ) {
/* free and release entry from backend */
return be->be_release( be, e, rw );
return be->be_release( be, conn, op, e, rw );
} else {
/* free entry */
entry_free( e );
@ -831,6 +836,8 @@ int backend_check_referrals(
int
backend_group(
Backend *be,
Connection *conn,
Operation *op,
Entry *target,
const char *gr_ndn,
const char *op_ndn,
@ -849,7 +856,8 @@ backend_group(
}
if( be->be_group ) {
return be->be_group( be, target, gr_ndn, op_ndn,
return be->be_group( be, conn, op,
target, gr_ndn, op_ndn,
group_oc, group_at );
}
@ -887,6 +895,8 @@ backend_attribute(
Attribute *backend_operational(
Backend *be,
Connection *conn,
Operation *op,
Entry *e )
{
Attribute *a = NULL;

View file

@ -154,21 +154,22 @@ LDAP_SLAPD_F (int) be_isroot LDAP_P(( Backend *be, const char *ndn ));
LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Backend *be,
Connection *conn, const char *ndn, struct berval *cred ));
LDAP_SLAPD_F (char *) be_root_dn LDAP_P(( Backend *be ));
LDAP_SLAPD_F (int) be_entry_release_rw LDAP_P(( Backend *be, Entry *e, int rw ));
#define be_entry_release_r( be, e ) be_entry_release_rw( be, e, 0 )
#define be_entry_release_w( be, e ) be_entry_release_rw( be, e, 1 )
LDAP_SLAPD_F (int) be_entry_release_rw LDAP_P((
BackendDB *be, Connection *c, Operation *o, Entry *e, int rw ));
#define be_entry_release_r( be, c, o, e ) be_entry_release_rw( be, c, o, e, 0 )
#define be_entry_release_w( be, c, o, e ) be_entry_release_rw( be, c, o, e, 1 )
LDAP_SLAPD_F (int) backend_unbind LDAP_P((Connection *conn, Operation *op));
LDAP_SLAPD_F( int ) backend_check_restrictions LDAP_P((
Backend *be,
BackendDB *be,
Connection *conn,
Operation *op,
const char *extoid,
const char **text ));
LDAP_SLAPD_F( int ) backend_check_referrals LDAP_P((
Backend *be,
BackendDB *be,
Connection *conn,
Operation *op,
const char *dn,
@ -177,7 +178,9 @@ LDAP_SLAPD_F( int ) backend_check_referrals LDAP_P((
LDAP_SLAPD_F (int) backend_connection_init LDAP_P((Connection *conn));
LDAP_SLAPD_F (int) backend_connection_destroy LDAP_P((Connection *conn));
LDAP_SLAPD_F (int) backend_group LDAP_P((Backend *be,
LDAP_SLAPD_F (int) backend_group LDAP_P((BackendDB *be,
Connection *conn,
Operation *op,
Entry *target,
const char *gr_ndn,
const char *op_ndn,
@ -185,7 +188,7 @@ LDAP_SLAPD_F (int) backend_group LDAP_P((Backend *be,
AttributeDescription *group_at
));
LDAP_SLAPD_F (int) backend_attribute LDAP_P((Backend *be,
LDAP_SLAPD_F (int) backend_attribute LDAP_P((BackendDB *be,
Connection *conn,
Operation *op,
Entry *target,
@ -194,7 +197,11 @@ LDAP_SLAPD_F (int) backend_attribute LDAP_P((Backend *be,
struct berval ***vals
));
LDAP_SLAPD_F (Attribute *) backend_operational( Backend *, Entry * );
LDAP_SLAPD_F (Attribute *) backend_operational(
BackendDB *,
Connection *conn,
Operation *op,
Entry * );

View file

@ -694,7 +694,7 @@ send_search_entry(
/* eventually will loop through generated operational attributes */
/* only have subschemaSubentry implemented */
aa = backend_operational( be, e );
aa = backend_operational( be, conn, op, e );
for (a = aa ; a != NULL; a = a->a_next ) {
AttributeDescription *desc = a->a_desc;

View file

@ -906,7 +906,7 @@ struct slap_op;
typedef int (*SLAP_EXTENDED_FN) LDAP_P((
BackendDB *be,
struct slap_conn *conn,
struct slap_conn *conn,
struct slap_op *op,
const char *reqoid,
struct berval * reqdata,
@ -1014,7 +1014,9 @@ struct slap_backend_info {
SLAP_EXTENDED_FN bi_extended;
/* Auxilary Functions */
int (*bi_entry_release_rw) LDAP_P((BackendDB *bd, Entry *e, int rw));
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,
@ -1022,6 +1024,7 @@ struct slap_backend_info {
const char **text ));
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 ));