提交 bd3f958e 编写于 作者: M Mupceet

fix:xts bug

Signed-off-by: NMupceet <laiguizhong@huawei.com>
上级 45ffcdff
......@@ -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;
}
......
......@@ -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());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册