https://bugs.openldap.org/show_bug.cgi?id=10371

          Issue ID: 10371
           Summary: tools don't print useful error codes
           Product: OpenLDAP
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: needs_review
          Severity: normal
          Priority: ---
         Component: client tools
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

In tools/common.c, if ldap_result() returns an error, this return value is used
directly as an LDAP error code in the subsequent call to tool_perror(). That is
incorrect; ldap_result() always returns -1 on errors. The actual return code
must be retrieved using ldap_get_option(ld, LDAP_OPT_RESULT_CODE,...). So up
till now the tools have never printed the actual error message that's relevant
to whatever failure occurred.

Other applications appear to have copied this erroneous behavior. E.g., in
investigating ITS#10370 I see that curl's code does the same thing.

-- 
You are receiving this mail because:
You are on the CC list for the issue.

Reply via email to