diff options
| author | Kalle Sommer Nielsen <kalle@php.net> | 2010-04-26 23:53:30 +0000 |
|---|---|---|
| committer | Kalle Sommer Nielsen <kalle@php.net> | 2010-04-26 23:53:30 +0000 |
| commit | dd8e59da8f5aafd9d77a0f1f17e5e272d09f643f (patch) | |
| tree | 6c3e808cb0300c72f869478fbbc9dea69e5cf697 /ext/sqlite | |
| parent | 3c78ad763ebb0e09ad5524ba08fa6e83feffe102 (diff) | |
| download | php-git-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/sqlite')
| -rw-r--r-- | ext/sqlite/pdo_sqlite2.c | 7 | ||||
| -rw-r--r-- | ext/sqlite/sess_sqlite.c | 1 | ||||
| -rw-r--r-- | ext/sqlite/sqlite.c | 17 |
3 files changed, 5 insertions, 20 deletions
diff --git a/ext/sqlite/pdo_sqlite2.c b/ext/sqlite/pdo_sqlite2.c index 89f0520cd9..3eeb1f2bd9 100644 --- a/ext/sqlite/pdo_sqlite2.c +++ b/ext/sqlite/pdo_sqlite2.c @@ -522,11 +522,6 @@ static char *make_filename_safe(const char *filename TSRMLS_DC) return NULL; } - if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - efree(fullpath); - return NULL; - } - if (php_check_open_basedir(fullpath TSRMLS_CC)) { efree(fullpath); return NULL; @@ -585,7 +580,7 @@ static int pdo_sqlite2_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRML if (!filename) { zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, - "safe_mode/open_basedir prohibits opening %s", + "open_basedir prohibits opening %s", dbh->data_source); goto cleanup; } diff --git a/ext/sqlite/sess_sqlite.c b/ext/sqlite/sess_sqlite.c index 37f01576b5..30ebc0e38d 100644 --- a/ext/sqlite/sess_sqlite.c +++ b/ext/sqlite/sess_sqlite.c @@ -42,7 +42,6 @@ PS_OPEN_FUNC(sqlite) char *errmsg = NULL; sqlite *db; - /* TODO: do we need a safe_mode check here? */ db = sqlite_open(save_path, 0666, &errmsg); if (db == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index 4017dc7fbc..4c1b3f11b1 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -1066,9 +1066,6 @@ static int php_sqlite_authorizer(void *autharg, int access_type, const char *arg case SQLITE_COPY: if (strncmp(arg4, ":memory:", sizeof(":memory:") - 1)) { TSRMLS_FETCH(); - if (PG(safe_mode) && (!php_checkuid(arg4, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - return SQLITE_DENY; - } if (php_check_open_basedir(arg4 TSRMLS_CC)) { return SQLITE_DENY; @@ -1079,9 +1076,6 @@ static int php_sqlite_authorizer(void *autharg, int access_type, const char *arg case SQLITE_ATTACH: if (strncmp(arg3, ":memory:", sizeof(":memory:") - 1)) { TSRMLS_FETCH(); - if (PG(safe_mode) && (!php_checkuid(arg3, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - return SQLITE_DENY; - } if (php_check_open_basedir(arg3 TSRMLS_CC)) { return SQLITE_DENY; @@ -1510,7 +1504,7 @@ 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 */ - if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) { + if (PG(open_basedir) && *PG(open_basedir)) { sqlite_set_authorizer(sdb, php_sqlite_authorizer, NULL); } @@ -1566,8 +1560,7 @@ PHP_FUNCTION(sqlite_popen) RETURN_FALSE; } - if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || - php_check_open_basedir(fullpath TSRMLS_CC)) { + if (php_check_open_basedir(fullpath TSRMLS_CC)) { efree(fullpath); RETURN_FALSE; } @@ -1648,8 +1641,7 @@ PHP_FUNCTION(sqlite_open) } } - if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || - php_check_open_basedir(fullpath TSRMLS_CC)) { + if (php_check_open_basedir(fullpath TSRMLS_CC)) { efree(fullpath); zend_restore_error_handling(&error_handling TSRMLS_CC); if (object) { @@ -1697,8 +1689,7 @@ PHP_FUNCTION(sqlite_factory) RETURN_NULL(); } - if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || - php_check_open_basedir(fullpath TSRMLS_CC)) { + if (php_check_open_basedir(fullpath TSRMLS_CC)) { efree(fullpath); zend_restore_error_handling(&error_handling TSRMLS_CC); RETURN_NULL(); |
