diff options
author | Ilho Kim <ilho159.kim@samsung.com> | 2024-11-15 15:57:10 +0900 |
---|---|---|
committer | Ilho Kim <ilho159.kim@samsung.com> | 2024-11-15 15:57:10 +0900 |
commit | 85414120a6483fa8504d357afc5863794613bac9 (patch) | |
tree | 0b6234294cf7835ed031dfbb681b6715fa837ec2 | |
parent | 62505b04eaed5a9bbf155a7a8326a9dcd3c49528 (diff) | |
download | app-installers-85414120a6483fa8504d357afc5863794613bac9.tar.gz app-installers-85414120a6483fa8504d357afc5863794613bac9.tar.bz2 app-installers-85414120a6483fa8504d357afc5863794613bac9.zip |
Remove priv shared res directory directly
The installer already has the authority to delete the directory
so it is unnecessary to make a request to the pkgmgr-server
Change-Id: I6e5db434ed0f9ff55ab5e5df6a6b33ddd59ad235
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
-rw-r--r-- | src/common/step/pkgmgr/step_remove_priv_sharedres.cc | 45 | ||||
-rw-r--r-- | src/common/step/pkgmgr/step_remove_priv_sharedres.h | 4 |
2 files changed, 0 insertions, 49 deletions
diff --git a/src/common/step/pkgmgr/step_remove_priv_sharedres.cc b/src/common/step/pkgmgr/step_remove_priv_sharedres.cc index 8c7623bc..ac6a0821 100644 --- a/src/common/step/pkgmgr/step_remove_priv_sharedres.cc +++ b/src/common/step/pkgmgr/step_remove_priv_sharedres.cc @@ -37,28 +37,12 @@ bool RemoveResForUid(const std::string& pkgid, uid_t uid) { return true; } -int SendUninstallRequest(const std::string& pkgid, uid_t uid) { - pkgmgr_client *pc = pkgmgr_client_new(PC_REQUEST); - - int ret = pkgmgr_client_res_usr_uninstall(pc, pkgid.c_str(), uid); - pkgmgr_client_free(pc); - - return ret; -} - } // namespace namespace common_installer { namespace pkgmgr { Step::Status StepRemovePrivSharedres::process() { - if (context_->installation_mode.get() == InstallationMode::OFFLINE) - return OfflineRemove(); - else - return RequestRemove(); -} - -Step::Status StepRemovePrivSharedres::OfflineRemove() { if (context_->request_mode.get() == RequestMode::GLOBAL) { common_installer::UserList user_list = common_installer::GetUserList(); for (const auto& l : user_list) { @@ -74,34 +58,5 @@ Step::Status StepRemovePrivSharedres::OfflineRemove() { return Status::OK; } -Step::Status StepRemovePrivSharedres::RequestRemove() { - if (context_->request_mode.get() == RequestMode::GLOBAL) { - common_installer::UserList user_list = common_installer::GetUserList(); - for (const auto& l : user_list) { - uid_t uid = std::get<0>(l); - int ret = SendUninstallRequest(context_->pkgid.get(), uid); - if (ret == PKGMGR_R_OK) { - return Status::OK; - } else if (ret == PKGMGR_R_ECOMM) { - return OfflineRemove(); - } else { - LOG(ERROR) << "Failed to remove privileged shared resources"; - return Status::ERROR; - } - } - } else { - int ret = SendUninstallRequest(context_->pkgid.get(), context_->uid.get()); - if (ret == PKGMGR_R_OK) { - return Status::OK; - } else if (ret == PKGMGR_R_ECOMM) { - return OfflineRemove(); - } else { - LOG(ERROR) << "Failed to remove privileged shared resources"; - return Status::ERROR; - } - } - return Status::OK; -} - } // namespace pkgmgr } // namespace common_installer diff --git a/src/common/step/pkgmgr/step_remove_priv_sharedres.h b/src/common/step/pkgmgr/step_remove_priv_sharedres.h index 403072fc..aee140de 100644 --- a/src/common/step/pkgmgr/step_remove_priv_sharedres.h +++ b/src/common/step/pkgmgr/step_remove_priv_sharedres.h @@ -22,10 +22,6 @@ class StepRemovePrivSharedres : public Step { Status undo() override { return Status::OK; } Status precheck() override { return Status::OK; } - private: - Status OfflineRemove(); - Status RequestRemove(); - STEP_NAME(RemovePrivSharedres) }; |