{
int i;
for( i=0; attrs[i] != NULL; i++ ) {
+ ObjectClass *oc;
AttributeDescription *ad = NULL;
const char *text;
int rc;
rc = slap_str2ad( attrs[i], &ad, &text );
+ if( rc == LDAP_SUCCESS ) {
+ rc = is_ad_subtype( desc, ad );
+ if( rc ) return 1;
+ continue;
+ }
- if( rc != LDAP_SUCCESS ) continue;
-
- rc = is_ad_subtype( desc, ad );
+ /*
+ * EXTENSION: see if requested description is an object class
+ * if so, return attributes which the class requires/allows
+ */
+ oc = oc_find( attrs[i] );
+ if( oc != NULL ) {
+ if ( oc == slap_schema.si_oc_extensibleObject ) {
+ /* extensibleObject allows the return of anything */
+ return 1;
+ }
- if( rc ) return 1;
+ if( oc->soc_required ) {
+ /* allow return of required attributes */
+ int i;
+ for ( i = 0; oc->soc_required[i] != NULL; i++ ) {
+ rc = is_at_subtype( desc->ad_type,
+ oc->soc_allowed[i] );
+ if( rc ) return 1;
+ }
+ }
+ if( oc->soc_allowed ) {
+ /* allow return of allowed attributes */
+ int i;
+ for ( i = 0; oc->soc_allowed[i] != NULL; i++ ) {
+ rc = is_at_subtype( desc->ad_type,
+ oc->soc_allowed[i] );
+ if( rc ) return 1;
+ }
+ }
+ }
}
return 0;
echo "Using ldapsearch to retrieve all the entries..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -b "" -s base -h localhost:$PORT '+' > $SEARCHOUT 2>&1
+ $LDAPSEARCH -b "" -s base -h localhost:$PORT 'extensibleObject' > $SEARCHOUT 2>&1
RC=$?
if test $RC = 1 ; then
echo "Waiting 5 seconds for slapd to start..."