Bug 59347 - Authentication fails with 500 Server Error
Summary: Authentication fails with 500 Server Error
Status: RESOLVED LATER
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_ldap (show other bugs)
Version: 2.2-HEAD
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: MassUpdate
Depends on: 41435
Blocks:
  Show dependency tree
 
Reported: 2016-04-18 11:45 UTC by Tysonrudgey
Modified: 2018-11-07 21:09 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tysonrudgey 2016-04-18 11:45:15 UTC
+++ This bug was initially created as a clone of Bug #41435 +++

I'm running into a problem with mod_ldap on Windows.  When I try to authenticate
without passing in a username, I get a 500 server error.  Since the browser
doesn't get back a 401, it caches the user's credentials and I have to restart
the browser session in order to attempt to login again.
This is only happening on Windows, so I'm sure it's a difference (bug?) in the
Microsoft LDAP SDK.  Below is a proposed fix on top of Apache 2.2.4.  I added
the #if APR_HAS_MICROSOFT_LDAPSDK block.

modules/ldap/util_ldap.c (line 933):
    /* try do the search */
    if ((result = ldap_search_ext_s(ldc->ldap,
                                    (char *)basedn, scope,
                                    (char *)filter, attrs, 0,
                                    NULL, NULL, NULL, -1, &res))
            == LDAP_SERVER_DOWN)
    {
        ldc->reason = "ldap_search_ext_s() for user failed with server down";
        uldap_connection_unbind(ldc);
        goto start_over;
    }

#if APR_HAS_MICROSOFT_LDAPSDK
    if ( result == LDAP_FILTER_ERROR )
    { // no username was supplied, so fail with invalid credentials
        /* failure? if so - return */
        ldc->reason = "ldap_search_ext_s() to search for user failed";
        ldap_msgfree(res);
        uldap_connection_unbind(ldc);
        return LDAP_INVALID_CREDENTIALS;
    }
#endif

    /* if there is an error (including LDAP_NO_SUCH_OBJECT) return now */
    if (result != LDAP_SUCCESS) {
        ldc->reason = "ldap_search_ext_s() for user failed";
        return result;
    }



It would be great if this patch or something with similar affect could be
included in the next Apache 2.2 release.  Thanks.
,
Josh.
Comment 1 Stefan Bodewig 2016-04-18 12:10:29 UTC
doesn't really look like an Ant issue :-)
Comment 2 Guido W. 2017-03-27 16:05:13 UTC
Fixed status - sorry wrong bug.
Comment 3 William A. Rowe Jr. 2018-11-07 21:09:47 UTC
Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd.

As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd.

If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question.

If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with.

Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated.