cvs: TSRM / tsrm_virtual_cwd.c tsrm_virtual_cwd.h

From: Date: Mon, 13 Nov 2006 15:13:36 +0000
Subject: cvs: TSRM / tsrm_virtual_cwd.c tsrm_virtual_cwd.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5405@lists.php.net to get a copy of this message
dmitry Mon Nov 13 15:13:36 2006 UTC Modified files: /TSRM tsrm_virtual_cwd.c tsrm_virtual_cwd.h Log: Use symbolic names http://cvs.php.net/viewvc.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.94&r2=1.95&diff_format=u Index: TSRM/tsrm_virtual_cwd.c diff -u TSRM/tsrm_virtual_cwd.c:1.94 TSRM/tsrm_virtual_cwd.c:1.95 --- TSRM/tsrm_virtual_cwd.c:1.94 Fri Nov 10 17:24:11 2006 +++ TSRM/tsrm_virtual_cwd.c Mon Nov 13 15:13:36 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tsrm_virtual_cwd.c,v 1.94 2006/11/10 17:24:11 dmitry Exp $ */ +/* $Id: tsrm_virtual_cwd.c,v 1.95 2006/11/13 15:13:36 dmitry Exp $ */ #include <sys/types.h> #include <sys/stat.h> @@ -512,7 +512,7 @@ char resolved_path[MAXPATHLEN]; if (!realpath(path, resolved_path)) { /* Note: Not threadsafe on older *BSD's */ - if (use_realpath == 2) { + if (use_realpath == CWD_REALPATH) { return 1; } goto no_realpath; @@ -667,7 +667,7 @@ CWD_API int virtual_chdir(const char *path TSRMLS_DC) { - return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, 1)?-1:0; + return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH)?-1:0; } CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC) @@ -709,7 +709,7 @@ CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, 2)==0) { + if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)==0) { int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; memcpy(real_path, new_state.cwd, len); @@ -730,7 +730,7 @@ int retval; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - retval = virtual_file_ex(&new_state, path, verify_path, 1); + retval = virtual_file_ex(&new_state, path, verify_path, CWD_FILEPATH); *filepath = new_state.cwd; @@ -753,7 +753,7 @@ } CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, 1)) { + if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) { return NULL; } @@ -769,7 +769,7 @@ int ret; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, pathname, NULL, 2)) { + if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) { return -1; } @@ -792,7 +792,7 @@ int ret; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, filename, NULL, 0)) { + if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) { return -1; } @@ -809,7 +809,7 @@ int ret; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, filename, NULL, 2)) { + if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) { return -1; } @@ -826,7 +826,7 @@ int ret; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, filename, NULL, 0)) { + if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) { return -1; } @@ -851,7 +851,7 @@ int f; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, 1)) { + if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) { return -1; } @@ -877,7 +877,7 @@ int f; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, 1)) { + if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) { return -1; } @@ -894,13 +894,13 @@ int retval; CWD_STATE_COPY(&old_state, &CWDG(cwd)); - if (virtual_file_ex(&old_state, oldname, NULL, 0)) { + if (virtual_file_ex(&old_state, oldname, NULL, CWD_REALPATH)) { return -1; } oldname = old_state.cwd; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, newname, NULL, 0)) { + if (virtual_file_ex(&new_state, newname, NULL, CWD_FILEPATH)) { return -1; } newname = new_state.cwd; @@ -919,7 +919,7 @@ int retval; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, 2)) { + if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) { return -1; } @@ -936,7 +936,7 @@ int retval; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, 0)) { + if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) { return -1; } @@ -953,7 +953,7 @@ int retval; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, 0)) { + if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND)) { return -1; } @@ -969,7 +969,7 @@ int retval; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, pathname, NULL, 1)) { + if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH)) { return -1; } @@ -988,7 +988,7 @@ int retval; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, pathname, NULL, 0)) { + if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND)) { return -1; } @@ -1008,7 +1008,7 @@ DIR *retval; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, pathname, NULL, 2)) { + if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) { return NULL; } @@ -1133,7 +1133,7 @@ new_state.cwd_length = 0; } - if (virtual_file_ex(&new_state, path, NULL, 2)) { + if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) { free(new_state.cwd); return NULL; } http://cvs.php.net/viewvc.cgi/TSRM/tsrm_virtual_cwd.h?r1=1.59&r2=1.60&diff_format=u Index: TSRM/tsrm_virtual_cwd.h diff -u TSRM/tsrm_virtual_cwd.h:1.59 TSRM/tsrm_virtual_cwd.h:1.60 --- TSRM/tsrm_virtual_cwd.h:1.59 Fri Nov 10 15:04:19 2006 +++ TSRM/tsrm_virtual_cwd.h Mon Nov 13 15:13:36 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tsrm_virtual_cwd.h,v 1.59 2006/11/10 15:04:19 dmitry Exp $ */ +/* $Id: tsrm_virtual_cwd.h,v 1.60 2006/11/13 15:13:36 dmitry Exp $ */ #ifndef VIRTUAL_CWD_H #define VIRTUAL_CWD_H @@ -203,6 +203,10 @@ CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC); #endif +#define CWD_EXPAND 0 +#define CWD_FILEPATH 1 +#define CWD_REALPATH 2 + CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath); CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC);

« previous php.zend-engine.cvs (#5405) next »