AUL_K_MOUNT_ALLOWED_RES_DIR);
AddDataToBundle(info->GetGlobalPaths(), context->GetBundle(),
AUL_K_MOUNT_GLOBAL_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(),
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<std::shared_ptr<ResPkgInfo>>& allowed_packages,
pkg->GetResType());
}
+ if (pkg->IsLib())
+ lib_paths_.emplace_back(pkg->GetRootPath() + kLibDir);
+
allowed_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX);
}
return global_paths_;
}
+const std::vector<std::string>& ResMountPackageInfo::GetLibPaths() const {
+ return lib_paths_;
+}
+
const std::set<std::string>& ResMountPackageInfo::GetGadgetPkgIds() const {
return gadget_pkgids_;
}
std::optional<ResMountPackageInfo>* info);
const std::vector<std::string>& GetAllowedPaths() const;
const std::vector<std::string>& GetGlobalPaths() const;
+ const std::vector<std::string>& GetLibPaths() const;
const std::set<std::string>& GetGadgetPkgIds() const;
const std::vector<std::string>& GetGadgetPaths() const;
private:
std::vector<std::string> allowed_paths_;
std::vector<std::string> global_paths_;
+ std::vector<std::string> lib_paths_;
std::set<std::string> gadget_pkgids_;
std::vector<std::string> gadget_paths_;
};
return root_path_;
}
+bool ResPkgInfo::IsLib() {
+ return is_lib_;
+}
+
bool ResPkgInfo::IsBlocked() {
return is_blocked_;
}
char* res_type;
char* res_version;
char* root_path;
+ bool is_lib;
AllowedPkgPrivList allowed_pkg_priv_list;
if (pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid) != PMINFO_R_OK)
if (pkgmgrinfo_pkginfo_get_root_path(handle, &root_path) != PMINFO_R_OK)
return nullptr;
+ if (pkgmgrinfo_pkginfo_is_lib(handle, &is_lib) != PMINFO_R_OK)
+ return nullptr;
+
if (pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle,
[](const char* allowed_package, required_privilege_h privilege_handle,
void* user_data) -> int {
return nullptr;
return std::shared_ptr<ResPkgInfo>(new ResPkgInfo(pkgid, res_type,
- res_version, root_path, std::move(allowed_pkg_priv_list)));
+ res_version, root_path, is_lib, std::move(allowed_pkg_priv_list)));
}
std::shared_ptr<ResPkgInfo> ResPkgInfo::CreateResPkgInfo(
const std::string& GetResType();
const std::string& GetResVersion();
const std::string& GetRootPath();
+ bool IsLib();
bool IsBlocked();
bool IsAllowedPkg(const std::string& pkgid,
const std::set<std::string>& app_priv);
private:
ResPkgInfo(std::string pkgid, std::string res_type, std::string res_version,
- std::string root_path, AllowedPkgPrivList priv_list)
+ std::string root_path, bool is_lib, AllowedPkgPrivList priv_list)
: pkgid_(std::move(pkgid)),
res_type_(std::move(res_type)),
res_version_(std::move(res_version)),
root_path_(std::move(root_path)),
+ is_lib_(is_lib),
allowed_pkg_priv_list_(std::move(priv_list)),
is_blocked_(false) {}
std::string res_type_;
std::string res_version_;
std::string root_path_;
+ bool is_lib_;
AllowedPkgPrivList allowed_pkg_priv_list_;
bool is_blocked_;
};