Bug 47295 - AuthDBDUserPWQueryFmt/AuthDBDUserRealmQueryFmt in mod_authn_dbd
Summary: AuthDBDUserPWQueryFmt/AuthDBDUserRealmQueryFmt in mod_authn_dbd
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_dbd (show other bugs)
Version: 2.2.11
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Keywords: MassUpdate, PatchAvailable
Depends on:
Reported: 2009-06-01 23:21 UTC by KaiGai Kohei
Modified: 2018-11-07 21:09 UTC (History)
0 users

A patch to allow discretionary parameter order in mod_authn_dbd (7.68 KB, patch)
2009-06-01 23:21 UTC, KaiGai Kohei
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description KaiGai Kohei 2009-06-01 23:21:03 UTC
Created attachment 23739 [details]
A patch to allow discretionary parameter order in mod_authn_dbd

This patch adds a two new directives (AuthDBDUserPWQueryFmt, AuthDBDUserRealmQueryFmt) on mod_authn_dbd.

These options allow to deploy various kind of query parameters (not only username, password and realm) in discretionary order.
Needless to say, you can use the existing directives, if here is no concerns.

This patch enables to apply mod_authn_dbd on the following cases also.

1. Hardwired parameter order is not suitable for the database.

SELECT md5(uname || ':' || %s || ':' upass) FROM uaccount WHERE uname = %s;

If we want to execute the query (the 1st %s should be realm, and the 2nd %s
should be username) for digest authentication, the hardwired parameter order
is not suitable for the current AuthDBDUserRealmQuery option.

The new AuthDBDUserRealmQueryFmt allows to specify the order as follows:

AuthDBDUserRealmQueryFmt \
    "SELECT md5(uname || ':' || $(realm) || ':' upass) \
         FROM uaccount WHERE uname = $(username)"

2. Additional conditions more than username/password.

When we want to restrict available users depending on remote address or
other factors, the current directive does not support it.

This patch allows to put $(remote_addr) other than username, password and
realm, as a proof of the concept. It can be used to implement a user who
is available only from local networks, for example.
Comment 1 William A. Rowe Jr. 2018-11-07 21:09:53 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.