elecharny commented on code in PR #382:
URL: https://github.com/apache/directory-server/pull/382#discussion_r4372893839
##########
protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java:
##########
@@ -149,6 +150,19 @@ private void handlePersistentSearch( LdapSession session,
SearchRequest req, Per
return;
}
}
+ else
+ {
+ // Even if only the changes are requested, the client must be
allowed to
+ // search the base : do a base level search through the client's
session,
+ // which will throw an exception if it isn't authenticated as
required, or
+ // if the base does not exist
+ try ( Cursor<Entry> cursor = session.getCoreSession().search(
req.getBase(), SearchScope.OBJECT,
+ new PresenceNode( SchemaConstants.OBJECT_CLASS_AT ),
AliasDerefMode.NEVER_DEREF_ALIASES,
+ SchemaConstants.NO_ATTRIBUTE ) )
+ {
Review Comment:
Not sure it's necessary. We can let the cursor being auto-closed without
doing anything with it, teh idea is just to check that the user is authorized.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]