Tk Library Source Code

View Ticket
Login
Ticket UUID: 2018141
Title: Reimpl. of search filter strings parsing/encoding
Type: Patch Version: None
Submitter: flatworm Created on: 2008-07-14 17:21:11
Subsystem: ldap Assigned To: loewerj
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2008-07-21 02:52:43
Resolution: Accepted Closed By: mic42
    Closed on: 2008-07-20 19:52:43
Description:
This patch reimplements parsing and encoding of search filter strings, namely:
* Implemented proper syntax parsing using regexps only when really applicable. The parser appears to be enough robust for errors in filter specifications.
* Options in attribute descriptions are now permitted (but not used, see below).
* Implemented full support for extensible match rules.

Test suite with pretty complete coverage for this code is also provided.

Other changes include:
* Removed artifical restriction of permitted types of search result PDUs: this removes module misbehaving when presented with a PDU tagged with apptype 19 (search continuation).
* Fixed RFC number in leading commend in ldap.tcl.
* Added Vim modelines to ldap.tcl and ldap.test to force braindamaged indentation mode used in these files.

This patch should fix bugs 1751871 and 1852718.

The ldap module with this patch applied works for me against Windows Server 2003 LDAP directory.

Note on options: while LDAP RFCs mention one standard attribute description option "binary" which requires special encoding when transmitting associated attribute values, I failed to understand both its applicability to client requests and whether its usage has any sense in search representation of filter strings. So the proposed implementation parses it, but does nothing besides this.
User Comments: mic42 added on 2008-07-21 02:52:43:
Logged In: YES 
user_id=302287
Originator: NO

Accepted the patch with some minor changes to the test suit organisation.

flatworm added on 2008-07-15 06:34:19:

File Deleted - 284669:

flatworm added on 2008-07-15 06:34:00:

File Added - 284706: ldap.diff

Logged In: YES 
user_id=1350198
Originator: YES

Attached an updated patch with the logic regarding encoding of attribute descriptions and assertion values made more consistent on the source level.

Also added more tests, comments made more clear and some procs renamed to better mirror their purpose.
File Added: ldap.diff

flatworm added on 2008-07-15 04:37:00:
Logged In: YES 
user_id=1350198
Originator: YES

After reading bug 1178045 I fear I might overuse conversion to LDAPString in my code. Let me check and re-upload the fixed patch.

flatworm added on 2008-07-15 00:21:11:

File Added - 284669: ldap.diff

Attachments: