svn commit: r1935947 - httpd/httpd/trunk/modules/aaa
[email protected] Mon, 06 Jul 2026 12:51:26 -0000
| Newsgroups | gmane.comp.apache.cvs |
|---|---|
| Message-ID | <178334228683.446197.12521018646751796637@svn03-he-fi> |
Author: jorton
Date: Mon Jul 6 12:51:26 2026
New Revision: 1935947
Log:
* modules/aaa/config.m4,
modules/aaa/mod_auth_digest.c (pre_init, initialize_module):
Prevent using mod_auth_digest without APR_HAS_SHARED_MEMORY.
GitHub: PR #661
Modified:
httpd/httpd/trunk/modules/aaa/config.m4
httpd/httpd/trunk/modules/aaa/mod_auth_digest.c
Modified: httpd/httpd/trunk/modules/aaa/config.m4
==============================================================================
--- httpd/httpd/trunk/modules/aaa/config.m4 Mon Jul 6 12:51:01 2026 (r1935946)
+++ httpd/httpd/trunk/modules/aaa/config.m4 Mon Jul 6 12:51:26 2026 (r1935947)
@@ -81,9 +81,9 @@ APACHE_MODULE(auth_bearer, bearer authen
APACHE_MODULE(auth_form, form authentication, , , most)
APACHE_MODULE(auth_digest, RFC2617 Digest authentication, , , most, [
APR_CHECK_APR_DEFINE(APR_HAS_RANDOM)
- if test $ac_cv_define_APR_HAS_RANDOM = "no"; then
- echo "You need APR random support to use mod_auth_digest."
- echo "Look at APR configure options --with-egd and --with-devrandom."
+ APR_CHECK_APR_DEFINE(APR_HAS_SHARED_MEMORY)
+ if test "${ac_cv_define_APR_HAS_RANDOM}X${ac_cv_define_APR_HAS_SHARED_MEMORY}" != "yesXyes"; then
+ AC_MSG_NOTICE([mod_auth_digest requires APR with random and shared memory support])
enable_auth_digest="no"
fi
])
Modified: httpd/httpd/trunk/modules/aaa/mod_auth_digest.c
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_auth_digest.c Mon Jul 6 12:51:01 2026 (r1935946)
+++ httpd/httpd/trunk/modules/aaa/mod_auth_digest.c Mon Jul 6 12:51:26 2026 (r1935947)
@@ -254,8 +254,6 @@ static apr_status_t rmm_free(apr_rmm_t *
return apr_rmm_free(rmm, offset);
}
-#if APR_HAS_SHARED_MEMORY
-
static int initialize_tables(server_rec *s, apr_pool_t *ctx)
{
unsigned long idx;
@@ -360,13 +358,17 @@ static int initialize_tables(server_rec
return OK;
}
-#endif /* APR_HAS_SHARED_MEMORY */
-
static int pre_init(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
{
apr_status_t rv;
void *retained;
+ if (!APR_HAS_SHARED_MEMORY) {
+ ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, APLOGNO(10590)
+ "mod_auth_digest cannot be used on platforms without shared memory support");
+ return !OK;
+ }
+
rv = ap_mutex_register(pconf, client_mutex_type, NULL, APR_LOCK_DEFAULT, 0);
if (rv != APR_SUCCESS)
return !OK;
@@ -403,7 +405,6 @@ static int initialize_module(apr_pool_t
if (ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG)
return OK;
-#if APR_HAS_SHARED_MEMORY
/* Note: this stuff is currently fixed for the lifetime of the server,
* i.e. even across restarts. This means that A) any shmem-size
* configuration changes are ignored, and B) certain optimizations,
@@ -414,11 +415,7 @@ static int initialize_module(apr_pool_t
* last child dies. Therefore we can never clean up the old stuff,
* creating a creeping memory leak.
*/
- if (initialize_tables(s, p) != OK) {
- return !OK;
- }
-#endif /* APR_HAS_SHARED_MEMORY */
- return OK;
+ return initialize_tables(s, p);
}
static void initialize_child(apr_pool_t *p, server_rec *s)
@@ -542,14 +539,6 @@ static const char *set_nonce_lifetime(cm
static const char *set_nc_check(cmd_parms *cmd, void *config, int flag)
{
-#if !APR_HAS_SHARED_MEMORY
- if (flag) {
- return "AuthDigestNcCheck: ERROR: nonce-count checking "
- "is not supported on platforms without shared-memory "
- "support";
- }
-#endif
-
((digest_config_rec *) config)->check_nc = flag;
return NULL;
}