mirror of
https://gitee.com/openharmony/filemanagement_storage_service
synced 2024-11-23 06:59:59 +00:00
!1537 单框架适应双框架安全加固加log
Merge pull request !1537 from zhaoshuyuan/master
This commit is contained in:
commit
4d4f876d04
@ -696,7 +696,7 @@ bool BaseKey::DoRestoreKey(const UserAuth &auth, const std::string &path)
|
||||
std::string need_restore;
|
||||
LoadStringFromFile(path + SUFFIX_NEED_RESTORE, need_restore);
|
||||
uint32_t restore_version = std::atoi(need_restore.c_str());
|
||||
UpdateVersion update_version = static_cast<UpdateVersion>(std::atoi(need_restore.c_str()) + 1);
|
||||
UpdateVersion update_version = static_cast<UpdateVersion>(std::atoi(need_restore.c_str()));
|
||||
LOGI("NeedRestore Path is: %{public}s, restore_version: %{public}u", path.c_str(), restore_version);
|
||||
if (std::filesystem::exists(path + SUFFIX_NEED_RESTORE, errCode)) {
|
||||
if (restore_version < 3) {
|
||||
|
@ -254,11 +254,13 @@ int32_t StorageDaemon::RestoreOneUserKey(int32_t userId, KeyType type)
|
||||
|
||||
std::string elNeedRestorePath = GetNeedRestoreFilePathByType(userId, type);
|
||||
if (elNeedRestorePath.empty()) {
|
||||
LOGI("elNeedRestorePath is empty, type = %{public}d", type);
|
||||
return E_KEY_TYPE_INVAL;
|
||||
}
|
||||
|
||||
std::error_code errCode;
|
||||
if (!std::filesystem::exists(elNeedRestorePath, errCode)) {
|
||||
LOGI("elNeedRestorePath not exist, type = %{public}d", type);
|
||||
return E_OK;
|
||||
}
|
||||
std::string SINGLE_RESTORE_VERSION;
|
||||
|
Loading…
Reference in New Issue
Block a user