Bug #10530: shmop.c: shmop_open() with mode "a" is miscoded

From: Date: Fri, 27 Apr 2001 20:26:57 +0000
Subject: Bug #10530: shmop.c: shmop_open() with mode "a" is miscoded
Groups: php.dev 
Request: Send a blank email to php-dev+get-52616@lists.php.net to get a copy of this message
From: Robert.Siemer@gmx.de Operating system: Linux 2.4.4-pre5 PHP version: 4.0.4pl1 PHP Bug Type: Unknown/Other Function Bug description: shmop.c: shmop_open() with mode "a" is miscoded 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 -- Edit Bug report at: http://bugs.php.net/?id=10530&edit=1

« previous php.dev (#52616) next »