diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-08 10:27:42 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-08 10:27:42 (GMT) |
commit | 82df34a36d5981e30a94e77f7788ba77201bca0c (patch) | |
tree | ac7fec93623bb52eb7a4cc5ab9910f245fcd532f | |
parent | 5e04de18570772af42f7d32958d178bf85737430 (diff) | |
parent | 77532b29d0c6c85dab5e98de6141a4f876114210 (diff) | |
download | tcl-82df34a36d5981e30a94e77f7788ba77201bca0c.zip tcl-82df34a36d5981e30a94e77f7788ba77201bca0c.tar.gz tcl-82df34a36d5981e30a94e77f7788ba77201bca0c.tar.bz2 |
[Bug 3092089]: [file normalize] can remove path components.
[Bug 3587096] win vista/7: "can't find init.tcl" when called via junction.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | win/tclWinFile.c | 11 |
2 files changed, 12 insertions, 5 deletions
@@ -1,3 +1,9 @@ +2013-01-08 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tclWinFile.c: [Bug 3092089]: [file normalize] can remove path + components. [Bug 3587096] win vista/7: "can't find init.tcl" when + called via junction. + 2013-01-07 Jan Nijtmans <nijtmans@users.sf.net> * generic/tclOOStubLib.c: Restrict the stub library to only use diff --git a/win/tclWinFile.c b/win/tclWinFile.c index a1189f5..a4512ec 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -160,7 +160,7 @@ static unsigned short NativeStatMode(DWORD attr, int checkLinks, int isExec); static int NativeIsExec(const TCHAR *path); static int NativeReadReparse(const TCHAR *LinkDirectory, - REPARSE_DATA_BUFFER *buffer); + REPARSE_DATA_BUFFER *buffer, DWORD desiredAccess); static int NativeWriteReparse(const TCHAR *LinkDirectory, REPARSE_DATA_BUFFER *buffer); static int NativeMatchType(int isDrive, DWORD attr, @@ -444,7 +444,7 @@ TclWinSymLinkCopyDirectory( DUMMY_REPARSE_BUFFER dummy; REPARSE_DATA_BUFFER *reparseBuffer = (REPARSE_DATA_BUFFER *) &dummy; - if (NativeReadReparse(linkOrigPath, reparseBuffer)) { + if (NativeReadReparse(linkOrigPath, reparseBuffer, GENERIC_READ)) { return -1; } return NativeWriteReparse(linkCopyPath, reparseBuffer); @@ -542,7 +542,7 @@ WinReadLinkDirectory( if (!(attr & FILE_ATTRIBUTE_REPARSE_POINT)) { goto invalidError; } - if (NativeReadReparse(linkDirPath, reparseBuffer)) { + if (NativeReadReparse(linkDirPath, reparseBuffer, 0)) { return NULL; } @@ -663,12 +663,13 @@ WinReadLinkDirectory( static int NativeReadReparse( const TCHAR *linkDirPath, /* The junction to read */ - REPARSE_DATA_BUFFER *buffer)/* Pointer to buffer. Cannot be NULL */ + REPARSE_DATA_BUFFER *buffer,/* Pointer to buffer. Cannot be NULL */ + DWORD desiredAccess) { HANDLE hFile; DWORD returnedLength; - hFile = CreateFile(linkDirPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, + hFile = CreateFile(linkDirPath, desiredAccess, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL); if (hFile == INVALID_HANDLE_VALUE) { |