Bug #60621 [NEW]: dba_close() does not check for errors
From: tstarling
Operating system: Linux
PHP version: 5.3SVN-2011-12-29 (SVN)
Package: DBM/DBA related
Bug Type: Bug
Bug description:dba_close() does not check for errors
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.
--
Edit bug report at https://bugs.php.net/bug.php?id=60621&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60621&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60621&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60621&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=60621&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60621&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=60621&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=60621&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=60621&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=60621&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=60621&r=support
Expected behavior: https://bugs.php.net/fix.php?id=60621&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=60621&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=60621&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=60621&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60621&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60621&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=60621&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=60621&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=60621&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=60621&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=60621&r=mysqlcfg
Thread (2 messages)
- tstarling@php.net