summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--win/tclWinFile.c11
2 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index a885b3e..f14699c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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/tcl.decls: Extend the public and private stub tables with
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) {