|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-03-09 10:38 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 28 20:00:01 2025 UTC |
Description: ------------ If I create a Shared memory segment using shm_attach with one user, and set it as readable by all users, but only writable by the owner, then other users cannot open the segment via shm_attach, they get permission denied errors. I would guess this is maybe because shm_attach can't open a segment as read-only, and always tried to open it as rw? Reproduce code: --------------- run as someuser1: <?php $f = ftok('somefile', 'I'); $sh = shm_attach($f, 1024000, 0644); ?> works if its not already created by another user... run as someuser2: <?php $f = ftok('somefile', 'I'); $sh = shm_attach($f); ?> Expected result: ---------------- what I would expect is that since I created it as 0644, other users should be able to access it via read-only mode (which I can do if I open it using shmop_open with the read-only flag instead). Actual result: -------------- second user gets "Permission Denied" php warning messages. once again, I think this is mearly a result of shm_attach not actually ever opening an shm as read-only, always read-write... but I might be mistaken. Thanks.