fix: 修改SetAppSandboxProperty函数

Signed-off-by: 樊景乐 <fanjingle@h-partners.com>
This commit is contained in:
樊景乐 2024-10-16 15:36:53 +08:00
parent 2b24574f32
commit 6eb07aa48c
2 changed files with 2 additions and 2 deletions

View File

@ -198,7 +198,7 @@ static int InitSandboxContext(SandboxContext *context,
context->message = property->message;
context->sandboxNsFlags = CLONE_NEWNS;
if (CheckSpawningMsgFlagSet(context, APP_FLAGS_ISOLATED_SANDBOX) ||
if ((CheckSpawningMsgFlagSet(context, APP_FLAGS_ISOLATED_SANDBOX) && !IsDeveloperModeOpen()) ||
CheckSpawningMsgFlagSet(context, APP_FLAGS_ISOLATED_NETWORK)) {
context->sandboxNsFlags |= sandbox->sandboxNsFlags & CLONE_NEWNET ? CLONE_NEWNET : 0;
}

View File

@ -1756,7 +1756,7 @@ int32_t SetAppSandboxProperty(AppSpawnMgr *content, AppSpawningCtx *property)
}
}
uint32_t sandboxNsFlags = CLONE_NEWNS;
if (CheckAppMsgFlagsSet(property, APP_FLAGS_ISOLATED_SANDBOX) ||
if ((CheckAppMsgFlagsSet(property, APP_FLAGS_ISOLATED_SANDBOX) && !IsDeveloperModeOpen()) ||
CheckAppMsgFlagsSet(property, APP_FLAGS_ISOLATED_NETWORK)) {
sandboxNsFlags |= content->content.sandboxNsFlags & CLONE_NEWNET ? CLONE_NEWNET : 0;
}