Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/src/main/resources/lib/layout/skeleton/skeleton.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,10 @@ body:has(.jenkins-form-skeleton) {
margin: 0 !important;
}
}
/*
* Fix anchor links being obscured by the fixed Jenkins header
* See: https://github.com/jenkinsci/jenkins/issues/16803
*/
html {
scroll-padding-top: 64px;
}
20 changes: 20 additions & 0 deletions test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure that you create a new branch based on the master/main and not from another branch that you already used for another change. This here is already part of #26099

Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ public boolean delete() {
@Test
@Issue("SECURITY-904")
void symlink_outsideWorkspace_areNotAllowed() throws Exception {
Path root = j.jenkins.getRootDir().toPath();
assumeSymlinksSupported(root);
FreeStyleProject p = j.createFreeStyleProject();

File secretsFolder = new File(j.jenkins.getRootDir(), "secrets");
Expand Down Expand Up @@ -721,13 +723,31 @@ void symlink_outsideWorkspace_areNotAllowed() throws Exception {
}
}

// Helper Function
private static void assumeSymlinksSupported(Path dir) throws IOException {
Path target = Files.createTempFile(dir, "symlink-target", ".tmp");
Path link = dir.resolve("symlink-link");

try {
Files.createSymbolicLink(link, target.getFileName());
} catch (UnsupportedOperationException | IOException e) {
assumeTrue(false, "Symbolic links are not supported on this system");
} finally {
Files.deleteIfExists(link);
Files.deleteIfExists(target);
}
}

/*
* If the glob filter is used, we do not want that it leaks some information.
* Presence of a folder means that the folder contains one or multiple results, so we need to hide it completely
*/
@Test
@Issue("SECURITY-904")
void symlink_avoidLeakingInformation_aboutIllegalFolder() throws Exception {
Path root = j.jenkins.getRootDir().toPath();
assumeSymlinksSupported(root);

FreeStyleProject p = j.createFreeStyleProject();

File secretsFolder = new File(j.jenkins.getRootDir(), "secrets");
Expand Down
Loading