php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72812 dbase_create does not close the FD on failure
Submitted: 2016-08-11 12:36 UTC Modified: 2016-08-11 13:21 UTC
From: cmb@php.net Assigned: cmb (profile)
Status: Closed Package: dbase (PECL)
PHP Version: Irrelevant OS: *
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:
Package:
Bug Type:
Summary:
From: cmb@php.net
New email:
PHP Version: OS:

 

 [2016-08-11 12:36 UTC] cmb@php.net
Description:
------------
When dbase_create() fails (i.e. returns false) after it has opened
the file, the file descriptor is never closed. This can be seen
nicely on NTFS, where opened files are locked for some operations,
such as deletion.


Test script:
---------------
<?php
$db = dbase_create('foo.dbf', array(array('error', '-')));
var_dump($db);
var_dump(unlink('foo.dbf'));


Expected result:
----------------
Warning: dbase_create(): unknown field type '-' in …
bool(false)
bool(true)


Actual result:
--------------
Warning: dbase_create(): unknown field type '-' in …
bool(false)

Warning: unlink(foo.dbf): Text file busy in …
bool(false)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-11 12:36 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2016-08-11 13:14 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=339846
Log: Fix #72812: dbase_create does not close the FD on failure
 [2016-08-11 13:20 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=339847
Log: Merged revision(s) 339845-339846 from pecl/dbase/branches/dbase-5.1:

Fix #72812: dbase_create does not close the FD on failure
 [2016-08-11 13:21 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 14 21:01:24 2020 UTC