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);
return 0;
}
const std::vector<std::shared_ptr<ResPkgInfo>>& global_packages) {
for (const auto& pkg : allowed_packages) {
pkgids_.insert(pkg->GetPkgId());
- allowed_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);
}
for (const auto& pkg : global_packages) {
pkgids_.insert(pkg->GetPkgId());
- global_paths_.emplace_back(pkg->GetRootPath() + GLOBAL_SUFFIX);
+ if (pkg->IsLib())
+ global_lib_paths_.emplace_back(
+ pkg->GetRootPath() + GLOBAL_SUFFIX + "/" + pkg->GetResType());
+ else
+ global_paths_.emplace_back(pkg->GetRootPath() + GLOBAL_SUFFIX);
}
}
const std::vector<std::string>& GetGlobalPaths() const {
return global_paths_;
}
+ const std::vector<std::string>& GetAllowedLibPaths() const {
+ return allowed_lib_paths_;
+ }
+ const std::vector<std::string>& GetGlobalLibPaths() const {
+ return global_lib_paths_;
+ }
private:
std::set<std::string> pkgids_;
std::vector<std::string> allowed_paths_;
std::vector<std::string> global_paths_;
+ std::vector<std::string> allowed_lib_paths_;
+ std::vector<std::string> global_lib_paths_;
};
} // namespace amd
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_;
};