From: Sangyoon Jang Date: Tue, 30 Jan 2024 06:56:15 +0000 (+0900) Subject: Fix lib rpk mount X-Git-Tag: accepted/tizen/unified/20240201.165051~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b067584ff7fc7fa50f933897cc0fa2a54b9a1f8;p=platform%2Fcore%2Fappfw%2Famd.git Fix lib rpk mount Only allowed package can use lib rpk. A lib rpk can contains resources for lib. Change-Id: I49e6d5ef35c58ea49402aa234e1139c8e7b44b95 Signed-off-by: Sangyoon Jang --- diff --git a/src/lib/launch/step_prepare_starting_app.cc b/src/lib/launch/step_prepare_starting_app.cc index 98fe164d..18b7d17a 100644 --- a/src/lib/launch/step_prepare_starting_app.cc +++ b/src/lib/launch/step_prepare_starting_app.cc @@ -647,10 +647,8 @@ int StepPrepareStartingApp::SetResPackagePaths(LaunchContext* context) { AUL_K_MOUNT_ALLOWED_RES_DIR); AddDataToBundle(info->GetGlobalPaths(), context->GetBundle(), AUL_K_MOUNT_GLOBAL_RES_DIR); - AddDataToBundle(info->GetAllowedLibPaths(), context->GetBundle(), - AUL_K_MOUNT_ALLOWED_LIB_RES_DIR); - AddDataToBundle(info->GetGlobalLibPaths(), context->GetBundle(), - AUL_K_MOUNT_GLOBAL_LIB_RES_DIR); + AddDataToBundle(info->GetLibPaths(), context->GetBundle(), + AUL_K_MOUNT_LIB_DIR); AddDataToBundle(info->GetGadgetPkgIds(), context->GetBundle(), AUL_K_MOUNT_GADGET_PKGIDS); AddDataToBundle(info->GetGadgetPaths(), context->GetBundle(), diff --git a/src/lib/res_info/res_mount_package_info.cc b/src/lib/res_info/res_mount_package_info.cc index 2d16a859..93ccce77 100644 --- a/src/lib/res_info/res_mount_package_info.cc +++ b/src/lib/res_info/res_mount_package_info.cc @@ -29,6 +29,7 @@ namespace amd { constexpr const char ALLOWED_SUFFIX[] = "/res/allowed"; constexpr const char GLOBAL_SUFFIX[] = "/res/global"; constexpr const char kGadgetPrefix[] = "org.tizen.appfw.gadget."; +constexpr const char kLibDir[] = "/lib"; ResMountPackageInfo::ResMountPackageInfo( const std::vector>& allowed_packages, @@ -40,22 +41,14 @@ ResMountPackageInfo::ResMountPackageInfo( gadget_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX); } - if (pkg->IsLib()) { - allowed_lib_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX + - "/" + pkg->GetResType()); - } else { - allowed_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX); - } - } + if (pkg->IsLib()) + lib_paths_.emplace_back(pkg->GetRootPath() + kLibDir); - for (const auto& pkg : global_packages) { - if (pkg->IsLib()) { - global_lib_paths_.emplace_back(pkg->GetRootPath() + GLOBAL_SUFFIX + "/" + - pkg->GetResType()); - } else { - global_paths_.emplace_back(pkg->GetRootPath() + GLOBAL_SUFFIX); - } + allowed_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX); } + + for (const auto& pkg : global_packages) + global_paths_.emplace_back(pkg->GetRootPath() + GLOBAL_SUFFIX); } static int ResInfoGetGadgetResPackagesInfo( @@ -130,13 +123,8 @@ const std::vector& ResMountPackageInfo::GetGlobalPaths() const { return global_paths_; } -const std::vector& -ResMountPackageInfo::GetAllowedLibPaths() const { - return allowed_lib_paths_; -} - -const std::vector& ResMountPackageInfo::GetGlobalLibPaths() const { - return global_lib_paths_; +const std::vector& ResMountPackageInfo::GetLibPaths() const { + return lib_paths_; } const std::set& ResMountPackageInfo::GetGadgetPkgIds() const { diff --git a/src/lib/res_info/res_mount_package_info.hh b/src/lib/res_info/res_mount_package_info.hh index e6a4ba78..83577c9c 100644 --- a/src/lib/res_info/res_mount_package_info.hh +++ b/src/lib/res_info/res_mount_package_info.hh @@ -38,16 +38,14 @@ class ResMountPackageInfo { const std::vector& GetAllowedPaths() const; const std::vector& GetGlobalPaths() const; - const std::vector& GetAllowedLibPaths() const; - const std::vector& GetGlobalLibPaths() const; + const std::vector& GetLibPaths() const; const std::set& GetGadgetPkgIds() const; const std::vector& GetGadgetPaths() const; private: std::vector allowed_paths_; std::vector global_paths_; - std::vector allowed_lib_paths_; - std::vector global_lib_paths_; + std::vector lib_paths_; std::set gadget_pkgids_; std::vector gadget_paths_; };