cvs: php-src(PHP_5_1) /ext/sqlite sqlite.c
| From: | Ilia Alshanetsky | Date: | Tue, 18 Oct 2005 22:51:10 +0000 |
| Subject: | cvs: php-src(PHP_5_1) /ext/sqlite sqlite.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-34666@lists.php.net to get a copy of this message | ||
iliaa Tue Oct 18 18:51:10 2005 EDT
Modified files: (Branch: PHP_5_1)
/php-src/ext/sqlite sqlite.c
Log:
MFH: Do not set authorizer unless safe_mode or open_basedir are being used.
http://cvs.php.net/diff.php/php-src/ext/sqlite/sqlite.c?r1=1.166.2.3&r2=1.166.2.4&ty=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.166.2.3 php-src/ext/sqlite/sqlite.c:1.166.2.4
--- php-src/ext/sqlite/sqlite.c:1.166.2.3 Tue Oct 18 10:50:48 2005
+++ php-src/ext/sqlite/sqlite.c Tue Oct 18 18:51:10 2005
@@ -17,7 +17,7 @@
| Marcus Boerger <helly@php.net> |
+----------------------------------------------------------------------+
- $Id: sqlite.c,v 1.166.2.3 2005/10/18 14:50:48 tony2001 Exp $
+ $Id: sqlite.c,v 1.166.2.4 2005/10/18 22:51:10 iliaa Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -1125,7 +1125,7 @@
{
php_info_print_table_start();
php_info_print_table_header(2, "SQLite support", "enabled");
- php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id:
sqlite.c,v 1.166.2.3 2005/10/18 14:50:48 tony2001 Exp $");
+ php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id:
sqlite.c,v 1.166.2.4 2005/10/18 22:51:10 iliaa Exp $");
php_info_print_table_row(2, "SQLite Library", sqlite_libversion());
php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding());
php_info_print_table_end();
@@ -1177,7 +1177,9 @@
/* authorizer hook so we can enforce safe mode
* Note: the declaration of php_sqlite_authorizer is correct for 2.8.2 of libsqlite,
* and IS backwards binary compatible with earlier versions */
- sqlite_set_authorizer(sdb, php_sqlite_authorizer, NULL);
+ if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) {
+ sqlite_set_authorizer(sdb, php_sqlite_authorizer, NULL);
+ }
db->rsrc_id = ZEND_REGISTER_RESOURCE(object ? NULL : return_value, db, persistent_id ?
le_sqlite_pdb : le_sqlite_db);
if (object) {