Skip to content

Commit eae3384

Browse files
jglickjenkinsci-cert-ci
authored andcommitted
1 parent 6ff0599 commit eae3384

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/src/main/java/jenkins/security/s2m/RunningBuildFilePathFilter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@ protected boolean op(String name, File path) throws SecurityException {
7878
LOGGER.log(Level.FINE, () -> "Skipping check for '" + name + "' on '" + path + "'");
7979
return false;
8080
}
81-
if (!(context instanceof Computer)) {
82-
LOGGER.log(Level.FINE, "No context provided for path access: " + path);
83-
return false;
84-
}
85-
Computer c = (Computer) context;
8681

8782
final Jenkins jenkins = Jenkins.get();
8883

@@ -108,6 +103,11 @@ protected boolean op(String name, File path) throws SecurityException {
108103
return false;
109104
}
110105

106+
if (!(context instanceof Computer)) {
107+
LOGGER.warning(() -> "Unrecognized context " + context + " rejected for " + name + " on " + path);
108+
throw new SecurityException("Failed to discover context of access to build directory"); // Minimal details
109+
}
110+
Computer c = (Computer) context;
111111
final Path thePath = path.getAbsoluteFile().toPath();
112112
for (Executor executor : c.getExecutors()) {
113113
Run<?, ?> build = findRun(executor.getCurrentExecutable());

0 commit comments

Comments
 (0)