[PHP-CVS] svn: /php/php-src/trunk/TSRM/ tsrm_virtual_cwd.c
pajoye Mon, 10 Jan 2011 00:59:19 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307317 Log: - WS Changed paths: U php/php-src/trunk/TSRM/tsrm_virtual_cwd.c Modified: php/php-src/trunk/TSRM/tsrm_virtual_cwd.c === --- php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2011-01-10 00:43:08 UTC (rev 307316) +++ php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2011-01-10 00:59:19 UTC (rev 307317) @@ -840,8 +840,8 @@ memcpy(tmp, path, len+1); if(save - !(IS_UNC_PATH(path, len) len = 3 path[2] != '?') - (data.dwFileAttributes FILE_ATTRIBUTE_REPARSE_POINT)) { + !(IS_UNC_PATH(path, len) len = 3 path[2] != '?') + (data.dwFileAttributes FILE_ATTRIBUTE_REPARSE_POINT)) { /* File is a reparse point. Get the target */ HANDLE hLink = NULL; REPARSE_DATA_BUFFER * pbuffer; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ TSRM/tsrm_virtual_cwd.c TSRM/tsrm_virtual_cwd.h TSRM/tsrm_win32.c TSRM/tsrm_win32.h UPGRADING.INTERNALS
pajoye Fri, 17 Sep 2010 09:27:19 + Revision: http://svn.php.net/viewvc?view=revisionrevision=303455 Log: - drop tsrmls_fetch in tsrm_win32_access Changed paths: U php/php-src/trunk/TSRM/tsrm_virtual_cwd.c U php/php-src/trunk/TSRM/tsrm_virtual_cwd.h U php/php-src/trunk/TSRM/tsrm_win32.c U php/php-src/trunk/TSRM/tsrm_win32.h U php/php-src/trunk/UPGRADING.INTERNALS Modified: php/php-src/trunk/TSRM/tsrm_virtual_cwd.c === --- php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2010-09-17 08:42:12 UTC (rev 303454) +++ php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2010-09-17 09:27:19 UTC (rev 303455) @@ -1433,7 +1433,7 @@ } #if defined(TSRM_WIN32) - ret = tsrm_win32_access(new_state.cwd, mode); + ret = tsrm_win32_access(new_state.cwd, mode TSRMLS_CC); #else ret = access(new_state.cwd, mode); #endif Modified: php/php-src/trunk/TSRM/tsrm_virtual_cwd.h === --- php/php-src/trunk/TSRM/tsrm_virtual_cwd.h 2010-09-17 08:42:12 UTC (rev 303454) +++ php/php-src/trunk/TSRM/tsrm_virtual_cwd.h 2010-09-17 09:27:19 UTC (rev 303455) @@ -310,7 +310,7 @@ #define VCWD_OPENDIR(pathname) opendir(pathname) #define VCWD_POPEN(command, type) popen(command, type) #if defined(TSRM_WIN32) -#define VCWD_ACCESS(pathname, mode) tsrm_win32_access(pathname, mode) +#define VCWD_ACCESS(pathname, mode) tsrm_win32_access(pathname, mode TSRMLS_CC) #else #define VCWD_ACCESS(pathname, mode) access(pathname, mode) #endif Modified: php/php-src/trunk/TSRM/tsrm_win32.c === --- php/php-src/trunk/TSRM/tsrm_win32.c 2010-09-17 08:42:12 UTC (rev 303454) +++ php/php-src/trunk/TSRM/tsrm_win32.c 2010-09-17 09:27:19 UTC (rev 303455) @@ -190,7 +190,7 @@ return NULL; } -TSRM_API int tsrm_win32_access(const char *pathname, int mode) +TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC) { time_t t; HANDLE thread_token; @@ -208,8 +208,6 @@ realpath_cache_bucket * bucket = NULL; char * real_path = NULL; - TSRMLS_FETCH(); - if (mode == 1 /*X_OK*/) { DWORD type; return GetBinaryType(pathname, type) ? 0 : -1; Modified: php/php-src/trunk/TSRM/tsrm_win32.h === --- php/php-src/trunk/TSRM/tsrm_win32.h 2010-09-17 08:42:12 UTC (rev 303454) +++ php/php-src/trunk/TSRM/tsrm_win32.h 2010-09-17 09:27:19 UTC (rev 303455) @@ -98,7 +98,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env); TSRM_API FILE *popen(const char *command, const char *type); TSRM_API int pclose(FILE *stream); -TSRM_API int tsrm_win32_access(const char *pathname, int mode); +TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC); TSRM_API int win32_utime(const char *filename, struct utimbuf *buf); TSRM_API int shmget(int key, int size, int flags); Modified: php/php-src/trunk/UPGRADING.INTERNALS === --- php/php-src/trunk/UPGRADING.INTERNALS 2010-09-17 08:42:12 UTC (rev 303454) +++ php/php-src/trunk/UPGRADING.INTERNALS 2010-09-17 09:27:19 UTC (rev 303455) @@ -91,3 +91,5 @@ . sapi_register_input_filter SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC), unsigned int (*input_filter_init)(TSRMLS_D) TSRMLS_DC); +. tsrm_win32_access + TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ TSRM/tsrm_virtual_cwd.c TSRM/tsrm_win32.c TSRM/tsrm_win32.h UPGRADING.INTERNALS
pajoye Fri, 17 Sep 2010 10:00:01 + Revision: http://svn.php.net/viewvc?view=revisionrevision=303456 Log: - drop tsrmls_fetch in popen_ex Changed paths: U php/php-src/trunk/TSRM/tsrm_virtual_cwd.c U php/php-src/trunk/TSRM/tsrm_win32.c U php/php-src/trunk/TSRM/tsrm_win32.h U php/php-src/trunk/UPGRADING.INTERNALS Modified: php/php-src/trunk/TSRM/tsrm_virtual_cwd.c === --- php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2010-09-17 09:27:19 UTC (rev 303455) +++ php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2010-09-17 10:00:01 UTC (rev 303456) @@ -1764,7 +1764,7 @@ #ifdef TSRM_WIN32 CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */ { - return popen_ex(command, type, CWDG(cwd).cwd, NULL); + return popen_ex(command, type, CWDG(cwd).cwd, NULL TSRMLS_CC); } /* }}} */ #elif defined(NETWARE) Modified: php/php-src/trunk/TSRM/tsrm_win32.c === --- php/php-src/trunk/TSRM/tsrm_win32.c 2010-09-17 09:27:19 UTC (rev 303455) +++ php/php-src/trunk/TSRM/tsrm_win32.c 2010-09-17 10:00:01 UTC (rev 303456) @@ -446,10 +446,12 @@ TSRM_API FILE *popen(const char *command, const char *type) { - return popen_ex(command, type, NULL, NULL); + TSRMLS_FETCH(); + + return popen_ex(command, type, NULL, NULL TSRMLS_CC); } -TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env) +TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC) { FILE *stream = NULL; int fno, type_len = strlen(type), read, mode; @@ -467,8 +469,6 @@ HANDLE token_user = NULL; BOOL asuser = TRUE; - TSRMLS_FETCH(); - if (!type) { return NULL; } Modified: php/php-src/trunk/TSRM/tsrm_win32.h === --- php/php-src/trunk/TSRM/tsrm_win32.h 2010-09-17 09:27:19 UTC (rev 303455) +++ php/php-src/trunk/TSRM/tsrm_win32.h 2010-09-17 10:00:01 UTC (rev 303456) @@ -95,7 +95,7 @@ TSRM_API void tsrm_win32_startup(void); TSRM_API void tsrm_win32_shutdown(void); -TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env); +TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC); TSRM_API FILE *popen(const char *command, const char *type); TSRM_API int pclose(FILE *stream); TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC); Modified: php/php-src/trunk/UPGRADING.INTERNALS === --- php/php-src/trunk/UPGRADING.INTERNALS 2010-09-17 09:27:19 UTC (rev 303455) +++ php/php-src/trunk/UPGRADING.INTERNALS 2010-09-17 10:00:01 UTC (rev 303456) @@ -93,3 +93,6 @@ . tsrm_win32_access TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC); + +. popen_ex (win32) + TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/TSRM/ tsrm_virtual_cwd.c
pajoye Fri, 10 Sep 2010 14:02:19 + Revision: http://svn.php.net/viewvc?view=revisionrevision=303257 Log: - WS Changed paths: U php/php-src/trunk/TSRM/tsrm_virtual_cwd.c Modified: php/php-src/trunk/TSRM/tsrm_virtual_cwd.c === --- php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2010-09-10 14:01:44 UTC (rev 303256) +++ php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2010-09-10 14:02:19 UTC (rev 303257) @@ -88,14 +88,14 @@ #include tchar.h #define tsrm_strtok_r(a,b,c) _tcstok((a),(b)) #define TOKENIZER_STRING /\\ - -static int php_check_dots(const char *element, int n) + +static int php_check_dots(const char *element, int n) { while (n-- 0) if (element[n] != '.') break; return (n != -1); } - + #define IS_DIRECTORY_UP(element, len) \ (len = 2 !php_check_dots(element, len)) @@ -129,7 +129,7 @@ /* define this to check semantics */ #define IS_DIR_OK(s) (1) - + #ifndef IS_DIR_OK #define IS_DIR_OK(state) (php_is_dir_ok(state) == 0) #endif @@ -142,7 +142,7 @@ #define CWD_STATE_FREE(s) \ free((s)-cwd); - + #ifdef TSRM_WIN32 #ifdef CTL_CODE @@ -249,7 +249,7 @@ /* Skip first 4 characters if they are \??\ */ if(target[0] == '\\' target[1] == '\\' target[2] == '?' target[3] == '\\') { char tmp[MAXPATHLEN]; - + dwRet -= 4; memcpy(tmp, target + 4, dwRet); memcpy(target, tmp, dwRet); @@ -428,7 +428,7 @@ } } #else - result = getcwd(cwd, sizeof(cwd)); + result = getcwd(cwd, sizeof(cwd)); #endif if (!result) { cwd[0] = '\0'; @@ -479,7 +479,7 @@ *length = 1; retval = (char *) malloc(2); retval[0] = DEFAULT_SLASH; - retval[1] = '\0'; + retval[1] = '\0'; return retval; } @@ -606,7 +606,7 @@ { long size = sizeof(realpath_cache_bucket) + path_len + 1; int same = 1; - + if (realpath_len != path_len || memcmp(path, realpath, path_len) != 0) { size += realpath_len + 1; @@ -682,17 +682,17 @@ } /* }}} */ -CWD_API int realpath_cache_size(TSRMLS_D) +CWD_API int realpath_cache_size(TSRMLS_D) { return CWDG(realpath_cache_size); } -CWD_API int realpath_cache_max_buckets(TSRMLS_D) +CWD_API int realpath_cache_max_buckets(TSRMLS_D) { return (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0])); } -CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D) +CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D) { return CWDG(realpath_cache); } @@ -751,7 +751,7 @@ path[4] = '.'; path[5] = DEFAULT_SLASH; j = 5; - } else if (j 0 + } else if (j 0 path[j+1] == '.' path[j+2] == '.' IS_SLASH(path[j+3])) { j += 4; @@ -769,7 +769,7 @@ } return j; } - + path[len] = 0; save = (use_realpath != CWD_EXPAND); @@ -802,7 +802,7 @@ /* continue resolution anyway but don't save result in the cache */ save = 0; } - + if (save) { FindClose(hFind); } @@ -810,7 +810,7 @@ tmp = tsrm_do_alloca(len+1, use_heap); memcpy(tmp, path, len+1); - if(save + if(save !(IS_UNC_PATH(path, len) len = 3 path[2] != '?') (data.dwFileAttributes FILE_ATTRIBUTE_REPARSE_POINT)) { /* File is a reparse point. Get the target */ @@ -847,7 +847,7 @@ reparsetarget = pbuffer-SymbolicLinkReparseBuffer.ReparseTarget; printname_len = pbuffer-MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR); isabsolute = (pbuffer-SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0; -if (!WideCharToMultiByte(CP_THREAD_ACP, 0, +if (!WideCharToMultiByte(CP_THREAD_ACP, 0, reparsetarget + pbuffer-MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR), printname_len + 1, printname, MAX_PATH, NULL, NULL @@ -859,7 +859,7 @@ printname[printname_len] = 0; substitutename_len = pbuffer-MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR); -if (!WideCharToMultiByte(CP_THREAD_ACP, 0, +if (!WideCharToMultiByte(CP_THREAD_ACP, 0, reparsetarget + pbuffer-MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), substitutename_len + 1, substitutename, MAX_PATH, NULL, NULL @@ -873,7 +873,7 @@ isabsolute = 1; reparsetarget = pbuffer-MountPointReparseBuffer.ReparseTarget; printname_len = pbuffer-MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR); -if (!WideCharToMultiByte(CP_THREAD_ACP, 0, +if (!WideCharToMultiByte(CP_THREAD_ACP, 0, reparsetarget + pbuffer-MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR), printname_len + 1, printname, MAX_PATH, NULL, NULL @@ -884,7 +884,7 @@ printname[pbuffer-MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR)] = 0; substitutename_len = pbuffer-MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR); -if (!WideCharToMultiByte(CP_THREAD_ACP, 0, +if (!WideCharToMultiByte(CP_THREAD_ACP, 0, reparsetarget + pbuffer-MountPointReparseBuffer.SubstituteNameOffset /
[PHP-CVS] svn: /php/php-src/trunk/ TSRM/tsrm_virtual_cwd.c TSRM/tsrm_virtual_cwd.h UPGRADING ext/zip/php_zip.c main/fopen_wrappers.c main/php_open_temporary_file.c
pajoye Mon, 30 Aug 2010 09:38:47 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302883 Log: - use TSRMLS_CC instead of TSRMLS_FETCH in virtual_file_ex Changed paths: U php/php-src/trunk/TSRM/tsrm_virtual_cwd.c U php/php-src/trunk/TSRM/tsrm_virtual_cwd.h U php/php-src/trunk/UPGRADING U php/php-src/trunk/ext/zip/php_zip.c U php/php-src/trunk/main/fopen_wrappers.c U php/php-src/trunk/main/php_open_temporary_file.c Modified: php/php-src/trunk/TSRM/tsrm_virtual_cwd.c === --- php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2010-08-30 09:20:48 UTC (rev 302882) +++ php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2010-08-30 09:38:47 UTC (rev 302883) @@ -990,7 +990,7 @@ /* Resolve path relatively to state and put the real path into state */ /* returns 0 for ok, 1 for error */ -CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath) /* {{{ */ +CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath TSRMLS_DC) /* {{{ */ { int path_length = strlen(path); char resolved_path[MAXPATHLEN]; @@ -1000,7 +1000,6 @@ int ret; int add_slash; void *tmp; - TSRMLS_FETCH(); if (path_length == 0 || path_length = MAXPATHLEN-1) { #ifdef TSRM_WIN32 @@ -1196,7 +1195,7 @@ CWD_API int virtual_chdir(const char *path TSRMLS_DC) /* {{{ */ { - return virtual_file_ex(CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH)?-1:0; + return virtual_file_ex(CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH TSRMLS_CC)?-1:0; } /* }}} */ @@ -1256,7 +1255,7 @@ new_state.cwd_length = 0; } - if (virtual_file_ex(new_state, path, NULL, CWD_REALPATH)==0) { + if (virtual_file_ex(new_state, path, NULL, CWD_REALPATH TSRMLS_CC)==0) { int len = new_state.cwd_lengthMAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; memcpy(real_path, new_state.cwd, len); @@ -1278,7 +1277,7 @@ int retval; CWD_STATE_COPY(new_state, CWDG(cwd)); - retval = virtual_file_ex(new_state, path, verify_path, CWD_FILEPATH); + retval = virtual_file_ex(new_state, path, verify_path, CWD_FILEPATH TSRMLS_CC); *filepath = new_state.cwd; @@ -1303,7 +1302,7 @@ } CWD_STATE_COPY(new_state, CWDG(cwd)); - if (virtual_file_ex(new_state, path, NULL, CWD_FILEPATH)) { + if (virtual_file_ex(new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) { CWD_STATE_FREE(new_state); return NULL; } @@ -1321,7 +1320,7 @@ int ret; CWD_STATE_COPY(new_state, CWDG(cwd)); - if (virtual_file_ex(new_state, pathname, NULL, CWD_REALPATH)) { + if (virtual_file_ex(new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) { CWD_STATE_FREE(new_state); return -1; } @@ -1394,7 +1393,7 @@ int ret; CWD_STATE_COPY(new_state, CWDG(cwd)); - if (virtual_file_ex(new_state, filename, NULL, CWD_REALPATH)) { + if (virtual_file_ex(new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) { CWD_STATE_FREE(new_state); return -1; } @@ -1417,7 +1416,7 @@ int ret; CWD_STATE_COPY(new_state, CWDG(cwd)); - if (virtual_file_ex(new_state, filename, NULL, CWD_REALPATH)) { + if (virtual_file_ex(new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) { CWD_STATE_FREE(new_state); return -1; } @@ -1436,7 +1435,7 @@ int ret; CWD_STATE_COPY(new_state, CWDG(cwd)); - if (virtual_file_ex(new_state, filename, NULL, CWD_REALPATH)) { + if (virtual_file_ex(new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) { CWD_STATE_FREE(new_state); return -1; } @@ -1463,7 +1462,7 @@ int f; CWD_STATE_COPY(new_state, CWDG(cwd)); - if (virtual_file_ex(new_state, path, NULL, CWD_FILEPATH)) { + if (virtual_file_ex(new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) { CWD_STATE_FREE(new_state); return -1; } @@ -1491,7 +1490,7 @@ int f; CWD_STATE_COPY(new_state, CWDG(cwd)); - if (virtual_file_ex(new_state, path, NULL, CWD_FILEPATH)) { + if (virtual_file_ex(new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) { CWD_STATE_FREE(new_state); return -1; } @@ -1510,14 +1509,14 @@ int retval; CWD_STATE_COPY(old_state, CWDG(cwd)); - if (virtual_file_ex(old_state, oldname, NULL, CWD_EXPAND)) { + if (virtual_file_ex(old_state, oldname, NULL, CWD_EXPAND TSRMLS_CC)) { CWD_STATE_FREE(old_state); return -1; } oldname = old_state.cwd; CWD_STATE_COPY(new_state, CWDG(cwd)); - if (virtual_file_ex(new_state, newname, NULL, CWD_EXPAND)) { + if (virtual_file_ex(new_state, newname, NULL, CWD_EXPAND TSRMLS_CC)) { CWD_STATE_FREE(old_state); CWD_STATE_FREE(new_state); return -1; @@ -1546,7 +1545,7 @@ int retval; CWD_STATE_COPY(new_state, CWDG(cwd)); - if (virtual_file_ex(new_state, path, NULL, CWD_REALPATH)) { + if (virtual_file_ex(new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) { CWD_STATE_FREE(new_state); return -1; } @@ -1565,7 +1564,7 @@ int retval; CWD_STATE_COPY(new_state, CWDG(cwd)); - if (virtual_file_ex(new_state, path, NULL,
[PHP-CVS] svn: /php/php-src/trunk/TSRM/ tsrm_virtual_cwd.c
pajoye Thu, 26 Aug 2010 14:23:48 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302802 Log: - WS Changed paths: U php/php-src/trunk/TSRM/tsrm_virtual_cwd.c Modified: php/php-src/trunk/TSRM/tsrm_virtual_cwd.c === --- php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2010-08-26 14:23:17 UTC (rev 302801) +++ php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2010-08-26 14:23:48 UTC (rev 302802) @@ -814,7 +814,7 @@ || strncmp(substitutename, ?\\Volume{,11) == 0 || strncmp(substitutename, \\??\\UNC\\, 8) == 0 ) { - isVolume = TRUE; + isVolume = TRUE; substitutename_off = 0; } else /* do not use the \??\ and \\?\ prefix*/ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/TSRM/ tsrm_virtual_cwd.c
pajoye Mon, 19 Oct 2009 23:43:31 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289782 Log: - MF53: Fix #48746, improve fix to support all possible cases (see latest comment in the report) Bug: http://bugs.php.net/48746 (Assigned) Unable to browse directories within Junction Points Changed paths: U php/php-src/trunk/TSRM/tsrm_virtual_cwd.c Modified: php/php-src/trunk/TSRM/tsrm_virtual_cwd.c === --- php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2009-10-19 23:41:14 UTC (rev 289781) +++ php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2009-10-19 23:43:31 UTC (rev 289782) @@ -706,10 +706,14 @@ /* File is a reparse point. Get the target */ HANDLE hLink = NULL; REPARSE_DATA_BUFFER * pbuffer; - unsigned int retlength = 0, rname_off = 0; - int bufindex = 0, rname_len = 0, isabsolute = 0; + unsigned int retlength = 0; + int bufindex = 0, isabsolute = 0; wchar_t * reparsetarget; BOOL isVolume = FALSE; + char printname[MAX_PATH]; + char substitutename[MAX_PATH]; + int printname_len, substitutename_len; + int substitutename_off = 0; if(++(*ll) LINK_MAX) { return -1; @@ -730,33 +734,61 @@ CloseHandle(hLink); if(pbuffer-ReparseTag == IO_REPARSE_TAG_SYMLINK) { - rname_len = pbuffer-SymbolicLinkReparseBuffer.PrintNameLength/2; - rname_off = pbuffer-SymbolicLinkReparseBuffer.PrintNameOffset/2; - if(rname_len = 0) { - rname_len = pbuffer-SymbolicLinkReparseBuffer.SubstituteNameLength/2; - rname_off = pbuffer-SymbolicLinkReparseBuffer.SubstituteNameOffset/2; - } - reparsetarget = pbuffer-SymbolicLinkReparseBuffer.ReparseTarget; + printname_len = pbuffer-MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR); isabsolute = (pbuffer-SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0; + if (!WideCharToMultiByte(CP_THREAD_ACP, 0, + reparsetarget + pbuffer-MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR), + printname_len + 1, + printname, MAX_PATH, NULL, NULL + )) { + tsrm_free_alloca(pbuffer, use_heap_large); + return -1; + }; + printname_len = pbuffer-MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR); + printname[printname_len] = 0; + + substitutename_len = pbuffer-MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR); + if (!WideCharToMultiByte(CP_THREAD_ACP, 0, + reparsetarget + pbuffer-MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), + substitutename_len + 1, + substitutename, MAX_PATH, NULL, NULL + )) { + tsrm_free_alloca(pbuffer, use_heap_large); + return -1; + }; + substitutename[substitutename_len] = 0; } else if(pbuffer-ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) { - rname_len = pbuffer-MountPointReparseBuffer.PrintNameLength/2; - rname_off = pbuffer-MountPointReparseBuffer.PrintNameOffset/2; - if(rname_len = 0) { - rname_len = pbuffer-MountPointReparseBuffer.SubstituteNameLength/2; - rname_off = pbuffer-MountPointReparseBuffer.SubstituteNameOffset/2; - } + isabsolute = 1; + reparsetarget = pbuffer-MountPointReparseBuffer.ReparseTarget; + printname_len = pbuffer-MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR); + if (!WideCharToMultiByte(CP_THREAD_ACP, 0, + reparsetarget +
[PHP-CVS] svn: /php/php-src/trunk/TSRM/ tsrm_virtual_cwd.c
pajoye Thu, 03 Sep 2009 19:11:30 + Revision: http://svn.php.net/viewvc?view=revisionrevision=288002 Log: - MF53: len includes the NULL already Changed paths: U php/php-src/trunk/TSRM/tsrm_virtual_cwd.c Modified: php/php-src/trunk/TSRM/tsrm_virtual_cwd.c === --- php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2009-09-03 18:47:43 UTC (rev 288001) +++ php/php-src/trunk/TSRM/tsrm_virtual_cwd.c 2009-09-03 19:11:30 UTC (rev 288002) @@ -746,7 +746,7 @@ *(path + bufindex) = 0; j = bufindex; } else { - j = rname_len + 1; + j = len; } tsrm_free_alloca(pbuffer, use_heap_large); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php