Re: [ZEND-ENGINE-CVS] cvs: TSRM / tsrm_virtual_cwd.h
| From: | Andi Gutmans | Date: | Wed, 11 Dec 2002 05:16:38 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: TSRM / tsrm_virtual_cwd.h | ||
| References: | 1 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-708@lists.php.net to get a copy of this message | ||
This is not the correct patch but adds other bugs. You should check for UNC separetely in the code like in virtual_realpath(). IS_ABSOLUTE_PATH() is only meant to detect the drive letter and is always followed by use of COPY_WHEN_ABSOLUTE() (which happens to also be 2 but it's still not right. Stuff might break).
if (IS_ABSOLUTE_PATH(path_copy, path_length)) {
copy_amount = COPY_WHEN_ABSOLUTE(path_copy);
is_absolute = 1;
#ifdef TSRM_WIN32
} else if (IS_UNC_PATH(path_copy, path_length)) {
copy_amount = 2;
is_absolute = 1;
} else if (IS_SLASH(path_copy[0])) {
copy_amount = 2;
#endif
}Andi At 12:32 AM 12/11/2002 +0000, Ilia Alshanetsky wrote:
iliaa Tue Dec 10 19:32:34 2002 EDTModified files:/TSRM tsrm_virtual_cwd.hLog: On Win32 make PHP treat UNC paths as absolute paths, this should solve bugs such as #20831. Thanks to Wez Furlong for isolating the problem. Index: TSRM/tsrm_virtual_cwd.h diff -u TSRM/tsrm_virtual_cwd.h:1.27 TSRM/tsrm_virtual_cwd.h:1.28--- TSRM/tsrm_virtual_cwd.h:1.27 Fri Nov 15 11:36:55 2002 +++ TSRM/tsrm_virtual_cwd.h Tue Dec 10 19:32:33 2002@@ -17,7 +17,7 @@+----------------------------------------------------------------------+*/ -/* $Id: tsrm_virtual_cwd.h,v 1.27 2002/11/15 16:36:55 iliaa Exp $ */ +/* $Id: tsrm_virtual_cwd.h,v 1.28 2002/12/11 00:32:33 iliaa Exp $ */ #ifndef VIRTUAL_CWD_H #define VIRTUAL_CWD_H @@ -58,7 +58,7 @@ */ #define COPY_WHEN_ABSOLUTE(path) 2 #define IS_ABSOLUTE_PATH(path, len) \- (len >= 2 && isalpha(path[0]) && path[1] == ':') + (len >= 2 && ((isalpha(path[0]) && path[1] == ':') || (IS_SLASH(path[0]) && IS_SLASH(path[1]))))#define IS_UNC_PATH(path, len) \(len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1]))-- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php