summaryrefslogtreecommitdiff
path: root/ext/sqlite/sqlite.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2005-10-18 22:51:10 +0000
committerIlia Alshanetsky <iliaa@php.net>2005-10-18 22:51:10 +0000
commitcbb928b8eb757dc4a433b097f12b3d45733f2b46 (patch)
tree8c53b6c40f1faaad1c67f7ed41ee9e88a629b558 /ext/sqlite/sqlite.c
parent3e46adb1831f8ff467b783e2a864588f9086e504 (diff)
downloadphp-git-cbb928b8eb757dc4a433b097f12b3d45733f2b46.tar.gz
MFH: Do not set authorizer unless safe_mode or open_basedir are being used.
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r--ext/sqlite/sqlite.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index 8778b1d89f..7945c02b03 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -1177,7 +1177,9 @@ static struct php_sqlite_db *php_sqlite_open(char *filename, int mode, char *per
/* 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) {