|
@@ -1,101 +0,0 @@
|
1
|
|
---- a/ext/sqlite/pdo_sqlite2.c
|
2
|
|
-+++ b/ext/sqlite/pdo_sqlite2.c
|
3
|
|
-@@ -522,11 +522,6 @@ static char *make_filename_safe(const ch
|
4
|
|
- return NULL;
|
5
|
|
- }
|
6
|
|
-
|
7
|
|
-- if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
|
8
|
|
-- efree(fullpath);
|
9
|
|
-- return NULL;
|
10
|
|
-- }
|
11
|
|
--
|
12
|
|
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
|
13
|
|
- efree(fullpath);
|
14
|
|
- return NULL;
|
15
|
|
-@@ -585,7 +580,7 @@ static int pdo_sqlite2_handle_factory(pd
|
16
|
|
-
|
17
|
|
- if (!filename) {
|
18
|
|
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC,
|
19
|
|
-- "safe_mode/open_basedir prohibits opening %s",
|
20
|
|
-+ "open_basedir prohibits opening %s",
|
21
|
|
- dbh->data_source);
|
22
|
|
- goto cleanup;
|
23
|
|
- }
|
24
|
|
---- a/ext/sqlite/sqlite.c
|
25
|
|
-+++ b/ext/sqlite/sqlite.c
|
26
|
|
-@@ -1066,10 +1066,6 @@ static int php_sqlite_authorizer(void *a
|
27
|
|
- case SQLITE_COPY:
|
28
|
|
- if (strncmp(arg4, ":memory:", sizeof(":memory:") - 1)) {
|
29
|
|
- TSRMLS_FETCH();
|
30
|
|
-- if (PG(safe_mode) && (!php_checkuid(arg4, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
|
31
|
|
-- return SQLITE_DENY;
|
32
|
|
-- }
|
33
|
|
--
|
34
|
|
- if (php_check_open_basedir(arg4 TSRMLS_CC)) {
|
35
|
|
- return SQLITE_DENY;
|
36
|
|
- }
|
37
|
|
-@@ -1079,10 +1075,6 @@ static int php_sqlite_authorizer(void *a
|
38
|
|
- case SQLITE_ATTACH:
|
39
|
|
- if (strncmp(arg3, ":memory:", sizeof(":memory:") - 1)) {
|
40
|
|
- TSRMLS_FETCH();
|
41
|
|
-- if (PG(safe_mode) && (!php_checkuid(arg3, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
|
42
|
|
-- return SQLITE_DENY;
|
43
|
|
-- }
|
44
|
|
--
|
45
|
|
- if (php_check_open_basedir(arg3 TSRMLS_CC)) {
|
46
|
|
- return SQLITE_DENY;
|
47
|
|
- }
|
48
|
|
-@@ -1160,13 +1152,12 @@ static void sqlite_object_free_storage(v
|
49
|
|
- static void sqlite_object_new(zend_class_entry *class_type, zend_object_handlers *handlers, zend_object_value *retval TSRMLS_DC)
|
50
|
|
- {
|
51
|
|
- sqlite_object *intern;
|
52
|
|
-- zval *tmp;
|
53
|
|
-
|
54
|
|
- intern = emalloc(sizeof(sqlite_object));
|
55
|
|
- memset(intern, 0, sizeof(sqlite_object));
|
56
|
|
-
|
57
|
|
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
|
58
|
|
-- zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
59
|
|
-+ object_properties_init(&intern->std, class_type);
|
60
|
|
-
|
61
|
|
- retval->handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) sqlite_object_free_storage, NULL TSRMLS_CC);
|
62
|
|
- retval->handlers = handlers;
|
63
|
|
-@@ -1510,7 +1501,7 @@ static struct php_sqlite_db *php_sqlite_
|
64
|
|
- /* authorizer hook so we can enforce safe mode
|
65
|
|
- * Note: the declaration of php_sqlite_authorizer is correct for 2.8.2 of libsqlite,
|
66
|
|
- * and IS backwards binary compatible with earlier versions */
|
67
|
|
-- if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) {
|
68
|
|
-+ if (PG(open_basedir) && *PG(open_basedir)) {
|
69
|
|
- sqlite_set_authorizer(sdb, php_sqlite_authorizer, NULL);
|
70
|
|
- }
|
71
|
|
-
|
72
|
|
-@@ -1569,8 +1560,7 @@ PHP_FUNCTION(sqlite_popen)
|
73
|
|
- RETURN_FALSE;
|
74
|
|
- }
|
75
|
|
-
|
76
|
|
-- if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) ||
|
77
|
|
-- php_check_open_basedir(fullpath TSRMLS_CC)) {
|
78
|
|
-+ if (php_check_open_basedir(fullpath TSRMLS_CC)) {
|
79
|
|
- efree(fullpath);
|
80
|
|
- RETURN_FALSE;
|
81
|
|
- }
|
82
|
|
-@@ -1656,8 +1646,7 @@ PHP_FUNCTION(sqlite_open)
|
83
|
|
- }
|
84
|
|
- }
|
85
|
|
-
|
86
|
|
-- if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) ||
|
87
|
|
-- php_check_open_basedir(fullpath TSRMLS_CC)) {
|
88
|
|
-+ if (php_check_open_basedir(fullpath TSRMLS_CC)) {
|
89
|
|
- efree(fullpath);
|
90
|
|
- zend_restore_error_handling(&error_handling TSRMLS_CC);
|
91
|
|
- if (object) {
|
92
|
|
-@@ -1710,8 +1699,7 @@ PHP_FUNCTION(sqlite_factory)
|
93
|
|
- RETURN_NULL();
|
94
|
|
- }
|
95
|
|
-
|
96
|
|
-- if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) ||
|
97
|
|
-- php_check_open_basedir(fullpath TSRMLS_CC)) {
|
98
|
|
-+ if (php_check_open_basedir(fullpath TSRMLS_CC)) {
|
99
|
|
- efree(fullpath);
|
100
|
|
- zend_restore_error_handling(&error_handling TSRMLS_CC);
|
101
|
|
- RETURN_NULL();
|