cvs: php-src(PHP_4_3) / NEWS /ext/dbase dbase.c /ext/dbase/tests bug31754.phpt

From: Date: Fri, 04 Feb 2005 14:29:21 +0000
Subject: cvs: php-src(PHP_4_3) / NEWS /ext/dbase dbase.c /ext/dbase/tests bug31754.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-30278@lists.php.net to get a copy of this message
derick Fri Feb 4 09:29:21 2005 EDT Added files: (Branch: PHP_4_3) /php-src/ext/dbase/tests bug31754.phpt Modified files: /php-src NEWS /php-src/ext/dbase dbase.c Log: - MFH: Fixed bug #31754 (dbase_open() fails for mode = 1). (Mehdi, Derick) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.829&r2=1.1247.2.830&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1247.2.829 php-src/NEWS:1.1247.2.830 --- php-src/NEWS:1.1247.2.829 Fri Feb 4 08:09:24 2005 +++ php-src/NEWS Fri Feb 4 09:29:20 2005 @@ -11,6 +11,7 @@ - Fixed bug #31797 (exif_read_data() uses too low nesting limit). (Ilia) - Fixed bug #31796 (readline completion handler does not handle empty return values). (Ilia) +- Fixed bug #31754 (dbase_open() fails for mode = 1). (Mehdi, Derick) - Fixed bug #31705 (parse_url() does not recognize http://foo.com#bar). (Ilia) - Fixed bug #31684 (dio_tcsetattr(): misconfigured termios settings). (elod at itfais dot com) http://cvs.php.net/diff.php/php-src/ext/dbase/dbase.c?r1=1.60.2.3&r2=1.60.2.4&ty=u Index: php-src/ext/dbase/dbase.c diff -u php-src/ext/dbase/dbase.c:1.60.2.3 php-src/ext/dbase/dbase.c:1.60.2.4 --- php-src/ext/dbase/dbase.c:1.60.2.3 Tue Nov 4 01:09:19 2003 +++ php-src/ext/dbase/dbase.c Fri Feb 4 09:29:20 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dbase.c,v 1.60.2.3 2003/11/04 06:09:19 sniper Exp $ */ +/* $Id: dbase.c,v 1.60.2.4 2005/02/04 14:29:20 derick Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -129,6 +129,11 @@ convert_to_string(dbf_name); convert_to_long(options); + if (Z_LVAL_P(options) == 1) { + php_error(E_WARNING, "Cannot open %s in write-only mode", Z_STRVAL_P(dbf_name)); + RETURN_FALSE; + } + if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_P(dbf_name), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { RETURN_FALSE; } http://cvs.php.net/co.php/php-src/ext/dbase/tests/bug31754.phpt?r=1.1&p=1 Index: php-src/ext/dbase/tests/bug31754.phpt +++ php-src/ext/dbase/tests/bug31754.phpt --TEST-- Bug #31754: (dbase_open() fails for mode = 1) --SKIPIF-- <?php if (!extension_loaded('dbase')) { die('skip dbase extension not available'); } ?> --FILE-- <?php // database "definition" $def = array( array("foo", "L") ); // creation $dbh = dbase_create('/tmp/bug31754.dbf', array(array('foo', 'L'))); dbase_close($dbh); $dbh = dbase_open('/tmp/bug31754.dbf', 1); unlink('/tmp/bug31754.dbf'); ?> --EXPECTF-- Warning: dbase_open(): Cannot open /tmp/bug31754.dbf in write-only mode in %sbug31754.php on line %d

« previous php.cvs (#30278) next »