Merge branch 'master' of https://github.com/jenkinsci/jenkins into anonymous-to-lambda

This commit is contained in:
Jesse Glick committed 2021-08-30 14:18:15 -04:00
commit b23b674fc4
380 files changed
+2454 -23429

No files matched your search

+3 -8
View File
@@ -35,7 +35,6 @@ import hudson.model.AbstractProject;
import hudson.model.Computer;
import hudson.model.Item;
import hudson.model.TaskListener;
import hudson.os.PosixAPI;
import hudson.os.PosixException;
import hudson.remoting.Callable;
import hudson.remoting.Channel;
@@ -697,7 +696,7 @@ public final class FilePath implements SerializableOnlyOverRemoting {
while (entries.hasMoreElements()) {
ZipEntry e = entries.nextElement();
File f = new File(dir, e.getName());
if (!f.getCanonicalPath().startsWith(dir.getCanonicalPath())) {
if (!f.getCanonicalFile().toPath().startsWith(dir.getCanonicalPath())) {
throw new IOException(
"Zip " + zipFile.getPath() + " contains illegal file name that breaks out of the target directory: " + e.getName());
}
@@ -1013,7 +1012,7 @@ public final class FilePath implements SerializableOnlyOverRemoting {
timestamp.touch(sourceTimestamp);
return true;
} catch (IOException x) {
Functions.printStackTrace(x, listener.error("Failed to download " + archive + " from agent; will retry from master"));
Functions.printStackTrace(x, listener.error("Failed to download " + archive + " from agent; will retry from controller"));
}
}
@@ -1895,11 +1894,7 @@ public final class FilePath implements SerializableOnlyOverRemoting {
// Anyway the existing calls already skip this method if on Windows.
if (File.pathSeparatorChar==';') return; // noop
if (Util.NATIVE_CHMOD_MODE) {
PosixAPI.jnr().chmod(f.getAbsolutePath(), mask);
} else {
Files.setPosixFilePermissions(fileToPath(f), Util.modeToPermissions(mask));
}
Files.setPosixFilePermissions(fileToPath(f), Util.modeToPermissions(mask));
}
private static boolean CHMOD_WARNED = false;