php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10530 shmop.c: shmop_open() with mode "a" is miscoded
Submitted: 2001-04-27 16:26 UTC Modified: 2002-01-09 03:22 UTC
From: Robert dot Siemer at gmx dot de Assigned:
Status: Closed Package: Semaphore related
PHP Version: 4.0.4pl1 OS: Linux 2.4.4-pre5
Private report: No CVE-ID: None
 [2001-04-27 16:26 UTC] Robert dot Siemer at gmx dot de
file: php4/ext/shmop/shmop.c

The documentation states two modes for shmop_open(). "a" and "c". While "c" is usefull for creation (and access), "a" is programmed incorrect and misdocumented (for access and other uses).

Currently "a" is inserting the IPC_EXCL flag for (system) shmget(). This is completly useless, as IPC_EXCL is only operative when IPC_CREAT is set (which isn't).
Further "a" inserts SHM_RDONLY for (system) shmat(). This makes an read-only attach instead of a read-write, which does not need any flags.

Proposal:
To let the "a" do what it is intended for remove line 117 and 118 from shmop.c.

Furthermore the documentation could be more precise: "a" does never create a shm segment, while "c" maybe creates one.

Other usefull changes to the code in this respect would brake the interface (as it is _used_ now...).

Bye,
	Robert

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-09 03:22 UTC] yohgaki@php.net
Fixed in CVS.
Please submit bug if you find any problem.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Dec 03 11:03:36 2021 UTC