summaryrefslogtreecommitdiff
path: root/ext/sqlite3/sqlite3.c
diff options
context:
space:
mode:
authorKalle Sommer Nielsen <kalle@php.net>2010-04-26 23:53:30 (GMT)
committerKalle Sommer Nielsen <kalle@php.net>2010-04-26 23:53:30 (GMT)
commitdd8e59da8f5aafd9d77a0f1f17e5e272d09f643f (patch)
tree6c3e808cb0300c72f869478fbbc9dea69e5cf697 /ext/sqlite3/sqlite3.c
parent3c78ad763ebb0e09ad5524ba08fa6e83feffe102 (diff)
downloadphp-dd8e59da8f5aafd9d77a0f1f17e5e272d09f643f.tar.gz
Removed safe_mode
* Removed ini options, safe_mode* * Removed --enable-safe-mode --with-exec-dir configure options on Unix * Updated extensions, SAPI's and core * php_get_current_user() is now declared in main.c, thrus no need to include safe_mode.h anymore
Diffstat (limited to 'ext/sqlite3/sqlite3.c')
-rw-r--r--ext/sqlite3/sqlite3.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index 7f7bbe9..00364b0 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -120,11 +120,13 @@ PHP_METHOD(sqlite3, open)
return;
}
+#if PHP_API_VERSION < 20100412
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "safe_mode prohibits opening %s", fullpath);
efree(fullpath);
return;
}
+#endif
if (php_check_open_basedir(fullpath TSRMLS_CC)) {
zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "open_basedir prohibits opening %s", fullpath);
@@ -158,7 +160,11 @@ PHP_METHOD(sqlite3, open)
}
#endif
+#if PHP_API_VERSION < 20100412
if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) {
+#else
+ if (PG(open_basedir) && *PG(open_basedir)) {
+#endif
sqlite3_set_authorizer(db_obj->db, php_sqlite3_authorizer, NULL);
}
@@ -1779,14 +1785,18 @@ static zend_function_entry php_sqlite3_result_class_methods[] = {
*/
static int php_sqlite3_authorizer(void *autharg, int access_type, const char *arg3, const char *arg4, const char *arg5, const char *arg6)
{
- TSRMLS_FETCH();
switch (access_type) {
case SQLITE_ATTACH:
{
if (strncmp(arg3, ":memory:", sizeof(":memory:")-1)) {
+ TSRMLS_FETCH();
+
+#if PHP_API_VERSION < 20100412
if (PG(safe_mode) && (!php_checkuid(arg3, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
return SQLITE_DENY;
}
+#endif
+
if (php_check_open_basedir(arg3 TSRMLS_CC)) {
return SQLITE_DENY;
}