php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60621 dba_close() does not check for errors
Submitted: 2011-12-29 05:07 UTC Modified: 2013-12-05 16:05 UTC
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: tstarling@php.net Assigned:
Status: Wont fix Package: DBM/DBA related
PHP Version: 5.3SVN-2011-12-29 (SVN) OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-12-29 05:07 UTC] tstarling@php.net
Description:
------------
Please make PHP_FUNCTION(dba_close) return true for success, and raise a warning and return false on failure, as per the usual PHP convention.

PHP_FUNCTION(dba_close) calls zend_list_delete(), which doesn't provide any way for the handlers to report errors either via php_error_docref() or by returning false to the caller.

Some handlers (such as CDB) write a large amount of data to disk on close, and so a disk full error can easily be encountered, e.g.
https://bugzilla.wikimedia.org/show_bug.cgi?id=33409

You could change the prototype for dba_handler.close and dba_close() to return int, and you could make PHP_FUNCTION(dba_close) call dba_close() directly before destroying the resource. dba_close() would need to be modified slightly to avoid dangling pointers.


Patches

add-fronk-support (last revision 2013-11-11 15:07 UTC by ladycuyik14 at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-05 16:05 UTC] mike@php.net
-Status: Open +Status: Wont fix
 [2013-12-05 16:05 UTC] mike@php.net
Unfortunately, not every DB handler supports a status code on close.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Nov 28 14:01:23 2020 UTC