diff options
author | Björn-Egil Dahlberg <[email protected]> | 2011-09-16 14:39:00 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2011-09-16 14:39:00 +0200 |
commit | 0c41940bef1d80b6b335cb0a77d5608d9bbe27fd (patch) | |
tree | 2eb9bfdf8723b593b2d8428cbc5e738648547a6f /erts/emulator/drivers | |
parent | 9c87b49e4433cf910a9f8d4548c5c3d2da3c5a5f (diff) | |
parent | e7580bdbd1a84f53e78625c26d548025aeb585f0 (diff) | |
download | otp-0c41940bef1d80b6b335cb0a77d5608d9bbe27fd.tar.gz otp-0c41940bef1d80b6b335cb0a77d5608d9bbe27fd.tar.bz2 otp-0c41940bef1d80b6b335cb0a77d5608d9bbe27fd.zip |
Merge branch 'pan/win_symbolic_link_fixes/OTP-9279' into dev
* pan/win_symbolic_link_fixes/OTP-9279:
Add error code for cyclic symbolic links and make directory links readable
Diffstat (limited to 'erts/emulator/drivers')
-rwxr-xr-x | erts/emulator/drivers/win32/win_efile.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/erts/emulator/drivers/win32/win_efile.c b/erts/emulator/drivers/win32/win_efile.c index 3d59564f7b..931bb196f1 100755 --- a/erts/emulator/drivers/win32/win_efile.c +++ b/erts/emulator/drivers/win32/win_efile.c @@ -127,6 +127,8 @@ static int errno_map(DWORD last_error) { return EBUSY; case ERROR_NO_PROC_SLOTS: return EAGAIN; + case ERROR_CANT_RESOLVE_FILENAME: + return EMLINK; case ERROR_ARENA_TRASHED: case ERROR_INVALID_BLOCK: case ERROR_BAD_ENVIRONMENT: @@ -1405,7 +1407,7 @@ efile_readlink(Efile_error* errInfo, char* name, char* buffer, size_t size) DWORD fileAttributes = GetFileAttributesW(wname); if ((fileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) { BOOLEAN success = 0; - HANDLE h = CreateFileW(wname, GENERIC_READ, 0,NULL, OPEN_EXISTING, 0, NULL); + HANDLE h = CreateFileW(wname, GENERIC_READ, 0,NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); int len; if(h != INVALID_HANDLE_VALUE) { success = pGetFinalPathNameByHandle(h, wbuffer, size,0); @@ -1421,7 +1423,7 @@ efile_readlink(Efile_error* errInfo, char* name, char* buffer, size_t size) if (*wbuffer == L'\\') *wbuffer = L'/'; CloseHandle(h); - } + } FreeLibrary(hModule); if (success) { return 1; |