[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Enhancement to implement V3 Referral / Search ReferenceHandling (ITS#546)



Developers, please review and provide technical comments to this
list. Thanks!

Kurt


At 03:55 PM 5/24/00 -0600, Steve Sonntag wrote:
>>>>
Full_Name: Steven Sonntag
Version: devel
OS: Linux / NetWare / WinNT
URL: <ftp://ftp.openldap.org/incoming/vtag-000524.patch>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
<mailto:vtag@novell.com>vtag@novell.com

<<<<