From 73fba481ed65dfb0e1b725b7d456d87e2986455b Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Wed, 1 Nov 2023 12:18:50 +0100 Subject: [PATCH] [MM-55170] Improve error message when trying to activate a plugin in an unsupported environment (#25160) --- server/public/plugin/supervisor.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/server/public/plugin/supervisor.go b/server/public/plugin/supervisor.go index ad4f9ccf0c..fad1712ef1 100644 --- a/server/public/plugin/supervisor.go +++ b/server/public/plugin/supervisor.go @@ -54,15 +54,14 @@ func newSupervisor(pluginInfo *model.BundleInfo, apiImpl API, driver Driver, par }, } - executable := filepath.Clean(filepath.Join( - ".", - pluginInfo.Manifest.GetExecutableForRuntime(runtime.GOOS, runtime.GOARCH), - )) + executable := pluginInfo.Manifest.GetExecutableForRuntime(runtime.GOOS, runtime.GOARCH) if executable == "" { - return nil, fmt.Errorf("backend executable not found for environment %s/%s", runtime.GOOS, runtime.GOARCH) + return nil, fmt.Errorf("backend executable not found for environment: %s/%s", runtime.GOOS, runtime.GOARCH) } + + executable = filepath.Clean(filepath.Join(".", executable)) if strings.HasPrefix(executable, "..") { - return nil, fmt.Errorf("invalid backend executable") + return nil, fmt.Errorf("invalid backend executable: %s", executable) } executable = filepath.Join(pluginInfo.Path, executable)