Re: umask wierdness
| From: | Bret Hughes | Date: | Thu, 22 Apr 2004 14:32:24 +0000 |
| Subject: | Re: umask wierdness | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184239@lists.php.net to get a copy of this message | ||
On Wed, 2004-04-21 at 22:10, Curt Zirzow wrote:
> * Thus wrote Bret Hughes (bhughes@elevating.com):
> > I have found a funky situation that I am trying to figure out if it is
> > bug or not:
> >
> > I see this behavior on both redhat 9 and fedora running
> >
> > php 4.3.4
> > httpd(apache) 2.0.48
> >
> > calling umask(0002) in a script leaves the httpd process with a umask of
> > 2 after exit so that the next process to hit that process gets the new
> > umask. in other words the environment does not revert to default as the
> > umask() docs say it should. This does not happen on my 7.3 box running
> > apache-1.3.27-2
> > php-4.1.2-7.3.6
> >
> > I found this chasing a rabbit trail of a bug. This is kind of sneaky
> > since it only changes the umask for the single httpd process it hits.
> > multiple calls to umask(0002) will change every process it hits.
>
> This set up works perfectly fine for me, umask is reset to original
> value after php dies so all my checkumask.sh output results with
> 18.
>
> System: FreeBSD, apache 1.3.29, php5.
>
> Looking at the php source code, it looks like all its doing is
> calling the system's umask(), which leads me to belive its an issue
> with either the OS or apache.
>
> You might want to ask internals@php.net about this they might be
> able to help you a little more about this.
>
Last email went straight to Curt by mistake. Basically said thanks.
here is the latest on the bug report at redhat:
From redhat developer/bug owner:
> It's a bug in the Apache 2.0 support in PHP: I've got a patch which
> I'll integrate and submit upstream.
I suspect this is a pretty wide ranging problem, and if you are using
redhat/fedora and have sensitive data you are writing to disk expecting
the default umask, I would check it out.
Bret