Blame SOURCES/0009-Bug-1624004-fix-regression-in-empty-attribute-list.patch

31affc
From 55e961338810d89a6f45f31f27b3fd609535b1da Mon Sep 17 00:00:00 2001
31affc
From: Mark Reynolds <mreynolds@redhat.com>
31affc
Date: Wed, 19 Sep 2018 09:26:59 -0400
31affc
Subject: [PATCH] Bug 1624004 - fix regression in empty attribute list
31affc
31affc
https://bugzilla.redhat.com/show_bug.cgi?id=1624004
31affc
---
31affc
 ldap/servers/slapd/search.c | 12 ++++++++----
31affc
 1 file changed, 8 insertions(+), 4 deletions(-)
31affc
31affc
diff --git a/ldap/servers/slapd/search.c b/ldap/servers/slapd/search.c
31affc
index dc26fc4d2..7e253f535 100644
31affc
--- a/ldap/servers/slapd/search.c
31affc
+++ b/ldap/servers/slapd/search.c
31affc
@@ -210,6 +210,7 @@ do_search(Slapi_PBlock *pb)
31affc
         char *normaci = slapi_attr_syntax_normalize("aci");
31affc
         int replace_aci = 0;
31affc
         int attr_count = 0;
31affc
+        int empty_attrs = 0;
31affc
         if (!normaci) {
31affc
             normaci = slapi_ch_strdup("aci");
31affc
         } else if (strcasecmp(normaci, "aci")) {
31affc
@@ -226,10 +227,13 @@ do_search(Slapi_PBlock *pb)
31affc
             attr_count++;
31affc
 
31affc
             if ( attrs[i][0] == '\0') {
31affc
-                log_search_access(pb, base, scope, fstr, "invalid attribute request");
31affc
-                send_ldap_result(pb, LDAP_PROTOCOL_ERROR, NULL, NULL, 0, NULL);
31affc
-                slapi_ch_free_string(&normaci);
31affc
-                goto free_and_return;
31affc
+                empty_attrs++;
31affc
+                if (empty_attrs > 1) {
31affc
+                    log_search_access(pb, base, scope, fstr, "invalid attribute request");
31affc
+                    send_ldap_result(pb, LDAP_PROTOCOL_ERROR, NULL, NULL, 0, NULL);
31affc
+                    slapi_ch_free_string(&normaci);
31affc
+                    goto free_and_return;
31affc
+                }
31affc
             }
31affc
 
31affc
             /* check if @<objectclass> is included */
31affc
-- 
31affc
2.17.1
31affc