/* #undef SLAPD_META_DYNAMIC */
/* define to support cn=Monitor backend */
-/* #undef SLAPD_MONITOR */
+#define SLAPD_MONITOR 1
/* define to support dynamic cn=Monitor backend */
/* #undef SLAPD_MONITOR_DYNAMIC */
sbiod->sbiod_sb->sb_debug );
/* Grow the packet buffer if neccessary */
- if ( ( p->sec_buf_in.buf_size < ret ) &&
+ if ( ( p->sec_buf_in.buf_size < (ber_len_t) ret ) &&
ber_pvt_sb_grow_buffer( &p->sec_buf_in, ret ) < 0 )
{
errno = ENOMEM;
Connection *conn,
Operation *op,
Entry *target,
- const char *entry_ndn,
+ struct berval *entry_ndn,
AttributeDescription *entry_at,
struct berval ***vals )
{
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ARGS,
- "bdb_attribute: gr dn: \"%s\"\n", entry_ndn ));
+ "bdb_attribute: gr dn: \"%s\"\n", entry_ndn->bv_val ));
LDAP_LOG(( "backend", LDAP_LEVEL_ARGS,
"bdb_attribute: at: \"%s\"\n", entry_at_name));
LDAP_LOG(( "backend", LDAP_LEVEL_ARGS,
#else
Debug( LDAP_DEBUG_ARGS,
"=> bdb_attribute: gr dn: \"%s\"\n",
- entry_ndn, 0, 0 );
+ entry_ndn->bv_val, 0, 0 );
Debug( LDAP_DEBUG_ARGS,
"=> bdb_attribute: at: \"%s\"\n",
entry_at_name, 0, 0 );
target ? target->e_ndn : "", 0, 0 );
#endif
- if (target != NULL && strcmp(target->e_ndn, entry_ndn) == 0) {
+ if (target != NULL && strcmp(target->e_ndn, entry_ndn->bv_val) == 0) {
/* we already have a LOCKED copy of the entry */
e = target;
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
"bdb_attribute: target is LOCKED (%s)\n",
- entry_ndn ));
+ entry_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ARGS,
"=> bdb_attribute: target is entry: \"%s\"\n",
- entry_ndn, 0, 0 );
+ entry_ndn->bv_val, 0, 0 );
#endif
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"bdb_attribute: cannot find entry (%s)\n",
- entry_ndn ));
+ entry_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ACL,
"=> bdb_attribute: cannot find entry: \"%s\"\n",
- entry_ndn, 0, 0 );
+ entry_ndn->bv_val, 0, 0 );
#endif
return LDAP_NO_SUCH_OBJECT;
}
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "bdb_attribute: found entry (%s)\n", e_ndn ));
+ "bdb_attribute: found entry (%s)\n",
+ entry_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ACL,
"=> bdb_attribute: found entry: \"%s\"\n",
- entry_ndn, 0, 0 );
+ entry_ndn->bv_val, 0, 0 );
#endif
}
Connection *conn,
Operation *op,
Entry *target,
- const char *entry_ndn,
+ struct berval *entry_ndn,
AttributeDescription *entry_at,
struct berval ***vals )
{
target ? target->e_ndn : "", 0, 0 );
#endif
- if (target != NULL && strcmp(target->e_ndn, entry_ndn) == 0) {
+ if (target != NULL && strcmp(target->e_ndn, entry_ndn->bv_val) == 0) {
/* we already have a LOCKED copy of the entry */
e = target;
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
"ldbm_back_attribute: target is LOCKED (%s)\n",
- entry_ndn ));
+ entry_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ARGS,
"=> ldbm_back_attribute: target is entry: \"%s\"\n",
- entry_ndn, 0, 0 );
+ entry_ndn->bv_val, 0, 0 );
#endif
} else {
/* can we find entry with reader lock */
- if ((e = dn2entry_r(be, entry_ndn, NULL )) == NULL) {
+ if ((e = dn2entry_r(be, entry_ndn->bv_val, NULL )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_back_attribute: cannot find entry (%s)\n",
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "ldbm_back_attribute: found entry (%s)\n", entry_ndn ));
+ "ldbm_back_attribute: found entry (%s)\n",
+ entry_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ACL,
"=> ldbm_back_attribute: found entry: \"%s\"\n",
- entry_ndn, 0, 0 );
+ entry_ndn->bv_val, 0, 0 );
#endif
}
if( is_entry_alias( e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "ldbm_back_attribute: entry (%s) is an alias\n", e->e_dn ));
+ "ldbm_back_attribute: entry (%s) is an alias\n", e->e_dn ));
#else
Debug( LDAP_DEBUG_ACL,
"<= ldbm_back_attribute: entry is an alias\n", 0, 0, 0 );
if( is_entry_referral( e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "ldbm_back_attribute: entry (%s) is a referral.\n", e->e_dn ));
+ "ldbm_back_attribute: entry (%s) is a referral.\n", e->e_dn ));
#else
Debug( LDAP_DEBUG_ACL,
"<= ldbm_back_attribute: entry is an referral\n", 0, 0, 0 );
if ((attr = attr_find(e->e_attrs, entry_at)) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "ldbm_back_attribute: failed to find %s.\n", entry_at_name ));
+ "ldbm_back_attribute: failed to find %s.\n", entry_at_name ));
#else
Debug( LDAP_DEBUG_ACL,
"<= ldbm_back_attribute: failed to find %s\n",
Connection *conn,
Operation *op,
Entry *target,
- const char *gr_ndn,
- const char *op_ndn,
+ struct berval *gr_ndn,
+ struct berval *op_ndn,
ObjectClass *group_oc,
AttributeDescription *group_at
)
Entry *e;
int rc = 1;
Attribute *attr;
- struct berval bv;
const char *group_oc_name = NULL;
const char *group_at_name = group_at->ad_cname.bv_val;
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
- "ldbm_back_group: check (%s) member of (%s), oc %s\n",
- op_ndn, gr_ndn, group_oc_name ));
+ "ldbm_back_group: check (%s) member of (%s), oc %s\n",
+ op_ndn->bv_val, gr_ndn->bv_val, group_oc_name ));
#else
Debug( LDAP_DEBUG_ARGS,
"=> ldbm_back_group: gr dn: \"%s\"\n",
- gr_ndn, 0, 0 );
+ gr_ndn->bv_val, 0, 0 );
Debug( LDAP_DEBUG_ARGS,
"=> ldbm_back_group: op dn: \"%s\"\n",
- op_ndn, 0, 0 );
+ op_ndn->bv_val, 0, 0 );
Debug( LDAP_DEBUG_ARGS,
"=> ldbm_back_group: oc: \"%s\" at: \"%s\"\n",
group_oc_name, group_at_name, 0 );
target->e_ndn, 0, 0 );
#endif
- if (strcmp(target->e_ndn, gr_ndn) == 0) {
+ if (strcmp(target->e_ndn, gr_ndn->bv_val) == 0) {
/* we already have a LOCKED copy of the entry */
e = target;
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "ldbm_back_group: target is group (%s)\n", gr_ndn ));
+ "ldbm_back_group: target is group (%s)\n",
+ gr_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ARGS,
"=> ldbm_back_group: target is group: \"%s\"\n",
- gr_ndn, 0, 0 );
+ gr_ndn->bv_val, 0, 0 );
#endif
} else {
/* can we find group entry with reader lock */
- if ((e = dn2entry_r(be, gr_ndn, NULL )) == NULL) {
+ if ((e = dn2entry_r(be, gr_ndn->bv_val, NULL )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "ldbm_back_group: cannot find group (%s)\n",
- gr_ndn ));
+ "ldbm_back_group: cannot find group (%s)\n",
+ gr_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ACL,
"=> ldbm_back_group: cannot find group: \"%s\"\n",
- gr_ndn, 0, 0 );
+ gr_ndn->bv_val, 0, 0 );
#endif
return( 1 );
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "ldbm_back_group: found group (%s)\n", gr_ndn ));
+ "ldbm_back_group: found group (%s)\n", gr_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ACL,
"=> ldbm_back_group: found group: \"%s\"\n",
- gr_ndn, 0, 0 );
+ gr_ndn->bv_val, 0, 0 );
#endif
}
if( is_entry_alias( e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "ldbm_back_group: group (%s) is an alias\n", gr_ndn ));
+ "ldbm_back_group: group (%s) is an alias\n",
+ gr_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ACL,
"<= ldbm_back_group: group is an alias\n", 0, 0, 0 );
if( is_entry_referral( e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "ldbm_back_group: group (%s) is a referral.\n", gr_ndn ));
+ "ldbm_back_group: group (%s) is a referral.\n",
+ gr_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ACL,
"<= ldbm_back_group: group is an referral\n", 0, 0, 0 );
if( !is_entry_objectclass( e, group_oc ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
- "ldbm_back_group: failed to find %s in objectClass.\n",
- group_oc_name ));
+ "ldbm_back_group: failed to find %s in objectClass.\n",
+ group_oc_name ));
#else
Debug( LDAP_DEBUG_ACL,
"<= ldbm_back_group: failed to find %s in objectClass\n",
if ((attr = attr_find(e->e_attrs, group_at)) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "ldbm_back_group: failed to find %s\n", group_at_name ));
+ "ldbm_back_group: failed to find %s\n", group_at_name ));
#else
Debug( LDAP_DEBUG_ACL,
"<= ldbm_back_group: failed to find %s\n",
#endif
- bv.bv_val = (char *) op_ndn;
- bv.bv_len = strlen( op_ndn );
-
- if( value_find( group_at, attr->a_vals, &bv ) != LDAP_SUCCESS ) {
+ if( value_find( group_at, attr->a_vals, op_ndn ) != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "ldbm_back_group: \"%s\" not in \"%s\": %s\n",
- op_ndn, gr_ndn, group_at_name ));
+ "ldbm_back_group: \"%s\" not in \"%s\": %s\n",
+ op_ndn->bv_val, gr_ndn->bv_val, group_at_name ));
#else
Debug( LDAP_DEBUG_ACL,
"<= ldbm_back_group: \"%s\" not in \"%s\": %s\n",
- op_ndn, gr_ndn, group_at_name );
+ op_ndn->bv_val, gr_ndn->bv_val, group_at_name );
#endif
goto return_results;
}
-
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "ldbm_back_group: %s is in %s: %s\n",
- op_ndn, gr_ndn, group_at_name ));
+ "ldbm_back_group: %s is in %s: %s\n",
+ op_ndn->bv_val, gr_ndn->bv_val, group_at_name ));
#else
Debug( LDAP_DEBUG_ACL,
"<= ldbm_back_group: \"%s\" is in \"%s\": %s\n",
- op_ndn, gr_ndn, group_at_name );
+ op_ndn->bv_val, gr_ndn->bv_val, group_at_name );
#endif
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
- "ldbm_back_group: rc=%d\n", rc ));
+ "ldbm_back_group: rc=%d\n", rc ));
#else
Debug( LDAP_DEBUG_TRACE, "ldbm_back_group: rc=%d\n", rc, 0, 0 );
#endif
if( be->be_group ) {
int res = be->be_group( be, conn, op,
- target, gr_ndn->bv_val, op_ndn->bv_val,
+ target, gr_ndn, op_ndn,
group_oc, group_at );
if (op->o_tag != LDAP_REQ_BIND) {
}
if( be->be_attribute ) {
- return be->be_attribute( be, conn, op, target, edn->bv_val,
+ return be->be_attribute( be, conn, op, target, edn,
entry_at, vals );
}
Connection *conn,
Operation *op,
Entry *target,
- const char *ndn,
- const char *ondn,
+ struct berval *ndn,
+ struct berval *ondn,
ObjectClass *oc,
AttributeDescription * ad
)
BackendDB *be;
int rc;
- be = glue_back_select (b0, ndn);
+ be = glue_back_select (b0, ndn->bv_val);
if (be && be->be_group) {
rc = be->be_group (be, conn, op, target, ndn, ondn, oc, ad);
Connection *conn,
Operation *op,
Entry *target,
- const char *ndn,
+ struct berval *ndn,
AttributeDescription *ad,
struct berval ***vals
)
BackendDB *be;
int rc;
- be = glue_back_select (b0, ndn);
+ be = glue_back_select (b0, ndn->bv_val);
if (be && be->be_attribute) {
rc = be->be_attribute (be, conn, op, target, ndn, ad, vals);
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,
+ Entry *e,
+ struct berval *bdn,
+ struct berval *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,
+ Entry *e, struct berval *edn,
AttributeDescription *entry_at,
struct berval ***vals ));