From c09f66bd2de4648defffcf80d914b6a7e684c3fb Mon Sep 17 00:00:00 2001 From: Minh-Chien Trang <93188636+Minh-Chien@users.noreply.github.com> Date: Wed, 14 Sep 2022 16:32:48 +0700 Subject: [PATCH] Use MasterToSlaveCallable to prevent callable to be executed in controller --- .../jenkins/plugin/helper/ExecuteKatalonStudioHelper.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/katalon/jenkins/plugin/helper/ExecuteKatalonStudioHelper.java b/src/main/java/com/katalon/jenkins/plugin/helper/ExecuteKatalonStudioHelper.java index 4732027..af5ea76 100644 --- a/src/main/java/com/katalon/jenkins/plugin/helper/ExecuteKatalonStudioHelper.java +++ b/src/main/java/com/katalon/jenkins/plugin/helper/ExecuteKatalonStudioHelper.java @@ -7,8 +7,7 @@ import hudson.FilePath; import hudson.Launcher; import hudson.model.TaskListener; -import hudson.remoting.Callable; -import org.jenkinsci.remoting.RoleChecker; +import jenkins.security.MasterToSlaveCallable; import java.util.HashMap; import java.util.Map; @@ -27,7 +26,7 @@ public static boolean executeKatalon( String xvfbConfiguration) { Logger logger = new JenkinsLogger(taskListener); try { - return launcher.getChannel().call(new Callable() { + return launcher.getChannel().call(new MasterToSlaveCallable() { @Override public Boolean call() throws Exception { @@ -54,9 +53,6 @@ public Boolean call() throws Exception { } return true; } - @Override - public void checkRoles(RoleChecker roleChecker) throws SecurityException { - } }); } catch (Exception e) { String stackTrace = Throwables.getStackTraceAsString(e);