1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #ifndef FOPEN_WRAPPERS_H
22 #define FOPEN_WRAPPERS_H
23
24 BEGIN_EXTERN_C()
25 #include "php_globals.h"
26 #include "php_ini.h"
27
28 PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle);
29 PHPAPI char *expand_filepath(const char *filepath, char *real_path);
30 PHPAPI char *expand_filepath_ex(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len);
31 PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int use_realpath);
32
33 PHPAPI int php_check_open_basedir(const char *path);
34 PHPAPI int php_check_open_basedir_ex(const char *path, int warn);
35 PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path);
36
37
38 #if PHP_API_VERSION < 20100412
39 # define OPENBASEDIR_CHECKPATH(filename) \
40 (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)
41 #else
42 #define OPENBASEDIR_CHECKPATH(filename) \
43 php_check_open_basedir(filename)
44 #endif
45
46
47 PHPAPI int php_check_safe_mode_include_dir(const char *path);
48
49 PHPAPI zend_string *php_resolve_path(const char *filename, int filename_len, const char *path);
50
51 PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, zend_string **opened_path);
52
53 PHPAPI char *php_strip_url_passwd(char *path);
54
55 PHPAPI ZEND_INI_MH(OnUpdateBaseDir);
56 END_EXTERN_C()
57
58 #endif
59
60
61
62
63
64