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;
continue;
if (!CreateSymLink(app, context_))
return Status::ERROR;
- if (!SetExecPermission(app))
- return Status::ERROR;
}
return Status::OK;
}
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 =