mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-27 17:19:19 -05:00
fix user/operational mix of attribute request
This commit is contained in:
parent
66a66db3da
commit
0c65f51ab2
3 changed files with 25 additions and 14 deletions
|
|
@ -269,10 +269,12 @@ typedef struct backsql_srch_info {
|
|||
|
||||
unsigned bsi_flags;
|
||||
#define BSQL_SF_NONE 0x0000U
|
||||
#define BSQL_SF_ALL_OPER 0x0001U
|
||||
#define BSQL_SF_FILTER_HASSUBORDINATE 0x0002U
|
||||
#define BSQL_SF_FILTER_ENTRYUUID 0x0004U
|
||||
#define BSQL_SF_FILTER_ENTRYCSN 0x0008U
|
||||
#define BSQL_SF_ALL_USER 0x0001U
|
||||
#define BSQL_SF_ALL_OPER 0x0002U
|
||||
#define BSQL_SF_ALL_ATTRS (BSQL_SF_ALL_USER|BSQL_SF_ALL_OPER)
|
||||
#define BSQL_SF_FILTER_HASSUBORDINATE 0x0010U
|
||||
#define BSQL_SF_FILTER_ENTRYUUID 0x0020U
|
||||
#define BSQL_SF_FILTER_ENTRYCSN 0x0040U
|
||||
#define BSQL_SF_RETURN_ENTRYUUID (BSQL_SF_FILTER_ENTRYUUID << 8)
|
||||
|
||||
struct berval *bsi_base_ndn;
|
||||
|
|
|
|||
|
|
@ -510,7 +510,14 @@ backsql_id2entry( backsql_srch_info *bsi, backsql_entryID *eid )
|
|||
return rc;
|
||||
}
|
||||
|
||||
if ( bsi->bsi_attrs != NULL ) {
|
||||
if ( bsi->bsi_attrs == NULL || ( bsi->bsi_flags & BSQL_SF_ALL_USER ) )
|
||||
{
|
||||
Debug( LDAP_DEBUG_TRACE, "backsql_id2entry(): "
|
||||
"retrieving all attributes\n", 0, 0, 0 );
|
||||
avl_apply( bsi->bsi_oc->bom_attrs, backsql_get_attr_vals,
|
||||
bsi, 0, AVL_INORDER );
|
||||
|
||||
} else {
|
||||
Debug( LDAP_DEBUG_TRACE, "backsql_id2entry(): "
|
||||
"custom attribute list\n", 0, 0, 0 );
|
||||
for ( i = 0; bsi->bsi_attrs[ i ].an_name.bv_val; i++ ) {
|
||||
|
|
@ -555,12 +562,6 @@ backsql_id2entry( backsql_srch_info *bsi, backsql_entryID *eid )
|
|||
|
||||
next:;
|
||||
}
|
||||
|
||||
} else {
|
||||
Debug( LDAP_DEBUG_TRACE, "backsql_id2entry(): "
|
||||
"retrieving all attributes\n", 0, 0, 0 );
|
||||
avl_apply( bsi->bsi_oc->bom_attrs, backsql_get_attr_vals,
|
||||
bsi, 0, AVL_INORDER );
|
||||
}
|
||||
|
||||
if ( bsi->bsi_flags & BSQL_SF_RETURN_ENTRYUUID ) {
|
||||
|
|
@ -600,7 +601,9 @@ next:;
|
|||
}
|
||||
|
||||
if ( ( bsi->bsi_flags & BSQL_SF_ALL_OPER )
|
||||
|| an_find( bsi->bsi_attrs, &AllOper ) ) {
|
||||
|| an_find( bsi->bsi_attrs, &AllOper )
|
||||
|| an_find( bsi->bsi_attrs, &slap_schema.si_ad_structuralObjectClass->ad_cname ) )
|
||||
{
|
||||
rc = attr_merge_normalize_one( bsi->bsi_e,
|
||||
slap_schema.si_ad_structuralObjectClass,
|
||||
&soc, bsi->bsi_op->o_tmpmemctx );
|
||||
|
|
|
|||
|
|
@ -132,8 +132,10 @@ backsql_init_search(
|
|||
/*
|
||||
* handle "*"
|
||||
*/
|
||||
if ( attrs == NULL || an_find( attrs, &AllUser ) ) {
|
||||
if ( attrs == NULL ) {
|
||||
/* also add request for all operational */
|
||||
bsi->bsi_attrs = NULL;
|
||||
bsi->bsi_flags |= BSQL_SF_ALL_USER;
|
||||
|
||||
} else {
|
||||
int got_oc = 0;
|
||||
|
|
@ -146,7 +148,11 @@ backsql_init_search(
|
|||
/*
|
||||
* ignore "1.1"; handle "+"
|
||||
*/
|
||||
if ( BACKSQL_NCMP( &p->an_name, &AllOper ) == 0 ) {
|
||||
if ( BACKSQL_NCMP( &p->an_name, &AllUser ) == 0 ) {
|
||||
bsi->bsi_flags |= BSQL_SF_ALL_USER;
|
||||
continue;
|
||||
|
||||
} else if ( BACKSQL_NCMP( &p->an_name, &AllOper ) == 0 ) {
|
||||
bsi->bsi_flags |= BSQL_SF_ALL_OPER;
|
||||
continue;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue