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

RE: Porting mozldap to openldap



Hi Howard,

I am sure that my brain must be very dense. I have spend last 2 days to
study your example and again look at what is in the function
ldap_advclientauth_init() of mozldap which is used in my application and
I have no foggy idea where to start.

1. Patch ID334117: this seems to be the patch for thunderbird revision
1.65. you're still using both openldap and some from mozilla-nspr
package. I could not find source code of thunderbird revision 1.65 any
where.

2. The function ldap_advclientauth_init() has only about 15 lines. It is
traced out to almost 1680 lines used many functions from mozldap to nss
to nspr. It is just too complicated and confusing for me.

I am thinking to port the function ldap_advclientauth_init() only to
openldap so I will not have to mess up with the rest of the software
which already proven to work.

Is that a right approach?

Could you give me some guide lines on what need and do need to be done?
Please keep in mind that I don't have the knowledge of yours, nowhere
near that.

Thank you very much.

Quang Nguyen

-----Original Message-----
From: Howard Chu [mailto:hyc@symas.com] 
Sent: Monday, April 20, 2009 11:08 AM
To: Nguyen, Quang
Cc: openldap-technical@openldap.org
Subject: Re: Porting mozldap to openldap

Nguyen, Quang wrote:
> Hi everybody,
>
> I have spend sometime to understand mozldap and openldap. I have
> searched the archives using these keyword "mozldap to openldap" or
just
> "mozldap" but found nothing.
>
> I have to port an application currently using mozldap to openldap.
>
> Has anyone done this before, I would like to ask some questions such
as:
>
> 1. I see that the application called ldapssl_advclientauth_init(),
> ldapssl_init() if using certificate and call prldap_init() if using
> simple authentication. The function ldapssl_advclientauth_init() is
very
> big after I traced it down. Is there an equivalent call in openldap?

No, it's a lot easier than that in OpenLDAP.

> 2. Is there any example posted somewhere that my search on google
missed
> (I could not find any).

I have ported Mozilla/Thunderbird/Seamonkey to use OpenLDAP already.

https://bugzilla.mozilla.org/show_bug.cgi?id=292127

> 3. Is there anything I should be watching for?

MozLDAP provides a single library that is moderately thread-safe. It
uses 
thread-local-storage in a few places as needed. OpenLDAP provides two
separate 
libraries, one non-threaded and one threaded. If your app is threaded
you'll 
need to check which library you've linked and how you use the LDAP *
session 
handles.

> 4. What is the best approach to do this?

For the most part it's a pretty easy transition.

> I thank you very much for any help, suggestion I can get.

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