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

ldap_init overwrites ldap version number to 2



There's a line in open.c that get executed when ldap_init is called:

        /* we'll assume we're talking version 2 for now */
        ld->ld_version = LDAP_VERSION2;

This breaks the case where an application sets the ldap version to 3 in the global options before calling ldap_init().
i.e.
      version = LDAP_VERSION3;
      ldap_set_option( NULL, LDAP_OPT_PROTOCOL_VERSION, &version);

      ldap_init(...);
      < version number gets reset to 2>

The global options are already initialized to version 2 and get copied into the ld handle when ldap_init is called.
These two lines should be deleted from open.c.