Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E66C7106AB for ; Sat, 25 Jan 2014 20:12:15 +0000 (UTC) Received: (qmail 99895 invoked by uid 500); 25 Jan 2014 20:12:14 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 99760 invoked by uid 500); 25 Jan 2014 20:12:14 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 99752 invoked by uid 99); 25 Jan 2014 20:12:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Jan 2014 20:12:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Jan 2014 20:12:11 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8F51323889E0; Sat, 25 Jan 2014 20:11:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1561385 - /httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Date: Sat, 25 Jan 2014 20:11:50 -0000 To: cvs@httpd.apache.org From: jim@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140125201150.8F51323889E0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jim Date: Sat Jan 25 20:11:50 2014 New Revision: 1561385 URL: http://svn.apache.org/r1561385 Log: 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. Modified: httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Modified: httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c?rev=1561385&r1=1561384&r2=1561385&view=diff ============================================================================== --- httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c (original) +++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Sat Jan 25 20:11:50 2014 @@ -88,40 +88,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. @@ -413,15 +379,6 @@ static apr_status_t slotmem_create(ap_sl 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;