diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2005-10-18 22:50:43 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2005-10-18 22:50:43 +0000 |
commit | 090ef86983d31b7af3905f5e5a2e710f5a84a433 (patch) | |
tree | 85ff3226b135e0adadd92ae1ab10b92e53973ee6 /ext/sqlite/sqlite.c | |
parent | f1272dee51d52c09d469fedad71e248d53401acf (diff) | |
download | php-git-090ef86983d31b7af3905f5e5a2e710f5a84a433.tar.gz |
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.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index c61c595052..427819c147 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -1178,7 +1178,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) { |