Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C7F931072D for ; Wed, 29 Jan 2014 15:03:29 +0000 (UTC) Received: (qmail 65174 invoked by uid 500); 29 Jan 2014 15:03:27 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 64369 invoked by uid 500); 29 Jan 2014 15:03:22 -0000 Mailing-List: contact dev-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 dev@httpd.apache.org Received: (qmail 64357 invoked by uid 99); 29 Jan 2014 15:03:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jan 2014 15:03:21 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [76.96.30.64] (HELO qmta07.emeryville.ca.mail.comcast.net) (76.96.30.64) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jan 2014 15:03:16 +0000 Received: from omta12.emeryville.ca.mail.comcast.net ([76.96.30.44]) by qmta07.emeryville.ca.mail.comcast.net with comcast id KpxQ1n0080x6nqcA7r2wxb; Wed, 29 Jan 2014 15:02:56 +0000 Received: from [192.168.199.10] ([69.251.80.74]) by omta12.emeryville.ca.mail.comcast.net with comcast id Kr2u1n0031cCKD98Yr2vzg; Wed, 29 Jan 2014 15:02:56 +0000 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1865.1\)) Subject: Re: svn commit: r1561385 - /httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c From: Jim Jagielski In-Reply-To: Date: Wed, 29 Jan 2014 10:02:53 -0500 Cc: apr Content-Transfer-Encoding: quoted-printable Message-Id: <3D5B1DD5-74EA-44D8-BB42-9675220D418B@jaguNET.com> References: <20140125201150.8F51323889E0@eris.apache.org> To: dev@httpd.apache.org X-Mailer: Apple Mail (2.1865.1) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1391007776; bh=rFtD4TaVW5Nt8zCioVdisc0EW9Fpk3Z4nFJt4VNJnGk=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To; b=QxfqdGViL6rpfLWzB2o1mRw772wlrUfiAPuU6Vg0uu0bCzZVJnyvHs+zPfrEyrzBN 69wRQBcQUmzFtpG1AZRvK06JC8ZQ6vLHiW4UJm9nFz786QOer13akoLgpxQH5hGosJ RzH8pWlDEAlSLZtPQnEa0B3pMwQuqrH8yMnukfXGTojZvjUmIU7jGYdJoTrsfci+Jd vOjWj5rOfJvQaiVMaMd5ZOGssr7sVX7bsZ5f7fBhPjLLBIkMJwd3vtZLjoaSznpQBO lPQ0/b1REAAhOnC/LXehheT3+07LHp5u5pEe1vdKoz6Qw8cdS/LQGPAJF9siDyrUtm FBiwi1XPsOB4A== X-Virus-Checked: Checked by ClamAV on apache.org But I would prefer others testing as well... It's worth noting that it's just slotmem which did this and so, if it was "required" any other use of shared mem which child processes needed to have access to cross forks would be broken. And it was just the SysV shm which did this. I *still* think that APR should backport the set_perm stuff from trunk to 1.5, but I think that breaks ABI. But *that's* where it belongs (in apr, not httpd). On Jan 29, 2014, at 7:33 AM, Jim Jagielski wrote: > Yes, it still works (at least in all my testing) :) >=20 > On Jan 28, 2014, at 12:48 PM, Jeff Trawick wrote: >=20 >> On Sat, Jan 25, 2014 at 3:11 PM, wrote: >> Author: jim >> Date: Sat Jan 25 20:11:50 2014 >> New Revision: 1561385 >>=20 >> URL: http://svn.apache.org/r1561385 >> Log: >> Remove wonky and unneeded code. We have access >> cross forks, so child processes have access. >>=20 >> I see that you are saying it is okay, but I have to ask anyway: For = SysV shared memory specifically, apr_shm_attach() in the child still = works when parent is root and child is not root? >>=20 >>=20 >> When we need true external access, this is something >> that APR shm must provide. We should have no >> knowledge of APR internals. >>=20 >> Modified: >> httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c >>=20 >> 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=3D1561385&r1=3D1561384&r2=3D1561385&view=3Ddiff >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- 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 =3D NULL; >> #define DEFAULT_SLOTMEM_SUFFIX ".shm" >> #define DEFAULT_SLOTMEM_PERSIST_SUFFIX ".persist" >>=20 >> -/* 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 =3D { { 0 } }; >> - key_t shmkey; >> - int shmid; >> - >> - shmkey =3D ftok(fname, 1); >> - if (shmkey =3D=3D (key_t)-1) { >> - return errno; >> - } >> - if ((shmid =3D shmget(shmkey, 0, SHM_R | SHM_W)) =3D=3D -1) { >> - return errno; >> - } >> -#if MODULE_MAGIC_NUMBER_MAJOR <=3D 20081212 >> -#define ap_unixd_config unixd_config >> -#endif >> - shmbuf.shm_perm.uid =3D ap_unixd_config.user_id; >> - shmbuf.shm_perm.gid =3D ap_unixd_config.group_id; >> - shmbuf.shm_perm.mode =3D 0600; >> - if (shmctl(shmid, IPC_SET, &shmbuf) =3D=3D -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 !=3D 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 =3D (char *)apr_shm_baseaddr_get(shm); >> desc.size =3D item_size; >> desc.num =3D item_num; >>=20 >>=20 >>=20 >>=20 >>=20 >> --=20 >> Born in Roswell... married an alien... >> http://emptyhammock.com/ >=20