mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1219369: In Windows debug builds allow write access to TEMP for logging purposes. r=tabraldes
This commit is contained in:
parent
56265354f6
commit
9482163d8e
@ -53,6 +53,21 @@ SandboxBroker::LaunchApp(const wchar_t *aPath,
|
||||
mozilla::sandboxing::ApplyLoggingPolicy(*mPolicy);
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
// Allow write access to TEMP directory in debug builds for logging purposes.
|
||||
// The path from GetTempPathW can have a length up to MAX_PATH + 1, including
|
||||
// the null, so we need MAX_PATH + 2, so we can add an * to the end.
|
||||
wchar_t tempPath[MAX_PATH + 2];
|
||||
uint32_t pathLen = ::GetTempPathW(MAX_PATH + 1, tempPath);
|
||||
if (pathLen > 0) {
|
||||
// GetTempPath path ends with \ and returns the length without the null.
|
||||
tempPath[pathLen] = L'*';
|
||||
tempPath[pathLen + 1] = L'\0';
|
||||
mPolicy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
|
||||
sandbox::TargetPolicy::FILES_ALLOW_ANY, tempPath);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Ceate the sandboxed process
|
||||
PROCESS_INFORMATION targetInfo = {0};
|
||||
sandbox::ResultCode result;
|
||||
|
Loading…
Reference in New Issue
Block a user