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