Ivan Nejgebauer wrote:
> On 21.10.25. 10:58, Bastian Tweddell wrote:
>> The space seems to be an issue at only one location. At the trailing
>> space at `^` in the expression `(!(attr=val)^)`
>>
>> [...]
>>
>> I cannot tell from [1] if this might be a bug in the parser or works as
>> designed.
>>
>> 1:https://www.rfc-editor.org/rfc/rfc4515#section-3
> 
> The RFC 4515 grammar only permits spaces in assertion values, so a strictly
> conforming parser wouldn't even work with the examples you've given.
>  
The git history shows that the parser has always accepted and ignored leading 
spaces ' (foo=bar)',
that behavior has been present since 1998 (initial commit, 
42e0d83cb3a1a1c5b25183f1ab74ce7edbe25de7, libldap/search.c)
It doesn't appear to have ever done anything special with trailing spaces.

A change was made in 2001 (commit 4e79e82972c0d5815608e139c1a3db0c6d2f7704) to 
require NOT filters
to contain only a single component. This is the change that is rejecting the 
trailing space, and it
only affects NOT filters. I think the behavior regarding trailing spaces was 
simply ignored.

-- 
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/

Reply via email to