}
bool RegisterSecurityContextForManifest(const ci::InstallerContext* context,
- std::string* error_message) {
+ std::string* error_message, bool is_undo) {
std::string pkg_id = context->pkgid.get();
std::string pkg_type = context->pkg_type.get();
fs::path path = context->GetPkgPath();
uid_t uid = context->uid.get();
const ci::CertificateInfo* cert_info = &(context->certificate_info.get());
- manifest_x* manifest = context->manifest_data.get();
+ manifest_x* manifest = is_undo ?
+ context->old_manifest_data.get() :
+ context->manifest_data.get();
bool cross_app_rules = context->cross_app_rules.get();
// Although application framework hold list of privilege per package, there
*
* \param context installer context contains necessary information
* \param error_message extra/detailed error message
+ * \param undo optional, default set to false, indicate if operation is undo
*
* \return true if success
*/
bool RegisterSecurityContextForManifest(
const common_installer::InstallerContext* context,
- std::string* error_message);
+ std::string* error_message,
+ bool is_undo = false);
/**
* Adapter interface for external Security module.
Step::Status StepUpdateSecurity::undo() {
std::string error_message;
- if (!RegisterSecurityContextForManifest(context_, &error_message)) {
+ if (!RegisterSecurityContextForManifest(context_, &error_message), true) {
if (!error_message.empty()) {
LOG(ERROR) << "error_message: " << error_message;
}