summaryrefslogtreecommitdiff
path: root/ext/sqlite/sqlite.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2003-04-17 01:57:55 +0000
committerWez Furlong <wez@php.net>2003-04-17 01:57:55 +0000
commit2d14d8b52015f7cd972ab123f46777769df8e2ce (patch)
tree5994c37d3d93f4d9cb255657cd580bdab2b42b6c /ext/sqlite/sqlite.c
parentcc5903adb4ddf184c5ce41f8a33371e564bd75ab (diff)
downloadphp-git-2d14d8b52015f7cd972ab123f46777769df8e2ce.tar.gz
Implement safe_mode and open_basedir checks.
Add package.xml
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r--ext/sqlite/sqlite.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index 39d193f447..7ff5a20e73 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -135,7 +135,13 @@ PHP_FUNCTION(sqlite_open)
return;
}
- /* TODO: safemode and open_basedir checks on the filename */
+ if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ RETURN_FALSE;
+ }
+
+ if (php_check_open_basedir(filename TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
db = sqlite_open(filename, mode, &errtext);