Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00

winws2: fix sandbox reinit error

This commit is contained in:
bol-van
2025-11-24 18:32:08 +03:00
parent 14503e0a57
commit 38454aabfa
2 changed files with 4 additions and 5 deletions

View File

@@ -733,13 +733,12 @@ static bool prepare_low_appdata()
static bool b_isandbox_set = false;
bool win_sandbox(void)
{
if (!RemoveTokenPrivs())
return FALSE;
// there's no way to return privs
if (!b_isandbox_set)
{
if (!RemoveTokenPrivs())
return FALSE;
// set low mandatory label on windivert device to allow administrators with low label access the driver
if (logical_net_filter_present() && !SetMandatoryLabelFile("\\\\.\\" WINDIVERT_DEVICE_NAME, SECURITY_MANDATORY_LOW_RID, 0))
return FALSE;