diff options
author | Andi Gutmans <andi@php.net> | 2000-11-22 04:59:32 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2000-11-22 04:59:32 +0000 |
commit | afccae85d96a4f863e1d8ee51ad9a3adc78214a1 (patch) | |
tree | aab35c093220d908382b8e4a51991c2716b087a3 /TSRM | |
parent | 2ef6b689e8f3c5ddd62c790f8f429cece8a57ff9 (diff) | |
download | php-git-afccae85d96a4f863e1d8ee51ad9a3adc78214a1.tar.gz |
- Thanks to "Daniel Beulshausen" <daniel@php4win.de>
Diffstat (limited to 'TSRM')
-rw-r--r-- | TSRM/tsrm_virtual_cwd.c | 12 | ||||
-rw-r--r-- | TSRM/tsrm_virtual_cwd.h | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index 10f50509b9..7dca55fa64 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -442,7 +442,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path) CWD_STATE_COPY(&new_state, &CWDG(cwd)); retval = virtual_file_ex(&new_state, path, NULL); - if(retval) { + if (!retval) { int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; memcpy(real_path, new_state.cwd, len); real_path[len] = '\0'; @@ -452,18 +452,24 @@ CWD_API char *virtual_realpath(const char *path, char *real_path) return NULL; } -CWD_API int virtual_filepath(const char *path, char **filepath) +CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path) { cwd_state new_state; int retval; CWDLS_FETCH(); CWD_STATE_COPY(&new_state, &CWDG(cwd)); - retval = virtual_file_ex(&new_state, path, php_is_file_ok); + retval = virtual_file_ex(&new_state, path, verify_path); *filepath = new_state.cwd; return retval; + +} + +CWD_API int virtual_filepath(const char *path, char **filepath) +{ + return virtual_filepath_ex(path, filepath, php_is_file_ok); } CWD_API FILE *virtual_fopen(const char *path, const char *mode) diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h index 3a4753c7d3..7ea7aa4cbf 100644 --- a/TSRM/tsrm_virtual_cwd.h +++ b/TSRM/tsrm_virtual_cwd.h @@ -100,6 +100,7 @@ CWD_API char *virtual_getcwd(char *buf, size_t size); CWD_API int virtual_chdir(const char *path); CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path)); CWD_API int virtual_filepath(const char *path, char **filepath); +CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path); CWD_API char *virtual_realpath(const char *path, char *real_path); CWD_API FILE *virtual_fopen(const char *path, const char *mode); CWD_API int virtual_open(const char *path, int flags, ...); |