From 176aead216c37ca46025fe66d76472d0efedc8cf Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Fri, 23 Dec 2016 16:27:08 +0900 Subject: [PATCH] Remove creating symlink of executable file Tpk package doesn't need symlink of executable file. Change-Id: I2b10b31440add2f8ab00e743da8b7502130981b5 Signed-off-by: Sangyoon Jang --- .../step/filesystem/step_create_symbolic_link.cc | 36 ---------------------- src/unit_tests/smoke_test.cc | 2 -- 2 files changed, 38 deletions(-) diff --git a/src/tpk/step/filesystem/step_create_symbolic_link.cc b/src/tpk/step/filesystem/step_create_symbolic_link.cc index 14e1135..fd29a12 100644 --- a/src/tpk/step/filesystem/step_create_symbolic_link.cc +++ b/src/tpk/step/filesystem/step_create_symbolic_link.cc @@ -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; } diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc index 6731a6c..4077fa4 100644 --- a/src/unit_tests/smoke_test.cc +++ b/src/unit_tests/smoke_test.cc @@ -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 = -- 2.7.4