From 01a2670b9cc6f00bdc81b990e0c75c2688fd54fd Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Wed, 30 Aug 2023 07:18:10 +0200 Subject: [PATCH] 1.11.0e --- CHANGELOG.md | 1 + Sandboxie/core/dll/file_link.c | 34 +++++++++++++++++++++++----------- SandboxiePlus/version.h | 2 +- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa3098b3..48472253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - fixed Side logo cut-off in all wizards [#3227](https://github.com/sandboxie-plus/Sandboxie/issues/3227) - fixed Text cut-off in box creation wizard [#3226](https://github.com/sandboxie-plus/Sandboxie/issues/3226) - fixed windows 7 compatybility issue with ImBox.exe +- fixed issue with UseNewSymlinkResolver=y diff --git a/Sandboxie/core/dll/file_link.c b/Sandboxie/core/dll/file_link.c index 3ee08922..3845ca03 100644 --- a/Sandboxie/core/dll/file_link.c +++ b/Sandboxie/core/dll/file_link.c @@ -824,6 +824,7 @@ _FX FILE_LINK *File_AddTempLink(WCHAR *path) WCHAR *newpath; BOOLEAN stop; BOOLEAN bPermLinkPath = FALSE; + WCHAR* CopyPath = NULL; // // try to open the path @@ -857,9 +858,6 @@ _FX FILE_LINK *File_AddTempLink(WCHAR *path) { THREAD_DATA* TlsData = Dll_GetTlsData(NULL); - WCHAR* CopyPath = NULL; - - Dll_PushTlsNameBuffer(TlsData); File_GetCopyPath(path, &CopyPath); @@ -881,8 +879,11 @@ _FX FILE_LINK *File_AddTempLink(WCHAR *path) NULL, 0); Dll_PopTlsNameBuffer(TlsData); + + if (!NT_SUCCESS(status)) + CopyPath = NULL; } - else + else // its already a copy path status = STATUS_BAD_INITIAL_PC; // @@ -918,16 +919,21 @@ _FX FILE_LINK *File_AddTempLink(WCHAR *path) REPARSE_DATA_BUFFER* reparseDataBuffer = Dll_AllocTemp(MAXIMUM_REPARSE_DATA_BUFFER_SIZE); status = pNtFsControlFile(handle, NULL, NULL, NULL, &IoStatusBlock, FSCTL_GET_REPARSE_POINT, NULL, 0, reparseDataBuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE); + newpath = NULL; + if (NT_SUCCESS(status)) { WCHAR* input_str = reparseDataBuffer->MountPointReparseBuffer.PathBuffer; if (_wcsnicmp(input_str, File_BQQB, 4) == 0) input_str = File_TranslateDosToNtPath(reparseDataBuffer->MountPointReparseBuffer.PathBuffer + 4); - newpath = File_TranslateTempLinks_2(input_str, wcslen(input_str)); + if (input_str) { - if (input_str != reparseDataBuffer->MountPointReparseBuffer.PathBuffer) - Dll_Free(input_str); + newpath = File_TranslateTempLinks_2(input_str, wcslen(input_str)); + + if (input_str != reparseDataBuffer->MountPointReparseBuffer.PathBuffer) + Dll_Free(input_str); + } /*THREAD_DATA* TlsData = Dll_GetTlsData(NULL); @@ -943,10 +949,16 @@ _FX FILE_LINK *File_AddTempLink(WCHAR *path) Dll_PopTlsNameBuffer(TlsData);*/ } - else //if (status == STATUS_NOT_A_REPARSE_POINT) - { - newpath = Dll_AllocTemp((wcslen(path) + 1) * sizeof(WCHAR)); - wcscpy(newpath, path); + //else if (status == STATUS_NOT_A_REPARSE_POINT) + + if (!newpath) { + + if (CopyPath) { + newpath = Dll_AllocTemp((wcslen(path) + 1) * sizeof(WCHAR)); + wcscpy(newpath, path); + } else + UserReparse = FALSE; + status = STATUS_SUCCESS; } diff --git a/SandboxiePlus/version.h b/SandboxiePlus/version.h index d370baf6..1d122776 100644 --- a/SandboxiePlus/version.h +++ b/SandboxiePlus/version.h @@ -3,7 +3,7 @@ #define VERSION_MJR 1 #define VERSION_MIN 11 #define VERSION_REV 0 -#define VERSION_UPD 4 +#define VERSION_UPD 5 #ifndef STR #define STR2(X) #X