|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5122 db.c - call to flock() - lock relased too early when close() is called
Submitted: 2000-06-19 14:01 UTC Modified: 2000-10-02 22:28 UTC
From: wcampbell at chello dot com Assigned:
Status: Closed Package: DBM/DBA related
PHP Version: 4.0.0 Release OS: Solaris 2.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: wcampbell at chello dot com
New email:
PHP Version: OS:


 [2000-06-19 14:01 UTC] wcampbell at chello dot com
The function php_dbm_open() in db.c contains the following lines ...

		if (lockfd) {
		} else {
			php_error(E_WARNING, "Unable to establish lock: %s",filename);

I don't think that this will achieve what is intended - at least not under Solaris where PHP implements flock() in terms of fnctl(). (I strongly suspect that this problem will also show itself under other versions of UNIX).

The reason is that the lock will be released immediately after it is obtained by the call to close().

I noticed this problem under PHP 3.0.12 but I have looked at the source code of PHP 4.0.0 to verify that this problem hasn't been fixed there.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-20 04:02 UTC]
Does this problem still persist with more recent version of php (from CVS or ??

 [2000-09-03 19:49 UTC]
Could you provide some sample script to test this..?

 [2000-10-02 22:28 UTC]
No feedback.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 13:01:27 2024 UTC