Merge "[Package] Synchronously checking access to file" into tizen
authorPiotr Kosko <p.kosko@samsung.com>
Thu, 26 Apr 2018 06:18:20 +0000 (06:18 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 26 Apr 2018 06:18:20 +0000 (06:18 +0000)
1  2 
src/package/package_instance.cc

@@@ -303,11 -297,14 +304,15 @@@ void PackageInstance::PackageManagerIns
    int callback_id = static_cast<int>(args.get("callbackId").get<double>());
    const std::string& packageFileURI =
        convertUriToPath(args.get("packageFileURI").get<std::string>());
 +  int progress_callback_id = static_cast<int>(args.get("progressCallbackId").get<double>());
  
+   const std::string real_path = common::FilesystemProvider::Create().GetRealPath(packageFileURI);
+   CHECK_STORAGE_ACCESS(real_path, &out);
    if (!request_) {
      LoggerE("package_manager_request_h is NULL");
 -    InvokeErrorCallbackAsync(callback_id,
 +    InvokeErrorCallbackAsync(callback_id, progress_callback_id,
                               UnknownException("It is not allowed to install the package by "
                                                "the platform or any other platform error occurs"));
      return;