php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13320 shmget() fails if running two copies of php4 simultaniously as different users
Submitted: 2001-09-15 13:05 UTC Modified: 2002-01-10 02:03 UTC
From: rawb at rawb dot org Assigned: yohgaki (profile)
Status: Closed Package: Session related
PHP Version: 4.0.6 OS: Linux/Debian/unstable
Private report: No CVE-ID: None
 [2001-09-15 13:05 UTC] rawb at rawb dot org
Even with the session handler set to 'files', the mod_mm MINIT function gets called, putting a session_mm.sem in /tmp with permissions set to 600. This stops anyone else from running php (such as from the command line) at the same time.

I see three possible fixes (but I don't know if these would work, otherwise I'd send you a patch):
1. Don't initialize the shared memory segment if the session save handler is set to anything but 'mm'
2. If the shared memory system fails, set a flag instead of erroring out, and have the rest of the shared memory system check this flag and let them error out when they try to use the shared memory system
3. (almost a kludge) Have the shared memory system look at either the $TMPDIR environment varible for where it should stick the segment, or have some other environment varible / configuration option that someone can set to put the session_mm.sem in someplace other than /tmp

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-19 22:42 UTC] yohgaki@php.net
This is expected. MM module will have problem you've mentioned.
This behavior will not be changed at least anytime soon...

--
Yasuo Ohgaki
 [2002-01-06 22:16 UTC] yohgaki@php.net
I'll work on this one ;)
This report is actually a dup of 13268, though.
 [2002-01-10 02:03 UTC] yohgaki@php.net
Fixed in CVS. Now you can specify different save_path for each instance.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 06:01:28 2024 UTC