cvs: TSRM(PHP_5_2) / tsrm_virtual_cwd.c

From: Date: Fri, 10 Nov 2006 17:23:59 +0000
Subject: cvs: TSRM(PHP_5_2) / tsrm_virtual_cwd.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5395@lists.php.net to get a copy of this message
dmitry Fri Nov 10 17:23:59 2006 UTC Modified files: (Branch: PHP_5_2) /TSRM tsrm_virtual_cwd.c Log: Fixed wrong realpath() result in case of unexistent path http://cvs.php.net/viewvc.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.74.2.9.2.12&r2=1.74.2.9.2.13&diff_format=u Index: TSRM/tsrm_virtual_cwd.c diff -u TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.12 TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.13 --- TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.12 Fri Nov 10 16:57:17 2006 +++ TSRM/tsrm_virtual_cwd.c Fri Nov 10 17:23:58 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.12 2006/11/10 16:57:17 dmitry Exp $ */ +/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.13 2006/11/10 17:23:58 dmitry Exp $ */ #include <sys/types.h> #include <sys/stat.h> @@ -512,7 +512,10 @@ char resolved_path[MAXPATHLEN]; if (!realpath(path, resolved_path)) { /* Note: Not threadsafe on older *BSD's */ - return 1; + if (use_realpath == 2) { + return 1; + } + goto no_realpath; } CWD_STATE_COPY(&old_state, state); @@ -706,7 +709,7 @@ CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, 1)==0) { + if (virtual_file_ex(&new_state, path, NULL, 2)==0) { int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; memcpy(real_path, new_state.cwd, len); @@ -766,7 +769,7 @@ int ret; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, pathname, NULL, 1)) { + if (virtual_file_ex(&new_state, pathname, NULL, 2)) { return -1; } @@ -806,7 +809,7 @@ int ret; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, filename, NULL, 1)) { + if (virtual_file_ex(&new_state, filename, NULL, 2)) { return -1; } @@ -916,7 +919,7 @@ int retval; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, 1)) { + if (virtual_file_ex(&new_state, path, NULL, 2)) { return -1; } @@ -1005,7 +1008,7 @@ DIR *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, 2)) { return NULL; } @@ -1130,7 +1133,7 @@ new_state.cwd_length = 0; } - if (virtual_file_ex(&new_state, path, NULL, 1)) { + if (virtual_file_ex(&new_state, path, NULL, 2)) { free(new_state.cwd); return NULL; }

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