I am running Apache 2.0.46 under RHEL3 with the latest up2date patches. Intermittently, I will have problems with files and directories created by apache from both PHP and mod_perl applications (our custom apps, and RT in particular) where the directories and/or files will wind up with (typically) zero modes (0000). The applications in question seem to be doing the right thing in setting explicit modes on files/dirs that are created, and normal exhibit expected behaviour. But intermittently this problem will recur without any other accompanying events. It also seems to clear up on its own without my intervention, although I have to chmod files that have already been created. A developer I'm working with who is developing under a fairly different environment (OSX, PHP5, Apache 2.0.52) who experiences the same problem with PHP session files in /tmp winding up, again intermittently, with 0000 modes. So the commonality here seems to be Apache 2. I haven't been able to to correlate this with any other log events. I am going to create a simple PHP program that will create files and dirs through apache and have it run itself regularly via cron and see what happens in terms of the modes.
SELinux is not enabled on my system.
You should report this to bugzilla.redhat.com since you're using vendor-patched packages. But it sounds a lot like some module or script is setting the umask badly. I doubt there is a bug in httpd itself here. This needs to be narrowed down to a specific issue with a specific module, first.
Created attachment 15020 [details] PHP Test Script that exercises this issue This is the test script that I wrote that exercises the problem over time.
So this script should produce the same results every time you would think, right? It doesn't. Looking at the permissions of the files in creates in /tmp/apachetest I see: 474524 4 -rw-r--r-- 1 apache apache 30 May 13 04:31 ./20050513/043150.test 474525 4 -rw-r--r-- 1 apache apache 30 May 13 04:46 ./20050513/044650.test 474526 4 -rw-r--r-- 1 apache apache 30 May 13 05:01 ./20050513/050150.test 474527 4 ---------- 1 apache apache 30 May 13 05:16 ./20050513/051651.test 474528 4 ---------- 1 apache apache 30 May 13 05:30 ./20050513/053000.test 474529 4 -rw-r--r-- 1 apache apache 30 May 13 05:31 ./20050513/053150.test 474530 4 -rw-r--r-- 1 apache apache 30 May 13 05:46 ./20050513/054651.test 474531 4 -rw-r--r-- 1 apache apache 30 May 13 06:01 ./20050513/060150.test 474532 4 ---------- 1 apache apache 30 May 13 06:16 ./20050513/061651.test 474533 4 ---------- 1 apache apache 30 May 13 06:29 ./20050513/062959.test 474534 4 -rw-r--r-- 1 apache apache 30 May 13 06:31 ./20050513/063150.test Some files have mode 0644, some have 0000. I will report this to the Redhat folks. I didn't realize that the Apache2 distribution in that release was considered nonstandard. But I can't see how this can be blamed on my application code, since I can exercise the failure mode in a very simple test program.
(In reply to comment #4) > I will report this to the Redhat folks. I didn't realize that the Apache2 > distribution in that release was considered nonstandard. Reported as bug 157648 at bugzilla.redhat.com. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=157648