#include "common/certificate_validation.h"
#include "common/utils/file_util.h"
-namespace bf = boost::filesystem;
+namespace fs = std::filesystem;
namespace ci = common_installer;
namespace {
LOG(ERROR) << "unpacked_dir_path attribute is empty";
return Step::Status::INVALID_VALUE;
}
- if (!boost::filesystem::exists(context_->unpacked_dir_path.get())) {
+ if (!std::filesystem::exists(context_->unpacked_dir_path.get())) {
LOG(ERROR) << "unpacked_dir_path ("
<< context_->unpacked_dir_path.get()
<< ") path does not exist";
return Step::Status::OK;
}
-boost::filesystem::path StepSignature::GetSignatureRoot() const {
+std::filesystem::path StepSignature::GetSignatureRoot() const {
return context_->unpacked_dir_path.get();
}
context_->manifest_data.get()->privileges, &error_message)) {
if (!error_message.empty()) {
LOG(ERROR) << "error_message: " << error_message;
- on_error(Status::SIGNATURE_ERROR, error_message);
+ on_error_->on_error(Status::SIGNATURE_ERROR, error_message);
}
return Status::SIGNATURE_ERROR;
}
std::string error_message;
if (!signature_->GetPrivilegeLevel(GetSignatureRoot(),
&level, &error_message)) {
- on_error(Status::CERT_ERROR, error_message);
+ on_error_->on_error(Status::CERT_ERROR, error_message);
return Status::CERT_ERROR;
}
if (level == PrivilegeLevel::UNTRUSTED) {
error_message = "Unsigned applications can not be installed";
- on_error(Status::SIGNATURE_ERROR, error_message);
+ on_error_->on_error(Status::SIGNATURE_ERROR, error_message);
return Status::SIGNATURE_ERROR;
}
&error_message)) {
if (!error_message.empty()) {
LOG(ERROR) << "error_message: " << error_message;
- on_error(Status::SIGNATURE_ERROR, error_message);
+ on_error_->on_error(Status::SIGNATURE_ERROR, error_message);
}
return Status::SIGNATURE_ERROR;
}
if (signature_ == nullptr)
return Step::Status::OK;
- bf::remove(signature_->GetFilePath());
- if (bf::exists(signature_->GetBackupPath()))
- bf::rename(signature_->GetBackupPath(), signature_->GetFilePath());
+ fs::remove(signature_->GetFilePath());
+ if (fs::exists(signature_->GetBackupPath()))
+ fs::rename(signature_->GetBackupPath(), signature_->GetFilePath());
return Step::Status::OK;
}