]> git.sur5r.net Git - openldap/commitdiff
read entry should allow special attributes in request (*, +, 1.1)
authorPierangelo Masarati <ando@openldap.org>
Sat, 14 Oct 2006 00:59:55 +0000 (00:59 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 14 Oct 2006 00:59:55 +0000 (00:59 +0000)
servers/slapd/controls.c

index b6c356e7413293b2f07234363f799e970749b2e3..bc31133bacd69abbbbba2f1764e6e7dd338b2bfa 100644 (file)
@@ -1294,18 +1294,37 @@ static int parsePostRead (
                goto done;
        }
 
-       for( i=0; i<siz; i++ ) {
+       for ( i = 0; i < siz; i++ ) {
                const char      *dummy = NULL;
+               int             rc;
 
                an[i].an_desc = NULL;
                an[i].an_oc = NULL;
                an[i].an_oc_exclude = 0;
-               rs->sr_err = slap_bv2ad( &an[i].an_name, &an[i].an_desc, &dummy );
-               if ( rs->sr_err != LDAP_SUCCESS && ctrl->ldctl_iscritical ) {
-                       rs->sr_text = dummy
-                               ? dummy
-                               : "postread control: unknown attributeType";
-                       goto done;
+               rc = slap_bv2ad( &an[i].an_name, &an[i].an_desc, &dummy );
+               if ( rc != LDAP_SUCCESS ) {
+                       int                     i;
+                       static struct berval    special_attrs[] = {
+                               BER_BVC( LDAP_NO_ATTRS ),
+                               BER_BVC( LDAP_ALL_USER_ATTRIBUTES ),
+                               BER_BVC( LDAP_ALL_OPERATIONAL_ATTRIBUTES ),
+                               BER_BVNULL
+                       };
+
+                       /* deal with special attribute types */
+                       for ( i = 0; !BER_BVISNULL( &special_attrs[ i ] ); i++ ) {
+                               if ( bvmatch( &an[i].an_name, &special_attrs[ i ] ) ) {
+                                       break;
+                               }
+                       }
+
+                       if ( BER_BVISNULL( &special_attrs[ i ] ) && ctrl->ldctl_iscritical ) {
+                               rs->sr_err = rc;
+                               rs->sr_text = dummy
+                                       ? dummy
+                                       : "postread control: unknown attributeType";
+                               goto done;
+                       }
                }
        }