From ced25e51fd201ec3ae7ae9d3e9262e573cf11e27 Mon Sep 17 00:00:00 2001 From: Jeff Thompson Date: Mon, 2 Dec 2019 15:29:45 -0700 Subject: [PATCH] Make sure everything has a justification. And move a couple of items to the exclude file. If we ever get to a lower threshold, these will show up all over the place. --- .../hudson/cli/DiagnosedStreamCorruptionException.java | 3 --- core/src/main/java/hudson/Proc.java | 2 +- core/src/main/java/hudson/console/AnnotatedLargeText.java | 2 +- core/src/main/java/hudson/console/ConsoleNote.java | 2 +- .../java/hudson/security/BasicAuthenticationFilter.java | 2 +- .../hudson/security/HudsonAuthenticationEntryPoint.java | 2 +- core/src/main/java/hudson/util/DOSToUnixPathHelper.java | 4 ++-- core/src/main/java/hudson/util/FormFieldValidator.java | 2 +- .../main/java/jenkins/slaves/JnlpSlaveAgentProtocol4.java | 2 +- src/findbugs/findbugs-excludes.xml | 8 ++++++++ 10 files changed, 17 insertions(+), 12 deletions(-) diff --git a/cli/src/main/java/hudson/cli/DiagnosedStreamCorruptionException.java b/cli/src/main/java/hudson/cli/DiagnosedStreamCorruptionException.java index c7d3963f3b..4708b425db 100644 --- a/cli/src/main/java/hudson/cli/DiagnosedStreamCorruptionException.java +++ b/cli/src/main/java/hudson/cli/DiagnosedStreamCorruptionException.java @@ -1,7 +1,5 @@ package hudson.cli; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - import java.io.PrintWriter; import java.io.StreamCorruptedException; import java.io.StringWriter; @@ -13,7 +11,6 @@ import java.io.StringWriter; * * @author Kohsuke Kawaguchi */ -@SuppressFBWarnings(value = "INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE") class DiagnosedStreamCorruptionException extends StreamCorruptedException { private final Exception diagnoseFailure; private final byte[] readBack; diff --git a/core/src/main/java/hudson/Proc.java b/core/src/main/java/hudson/Proc.java index d134d0b8b7..f387d6abcc 100644 --- a/core/src/main/java/hudson/Proc.java +++ b/core/src/main/java/hudson/Proc.java @@ -216,7 +216,7 @@ public abstract class Proc { * @param err * null to redirect stderr to stdout. */ - @SuppressFBWarnings("COMMAND_INJECTION") + @SuppressFBWarnings(value = "COMMAND_INJECTION", justification = "Command injection is the point of this old, barely used class.") public LocalProc(String[] cmd,String[] env,InputStream in,OutputStream out,OutputStream err,File workDir) throws IOException { this( calcName(cmd), stderr(environment(new ProcessBuilder(cmd),env).directory(workDir), err==null || err== SELFPUMP_OUTPUT), diff --git a/core/src/main/java/hudson/console/AnnotatedLargeText.java b/core/src/main/java/hudson/console/AnnotatedLargeText.java index 278c32c9a1..9625a8609f 100644 --- a/core/src/main/java/hudson/console/AnnotatedLargeText.java +++ b/core/src/main/java/hudson/console/AnnotatedLargeText.java @@ -117,7 +117,7 @@ public class AnnotatedLargeText extends LargeText { rsp.setContentType(isHtml() ? "text/html;charset=UTF-8" : "text/plain;charset=UTF-8"); } - @SuppressFBWarnings(value = "OBJECT_DESERIALIZATION") + @SuppressFBWarnings(value = "OBJECT_DESERIALIZATION", justification = "Deserialization is protected by logic.") private ConsoleAnnotator createAnnotator(StaplerRequest req) throws IOException { try { String base64 = req!=null ? req.getHeader("X-ConsoleAnnotator") : null; diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index c8dd1675fe..82ca8365e7 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -233,7 +233,7 @@ public abstract class ConsoleNote implements Serializable, Describable + + + + + + + +