diff --git a/interfaces/innerkits/init_module_engine/BUILD.gn b/interfaces/innerkits/init_module_engine/BUILD.gn old mode 100755 new mode 100644 index 320d0d6fba88fafae0094d1d48eced99597bc31b..f8da78de4781bb5c88390684cd845fb783da7ed6 --- a/interfaces/innerkits/init_module_engine/BUILD.gn +++ b/interfaces/innerkits/init_module_engine/BUILD.gn @@ -57,6 +57,10 @@ if (defined(ohos_lite)) { stub_description_file = "./stub/libinit.stub.empty.json" part_name = "init" install_enable = true + install_images = [ + "system", + "updater", + ] symlink_target_name = [ "libinit_module_engine.so" ] } diff --git a/interfaces/innerkits/modulemgr/modulemgr.c b/interfaces/innerkits/modulemgr/modulemgr.c index b505d7ea112b7045e3d177583a1605a8eb9dc747..116b395fa138e4a08e8951a62f2f54d7adc50404 100644 --- a/interfaces/innerkits/modulemgr/modulemgr.c +++ b/interfaces/innerkits/modulemgr/modulemgr.c @@ -13,14 +13,15 @@ * limitations under the License. */ +#include #include #include #include #include -#include #include #include "beget_ext.h" +#include "init_utils.h" #include "list.h" #include "securec.h" #include "modulemgr.h" @@ -107,8 +108,9 @@ static void *moduleInstall(MODULE_ITEM *module, int argc, const char *argv[]) return NULL; } } else { - if (snprintf_s(path, sizeof(path), sizeof(path) - 1, "/system/" MODULE_LIB_NAME "/%s/lib%s" MODULE_SUFFIX_D, - module->moduleMgr->name, module->name) < 0) { + const char *fmt = (InUpdaterMode() == 0) ? "/system/" MODULE_LIB_NAME : "/" MODULE_LIB_NAME; + if (snprintf_s(path, sizeof(path), sizeof(path) - 1, + "%s/%s/lib%s" MODULE_SUFFIX_D, fmt, module->moduleMgr->name, module->name) < 0) { return NULL; } } @@ -225,8 +227,9 @@ MODULE_MGR *ModuleMgrScan(const char *modulePath) if (modulePath[0] == '/') { BEGET_CHECK(!(snprintf_s(path, sizeof(path), sizeof(path) - 1, "%s", modulePath) < 0), return NULL); } else { + const char *fmt = (InUpdaterMode() == 0) ? "/system/" MODULE_LIB_NAME : "/" MODULE_LIB_NAME; BEGET_CHECK(!(snprintf_s(path, sizeof(path), sizeof(path) - 1, - "/system/" MODULE_LIB_NAME "/%s", modulePath) < 0), return NULL); + "%s/%s", fmt, modulePath) < 0), return NULL); } scanModules(moduleMgr, path); diff --git a/services/param/base/param_comm.c b/services/param/base/param_comm.c index e3e2bf530980555af8d2b1a4b2f087b2b9bb0027..0675447fa48bbba0ca6fd13cd4cdb0febc5aa5d3 100644 --- a/services/param/base/param_comm.c +++ b/services/param/base/param_comm.c @@ -392,6 +392,13 @@ INIT_LOCAL_API ParamSecurityLabel *GetParamSecurityLabel() { ParamWorkSpace *paramSpace = GetParamWorkSpace(); PARAM_CHECK(paramSpace != NULL, return NULL, "Invalid paramSpace"); +#if !(defined __LITEOS_A__ || defined __LITEOS_M__) +#ifndef STARTUP_INIT_TEST + paramSpace->securityLabel.cred.pid = getpid(); + paramSpace->securityLabel.cred.uid = geteuid(); + paramSpace->securityLabel.cred.gid = getegid(); +#endif +#endif return ¶mSpace->securityLabel; }