php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29563 locking problem
Submitted: 2004-08-07 20:28 UTC Modified: 2004-08-23 19:10 UTC
From: tom at bitworks dot de Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.3.8 OS: Debian Linux Woody & Apache/1.3.
Private report: No CVE-ID: None
 [2004-08-07 20:28 UTC] tom at bitworks dot de
Description:
------------
There seam to be several logical implementation faults, concerning flock() and dio_open()

1.) Opening a file by the first process with
  $fh = dio_open($dateiname,O_RDWR + O_NONBLOCK ,0 );

  does not trigger a failure opening the file twice by an other 
  process with the same method

  You always get the ressource handle

2.) Opening the file twice, after having opened with upper 
    method, by the flock(..., LOCK_NB) function, causes a
    waiststate for the flock() process. 

That problem should be solved.

Remark:
Mandatory locking on LINUX only works, if You mount the volume with option "mand" (-o mand) (missing Information in documentation)
Programs like vi nevertheless are able to override the "mandatory locking" with the "x!" command. (only checked for a LINUX Debian Woody system)


Expected result:
----------------
Triggering a failure (return false)

Actual result:
--------------
Waiting for locking

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-23 19:10 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

If you want to lock files opened with dio_open() you need 
to use dio_fcntl() to do so. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 22:01:29 2024 UTC