This commit is contained in:
parent
50331bc7d8
commit
5b2cf70e4f
|
@ -17,6 +17,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
### Changed
|
||||
- changed DynData format to add flags
|
||||
- Revert or provide a way to opt out of the new sandbox directory structure for volumes without drive letters [#3632](https://github.com/sandboxie-plus/Sandboxie/issues/3632)
|
||||
- guid usage can be re-enabled with "UseVolumeGuidWhenNoLetter=y"
|
||||
|
||||
### Removed
|
||||
- removed UseNewSymlinkResolver setting new mechanism is always used
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -363,9 +363,9 @@ static WCHAR *File_PublicUser = NULL;
|
|||
static ULONG File_PublicUserLen = 0;
|
||||
|
||||
static BOOLEAN File_DriveAddSN = FALSE;
|
||||
static BOOLEAN File_UseVolumeGuid = FALSE;
|
||||
|
||||
BOOLEAN File_Delete_v2 = FALSE;
|
||||
static BOOLEAN File_NoReparse = FALSE;
|
||||
|
||||
static WCHAR *File_AltBoxPath = NULL;
|
||||
static ULONG File_AltBoxPathLen = 0;
|
||||
|
@ -572,13 +572,13 @@ _FX NTSTATUS File_GetCopyPathImpl(WCHAR* TruePath, WCHAR **OutCopyPath, ULONG *O
|
|||
|
||||
ULONG drive_len;
|
||||
|
||||
guid = NULL;
|
||||
drive = File_GetDriveForPath(TruePath, length);
|
||||
if (drive)
|
||||
drive_len = drive->len;
|
||||
else
|
||||
drive = File_GetDriveForUncPath(TruePath, length, &drive_len);
|
||||
|
||||
if (!drive)
|
||||
if (!drive && File_UseVolumeGuid)
|
||||
guid = File_GetGuidForPath(TruePath, length);
|
||||
|
||||
if (drive || guid) {
|
||||
|
@ -763,9 +763,8 @@ check_sandbox_prefix:
|
|||
|
||||
drive = NULL;
|
||||
guid = NULL;
|
||||
|
||||
if (name[_DriveLen - 1] == L'\\') {
|
||||
if (name[_DriveLen] == L'{')
|
||||
if (name[_DriveLen] == L'{' && File_UseVolumeGuid)
|
||||
guid = File_GetLinkForGuid(&name[_DriveLen]);
|
||||
else
|
||||
drive = File_GetDriveForLetter(name[_DriveLen]);
|
||||
|
@ -1131,8 +1130,10 @@ _FX NTSTATUS File_GetName(
|
|||
// the next section of code from trying to translate symlinks
|
||||
//
|
||||
|
||||
drive = File_GetDriveForPath(objname_buf, objname_len / sizeof(WCHAR));
|
||||
if(!drive)
|
||||
guid = NULL;
|
||||
drive = File_GetDriveForPath(
|
||||
objname_buf, objname_len / sizeof(WCHAR));
|
||||
if(!drive && File_UseVolumeGuid)
|
||||
guid = File_GetGuidForPath(objname_buf, objname_len / sizeof(WCHAR));
|
||||
|
||||
if (drive || guid) {
|
||||
|
|
|
@ -144,7 +144,7 @@ _FX BOOLEAN File_Init(void)
|
|||
|
||||
File_DriveAddSN = SbieApi_QueryConfBool(NULL, L"UseVolumeSerialNumbers", FALSE);
|
||||
|
||||
File_NoReparse = SbieApi_QueryConfBool(NULL, L"NoPathReparse", FALSE);
|
||||
File_UseVolumeGuid = SbieApi_QueryConfBool(NULL, L"UseVolumeGuidWhenNoLetter", FALSE);
|
||||
|
||||
if (! File_InitDrives(0xFFFFFFFF))
|
||||
return FALSE;
|
||||
|
@ -872,6 +872,25 @@ _FX void File_InitLinks(THREAD_DATA *TlsData)
|
|||
// the device name
|
||||
//
|
||||
|
||||
DosPath += DosPathLen + 1;
|
||||
while (*DosPath) {
|
||||
File_AddLink(TRUE, DosPath, DeviceName);
|
||||
DosPath += wcslen(DosPath) + 1;
|
||||
}
|
||||
|
||||
} else if (File_UseVolumeGuid) {
|
||||
|
||||
// handle the case where the volume is not mounted as a
|
||||
// drive letter:
|
||||
// add reparse points for all mounted directories
|
||||
|
||||
//
|
||||
// This behavioure creates \[BoxRoot]\drive\{guid} fodlers
|
||||
// instead of using the first mount point on a volume with a letter
|
||||
//
|
||||
|
||||
WCHAR *FirstDosPath = DosPath;
|
||||
File_AddLink(TRUE, FirstDosPath, DeviceName);
|
||||
DosPath += DosPathLen + 1;
|
||||
while (*DosPath) {
|
||||
File_AddLink(TRUE, DosPath, DeviceName);
|
||||
|
@ -889,11 +908,17 @@ _FX void File_InitLinks(THREAD_DATA *TlsData)
|
|||
// also to the first mounted directory
|
||||
//
|
||||
|
||||
//
|
||||
// Note: this behavioure makes the first mounted directory
|
||||
// the location in the box where all files for that volume will be located
|
||||
// other mount points will be redirected to this folder
|
||||
//
|
||||
|
||||
WCHAR *FirstDosPath = DosPath;
|
||||
File_AddLink(TRUE, FirstDosPath, DeviceName);
|
||||
File_AddLink(TRUE, DeviceName, FirstDosPath);
|
||||
DosPath += DosPathLen + 1;
|
||||
while (*DosPath) {
|
||||
File_AddLink(TRUE, DosPath, DeviceName);
|
||||
File_AddLink(TRUE, DosPath, FirstDosPath);
|
||||
DosPath += wcslen(DosPath) + 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -604,9 +604,6 @@ _FX WCHAR *File_TranslateTempLinks(
|
|||
WCHAR *ret;
|
||||
ULONG TruePath_len, ret_len;
|
||||
|
||||
if (File_NoReparse)
|
||||
return NULL;
|
||||
|
||||
//
|
||||
// entry
|
||||
//
|
||||
|
@ -1023,10 +1020,6 @@ _FX FILE_LINK *File_AddTempLink(WCHAR *path)
|
|||
stop = TRUE;
|
||||
newpath = NULL;
|
||||
|
||||
BOOLEAN UserReparse = SbieApi_QueryConfBool(NULL, L"UseNewSymlinkResolver", TRUE);
|
||||
|
||||
if (UserReparse) {
|
||||
|
||||
status = File_OpenForAddTempLink(&handle, path, FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT);
|
||||
|
||||
if (NT_SUCCESS(status)) {
|
||||
|
@ -1088,7 +1081,6 @@ _FX FILE_LINK *File_AddTempLink(WCHAR *path)
|
|||
|
||||
pNtClose(handle);
|
||||
}
|
||||
}
|
||||
|
||||
const ULONG PATH_BUF_LEN = 1024;
|
||||
|
||||
|
|
Loading…
Reference in New Issue