]> granicus.if.org Git - apache/commitdiff
Merge r1684636 from trunk:
authorJoe Orton <jorton@apache.org>
Wed, 8 Feb 2017 14:10:30 +0000 (14:10 +0000)
committerJoe Orton <jorton@apache.org>
Wed, 8 Feb 2017 14:10:30 +0000 (14:10 +0000)
* mod_auth_digest: Use anonymous shm by default, fall back on name-based.

Submitted by: jkaluza
Reviewed by: jorton, ylavic, jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1782175 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/aaa/mod_auth_digest.c

diff --git a/CHANGES b/CHANGES
index 25a9c9568c02cf7b16366a61514d02f16b1744fb..f712649fa0645f0a8d18a42544185207fa93d103 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 
 Changes with Apache 2.4.26
 
+  *) mod_auth_digest: Use an anonymous shared memory segment by default,
+     preventing startup failure after unclean shutdown.  PR 54622.
+     [Jan Kaluza]
+
   *) mod_filter: Fix AddOutputFilterByType with non-content-level filters.
      PR 58856. [Micha Lenk <micha lenk.info>]
  
index 117caa19b8f4ce1b236539f4a6432ef7b672be04..d998d322bcc7128c11d14c172edbbf8c156f8200 100644 (file)
@@ -299,9 +299,18 @@ static int initialize_tables(server_rec *s, apr_pool_t *ctx)
     client_shm_filename = ap_runtime_dir_relative(ctx, "authdigest_shm");
     client_shm_filename = ap_append_pid(ctx, client_shm_filename, ".");
 
-    /* Now create that segment */
-    sts = apr_shm_create(&client_shm, shmem_size,
-                        client_shm_filename, ctx);
+    /* Use anonymous shm by default, fall back on name-based. */
+    sts = apr_shm_create(&client_shm, shmem_size, NULL, ctx);
+    if (APR_STATUS_IS_ENOTIMPL(sts)) {
+        /* For a name-based segment, remove it first in case of a
+         * previous unclean shutdown. */
+        apr_shm_remove(client_shm_filename, ctx);
+
+        /* Now create that segment */
+        sts = apr_shm_create(&client_shm, shmem_size,
+                            client_shm_filename, ctx);
+    }
+
     if (APR_SUCCESS != sts) {
         ap_log_error(APLOG_MARK, APLOG_ERR, sts, s, APLOGNO(01762)
                      "Failed to create shared memory segment on file %s",