mirror of
https://gitee.com/openharmony/startup_appspawn
synced 2024-11-26 16:51:08 +00:00
codecheck修复+挂载修复
Signed-off-by: 王达 <wangda20@huawei.com>
This commit is contained in:
parent
d4c348f19a
commit
516db4b345
@ -3,6 +3,7 @@
|
||||
"top-sandbox-switch": "ON",
|
||||
"app-base": [{
|
||||
"sandbox-ns-flags" : [ "net" ],
|
||||
"sandbox-root" : "/mnt/sandbox/<PackageName>",
|
||||
"mount-paths" : [{
|
||||
"src-path" : "/dev",
|
||||
"sandbox-path" : "/dev",
|
||||
@ -94,8 +95,8 @@
|
||||
"sandbox-flags" : [ "bind", "rec" ],
|
||||
"check-action-status": "false"
|
||||
}, {
|
||||
"src-path" : "/data/app/el1/bundle/public/",
|
||||
"sandbox-path" : "/data/app/el1/bundle/public/",
|
||||
"src-path" : "/data/app/el1/bundle/public/<PackageName>",
|
||||
"sandbox-path" : "/data/storage/el1/bundle",
|
||||
"sandbox-flags" : [ "bind", "rec" ],
|
||||
"check-action-status": "false"
|
||||
}],
|
||||
@ -117,6 +118,12 @@
|
||||
"check-action-status": "false"
|
||||
}]
|
||||
|
||||
}],
|
||||
"app-resources" : [{
|
||||
"sandbox-root" : "/mnt/sandbox/<PackageName>",
|
||||
"mount-paths" : [],
|
||||
"flag-point" : [],
|
||||
"symbol-links" : []
|
||||
}]
|
||||
}]
|
||||
}
|
||||
|
@ -488,11 +488,8 @@ string SandboxUtils::ConvertToRealPath(const AppSpawningCtx *appProperty, std::s
|
||||
path = replace_all(path, g_packageNameIndex, bundleNameWithIndex);
|
||||
}
|
||||
|
||||
const std::string bundleName = CheckAppMsgFlagsSet(appProperty, APP_FLAGS_ISOLATED_SANDBOX_TYPE) ? "isolated/"
|
||||
: "" + std::string(info->bundleName);
|
||||
|
||||
if (path.find(g_packageName) != std::string::npos) {
|
||||
path = replace_all(path, g_packageName, bundleName.c_str());
|
||||
path = replace_all(path, g_packageName, info->bundleName);
|
||||
}
|
||||
|
||||
if (path.find(g_userId) != std::string::npos) {
|
||||
|
@ -991,10 +991,10 @@ APPSPAWN_STATIC void AppSpawnArgSet(RunMode mode, AppSpawnStartArg *arg)
|
||||
return;
|
||||
}
|
||||
|
||||
APPSPAWN_STATIC void AppSpawnStartServiceEnd(pid_t nwebSpawnPid, pid_t NativeSpawnPid)
|
||||
APPSPAWN_STATIC void AppSpawnStartServiceEnd(pid_t nwebSpawnPid, pid_t nativeSpawnPid)
|
||||
{
|
||||
AddSpawnedProcess(nwebSpawnPid, NWEBSPAWN_SERVER_NAME);
|
||||
AddSpawnedProcess(NativeSpawnPid, NATIVESPAWN_SERVER_NAME);
|
||||
AddSpawnedProcess(nativeSpawnPid, NATIVESPAWN_SERVER_NAME);
|
||||
SetParameter("bootevent.appspawn.started", "true");
|
||||
}
|
||||
|
||||
@ -1002,7 +1002,7 @@ AppSpawnContent *StartSpawnService(const AppSpawnStartArg *startArg, uint32_t ar
|
||||
{
|
||||
APPSPAWN_CHECK(startArg != NULL && argv != NULL, return NULL, "Invalid start arg");
|
||||
pid_t pid = 0;
|
||||
pid_t NativeSpawnPid = 0;
|
||||
pid_t nativeSpawnPid = 0;
|
||||
AppSpawnStartArg *arg = (AppSpawnStartArg *)startArg;
|
||||
APPSPAWN_LOGV("Start appspawn argvSize %{public}d mode %{public}d service %{public}s",
|
||||
argvSize, arg->mode, arg->serviceName);
|
||||
@ -1011,8 +1011,8 @@ AppSpawnContent *StartSpawnService(const AppSpawnStartArg *startArg, uint32_t ar
|
||||
if (pid == 0) {
|
||||
AppSpawnArgSet(MODE_FOR_NWEB_SPAWN, arg);
|
||||
} else {
|
||||
NativeSpawnPid = NativeSpawnLaunch();
|
||||
if (NativeSpawnPid == 0) {
|
||||
nativeSpawnPid = NativeSpawnLaunch();
|
||||
if (nativeSpawnPid == 0) {
|
||||
AppSpawnArgSet(MODE_FOR_NATIVE_SPAWN, arg);
|
||||
}
|
||||
}
|
||||
@ -1046,7 +1046,7 @@ AppSpawnContent *StartSpawnService(const AppSpawnStartArg *startArg, uint32_t ar
|
||||
#endif
|
||||
AddAppSpawnHook(STAGE_CHILD_PRE_RUN, HOOK_PRIO_LOWEST, AppSpawnClearEnv);
|
||||
if (arg->mode == MODE_FOR_APP_SPAWN) {
|
||||
AppSpawnStartServiceEnd(pid, NativeSpawnPid);
|
||||
AppSpawnStartServiceEnd(pid, nativeSpawnPid);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ int AppSpawnTestCommander::ProcessArgs(int argc, char *const argv[])
|
||||
if (strcmp(argv[i], "nwebspawn") == 0) {
|
||||
appSpawn_ = 0;
|
||||
} else if (strcmp(argv[i], "nativespawn") == 0) {
|
||||
appSpawn_ = 2;
|
||||
appSpawn_ = 2; // 2 is nwebspawn
|
||||
} else {
|
||||
appSpawn_ = 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user