mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Code cleanup (no functional changes)
This commit is contained in:
parent
77911fc829
commit
33248a02e1
@ -919,7 +919,6 @@ dn_match_cleanup:;
|
||||
}
|
||||
|
||||
if ( b->a_group_pat.bv_len ) {
|
||||
char buf[ACL_BUF_SIZE];
|
||||
struct berval bv;
|
||||
struct berval ndn = { 0, NULL };
|
||||
int rc;
|
||||
@ -928,29 +927,33 @@ dn_match_cleanup:;
|
||||
continue;
|
||||
}
|
||||
|
||||
bv.bv_len = sizeof(buf) - 1;
|
||||
bv.bv_val = buf;
|
||||
|
||||
/* b->a_group is an unexpanded entry name, expanded it should be an
|
||||
* entry with objectclass group* and we test to see if odn is one of
|
||||
* the values in the attribute group
|
||||
*/
|
||||
/* see if asker is listed in dnattr */
|
||||
if ( b->a_group_style == ACL_STYLE_REGEX ) {
|
||||
string_expand(&bv, &b->a_group_pat, e->e_ndn, matches);
|
||||
if ( dnNormalize2(NULL, &bv, &ndn) != LDAP_SUCCESS ) {
|
||||
char buf[ACL_BUF_SIZE];
|
||||
bv.bv_len = sizeof(buf) - 1;
|
||||
bv.bv_val = buf;
|
||||
|
||||
string_expand( &bv, &b->a_group_pat, e->e_ndn, matches );
|
||||
if ( dnNormalize2( NULL, &bv, &ndn ) != LDAP_SUCCESS ) {
|
||||
/* did not expand to a valid dn */
|
||||
continue;
|
||||
}
|
||||
|
||||
bv = ndn;
|
||||
|
||||
} else {
|
||||
bv = b->a_group_pat;
|
||||
}
|
||||
|
||||
rc = backend_group(be, conn, op, e, &bv, &op->o_ndn,
|
||||
b->a_group_oc, b->a_group_at);
|
||||
if ( ndn.bv_val )
|
||||
free( ndn.bv_val );
|
||||
rc = backend_group( be, conn, op, e, &bv, &op->o_ndn,
|
||||
b->a_group_oc, b->a_group_at );
|
||||
|
||||
if ( ndn.bv_val ) free( ndn.bv_val );
|
||||
|
||||
if ( rc != 0 ) {
|
||||
continue;
|
||||
}
|
||||
@ -1674,7 +1677,8 @@ aci_group_member (
|
||||
bv.bv_val = (char *)&buf;
|
||||
string_expand(&bv, &subjdn, e->e_ndn, matches);
|
||||
if ( dnNormalize2(NULL, &bv, &ndn) == LDAP_SUCCESS ) {
|
||||
rc = (backend_group(be, conn, op, e, &ndn, &op->o_ndn, grp_oc, grp_ad) == 0);
|
||||
rc = (backend_group(be, conn, op, e, &ndn, &op->o_ndn,
|
||||
grp_oc, grp_ad) == 0);
|
||||
free( ndn.bv_val );
|
||||
}
|
||||
}
|
||||
|
@ -30,8 +30,7 @@ bdb_group(
|
||||
struct berval *gr_ndn,
|
||||
struct berval *op_ndn,
|
||||
ObjectClass *group_oc,
|
||||
AttributeDescription *group_at
|
||||
)
|
||||
AttributeDescription *group_at )
|
||||
{
|
||||
struct bdb_info *bdb = (struct bdb_info *) be->be_private;
|
||||
struct bdb_op_info *boi = NULL;
|
||||
@ -58,18 +57,19 @@ bdb_group(
|
||||
op_ndn->bv_val, gr_ndn->bv_val, group_oc_name );
|
||||
#else
|
||||
Debug( LDAP_DEBUG_ARGS,
|
||||
"=> bdb_group: gr dn: \"%s\"\n",
|
||||
"=> bdb_group: group ndn: \"%s\"\n",
|
||||
gr_ndn->bv_val, 0, 0 );
|
||||
|
||||
Debug( LDAP_DEBUG_ARGS,
|
||||
"=> bdb_group: op dn: \"%s\"\n",
|
||||
"=> bdb_group: op ndn: \"%s\"\n",
|
||||
op_ndn->bv_val, 0, 0 );
|
||||
|
||||
Debug( LDAP_DEBUG_ARGS,
|
||||
"=> bdb_group: oc: \"%s\" at: \"%s\"\n",
|
||||
group_oc_name, group_at_name, 0 );
|
||||
|
||||
Debug( LDAP_DEBUG_ARGS,
|
||||
"=> bdb_group: tr dn: \"%s\"\n",
|
||||
"=> bdb_group: tr ndn: \"%s\"\n",
|
||||
target->e_ndn, 0, 0 );
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user