]> granicus.if.org Git - apache/commitdiff
Merge r1561385 from trunk:
authorJim Jagielski <jim@apache.org>
Tue, 8 Jul 2014 13:12:40 +0000 (13:12 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 8 Jul 2014 13:12:40 +0000 (13:12 +0000)
Remove wonky and unneeded code. We have access
cross forks, so child processes have access.

When we need true external access, this is something
that APR shm must provide. We should have no
knowledge of APR internals.
Reviewed/backported by: jim

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

STATUS
modules/slotmem/mod_slotmem_shm.c

diff --git a/STATUS b/STATUS
index 60a5e55fae2ca8937dec332c81a8dcc0e4760041..796e3d311cc10b894710be05d9e9eac4e6225edc 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -100,12 +100,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mod_slotmem_shm: Remove wonky and dangerous code that knows about APR
-     internals. We work fine w/o it anyway at this stage.
-     trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1561385
-     2.4.x patch: trunk works
-     +1: jim, ylavic, jorton
-
    * mod_ssl: Add SSLOCSPUseRequestNonce directive to control whether or not
      OCSP requests should use a nonce to be checked against the responder's
      one. PR 56233.
index 0c4da367d1c9295e89c344742e14ad8b1f83c234..b6cfa0a229c3d77272ee8d6be7202f263a77eda2 100644 (file)
@@ -86,40 +86,6 @@ static apr_pool_t *gpool = NULL;
 #define DEFAULT_SLOTMEM_SUFFIX ".shm"
 #define DEFAULT_SLOTMEM_PERSIST_SUFFIX ".persist"
 
-/* apr:shmem/unix/shm.c */
-static apr_status_t unixd_set_shm_perms(const char *fname)
-{
-#ifdef AP_NEED_SET_MUTEX_PERMS
-#if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON
-    struct shmid_ds shmbuf = { { 0 } };
-    key_t shmkey;
-    int shmid;
-
-    shmkey = ftok(fname, 1);
-    if (shmkey == (key_t)-1) {
-        return errno;
-    }
-    if ((shmid = shmget(shmkey, 0, SHM_R | SHM_W)) == -1) {
-        return errno;
-    }
-#if MODULE_MAGIC_NUMBER_MAJOR <= 20081212
-#define ap_unixd_config unixd_config
-#endif
-    shmbuf.shm_perm.uid  = ap_unixd_config.user_id;
-    shmbuf.shm_perm.gid  = ap_unixd_config.group_id;
-    shmbuf.shm_perm.mode = 0600;
-    if (shmctl(shmid, IPC_SET, &shmbuf) == -1) {
-        return errno;
-    }
-    return APR_SUCCESS;
-#else
-    return APR_ENOTIMPL;
-#endif
-#else
-    return APR_ENOTIMPL;
-#endif
-}
-
 /*
  * Persist the slotmem in a file
  * slotmem name and file name.
@@ -422,15 +388,6 @@ static apr_status_t slotmem_create(ap_slotmem_instance_t **new,
         if (rv != APR_SUCCESS) {
             return rv;
         }
-        if (fbased) {
-            /* Set permissions to shared memory
-             * so it can be attached by child process
-             * having different user credentials
-             *
-             * See apr:shmem/unix/shm.c
-             */
-            unixd_set_shm_perms(fname);
-        }
         ptr = (char *)apr_shm_baseaddr_get(shm);
         desc.size = item_size;
         desc.num = item_num;