Skip to content

Commit

Permalink
1.11.0e
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidXanatos committed Aug 30, 2023
1 parent ba3ac77 commit 01a2670
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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



Expand Down
34 changes: 23 additions & 11 deletions Sandboxie/core/dll/file_link.c
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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;

//
Expand Down Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion SandboxiePlus/version.h
Expand Up @@ -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
Expand Down

0 comments on commit 01a2670

Please sign in to comment.