diff --git a/core/src/main/java/hudson/model/Hudson.java b/core/src/main/java/hudson/model/Hudson.java index fc21ee03dbc8ccfcff15762d5ffa0afa44b56d1b..adccb05a8dce3266249af5419a388fa59f25894e 100644 --- a/core/src/main/java/hudson/model/Hudson.java +++ b/core/src/main/java/hudson/model/Hudson.java @@ -2243,6 +2243,30 @@ public final class Hudson extends View implements ItemGroup, Node, }.process(); } + /** + * Performs syntactical check on the remote FS for slaves. + * + * TODO: find a better home for this method. + */ + public void doRemoteFSCheck(StaplerRequest req, StaplerResponse rsp, @QueryParameter("value") final String value) throws IOException, ServletException { + new FormFieldValidator(req,rsp,false) { + protected void check() throws IOException, ServletException { + if(Util.fixEmptyAndTrim(value)==null) { + error("Remote directory is mandatory"); + return; + } + + if(value.startsWith("\\\\") || value.startsWith("/net/")) { + warning("Are you sure you want to use network mounted file system for FS root? " + + "Note that this directory needs not be visible to the master."); + return; + } + + ok(); + } + }.process(); + } + /** * Serves static resources placed along with Jelly view files. *

diff --git a/core/src/main/resources/hudson/model/Hudson/configureExecutors.jelly b/core/src/main/resources/hudson/model/Hudson/configureExecutors.jelly index 0e91a2a5548135813a213438b26e28e1e992969d..94740c9c2ca505b5a4d05893198be5cd02719c94 100644 --- a/core/src/main/resources/hudson/model/Hudson/configureExecutors.jelly +++ b/core/src/main/resources/hudson/model/Hudson/configureExecutors.jelly @@ -60,7 +60,7 @@ + checkUrl="'remoteFSCheck?value='+escape(this.value)"/>