Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22254 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7073 invoked by uid 1010); 8 Mar 2006 21:05:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 7058 invoked from network); 8 Mar 2006 21:05:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Mar 2006 21:05:57 -0000 X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.4/2.6 Received: from ([204.11.219.139:51597] helo=colo.lerdorf.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 9A/B8-27106-4374F044 for ; Wed, 08 Mar 2006 16:05:57 -0500 Received: from [207.126.233.18] (rasmus2.corp.yahoo.com [207.126.233.18]) (authenticated bits=0) by colo.lerdorf.com (8.13.5/8.13.5/Debian-3) with ESMTP id k28L5pqn027816; Wed, 8 Mar 2006 13:05:52 -0800 Message-ID: <440F4730.8020506@lerdorf.com> Date: Wed, 08 Mar 2006 13:05:52 -0800 User-Agent: Thunderbird 1.5 (Macintosh/20051201) MIME-Version: 1.0 To: kjc CC: internals@lists.php.net References: <8b6fdd1d0603081259u62306b82ob284b183f0ff3892@mail.gmail.com> In-Reply-To: <8b6fdd1d0603081259u62306b82ob284b183f0ff3892@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] php5 reads /etc/group on start From: rasmus@lerdorf.com (Rasmus Lerdorf) kjc wrote: > What is it that php5.1.2 reads /etc/group on startup to setgroup? > > My Solaris 10 boxes use LDAP as a NIS replacement so that we don't have to > manage individual group files on all the servers. > > When I start Apache without php I see this the dtrace dtruss script: > log.dtruss-httpdcmd-nophp: 26471/1: read(0xE, > "0\202\001\b\002\001\002d\202\001\001\004\034cn=cau,ou=group,ou=dev ... > > log.dtruss-httpdcmd-nophp:26483/1: setgroups(0xA, 0x1001F20A0, > 0x400) = 0 0 > > times ten, for the ten (A) groups that the webuser is a member of, thus the > setgroups(0xA,. > > > BUT... When I LoadModule libphp5 I get this instead: > > log.dtruss-httpdcmd: 25142/1: open("/etc/group\0", 0x2000, > 0x1B6) = 15 0 > log.dtruss-httpdcmd: 25142/1: setgroups(0x2, 0x1002CCFB0, > 0x400) = 0 0 > > > Which is a grand total of 3 (2), one from /etc/group and the other is what > is actually associated with the LDAP user webuser but listed twice. > > So-- why does PHP manually go and read /etc/group-- and why? And how can I > disable or fix that? Obviously PHP doesn't read that file directly. Figure out which libc call leads to that call and we might be able to help. -Rasmus