!1576 修改appspawn 代码,解决debug 无法打印日志问题

Merge pull request !1576 from 樊景乐/master
This commit is contained in:
openharmony_ci 2024-10-22 03:20:42 +00:00 committed by Gitee
commit 6847e85e8c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 2 deletions

View File

@ -208,7 +208,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

@ -1785,7 +1785,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;
}