diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-08 08:44:33 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-08 08:44:33 (GMT) |
commit | 6eb9921283977c60251e6768c633fac4e6fbb4b5 (patch) | |
tree | dd42480f4016d54d8eae6ab4fc94bf144033fe33 | |
parent | 09531013443ef55893b05545dc67b5c5c304609e (diff) | |
download | tcl-6eb9921283977c60251e6768c633fac4e6fbb4b5.zip tcl-6eb9921283977c60251e6768c633fac4e6fbb4b5.tar.gz tcl-6eb9921283977c60251e6768c633fac4e6fbb4b5.tar.bz2 |
new attempt for better fixbug_3092089
-rw-r--r-- | win/tclWinFile.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index a1da83f..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,22 +699,17 @@ 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); if (hFile == INVALID_HANDLE_VALUE) { - hFile = (*tclWinProcs->createFileProc)(linkDirPath, 0, 0, - NULL, OPEN_EXISTING, - FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL); - } - - if (hFile == INVALID_HANDLE_VALUE) { /* * Error creating directory. */ |