Skip to content

Commit 9cd9e8c

Browse files
authored
Merge branch 'master' into SECURITY-771/Fix-test-logic
2 parents 92c510f + 4df1ecc commit 9cd9e8c

File tree

59 files changed

+1723
-237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1723
-237
lines changed

.github/workflows/changelog.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
env:
3636
GITHUB_AUTH: github-actions:${{ secrets.GITHUB_TOKEN }}
3737
- name: Upload Changelog YAML
38-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
38+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
3939
with:
4040
name: changelog.yaml
4141
path: changelog.yaml
@@ -44,15 +44,15 @@ jobs:
4444
runs-on: ubuntu-latest
4545
if: github.repository_owner == 'jenkinsci'
4646
steps:
47-
- uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
47+
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
4848
id: generate-token
4949
with:
5050
app-id: ${{ secrets.JENKINS_CHANGELOG_UPDATER_APP_ID }}
5151
private-key: ${{ secrets.JENKINS_CHANGELOG_UPDATER_PRIVATE_KEY }}
5252
owner: jenkins-infra
5353
repositories: jenkins.io
5454
- name: Check out
55-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
55+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5656
with:
5757
fetch-depth: 0
5858
- name: Publish jenkins.io changelog draft

.github/workflows/publish-release-artifact.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
is-lts: ${{ steps.set-version.outputs.is-lts }}
1717
is-rc: ${{ steps.set-version.outputs.is-rc }}
1818
steps:
19-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
19+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2020
- name: Set up JDK 21
21-
uses: actions/setup-java@4e7e684fbb6e33f88ecb2cf1e6b3797739cf499b #v 5.0.0
21+
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e #v 5.0.0
2222
with:
2323
distribution: "temurin"
2424
java-version: 21

.github/workflows/run-since-updater.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
if: ${{ github.repository_owner == 'jenkinsci' }}
1616
steps:
17-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
17+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1818
with:
1919
fetch-depth: 0
2020
- name: Run update-since-todo.py
@@ -29,7 +29,7 @@ jobs:
2929
id: run_script
3030
shell: bash
3131
- name: Create Pull Request
32-
uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9
32+
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
3333
with:
3434
token: ${{ secrets.GITHUB_TOKEN }}
3535
commit-message: Fill in since annotations

ath.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -o xtrace
66
cd "$(dirname "$0")"
77

88
# https://github.com/jenkinsci/acceptance-test-harness/releases
9-
export ATH_VERSION=6464.vf87c7908f638
9+
export ATH_VERSION=6483.vecb_7d34edb_75
1010

1111
if [[ $# -eq 0 ]]; then
1212
export JDK=21

bom/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ THE SOFTWARE.
4141
<commons-fileupload2.version>2.0.0-M4</commons-fileupload2.version>
4242
<groovy.version>2.4.21</groovy.version>
4343
<jelly.version>1.1-jenkins-20250731</jelly.version>
44-
<stapler.version>2050.v425108fd5089</stapler.version>
44+
<stapler.version>2061.v3949245133a_f</stapler.version>
4545
</properties>
4646

4747
<dependencyManagement>
@@ -63,7 +63,7 @@ THE SOFTWARE.
6363
<dependency>
6464
<groupId>org.springframework</groupId>
6565
<artifactId>spring-framework-bom</artifactId>
66-
<version>6.2.14</version>
66+
<version>6.2.15</version>
6767
<type>pom</type>
6868
<scope>import</scope>
6969
</dependency>
@@ -119,7 +119,7 @@ THE SOFTWARE.
119119
<dependency>
120120
<groupId>commons-io</groupId>
121121
<artifactId>commons-io</artifactId>
122-
<version>2.20.0</version>
122+
<version>2.21.0</version>
123123
</dependency>
124124
<dependency>
125125
<groupId>commons-lang</groupId>

cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<dependency>
5454
<groupId>org.bouncycastle</groupId>
5555
<artifactId>bcprov-jdk18on</artifactId>
56-
<version>1.82</version>
56+
<version>1.83</version>
5757
<optional>true</optional>
5858
</dependency>
5959
<dependency>

cli/src/main/java/hudson/cli/PlainCLIProtocol.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,14 @@ public void run() {
153153
}
154154
} catch (ClosedChannelException x) {
155155
LOGGER.log(Level.FINE, null, x);
156-
side.handleClose();
157156
} catch (IOException x) {
158157
LOGGER.log(Level.WARNING, null, flightRecorder.analyzeCrash(x, "broken stream"));
159158
} catch (ReadPendingException x) {
160159
// in case trick in CLIAction does not work
161160
LOGGER.log(Level.FINE, null, x);
162-
side.handleClose();
163161
} catch (RuntimeException x) {
164162
LOGGER.log(Level.WARNING, null, x);
163+
} finally {
165164
side.handleClose();
166165
}
167166
}

core/src/main/java/hudson/Functions.java

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ public class Functions {
203203
private static final AtomicLong iota = new AtomicLong();
204204
private static Logger LOGGER = Logger.getLogger(Functions.class.getName());
205205

206+
/**
207+
* Escape hatch to use the non-recursive f:password masking.
208+
*/
209+
private static /* non-final */ boolean NON_RECURSIVE_PASSWORD_MASKING_PERMISSION_CHECK = SystemProperties.getBoolean(Functions.class.getName() + ".nonRecursivePasswordMaskingPermissionCheck");
210+
211+
206212
public Functions() {
207213
}
208214

@@ -2252,13 +2258,38 @@ public String getPasswordValue(Object o) {
22522258
StaplerRequest2 req = Stapler.getCurrentRequest2();
22532259
if (o instanceof Secret || Secret.BLANK_NONSECRET_PASSWORD_FIELDS_WITHOUT_ITEM_CONFIGURE) {
22542260
if (req != null) {
2255-
Item item = req.findAncestorObject(Item.class);
2256-
if (item != null && !item.hasPermission(Item.CONFIGURE)) {
2257-
return "********";
2258-
}
2259-
Computer computer = req.findAncestorObject(Computer.class);
2260-
if (computer != null && !computer.hasPermission(Computer.CONFIGURE)) {
2261-
return "********";
2261+
if (NON_RECURSIVE_PASSWORD_MASKING_PERMISSION_CHECK) {
2262+
Item item = req.findAncestorObject(Item.class);
2263+
if (item != null && !item.hasPermission(Item.CONFIGURE)) {
2264+
return "********";
2265+
}
2266+
Computer computer = req.findAncestorObject(Computer.class);
2267+
if (computer != null && !computer.hasPermission(Computer.CONFIGURE)) {
2268+
return "********";
2269+
}
2270+
} else {
2271+
List<Ancestor> ancestors = req.getAncestors();
2272+
for (Ancestor ancestor : Iterators.reverse(ancestors)) {
2273+
Object type = ancestor.getObject();
2274+
if (type instanceof Item item) {
2275+
if (!item.hasPermission(Item.CONFIGURE)) {
2276+
return "********";
2277+
}
2278+
break;
2279+
}
2280+
if (type instanceof Computer computer) {
2281+
if (!computer.hasPermission(Computer.CONFIGURE)) {
2282+
return "********";
2283+
}
2284+
break;
2285+
}
2286+
if (type instanceof View view) {
2287+
if (!view.hasPermission(View.CONFIGURE)) {
2288+
return "********";
2289+
}
2290+
break;
2291+
}
2292+
}
22622293
}
22632294
}
22642295
}

core/src/main/java/hudson/cli/CLIAction.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
import java.nio.charset.Charset;
4141
import java.nio.charset.UnsupportedCharsetException;
4242
import java.util.ArrayList;
43-
import java.util.HashMap;
4443
import java.util.List;
4544
import java.util.Locale;
4645
import java.util.Map;
4746
import java.util.UUID;
47+
import java.util.concurrent.ConcurrentHashMap;
4848
import java.util.logging.Level;
4949
import java.util.logging.Logger;
5050
import jenkins.model.Jenkins;
@@ -80,7 +80,7 @@ public class CLIAction implements UnprotectedRootAction, StaplerProxy {
8080
*/
8181
/* package-private for testing */ static /* non-final for Script Console */ Boolean ALLOW_WEBSOCKET = SystemProperties.optBoolean(CLIAction.class.getName() + ".ALLOW_WEBSOCKET");
8282

83-
private final transient Map<UUID, FullDuplexHttpService> duplexServices = new HashMap<>();
83+
private final transient Map<UUID, FullDuplexHttpService> duplexServices = new ConcurrentHashMap<>();
8484

8585
@Override
8686
public String getIconFileName() {
@@ -315,8 +315,13 @@ private synchronized void ready() {
315315

316316
void run() throws IOException, InterruptedException {
317317
synchronized (this) {
318-
while (!ready) {
319-
wait();
318+
long end = System.currentTimeMillis() + FullDuplexHttpService.CONNECTION_TIMEOUT;
319+
while (!ready && System.currentTimeMillis() < end) {
320+
wait(1000);
321+
}
322+
if (!ready) {
323+
LOGGER.log(Level.FINE, "CLI timeout waiting for client");
324+
return;
320325
}
321326
}
322327
PrintStream stdout = new PrintStream(streamStdout(), false, encoding);

core/src/main/java/hudson/diagnosis/OldDataMonitor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import jenkins.model.Jenkins;
6262
import org.jenkinsci.Symbol;
6363
import org.kohsuke.accmod.Restricted;
64+
import org.kohsuke.accmod.restrictions.DoNotUse;
6465
import org.kohsuke.accmod.restrictions.NoExternalUse;
6566
import org.kohsuke.stapler.HttpRedirect;
6667
import org.kohsuke.stapler.HttpResponse;
@@ -107,6 +108,12 @@ public boolean isActivated() {
107108
return !data.isEmpty();
108109
}
109110

111+
@SuppressWarnings("unused")
112+
@Restricted(DoNotUse.class) // used by jelly
113+
public ManagementLink getManagementLink() {
114+
return ExtensionList.lookupSingleton(ManagementLinkImpl.class);
115+
}
116+
110117
public Map<Saveable, VersionRange> getData() {
111118
Map<Saveable, VersionRange> r = new HashMap<>();
112119
for (Map.Entry<SaveableReference, VersionRange> entry : this.data.entrySet()) {

0 commit comments

Comments
 (0)