zrhoffman / rpms / 389-ds-base

Forked from rpms/389-ds-base 3 years ago
Clone
Blob Blame History Raw
From 572ed29e447141f532f2d84f9ea78c48308ad684 Mon Sep 17 00:00:00 2001
From: Thierry Bordaz <tbordaz@redhat.com>
Date: Fri, 7 Jun 2019 11:35:46 +0200
Subject: [PATCH] Ticket 50428 - Log the actual base DN when the search fails
 with "invalid attribute request"

Bug Description:
	When a search request contains invalid parameters (attribute list with empty attribute
	name, unknown scope, invalid filter..) the search is rejected but the access log
	contains a wrong base search: ... SRCH base="(null)"...
	This is because it does not use for logging the variable that gather the actual base ('rawbase')

Fix Description:
	Use 'rawbase' value for logging

https://pagure.io/389-ds-base/issue/50428

Reviewed by: Mark Reynolds

Platforms tested: F28

Flag Day: no

Doc impact: no
---
 ldap/servers/slapd/search.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ldap/servers/slapd/search.c b/ldap/servers/slapd/search.c
index 7e253f535..2a9979552 100644
--- a/ldap/servers/slapd/search.c
+++ b/ldap/servers/slapd/search.c
@@ -154,6 +154,7 @@ do_search(Slapi_PBlock *pb)
             goto free_and_return;
         }
     }
+    base = rawbase;
 
     /*
      * ignore negative time and size limits since they make no sense
-- 
2.21.1