Issue 546 - Enhancement to implement V3 Referral / Search Reference Handling
Summary: Enhancement to implement V3 Referral / Search Reference Handling
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-05-24 21:55 UTC by Steve Sonntag
Modified: 2014-08-01 21:05 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Steve Sonntag 2000-05-24 21:55:45 UTC
Full_Name: Steven Sonntag
Version: devel
OS: Linux / NetWare / WinNT
URL: ftp://ftp.openldap.org/incoming/vtag-000524.patch


Here is the patch for the implementation of V3 referrals.  It is based on the development tree, current code revisions (as of 05/24).

I have tried to not break V2 referrals, but since I don't currently have a way to test them, I don't know for sure if V2 referrals still work.

This code has been built, and run on Netware, WinNT, and Linux and I believe it is pretty solid.

I don't know of any bugs in the current code, however there are some deficiencies.

1 - The rebind proc needs some work.  It should indicate to the application whether the URL is a reference or a referral.  It should really be more general and be called before connect whether or not a bind is needed.  This would change its nature from a rebind_proc to a referral_proc. The application can then decide:
 - If a new connection is needed - should the application allow one to be created?
 - If a bind is necessary, the application decides what kind of bind to perform and performs it
 - Should the referral be followed.
Anyway for now, it is just a rebind proc with somewhat changed parameters.  The rebind proc has the task of performing what ever synchronous bind is appropriate.  If not provided, the API performs an anonymous bind as before.

2 - The client control to turn referrals on / off on a per request basis is not implemented.

3 - When the BER is re-encoded the code does not replace the filter in the BER if one is specified in the referral or reference.  It only replaces the DN in the BER.

The following is a brief description of the changes in the various files.

 include/ldap.h
 - Redefine rebind_proc prototype
 libraries/libldap/bind.c
 - Remove previous implementation of rebind proc, now in options.c
 libraries/libldap/cldap.c
 - modify call to ldap_new_connection for changed prototype
 libraries/libldap/ldap-int.h
 - Add rebind proc to ldapoptions structure
 - Add new variables to connection structure to support V3 referrals
 - Add new status definition to request structure
 - Define structure used to provide data needed for the rebind proc. This structure is passed to the ldap_new_connection function and replaces the current 0/1 flag.  It is now NULL/pointer.
 - Remove previous rebind_proc storage from the ld structure.
 - Add prototypes for the ldap_chase_v3referrals function and modify prototypes for ldap_new_connection,   and ldap_send_server_request.
 libraries/libldap/open.c
 - Modify call to ldap_new_connection to conform with new function prototype.
 libraries/libldap/options.c
 - Add support for ldap_set_rebind_proc to ldap_set_option.
 libraries/libldap/request.c
 - Added Novell Copyright header
 - Add type variable to ber_reencode_request to return the request type
 - Change bind variable passed to ldap_send_server_request and ldap_new_connection from int to structure pointer
 - Rewrite code that calls rebind_proc in ldap_new_connection
 - Add code to ldap_free_connection to free resources associated with referral handling
 - Add code in ldap_dump_requests_and_responses function to display new status code
 - Add new function ldap_chase_v3referrals.
 - Minor modification to ldap_chase_referrals for ldap_send_server_request prototype change
 libraries/libldap/result.c
 - Added Novell Copyright header
 - Modified read1msg function to recognize and handle referrals and search references.
 libraries/libldap/search.c
 - Fix return so results are returned from a search reference
 libraries/libldap/test.c
 - Modified for new rebind_proc function prototype.
 libraries/libldap/url.c
 - Kluge to ldap_url_parse so it correctly interprets URLs from early versions of LDAP in NetWare.

-Steve Sonntag
Consulting Engineer
Novell Directory Services
vtag@novell.com
Comment 1 Kurt Zeilenga 2000-05-24 22:59:41 UTC
Developers, please review and direct technical comments to
openldap-devel@openldap.org.  Thanks!

Kurt
Comment 2 Kurt Zeilenga 2000-05-25 16:14:51 UTC
moved from Incoming to Software Enhancements
Comment 3 Kurt Zeilenga 2000-05-25 16:15:36 UTC
changed notes
changed state Open to Feedback
Comment 4 Kurt Zeilenga 2000-05-25 16:29:56 UTC
moved from Software Enhancements to Development
Comment 5 Kurt Zeilenga 2000-05-31 09:29:33 UTC
changed state Feedback to Closed
Comment 6 OpenLDAP project 2014-08-01 21:05:27 UTC
pending update