]> git.sur5r.net Git - openldap/commitdiff
Fix entry_get, only check mapped attr if attr was provided
authorHoward Chu <hyc@openldap.org>
Tue, 25 May 2004 04:54:32 +0000 (04:54 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 25 May 2004 04:54:32 +0000 (04:54 +0000)
servers/slapd/back-ldap/search.c

index 9b12268b7a97b7579f7998c9698d84c7bf28f9c8..6da4f608d98f103df1185cd3a86cd51d0450854f 100644 (file)
@@ -571,17 +571,17 @@ ldap_back_entry_get(
                        rc = 1;
                        goto cleanup;
                }
+               is_oc = (strcasecmp("objectclass", mapped.bv_val) == 0);
+               if (oc && !is_oc) {
+                       gattr[0] = "objectclass";
+                       gattr[1] = mapped.bv_val;
+                       gattr[2] = NULL;
+               } else {
+                       gattr[0] = mapped.bv_val;
+                       gattr[1] = NULL;
+               }
        }
 
-       is_oc = (strcasecmp("objectclass", mapped.bv_val) == 0);
-       if (oc && !is_oc) {
-               gattr[0] = "objectclass";
-               gattr[1] = mapped.bv_val;
-               gattr[2] = NULL;
-       } else {
-               gattr[0] = mapped.bv_val;
-               gattr[1] = NULL;
-       }
        if (oc) {
                char *ptr;
                ldap_back_map(&li->rwmap.rwm_oc, &oc->soc_cname, &mapped,