Skip to content

Commit

Permalink
1.12.4
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidXanatos committed Dec 13, 2023
1 parent 37d6ca6 commit 490d6fa
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- fixed running sandboxed processes located in a imdisk volume [#3472](https://github.com/sandboxie-plus/Sandboxie/discussions/3472)
- fixed sample 634d066fd4f9a8b201a3ddf346e880be unable to be terminate on windows 7 x64 [#3482](https://github.com/sandboxie-plus/Sandboxie/issues/3482)
- fixed UseNewSymlinkResolver causes applications to create both the link and the target folder [#3481](https://github.com/sandboxie-plus/Sandboxie/issues/3481)

### Changed
- without an active, non expired, supporter certificate, automatic updates/downloads are not longer available for the stable channel
Expand Down
54 changes: 38 additions & 16 deletions Sandboxie/core/dll/file_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -991,22 +991,44 @@ _FX FILE_LINK *File_AddTempLink(WCHAR *path)

if (NT_SUCCESS(status)) {

WCHAR* input_str = reparseDataBuffer->MountPointReparseBuffer.PathBuffer;
if (_wcsnicmp(input_str, L"\\??\\Volume{", 11) == 0)
input_str = File_TranslateGuidToNtPath(reparseDataBuffer->MountPointReparseBuffer.PathBuffer);
else if (_wcsnicmp(input_str, File_BQQB, 4) == 0)
input_str = File_TranslateDosToNtPath(reparseDataBuffer->MountPointReparseBuffer.PathBuffer + 4);

if (input_str) {

ULONG input_len = wcslen(input_str);
while (input_len > 0 && input_str[input_len - 1] == L'\\')
input_len -= 1; // remove tailing back slash

newpath = File_TranslateTempLinks_2(input_str, input_len);

if (input_str != reparseDataBuffer->MountPointReparseBuffer.PathBuffer)
Dll_Free(input_str);
USHORT SubstituteNameLength = 0;
WCHAR* SubstituteNameBuffer = NULL;
//USHORT PrintNameLength = 0;
//WCHAR* PrintNameBuffer = NULL;
BOOL RelativePath = FALSE;

if (reparseDataBuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK)
{
SubstituteNameLength = reparseDataBuffer->SymbolicLinkReparseBuffer.SubstituteNameLength;
SubstituteNameBuffer = &reparseDataBuffer->SymbolicLinkReparseBuffer.PathBuffer[reparseDataBuffer->SymbolicLinkReparseBuffer.SubstituteNameOffset/sizeof(WCHAR)];
if (reparseDataBuffer->SymbolicLinkReparseBuffer.Flags & SYMLINK_FLAG_RELATIVE)
RelativePath = TRUE;
}
else if (reparseDataBuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT)
{
SubstituteNameLength = reparseDataBuffer->MountPointReparseBuffer.SubstituteNameLength;
SubstituteNameBuffer = &reparseDataBuffer->MountPointReparseBuffer.PathBuffer[reparseDataBuffer->MountPointReparseBuffer.SubstituteNameOffset/sizeof(WCHAR)];
}

if (SubstituteNameBuffer && !RelativePath) // todo RelativePath - for now we fall back to UserReparse = FALSE;
{
WCHAR* input_str = SubstituteNameBuffer;
if (_wcsnicmp(input_str, L"\\??\\Volume{", 11) == 0)
input_str = File_TranslateGuidToNtPath(SubstituteNameBuffer);
else if (_wcsnicmp(input_str, File_BQQB, 4) == 0)
input_str = File_TranslateDosToNtPath(SubstituteNameBuffer + 4);

if (input_str) {

ULONG input_len = wcslen(input_str);
while (input_len > 0 && input_str[input_len - 1] == L'\\')
input_len -= 1; // remove tailing back slash

newpath = File_TranslateTempLinks_2(input_str, input_len);

if (input_str != SubstituteNameBuffer)
Dll_Free(input_str);
}
}

/*THREAD_DATA* TlsData = Dll_GetTlsData(NULL);
Expand Down

0 comments on commit 490d6fa

Please sign in to comment.