diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index 6f897dad6e..719b01db93 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -158,6 +158,8 @@ public final class FilePath implements Serializable { * Checks if the remote path is Unix. */ private boolean isUnix() { + // Windows absolute path always include ':', but this is not a valid char in Unix file systems. + if(remote.contains(":")) return false; // Windows can handle '/' as a path separator but Unix can't, // so err on Unix side return remote.indexOf("\\")==-1; diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index 8169ba4720..a98ecc16c0 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -527,9 +527,10 @@ public final class Slave implements Node, Serializable { } public Launcher createLauncher(TaskListener listener) { + // Windows absolute path always include ':', but this is not a valid char in Unix file systems. // Windows can handle '/' as a path separator but Unix can't, // so err on Unix side - boolean isUnix = remoteFS.indexOf("\\") == -1; + boolean isUnix = !remoteFS.contains(":") && !remoteFS.contains("\\"); return new RemoteLauncher(listener, getComputer().getChannel(),isUnix); }