From bd3f958e3060f0425fa439a2fc0f998f67c8fdad Mon Sep 17 00:00:00 2001 From: Mupceet Date: Thu, 12 May 2022 21:30:09 +0800 Subject: [PATCH] fix:xts bug Signed-off-by: Mupceet --- interfaces/innerkits/syspara/param_wrapper.cpp | 6 +++--- services/param/adapter/param_selinux.c | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/interfaces/innerkits/syspara/param_wrapper.cpp b/interfaces/innerkits/syspara/param_wrapper.cpp index e9bca61a..214387cd 100755 --- a/interfaces/innerkits/syspara/param_wrapper.cpp +++ b/interfaces/innerkits/syspara/param_wrapper.cpp @@ -67,7 +67,7 @@ std::string GetParameter(const std::string& key, const std::string& def) uint32_t size = 0; int ret = SystemReadParam(key.c_str(), NULL, &size); if (ret != 0) { - if (IsValidValue(def.c_str(), def.size()) == 1) { + if (IsValidValue(def.c_str(), MAX_VALUE_LEN) == 1) { return std::string(def); } return ""; @@ -77,7 +77,7 @@ std::string GetParameter(const std::string& key, const std::string& def) if (ret == 0) { return std::string(value.data()); } - if (IsValidValue(def.c_str(), def.size()) == 1) { + if (IsValidValue(def.c_str(), MAX_VALUE_LEN) == 1) { return std::string(def); } return ""; @@ -113,7 +113,7 @@ int GetStringParameter(const std::string key, std::string &value, const std::str return EC_SUCCESS; } } - if (IsValidValue(def.c_str(), def.size()) == 1) { + if (IsValidValue(def.c_str(), MAX_VALUE_LEN) == 1) { value = std::string(def); return EC_SUCCESS; } diff --git a/services/param/adapter/param_selinux.c b/services/param/adapter/param_selinux.c index 3ffc2386..9ef455ca 100644 --- a/services/param/adapter/param_selinux.c +++ b/services/param/adapter/param_selinux.c @@ -26,10 +26,8 @@ #ifdef __aarch64__ #define CHECKER_LIB_NAME "/system/lib64/libparaperm_checker.z.so" -#define CHECKER_UPDATER_LIB_NAME "/lib64/libparaperm_checker.z.so" #else #define CHECKER_LIB_NAME "/system/lib/libparaperm_checker.z.so" -#define CHECKER_UPDATER_LIB_NAME "/lib/libparaperm_checker.z.so" #endif static SelinuxSpace g_selinuxSpace = {0}; @@ -43,8 +41,7 @@ static int InitLocalSecurityLabel(ParamSecurityLabel *security, int isInit) security->flags[PARAM_SECURITY_SELINUX] = 0; #if !(defined STARTUP_INIT_TEST || defined LOCAL_TEST) if (g_selinuxSpace.selinuxHandle == NULL) { - const char *libname = (InUpdaterMode() == 1) ? CHECKER_UPDATER_LIB_NAME : CHECKER_LIB_NAME; - g_selinuxSpace.selinuxHandle = dlopen(libname, RTLD_LAZY); + g_selinuxSpace.selinuxHandle = dlopen(CHECKER_LIB_NAME, RTLD_LAZY); PARAM_CHECK(g_selinuxSpace.selinuxHandle != NULL, return -1, "Failed to dlsym selinuxHandle, %s", dlerror()); } -- GitLab