summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-08 10:13:20 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-08 10:13:20 (GMT)
commitca956e8f47e7ee4a5365864b2a0e0f057a75aa61 (patch)
tree32bd852591e380baee185561395763b25162866b /win
parent948149043162c4a2fa840e6c242e4bf31fe80dba (diff)
parent6eb9921283977c60251e6768c633fac4e6fbb4b5 (diff)
downloadtcl-ca956e8f47e7ee4a5365864b2a0e0f057a75aa61.zip
tcl-ca956e8f47e7ee4a5365864b2a0e0f057a75aa61.tar.gz
tcl-ca956e8f47e7ee4a5365864b2a0e0f057a75aa61.tar.bz2
[Bug 3092089]: [file normalize] can remove path components.
[Bug 3587096] win vista/7: "can't find init.tcl" when called via junction.
Diffstat (limited to 'win')
-rw-r--r--win/tclWinFile.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 69d1838..4abd215 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -181,7 +181,7 @@ static int NativeStat(CONST TCHAR *path, Tcl_StatBuf *statPtr, int checkLinks);
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, CONST TCHAR* nativeName,
@@ -395,7 +395,7 @@ TclWinSymLinkCopyDirectory(LinkOriginal, LinkCopy)
DUMMY_REPARSE_BUFFER dummy;
REPARSE_DATA_BUFFER *reparseBuffer = (REPARSE_DATA_BUFFER*)&dummy;
- if (NativeReadReparse(LinkOriginal, reparseBuffer)) {
+ if (NativeReadReparse(LinkOriginal, reparseBuffer, GENERIC_READ)) {
return -1;
}
return NativeWriteReparse(LinkCopy, reparseBuffer);
@@ -479,7 +479,7 @@ WinReadLinkDirectory(LinkDirectory)
Tcl_SetErrno(EINVAL);
return NULL;
}
- if (NativeReadReparse(LinkDirectory, reparseBuffer)) {
+ if (NativeReadReparse(LinkDirectory, reparseBuffer, 0)) {
return NULL;
}
@@ -585,14 +585,15 @@ WinReadLinkDirectory(LinkDirectory)
*--------------------------------------------------------------------
*/
static int
-NativeReadReparse(LinkDirectory, buffer)
+NativeReadReparse(LinkDirectory, buffer, desiredAccess)
CONST TCHAR* LinkDirectory; /* The junction to read */
REPARSE_DATA_BUFFER* buffer; /* Pointer to buffer. Cannot be NULL */
+ DWORD desiredAccess;
{
HANDLE hFile;
DWORD returnedLength;
- hFile = (*tclWinProcs->createFileProc)(LinkDirectory, GENERIC_READ, 0,
+ hFile = (*tclWinProcs->createFileProc)(LinkDirectory, desiredAccess, 0,
NULL, OPEN_EXISTING,
FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (hFile == INVALID_HANDLE_VALUE) {