Signed-off-by: huangshiwei <huangshiwei4@huawei.com>
This commit is contained in:
huangshiwei
2024-05-25 15:25:10 +08:00
parent 09ca18bd7c
commit 1fa1fee2a7
3 changed files with 17 additions and 2 deletions
@@ -10529,6 +10529,9 @@ bool AbilityManagerService::ParseJsonFromBoot(nlohmann::json jsonObj, const std:
}
}
}
if (!jsonObj.contains("exposed_white_list")) {
return false;
}
nlohmann::json exportWhiteJsonList = jsonObj["exposed_white_list"];
for (const auto& it : exportWhiteJsonList) {
if (it.is_string()) {
@@ -262,10 +262,16 @@ bool DeepLinkReserveConfig::ReadFileInfoJson(const std::string &filePath, nlohma
return false;
}
char path[PATH_MAX] = {0};
if (realpath(filePath.c_str(), path) == nullptr) {
TAG_LOGE(AAFwkTag::ABILITYMGR, "realpath error, errno is %{public}d.", errno);
return false;
}
std::fstream in;
char errBuf[256];
errBuf[0] = '\0';
in.open(filePath, std::ios_base::in);
in.open(path, std::ios_base::in);
if (!in.is_open()) {
strerror_r(errno, errBuf, sizeof(errBuf));
TAG_LOGE(AAFwkTag::ABILITYMGR, "the file cannot be open due to %{public}s", errBuf);
+7 -1
View File
@@ -156,7 +156,13 @@ bool ParserUtil::ReadFileIntoJson(const std::string &filePath, nlohmann::json &j
return false;
}
std::ifstream fin(filePath);
char path[PATH_MAX] = {0};
if (realpath(filePath.c_str(), path) == nullptr) {
TAG_LOGE(AAFwkTag::ABILITYMGR, "realpath error, errno is %{public}d.", errno);
return false;
}
std::ifstream fin(path);
if (!fin.is_open()) {
TAG_LOGE(AAFwkTag::ABILITYMGR, "File path exception.");
return false;