summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-08 10:17:54 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-08 10:17:54 (GMT)
commit77532b29d0c6c85dab5e98de6141a4f876114210 (patch)
tree9b999d21c9bcd38bf106e9e3f02b8e4bc51eb429 /win
parent3d7617301721b4c1a99390297e5035521abdbda1 (diff)
parentca956e8f47e7ee4a5365864b2a0e0f057a75aa61 (diff)
downloadtcl-77532b29d0c6c85dab5e98de6141a4f876114210.zip
tcl-77532b29d0c6c85dab5e98de6141a4f876114210.tar.gz
tcl-77532b29d0c6c85dab5e98de6141a4f876114210.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 a9b321d..7da19ce 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -190,7 +190,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,
@@ -481,7 +481,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);
@@ -580,7 +580,7 @@ WinReadLinkDirectory(
if (!(attr & FILE_ATTRIBUTE_REPARSE_POINT)) {
goto invalidError;
}
- if (NativeReadReparse(linkDirPath, reparseBuffer)) {
+ if (NativeReadReparse(linkDirPath, reparseBuffer, 0)) {
return NULL;
}
@@ -699,12 +699,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 = (*tclWinProcs->createFileProc)(linkDirPath, GENERIC_READ, 0,
+ hFile = (*tclWinProcs->createFileProc)(linkDirPath, desiredAccess, 0,
NULL, OPEN_EXISTING,
FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);