pi_.reset(new PkgmgrSignal(pkgmgr.get()->GetRawPi(),
pkgmgr->GetRequestType()));
- // TODO(p.sikorski) below property is only used in AppInstaller.
- // maybe it should then be kept in AppInstaller
context_->pkg_type.set(package_type);
context_->installation_mode.set(pkgmgr->GetInstallationMode());
}
return PMINFO_R_OK;
}
-bool AssignPackageTags(const std::string& pkgid, manifest_x* manifest,
+bool AssignPackageTags(manifest_x* manifest,
common_installer::RequestMode request_mode,
bool is_update) {
// this flag is actually set by preloaded app update to "true" but it is never
if (!tep_path.empty())
manifest->tep_name = strdup(tep_path.c_str());
- if (!AssignPackageTags(pkgid, manifest, request_mode, false))
+ if (!AssignPackageTags(manifest, request_mode, false))
return false;
int ret = request_mode != RequestMode::GLOBAL ?
const CertificateInfo& cert_info,
uid_t uid,
RequestMode request_mode) {
- if (!AssignPackageTags(pkgid, manifest, request_mode, true))
+ if (!AssignPackageTags(manifest, request_mode, true))
return false;
int ret = request_mode != RequestMode::GLOBAL ?
*error_message += ":<" + errnum + ">";
switch (result) {
- case ValidationCore::E_SIG_REVOKED: {
+ case ValidationCore::E_SIG_REVOKED:
LOG(ERROR) << "Certificate is revoked";
return common_installer::Step::Status::SIGNATURE_INVALID;
- };
- case ValidationCore::E_SIG_DISREGARDED: {
+ case ValidationCore::E_SIG_DISREGARDED:
if (data.isAuthorSignature()) {
LOG(ERROR) << "Author-signiture is disregarded";
return common_installer::Step::Status::SIGNATURE_INVALID;
}
LOG(WARNING) << "Signature disregarded: " << path;
break;
- };
- case ValidationCore::E_SIG_NONE: {
+ case ValidationCore::E_SIG_NONE:
if (!data.isAuthorSignature()) {
// First distributor signature sets the privilege level
// (wrt spec. 0620.)
cert_info->author_certificate.set(data.getEndEntityCertificatePtr());
}
break;
- };
- default: {
+ default:
LOG(ERROR) << "signature validation check failed : "
<< validator.errorToString(result);
return common_installer::Step::Status::SIGNATURE_INVALID;
- };
}
return common_installer::Step::Status::OK;
}
break;
}
default:
- // TODO(p.sikorski): should return unsupported, and display error
LOG(ERROR) <<
"Only installation, update and uninstallation is now supported";
return Status::CONFIG_ERROR;
return Step::Status::PACKAGE_NOT_FOUND;
}
- // TODO(p.sikorski) asserts?
-
return Step::Status::OK;
}
LOG(ERROR) << "Cannot modify. Not a regular file: " << input;
return false;
}
- const char* const argv[] = {
- kXDeltaBinary,
- "-d",
- "-s",
- input.c_str(),
- patch_file.c_str(),
- temp_file.c_str(),
- nullptr,
- };
pid_t pid = fork();
if (pid == 0) {
- int ret = execv(argv[0], const_cast<char* const*>(argv));
+ const char* const argv[] = {
+ kXDeltaBinary,
+ "-d",
+ "-s",
+ input.c_str(),
+ patch_file.c_str(),
+ temp_file.c_str(),
+ nullptr,
+ };
+ int ret = execv(argv[0], const_cast<char* const*>(argv));
if (ret != 0) {
// no other thing to -> do just quit
exit(-1);
LOG(DEBUG) << "Creating directories in: " << path;
bs::error_code error;
bf::create_directories(path, error);
- int r = -1;
if (error) {
LOG(ERROR) << "Failed to create directory: " << path;
return false;
}
- r = lsetxattr(subpath.c_str(), "security.SMACK64TRANSMUTE", "TRUE", 4, 0);
+ int r =
+ lsetxattr(subpath.c_str(), "security.SMACK64TRANSMUTE", "TRUE", 4, 0);
if (r < 0) {
LOG(ERROR) << "Failed to apply transmute";
return false;