Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 9705 invoked from network); 7 Feb 2009 09:21:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Feb 2009 09:21:44 -0000 Received: (qmail 25476 invoked by uid 500); 7 Feb 2009 09:21:43 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 25422 invoked by uid 500); 7 Feb 2009 09:21:42 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 25413 invoked by uid 99); 7 Feb 2009 09:21:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Feb 2009 01:21:42 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.9] (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 07 Feb 2009 09:21:42 +0000 Received: (qmail 9444 invoked by uid 2161); 7 Feb 2009 09:21:21 -0000 Received: from [192.168.2.4] (euler.heimnetz.de [192.168.2.4]) by cerberus.heimnetz.de (Postfix on SuSE Linux 7.0 (i386)) with ESMTP id E5C1B1721C for ; Sat, 7 Feb 2009 10:21:08 +0100 (CET) Message-ID: <498D5284.4030805@apache.org> Date: Sat, 07 Feb 2009 10:21:08 +0100 From: Ruediger Pluem User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20081204 SeaMonkey/1.1.14 MIME-Version: 1.0 To: dev@apr.apache.org Subject: Re: svn commit: r741862 - in /apr/apr/trunk: ./ include/ include/arch/unix/ locks/beos/ locks/netware/ locks/os2/ locks/unix/ locks/win32/ shmem/beos/ shmem/os2/ shmem/unix/ shmem/win32/ threadproc/beos/ threadproc/netware/ threadproc/os2/ threadproc/unix/... References: <20090207090556.7E199238887D@eris.apache.org> In-Reply-To: <20090207090556.7E199238887D@eris.apache.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org On 02/07/2009 10:05 AM, mturk@apache.org wrote: > Author: mturk > Date: Sat Feb 7 09:05:54 2009 > New Revision: 741862 > > URL: http://svn.apache.org/viewvc?rev=741862&view=rev > Log: > Add object perms set macros and implement them for shm and mutex > > Added: > apr/apr/trunk/include/apr_perms_set.h (with props) > Modified: > apr/apr/trunk/CHANGES > apr/apr/trunk/include/apr_global_mutex.h > apr/apr/trunk/include/apr_proc_mutex.h > apr/apr/trunk/include/apr_shm.h > apr/apr/trunk/include/apr_thread_proc.h > apr/apr/trunk/include/arch/unix/apr_arch_proc_mutex.h > apr/apr/trunk/include/arch/unix/apr_arch_shm.h > apr/apr/trunk/include/arch/unix/apr_arch_threadproc.h > apr/apr/trunk/locks/beos/proc_mutex.c > apr/apr/trunk/locks/netware/proc_mutex.c > apr/apr/trunk/locks/os2/proc_mutex.c > apr/apr/trunk/locks/unix/global_mutex.c > apr/apr/trunk/locks/unix/proc_mutex.c > apr/apr/trunk/locks/win32/proc_mutex.c > apr/apr/trunk/shmem/beos/shm.c > apr/apr/trunk/shmem/os2/shm.c > apr/apr/trunk/shmem/unix/shm.c > apr/apr/trunk/shmem/win32/shm.c > apr/apr/trunk/threadproc/beos/proc.c > apr/apr/trunk/threadproc/netware/proc.c > apr/apr/trunk/threadproc/os2/proc.c > apr/apr/trunk/threadproc/unix/proc.c > apr/apr/trunk/threadproc/win32/proc.c > > Modified: apr/apr/trunk/threadproc/unix/proc.c > URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/unix/proc.c?rev=741862&r1=741861&r2=741862&view=diff > ============================================================================== > --- apr/apr/trunk/threadproc/unix/proc.c (original) > +++ apr/apr/trunk/threadproc/unix/proc.c Sat Feb 7 09:05:54 2009 > @@ -463,7 +463,19 @@ > _exit(-1); /* We have big problems, the child should exit. */ > } > } > + if (!geteuid()) { > + apr_procattr_pscb_t *c = attr->perms_set_callbacks; > > + while (c) { > + apr_status_t r; > + r = (*c->perms_set_fn)((void *)c->data, c->perms, > + attr->uid, attr->gid); > + if (r != APR_SUCCESS || r != APR_ENOTIMPL) { This is always true isn't it? I guess it should be (r != APR_SUCCESS && r != APR_ENOTIMPL) > + _exit(-1); > + } > + c = c->next; > + } > + } > /* Only try to switch if we are running as root */ > if (attr->gid != -1 && !geteuid()) { > if ((status = setgid(attr->gid))) { > @@ -708,3 +720,20 @@ > > return APR_SUCCESS; > } > + > +APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, > + apr_perms_setfn_t *perms_set_fn, > + void *data, > + apr_fileperms_t perms) > +{ > + apr_procattr_pscb_t *c; > + > + c = apr_palloc(attr->pool, sizeof(apr_procattr_pscb_t)); > + c->data = data; > + c->perms = perms; > + c->perms_set_fn = perms_set_fn; > + c->next = attr->perms_set_callbacks; > + attr->perms_set_callbacks = c; Is it intended that we call the callback registered last first? > + > + return APR_SUCCESS; > +} > Regards RĂ¼diger