https://bz.apache.org/bugzilla/show_bug.cgi?id=69954

--- Comment #2 from Tần Quảng <[email protected]> ---
To be sure, I re-downloaded the latest APR 1.7.6 source code from the download
page. This error is indeed due to the use of "apr_natcasecmp".

In version 1.7.6, there is no function named "apr_natcasecmp" declared, but
there is a function named "apr_cstr_casecmp" declared in the file
"apr-1.7.6\strings\apr_cstr.c".

As for Commit 8d1c300:

#if APR_VERSION_AT_LEAST(1,6,0)
#include <apr_cstr.h> // Expected: Use the "apr_natcasecmp" function?
                      // Actual: Only the "apr_cstr_casecmp" function is
present.
#else
/* Define a (poor) backward-compatibility entry point for
 * apr_cstr_casecmp() from APR 1.6. */
#define apr_cstr_casecmp apr_natcasecmp // declare the "apr_cstr_casecmp"
function as "apr_natcasecmp"
#endif

If so, it is correct that mod_md must use the "apr_cstr_casecmp" function on
all new APR versions.

But to be sure, I tested it on Apr 1.5.2 (checking the #else branch).
Surprisingly, there are no functions named "apr_natcasecmp" or
"apr_cstr_casecmp" in this version, but the file
"apr-1.5.2\strings\apr_strnatcmp.c" contains a declaration for the function
"apr_strnatcasecmp".

In short, Commit 8d1c300 incorrectly declared "modules/md/md_util.h":
https://github.com/apache/httpd/commit/8d1c300644314d5011b647d589a7f51814e9d8d7#diff-be7c432d2dff884e7227f0ee69b8d94239ebf1d8fd0ea340ab15e338f34aa448

It should be:

#if APR_VERSION_AT_LEAST(1,6,0)
#include <apr_cstr.h> // ok, use apr_cstr_casecmp
#else
/* Define a (poor) backwards-compatibility entry point for
 * apr_cstr_casecmp() from APR 1.6. */
#define apr_cstr_casecmp apr_strnatcasecmp // apr_strnatcasecmp not
apr_natcasecmp
#endif

Then, "apr_cstr_casecmp" should be used for mod_md.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to