From 79b0db483fbcb9beb41004d5b6e1d0b8eb806916 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 31 Mar 2010 01:25:10 +0000 Subject: [PATCH] do not require the READ permission for channel connections. The connected session will be authenticated later git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@29623 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/Hudson.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/Hudson.java b/core/src/main/java/hudson/model/Hudson.java index 40f020f538..0eb44f6055 100644 --- a/core/src/main/java/hudson/model/Hudson.java +++ b/core/src/main/java/hudson/model/Hudson.java @@ -2823,13 +2823,16 @@ public final class Hudson extends Node implements ItemGroup, Stapl * Handles HTTP requests for duplex channels for CLI. */ public void doCli(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException { - checkPermission(READ); if(!"POST".equals(Stapler.getCurrentRequest().getMethod())) { // for GET request, serve _cli.jelly, assuming this is a browser + checkPermission(READ); req.getView(this,"_cli.jelly").forward(req,rsp); return; } + // do not require any permission to establish a CLI connection + // the actual authentication for the connecting Channel is done by CLICommand + UUID uuid = UUID.fromString(req.getHeader("Session")); rsp.setHeader("Hudson-Duplex",""); // set the header so that the client would know @@ -3334,6 +3337,7 @@ public final class Hudson extends Node implements ItemGroup, Stapl || rest.startsWith("/signup") || rest.startsWith("/jnlpJars/") || rest.startsWith("/tcpSlaveAgentListener") + || rest.startsWith("/cli")) || rest.startsWith("/securityRealm")) return this; // URLs that are always visible without READ permission throw e;