diff --git a/core/src/main/java/jenkins/security/s2m/AdminWhitelistRule.java b/core/src/main/java/jenkins/security/s2m/AdminWhitelistRule.java index 09a236a04d..98bcac0f7b 100644 --- a/core/src/main/java/jenkins/security/s2m/AdminWhitelistRule.java +++ b/core/src/main/java/jenkins/security/s2m/AdminWhitelistRule.java @@ -65,12 +65,16 @@ public class AdminWhitelistRule implements StaplerProxy { // overwrite 30-default.conf with what we think is the best from the core. // this file shouldn't be touched by anyone. For local customization, use other files in the conf dir. // 0-byte file is used as a signal from the admin to prevent this overwriting - placeDefaultRule( - new File(jenkins.getRootDir(), "secrets/whitelisted-callables.d/default.conf"), - getClass().getResourceAsStream("callable.conf")); - placeDefaultRule( - new File(jenkins.getRootDir(), "secrets/filepath-filters.d/30-default.conf"), - transformForWindows(getClass().getResourceAsStream("filepath-filter.conf"))); + try (InputStream callable = getClass().getResourceAsStream("callable.conf")) { + placeDefaultRule( + new File(jenkins.getRootDir(), "secrets/whitelisted-callables.d/default.conf"), + callable); + } + try (InputStream filepathFilter = getClass().getResourceAsStream("filepath-filter.conf")) { + placeDefaultRule( + new File(jenkins.getRootDir(), "secrets/filepath-filters.d/30-default.conf"), + transformForWindows(filepathFilter)); + } this.whitelisted = new CallableWhitelistConfig( new File(jenkins.getRootDir(),"secrets/whitelisted-callables.d/gui.conf")); diff --git a/core/src/main/java/jenkins/slaves/StandardOutputSwapper.java b/core/src/main/java/jenkins/slaves/StandardOutputSwapper.java index 29b3df3fc3..d7e9381f04 100644 --- a/core/src/main/java/jenkins/slaves/StandardOutputSwapper.java +++ b/core/src/main/java/jenkins/slaves/StandardOutputSwapper.java @@ -66,6 +66,7 @@ public class StandardOutputSwapper extends ComputerListener { } } + @SuppressFBWarnings(value = "OBL_UNSATISFIED_OBLIGATION", justification = "the obligation is satisfied with libc(7)") private void swap(StandardOutputStream stdout) throws IOException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, UnsatisfiedLinkError { // duplicate the OS file descriptor and create FileOutputStream around it int out = GNUCLibrary.LIBC.dup(1); diff --git a/src/spotbugs/spotbugs-excludes.xml b/src/spotbugs/spotbugs-excludes.xml index f93a6bb253..e042142993 100644 --- a/src/spotbugs/spotbugs-excludes.xml +++ b/src/spotbugs/spotbugs-excludes.xml @@ -385,13 +385,6 @@ - - - - - - -