LDAPSunMerge

From MozillaWiki
Jump to: navigation, search

Done: (12/31/2007) Sun LDAP C SDK code has been merged in now and is available on the trunk

The LDAP C SDK release 6.0.2 contains all of the merged source code.

This page is to track the work to merge the Sun LDAP C SDK codebase back into mozilla.

liblber

liblber is merged on the trunk.

Bugzilla Bug 347933 https://bugzilla.mozilla.org/show_bug.cgi?id=347933 with the first cut of the patch is filed. the following files are affected by the patch :

mozilla/directory/c-sdk/ldap/include/lber.h
mozilla/directory/c-sdk/ldap/include/portable.h
mozilla/directory/c-sdk/ldap/libraries/liblber/decode.c
mozilla/directory/c-sdk/ldap/libraries/liblber/encode.c
mozilla/directory/c-sdk/ldap/libraries/liblber/io.c
mozilla/directory/c-sdk/ldap/libraries/liblber/lber-int.h
mozilla/directory/c-sdk/ldap/libraries/libldap/compat.c
mozilla/directory/c-sdk/ldap/libraries/libldap/control.c
mozilla/directory/c-sdk/ldap/libraries/libldap/error.c
mozilla/directory/c-sdk/ldap/libraries/libldap/extendop.c
mozilla/directory/c-sdk/ldap/libraries/libldap/getattr.c
mozilla/directory/c-sdk/ldap/libraries/libldap/psearch.c
mozilla/directory/c-sdk/ldap/libraries/libldap/result.c
mozilla/directory/c-sdk/ldap/libraries/libldap/saslbind.c
mozilla/directory/c-sdk/ldap/libraries/libldap/sortctrl.c
  • Sun is using ber typedefs for the ber tags, lengths, sizes, and they are using the same typedefs as OpenLDAP uses (e.g. see /usr/include/lber_types.h on a linux system). This will help with OpenLDAP compatability.
  • decode.c - Sun added explicit boundary checking for bad ber lengths, and explicit freeing of allocated buffers upon ber failures
  • in io.c - Sun has a slightly different implementation of BerRead, as well as several other improvements in ber i/o (tunable buffer size, ber stats, and much more)
  • nsldap_ber_realloc - The Sun version keeps track of the number of reallocs

libldap

libldap is merged on the trunk.

see Bugzilla Bug 357668 https://bugzilla.mozilla.org/show_bug.cgi?id=357668 for more details.

see Bugzilla Bug 362619 https://bugzilla.mozilla.org/show_bug.cgi?id=362619 for more details.

strike used to indicate that file or code within has already been merged.

  • abandon.c - Quite a bit of work on abandon ops in Sun branch.
  • authzidctrl.c - New file in Sun branch.
  • cache.c - Simple printf format type difference (%d vs. %ld). Looks to be newer in Moz tip.
  • charray.c - Looks to be newer code in Moz tip.
  • cldap.c - Simple LDAP version const difference.
  • compat.c - Sun branch implments nsldapi_compat_strlcpy. Moz tip has an HPUX11 specific ifdef.
  • control.c - Sun branch uses new ber types.
  • disptmpl.c - Two refactored functions, nsldapi_free_strarray and nsldapi_next_line_tokens. Not sure which code is more recent.
  • dsparse.c - Use of refactored functions nsldapi_free_strarray and nsldapi_next_line_tokens.
  • error.c - Both sides have some general cleanup. Moz tip adds checking for availability of snprintf before using it. Sun branch adds some frees and has better variable initialization.
  • extendop.c - Sun branch uses new ber types. Differences in a ber_printf section. Both very similar, but a few minor differences around an empty ber value. Need to look into this closer to see which is better.
  • getattr.c - Sun branch uses new ber types.
  • getdn.c - Sun branch has a few small changes. It has better variable initialization and uses a flag for finding the beginning quote when parsing.
  • getdxbyname.c - Moz tip has some additional error checking.
  • geteffectiverightsctrl.c - New file in Sun branch.
  • getfilter.c - Use of refactored functions nsldapi_free_strarray and nsldapi_next_line_tokens. Moz tip adds checking for availability of snprintf before using it.
  • getoption.c - Sun branch adds SASL options plus LDAP_OPT_NOREBIND and LDAP_X_OPT_SOCKBUF. Moz tip has LDAP_OPT_EXTRA_THREAD_FN_PTRS.
  • globals.c - New file in Sun branch.
  • ldap-int.h - Moz tip has more platform specific ifdefs. Sun branch has some FD_SETSIZE and SASL changes. Various other refactoring, etc.
  • Makefile.client - Sun branch adds new source files, SASL linking and includes. A few other differences.
    • We should use autoconf for builds, get rid of Makefile.client
  • Makefile.in - A whole bunch of differences related to the changes in Makefile.client.
  • memcache.c - Some differences in hash_result use. Moz tip seems to be clearer code that does the same thing, but we need to look closer. Moz tip also has some additional casting, etc.
  • open.c - Sun branch has new SASL code. A bunch of platform ifdefs around pthreads between the two code bases.
  • os-ip.c - Sun branch has new SASL code. Moz tip looks to have some newer Windows related code and a bunch of ifdef NSLDAPI_AVOID_OS_SOCKETS code that the Sun branch doesn't have.
  • psearch.c - Sun branch uses new ber types.
  • pwmodext.c - New file in Sun branch.
  • pwpctrl.c - New file in Sun branch.
  • request.c - Lots of differences here. We'll need to go through this very closely.
  • result.c - Lots of differences here. We'll need to go through this very closely.
  • sasl.c - New file in Sun branch.
  • saslbind.c - Sun branch adds some code to deal with controls. Also uses new ber types.
  • search.c - Refactoring of ldap_put_filter vs. put_filter.
  • setoption.c - Sun branch adds new SASL code and NOREBIND option. A few other minor differences.
  • sortctrl.c - Sun branch uses new ber types.
  • srchpref.c - Uses refactored functions nsldapi_free_strarray and nsldapi_next_line_tokens.
  • svrcore.c - New file in Sun branch
    • We can use the open source svrcore now, so we can probably get rid of this file
  • test.c - Moz tip code looks newer.
  • uactrl.c - New file in Sun branch.
  • unbind.c - Sun branch adds new SASL code. Also a ber flush difference.
  • url.c - Sun branch exposes nsldapi_url_parse as ldap_url_parse_no_defaults.
  • utf8.c - Small variable initialization difference. Moz tip looks more correct.
  • vlistctrl.c - Small variable type difference. Moz tip looks more correct.
  • whoami.c - New file in Sun branch.

tools

ldap tools are merged on the trunk.

see Bugzilla Bug 364812 https://bugzilla.mozilla.org/show_bug.cgi?id=364812 for more details.

  • common.c - Moz tip has some ARGPIN stuff and some platform ifdefs. Sun has some SASL code. Differences around pwpolicy and TLS/SSL/FORTEZZA. The diffs are large for this file, so we'll need to go through it closely.
  • convutf8.c - Moz tip uses iconv while Sun branch uses ICU. Moz tip also has some Windows specific stuff. We need to go through this closely.
    • If Sun only uses ICU for utf8 <-> local charset conversion, we should just get rid of ICU in favor of moz tip
  • fileurl.c - A few minor differences with file url parsing. Should be an easy merge.
  • ldapcmp.c - A few function return type differences. Moz tip looks more correct at first glance. Moz tip also appears to have a few fixes for things such as specifying multiple host arguments.
    • Yep - Ulf submitted a patch for that in 2005
  • ldapcompare.c - A few minor differences. Should be an easy merge.
  • ldapdelete.c - Sun branch appears to have some new code, but a comment indicates that it broke iDS. We should review this before merging.
  • ldapmodify.c - Some minor fixes appear to be in the Moz tip. Very little new from the Sun branch. Should be an easy merge.
  • ldapmodrdn.c - Minor difference in the way main is defined. Sun branch is more clear.
  • ldappasswd.c - New file in Sun branch.
  • ldapsearch.c - A few function return type differences, casting, usage message differences, and SASL option differences. A small amount of ICU vs. iconv related stuff. Sun branch has some get effective rights stuff. We'll need to go through this closely.
  • ldaptool.h - Sun branch has some get effective rights, password related code, and linked-list structures that appear to be used for recursive entry deletion by ldapdelete.
  • ldaptool-sasl.c - New file in Sun branch.
  • ldaptool-sasl.h - New file in Sun branch.
  • list.c - New file in Sun branch.
  • list.h - New file in Sun branch.
  • Makefile.client - General build differences for SASL, ICU, svrcore, new source files, platform stuff, etc.
    • Sun should use the new autoconf style build - we should get rid of the Makefile.client files
  • Options.txt - Command-line options. Mozilla tip look more up-to-date. I'm not sure if this file was kept in sync with the actual options used in the Sun branch.
  • tools.mak - New file in Sun branch.

libssldap

libssldap is merged on the trunk.

see Bugzilla Bug 355244 https://bugzilla.mozilla.org/show_bug.cgi?id=355244 for more details.

  • Mozilla code seems to be more up to date and better organized with all deprecated and redundant code removed and secdb initialization reworked.
  • prerrstrs.h - Moz version has some additional error to string mappings.
  • secerrstrs.h - Moz version has some additional error to string mappings.
  • sslerrstrs.h - Moz version has some additional error to string mappings.
  • clientinit.c - diffs mainly related to basic NSS initialization with Moz version containing more up to date code in regard of handling secdb file or folder names.
    • ldapssl_basic_init() has changed in Moz version to take secdb pathnames as args and take care of initialization based on that. it allows to get rid of bunch of redundant functions and duplicated code in Sun branch.
    • internal memory allocation functions disabled in Moz version.
    • Sun version does SSL_OptionSetDefault(SSL_ENABLE_TLS, PR_TRUE) in addition to SSL2 and SSL3 where Moz version does not.
    • Sun version keeps around now deprecated ldapssl_tls_start_s() and ldapssl_tls_start() that are now replaced with ldap_start_tls_s().
  • errormap.c - practically same. two static const vs const and one macro vs value differences.
  • ldapsinit.c - in general subtle changes dealing with session info and error handling.
    • Moz version has better error handling in ldapssl_init().
    • do_ldapssl_connect() in Sun version == ldapssl_connect() in Moz ver, additional arg in Sun version but implementations are same with only one additional error check in Mozilla version.
    • Moz version contains new sslopt2string() function and supporting struct for debugging.
    • Sun version contains now redundant ldapssl_import_fd(), ldapssl_reset_to_nonsecure() and ldapssl_enableSSL_on_open_connection() to support deprecated ldapssl_tls_start* functions.
  • libssldap.rc - new file on Sun branch to deal with native version and vendor information on Windows, similar files exist for other libraries and tools. not a killer feature but must have in absence of ident/what on Windows.
  • Makefile* - bunch of diffs as expected due to static makefiles in Sun version. main diffs as well as for other libs and tools are RPATH args and version information added on Sun branch.

libprldap

libprldap is merged on the trunk.

see Bugzilla Bug 352519 https://bugzilla.mozilla.org/show_bug.cgi?id=352519 for more details.

  • Sun code seems more up to date with new functions.
  • ldappr-int.h - Moz version defines new PRLDAP_MAX_SEND_SIZE to workaround some large send problem on Windows.
    • Sun version has new prldap_socket_arg_from_ld() function.
  • ldappr-dns.c - Sun version has new prldap_getpeername() function.
  • ldappr-error.c - Moz version defines some additional platform specific error code macros, dunno if they really needed today or can be deprecated, needs a closer look later on.
    • some platform specific macros that are common aggregated in one place in Moz version.
  • ldappr-io.c - PRLDAP_MAX_SEND_SIZE handling in prldap_write() of Moz version.
    • prldap_socket_arg_from_ld() implementation in Sun version.
    • one additional free in prldap_connect() of Sun version and one additional error check in prldap_try_one_address() of Moz version.
  • ldappr-public.c - Sun version has these new functions: prldap_get_default_socket_info(), prldap_set_default_socket_info().
    • Moz version defines socket as int where Sun version defines socket as LBER_SOCKET in prldap_import_connection().
  • ldappr-threads.c - exactly the same code on both branches.
  • libprldap.rc - new file on Sun branch to deal with native version and vendor information on Windows, similar files exist for other libraries and tools. not a killer feature but must have in absence of ident/what on Windows.
  • Makefile* - bunch of diffs as expected due to static makefiles in Sun version. main diffs as well as for other libs and tools are RPATH args and version information added on Sun branch.