Commit Graph
267 Commits
Author SHA1 Message Date
Oleg Nenashev 8f1280a85c Revert "[JENKINS-10629] - Migrate the Tar archives handling code to commons-compress"
This reverts commit b6c7b83e7b.
2015-04-22 17:22:44 -07:00
Oleg Nenashev b6c7b83e7b [JENKINS-10629] - Migrate the Tar archives handling code to commons-compress 2015-04-14 19:02:32 +03:00
Jesse Glick 36bce39ff4 [FIXED JENKINS-26476] Work around Remoting problem by avoiding reference to Functions. 2015-01-16 14:24:52 -05:00
Jesse Glick 1fcee97d2f [FIXED JENKINS-26196] More robust handling of server errors in FilePath.installIfNecessaryFrom. 2014-12-29 14:49:27 -05:00
Jesse Glick c527628db9 installIfNecessaryFrom Javadoc improvements and nullness annotations. 2014-12-29 12:18:53 -05:00
Jesse Glick 534328b264 [FIXED JENKINS-25759] Avoid consuming too much memory while running validateAntFileMask.
Not fully solved, since the scannedDirs field can still grow to be large, but at least clearing files/dirsNotIncluded.
Also imposing a 5s timeout on the scan regardless of file count, and defining a user-customizable bound.
2014-11-24 10:37:58 -05:00
Jesse Glick 8c10c75d85 Merge branch 'security-rc' into SECURITY-144-rc 2014-10-28 11:20:25 -04:00
Jesse Glick 0434a2ac4a readFromOffset needed to be adjusted too. 2014-10-26 15:47:47 -07:00
Jesse Glick 300b6fa519 Forgotten @since. 2014-10-26 13:58:40 -07:00
Jesse Glick f0658e233d Merge branch 'security-rc' into SECURITY-144-rc
Conflicts:
	core/src/main/java/hudson/FilePath.java
2014-10-26 13:55:39 -07:00
Jesse Glick 97b2f931ae Merge branch 'SECURITY-144' into SECURITY-144-rc 2014-10-20 08:57:11 -04:00
Kohsuke Kawaguchi 8a105ce57c Adding separate check for symlink to prevent jailbreak
Otherwise a symlink can be created to point to a file outside $JENKINS_HOME and be read
2014-10-17 19:03:55 -07:00
Jesse Glick c94c1716f3 Merge branch 'SECURITY-144' into SECURITY-144-rc
Conflicts:
	core/src/main/java/hudson/FilePath.java
	core/src/main/java/hudson/PluginManager.java
	core/src/main/java/hudson/PluginWrapper.java
2014-10-17 10:59:32 -04:00
Kohsuke Kawaguchi c20308c3fa Making FilePathFilter itself more composable 2014-10-16 16:55:17 -07:00
Jesse Glick 32376946b8 Merge branch 'SECURITY-144' into SECURITY-144-rc
Conflicts:
	core/src/main/java/hudson/FilePath.java
2014-10-16 13:18:39 -04:00
Jesse Glick ccbe96227f Merge branch 'security-rc' into SECURITY-144-rc
Conflicts:
	core/src/main/java/hudson/FilePath.java
	pom.xml
2014-10-16 13:18:08 -04:00
Kohsuke Kawaguchi 547cc241c0 untar() has the same problem as unzip() about the directionality of the read.
This code duplication in two sides of the if statement is undesirable.
Post-release, I need to come back here to introduce a variant of FileCallable that runs on the given FilePath but with InputStream to another FilePath.
2014-10-15 22:15:30 -07:00
Kohsuke Kawaguchi e37597a81d Unzipping a local zip into a remote directory results in the file getting read from remote.
This change flips the order so that the read happens locally, and pipe gets forwarded to the other side.
2014-10-15 19:51:49 -07:00
Jesse Glick adc218825d FilePath.read should rethrow any FileNotFoundException, SecurityException, etc. 2014-10-15 16:36:12 -04:00
Jesse Glick 698858fd92 Changes in remoting make wrapping IOException less necessary.
Still do it so we capture FilePath.remote (which many JRE methods suppress),
but fix the wrapper Throwable.message to include cause.toString() according to convention.
2014-10-15 16:12:10 -04:00
Kohsuke Kawaguchi e219d19613 Added a method to read a file from the middle 2014-10-13 17:31:08 -07:00
Jesse Glick 89cbfc4639 Merge branch 'SECURITY-144' into SECURITY-144-rc
Conflicts:
	core/src/main/java/hudson/EnvVars.java
	core/src/main/java/hudson/FilePath.java
	core/src/main/java/hudson/cli/ClientAuthenticationCache.java
	core/src/main/java/hudson/markup/MyspacePolicy.java
	core/src/main/java/hudson/model/Computer.java
	core/src/main/java/hudson/node_monitors/DiskSpaceMonitorDescriptor.java
	core/src/main/java/hudson/node_monitors/ResponseTimeMonitor.java
	core/src/main/java/hudson/node_monitors/TemporarySpaceMonitor.java
	core/src/main/java/hudson/security/AbstractPasswordBasedSecurityRealm.java
	core/src/main/java/hudson/slaves/Channels.java
	core/src/main/java/hudson/slaves/SlaveComputer.java
	core/src/main/java/hudson/tasks/Fingerprinter.java
	core/src/main/java/hudson/tasks/Shell.java
	core/src/main/java/hudson/tasks/junit/JUnitParser.java
	core/src/main/java/hudson/tasks/test/DefaultTestResultParserImpl.java
	core/src/main/java/hudson/util/ProcessTree.java
	core/src/main/java/hudson/util/RemotingDiagnostics.java
	core/src/main/java/jenkins/model/Jenkins.java
	core/src/test/java/hudson/LauncherTest.java
	pom.xml
	test/src/test/java/hudson/tasks/junit/CaseResultTest.java
2014-09-26 15:56:48 -04:00
Kohsuke Kawaguchi 4f733244e6 Moving MasterToSlaveFileCallable/SlaveToMasterFileCallable to the top level classes.
If we ever decide to develop a compatibility thunk library for these changes to help promote deployment in plugins,
then these classes being a nested type is problematic as they'll fail to load under onld Jenkins
2014-09-24 19:04:24 -07:00
Kohsuke Kawaguchi 201b035cfc Updated to reflect the signature change around role checking in remoting 2014-09-24 09:43:31 -07:00
Jesse Glick 253943e13e [JENKINS-5756] Removing workarounds for HotSpot bug.
https://bugs.openjdk.java.net/browse/JDK-6933067 claims to be fixed as of Java 6, our baseline.
2014-09-24 09:32:50 -04:00
Kohsuke Kawaguchi ffb5b65093 Switched from annotation based scheme to a function based scheme. 2014-09-23 19:12:43 -07:00
Kohsuke Kawaguchi 140d929516 Fixed the computation of effective FilePathFilter.
If a @SlaveToMaster Callable gets sent to the master, and if inside its call() method the code directly/indirectly performs file system access (for example on files and directories that it didn't receive as parameters), that is not meant to be the subject of the filter check.

Rather, the check is meant for FilePath that the other side sends to us, when it points to a local file.

So it makes more sense to compute the effective FilePathFilter during the deserialization, as opposed to doing so when the actual operation is attempted.

Various FileCallable impls in FilePath fits this pattern, as it drags outer FilePath instance with itself. In addition, this change addresses other situations correctly, where FilePath is used as arguments and return values of other Callables, such as the following:

FilePath f = channel.call(new SlaveWillDoSomeComputationAndGiveMeTheResultAsFile());
f.copyTo(build.getRootDir().child("data.xml"))

"f.copyTo" happens in the context of Channel.current()==null, but we need to check that 'f' is legit and not something like
new FilePath(new File("/etc/shadow"))
2014-09-23 14:53:31 -07:00
Kohsuke Kawaguchi c0260056e5 in pre-cursor for the next change, make all remoting call go through FileCallable 2014-09-23 14:53:31 -07:00
Jesse Glick 735ba83148 Installing a default FilePathFilter that rejects everything. 2014-09-22 12:54:05 -04:00
Jesse Glick 4fabe92368 One-letter typo caused massive test failures, obscuring any real problems. 2014-09-20 15:44:12 -04:00
Kohsuke Kawaguchi 7bd7e4f0b2 Fix up.
- If a write results in a file creation, do the create check, to align with the POSIX semantics.
- Don't make pointless mkdirs check if the directory already exists
- read vs readSymlink difference is dangerous because read() can be called for symlinks in other context as well.
2014-09-18 18:52:05 -07:00
Kohsuke Kawaguchi e4a1ac2ba1 Added a hook to intercept remote file access and reject them if necessary 2014-09-18 18:40:56 -07:00
Kohsuke Kawaguchi 101b4e7fd5 [SECURITY-144] Classify all the core callables one way or the other 2014-09-18 15:07:31 -07:00
Jesse Glick 52c28ae38d NPE diagnosis from ProjectTest.testCheckout.
java.lang.NullPointerException: null
	at hudson.model.AbstractBuild.setWorkspace(AbstractBuild.java:296)
	at hudson.model.ProjectTest.testCheckout(ProjectTest.java:423)
2014-08-29 20:01:13 -04:00
Jesse Glick 06b6cc9cdd Missing @since. 2014-08-15 15:30:43 -04:00
Jesse Glick 4a98beaf64 Using ExtensionList.lookup consistently. 2014-08-04 15:55:22 -04:00
Jesse Glick 7076f0de7e @CheckForNull 2014-07-21 13:08:22 -04:00
Kohsuke Kawaguchi 65bc0fb146 Added a convenience method.
Reference: https://trello.com/c/doFFMdUm/46-filepath-getcomputer
2014-06-28 05:21:24 -07:00
Kohsuke Kawaguchi d5c368dd8e Merge branch 'pull-714' 2014-04-19 18:31:09 -07:00
Kohsuke Kawaguchi 20347431ae [JENKINS-16846]
This is a much simpler fix
2014-04-19 18:30:52 -07:00
Kohsuke Kawaguchi 0b27f364f9 [JENKINS-22354]
Avoid having FilePath to depend on Jenkins, which increases the amount of classloading that has to happen during remoting
2014-04-03 20:17:24 -07:00
Jesse Glick a0d6e5286d Fixed outstanding uses in core of deprecations from #1135 & #1138. 2014-02-27 17:29:29 -05:00
Jesse Glick 7c568178f3 [FIXED JENKINS-21958] FilePath.copyRecursiveTo given a scanner including a symlink but not any regular file in the same directory would neglect to create the parent directory on the destination and thus not copy the link.
(Util.createSymlink is partly to blame for not throwing a descriptive IOException when it fails to create a link,
but this is its historical behavior needed for compatibility.
copyRecursiveTo also continues to suppress error text from this method because there is nowhere for it to go.
Perhaps need a new variant of createSymlink that is guaranteed to either have created the link or throw an exception.)
2014-02-26 10:13:39 -05:00
Oliver Gondža 3cc7188d03 Amending #982 2013-11-25 16:00:28 +01:00
Oliver Gondža 5002949506 Merge pull request #982 from h0nIg/master
added ability to get remote disk sizes
2013-11-25 15:43:37 +01:00
Jesse Glick 15ac490af1 Now that we use Java 6, can finally deprecate IOException2. 2013-11-15 08:19:59 -05:00
Hans-Joachim Kliemeck 8dfa6f7363 added ability to get remote disk sizes 2013-10-29 19:59:10 +01:00
Kohsuke Kawaguchi f15f49f6f4 Merge pull request #923 from evernat/master
Optimize and close Zip resources in ClassicPluginStrategy and FilePath
2013-10-27 12:05:23 -07:00
Jesse Glick 793b6826e5 [FIXED JENKINS-19947] Restore historical undocumented behavior of a top-level entry in a ZIP.
Noting that various DirScanner implementations handle this inconsistently.
2013-10-09 09:55:06 -04:00
Andrew Kiellor 47c90210e3 Remove unused import. 2013-10-04 13:51:44 -04:00