Fix OfflineRemove in StepRemovePrivSharedres 38/320438/1
authorIlho Kim <ilho159.kim@samsung.com>
Fri, 15 Nov 2024 06:53:29 +0000 (15:53 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Fri, 15 Nov 2024 06:53:29 +0000 (15:53 +0900)
Change-Id: Ib9acc695d5d931b7bdebe9d2d5812ebe565304bc
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/step/pkgmgr/step_remove_priv_sharedres.cc

index ed59690031c1f431a81822fbfc80a2346f198532..8c7623bc545c23665931e86057b569457495fd4e 100644 (file)
@@ -16,6 +16,8 @@ namespace fs = std::filesystem;
 
 namespace {
 
+constexpr char kPrivSharedRes[] = "priv_shared_res";
+
 fs::path GetRootPathForUid(uid_t uid) {
   tzplatform_set_user(uid);
   const char* rootpath = tzplatform_getenv(TZ_USER_HOME);
@@ -24,9 +26,9 @@ fs::path GetRootPathForUid(uid_t uid) {
 }
 
 bool RemoveResForUid(const std::string& pkgid, uid_t uid) {
-  fs::path target_path = GetRootPathForUid(uid) / pkgid;
+  fs::path target_path = GetRootPathForUid(uid) / kPrivSharedRes / pkgid;
 
-  if (fs::exists(target_path))
+  if (!fs::exists(target_path))
     return true;
 
   if (!common_installer::RemoveAll(target_path))