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;
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++ ) {
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 ) {
}
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 );
/*
* 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;
/*
* 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;