Last Comment Bug 293199 - ldapsdk CLU with startTLS with specified certdb fails
: ldapsdk CLU with startTLS with specified certdb fails
Status: RESOLVED FIXED
:
Product: Directory
Classification: Components
Component: LDAP C SDK (show other bugs)
: other
: Other Other
: -- normal (vote)
: ---
Assigned To: Rich Megginson
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-06 16:35 PDT by Ulf Weltman
Modified: 2005-05-10 13:13 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Diff on common.c for -ZZ and -P happy coexistence (849 bytes, text/plain)
2005-05-06 16:39 PDT, Ulf Weltman
mcs: review+
Details

Description Ulf Weltman 2005-05-06 16:35:27 PDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050501 Firefox/1.0.3
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050501 Firefox/1.0.3

This works (with cert8.db and key3.db in the cwd):
ldapsearch -ZZ -s base -b "" "objectclass=*"

This does not work:
ldapsearch -ZZ -P /path/to/my-cert8.db -s base -b "" "objectclass=*"

Reproducible: Always

Steps to Reproduce:
1.ldapsearch -ZZ -P /path/to/my-cert8.db -s base -b "" "objectclass=*"
Actual Results:  
ldap_search: Can't contact LDAP server
    TLS/SSL error -5938 (Encountered end of file.)

Expected Results:  
Shown the results of the search.
Comment 1 Ulf Weltman 2005-05-06 16:36:09 PDT
It's happening because this seems to be a valid way of running ldapsearch:
ldapsearch -P /path/to/my-cert8.db -p 636 -s base -b "" "objectclass=*"

When -P is specified, -Z (secure=1) is implied!

So with -P and -ZZZ, we end up in the wrong block of this (simplified) block in
common.c:ldaptool_ldap_init():

    if(secure) {
        ldapssl_init();
    } else if (isZZ) {
        prldap_init();
        ldap_start_tls_s();
    }
Comment 2 Ulf Weltman 2005-05-06 16:39:11 PDT
Created attachment 182821 [details]
Diff on common.c for -ZZ and -P happy coexistence
Comment 3 Mark Smith (:mcs) 2005-05-09 06:14:47 PDT
Comment on attachment 182821 [details]
Diff on common.c for -ZZ and -P happy coexistence

This change looks OK to me.
Comment 4 Rich Megginson 2005-05-10 13:12:02 PDT
Checking in mozilla/directory/c-sdk/ldap/libraries/libprldap/Makefile.in;
/cvsroot/mozilla/directory/c-sdk/ldap/libraries/libprldap/Makefile.in,v  <-- 
Makefile.in
new revision: 5.11; previous revision: 5.10
done
Checking in mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile.in;
/cvsroot/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile.in,v  <-- 
Makefile.in
new revision: 5.9; previous revision: 5.8
done
Comment 5 Rich Megginson 2005-05-10 13:13:00 PDT
Ignore previous message.  This is the real CVS information.

Checking in mozilla/directory/c-sdk/ldap/clients/tools/common.c;
/cvsroot/mozilla/directory/c-sdk/ldap/clients/tools/common.c,v  <--  common.c
new revision: 5.16; previous revision: 5.15
done


Note You need to log in before you can comment on or make changes to this bug.