Remove creating symlink of executable file 30/106830/2
authorSangyoon Jang <s89.jang@samsung.com>
Fri, 23 Dec 2016 07:27:08 +0000 (16:27 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Fri, 23 Dec 2016 07:30:06 +0000 (16:30 +0900)
Tpk package doesn't need symlink of executable file.

Change-Id: I2b10b31440add2f8ab00e743da8b7502130981b5
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/tpk/step/filesystem/step_create_symbolic_link.cc
src/unit_tests/smoke_test.cc

index 14e1135..fd29a12 100644 (file)
@@ -48,40 +48,6 @@ bool CreateSymLink(application_x* app, InstallerContext* context) {
         return false;
       }
     }
-  } else {
-    // Exec path
-    // Make a symlink with the name of appid, pointing exec file
-    bf::path symlink_path = bindir / bf::path(app->appid);
-    bf::path app_exec_path(app->exec);
-    if (!bf::exists(symlink_path) && bf::exists(app_exec_path)) {
-      LOG(DEBUG) << "Creating symlink " << symlink_path << " pointing " <<
-          app_exec_path;
-      bf::create_symlink(app_exec_path, symlink_path, boost_error);
-      if (boost_error) {
-        LOG(ERROR) << "Symlink creation failure: " << symlink_path;
-        return false;
-      }
-    }
-  }
-
-  return true;
-}
-
-bool SetExecPermission(application_x* app) {
-  boost::system::error_code boost_error;
-  // Give an execution permission to the original executable
-  LOG(DEBUG) << "Giving exec permission to " << app->exec;
-  bf::path app_exec_path(app->exec);
-  if (bf::exists(app_exec_path)) {
-    bf::permissions(app_exec_path, bf::owner_all |
-        bf::group_read | bf::group_exe |
-        bf::others_read | bf::others_exe, boost_error);
-    if (boost_error) {
-      LOG(ERROR) << "Permission change failure";
-      return false;
-    }
-  } else {
-    LOG(WARNING) << "file does not exist";
   }
 
   return true;
@@ -109,8 +75,6 @@ Status StepCreateSymbolicLink::process() {
       continue;
     if (!CreateSymLink(app, context_))
       return Status::ERROR;
-    if (!SetExecPermission(app))
-      return Status::ERROR;
   }
   return Status::OK;
 }
index 6731a6c..4077fa4 100644 (file)
@@ -197,11 +197,9 @@ void ValidatePackageFS(const std::string& pkgid, const std::string& appid,
     uid_t uid, gid_t gid) {
   bf::path root_path = ci::GetRootAppPath(false, uid);
   bf::path package_path = root_path / pkgid;
-  bf::path binary_path = package_path / "bin" / appid;
   bf::path shared_path = package_path / "shared";
   ASSERT_TRUE(bf::exists(root_path));
   ASSERT_TRUE(bf::exists(package_path));
-  ASSERT_TRUE(bf::exists(binary_path));
   ASSERT_TRUE(bf::exists(shared_path));
 
   bf::path manifest_path =