Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard all the places that ant sets the security manager #1662

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

merks
Copy link
Contributor

@merks merks commented Dec 17, 2024

  • This copies the code because org.eclipse.ant.internal.launching.remote.InternalAntRunner can't see (much of) anything else define by org.eclipse.ant.

#1660

- This copies the code because
org.eclipse.ant.internal.launching.remote.InternalAntRunner can't see
(much of) anything else define by org.eclipse.ant.

eclipse-platform#1660
private static boolean isSecurityManagerAllowed() {
String sm = System.getProperty("java.security.manager"); //$NON-NLS-1$
if (sm == null) { // default is 'disallow' since 18 and was 'allow' before
return !JavaEnvUtils.isAtLeastJavaVersion("18"); //$NON-NLS-1$
Copy link
Contributor

Choose a reason for hiding this comment

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

If we require Java 21 now it might be obsolete?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These tests are failing when running with Java 21. Just because the IDE requires Java 21 doesn't mean an ant task requires Java 21 or even the Eclipse ant bundles for that matter.

Anyway, it's a copy of this already-committed code:

private static final boolean IS_SECURITY_MANAGER_SUPPORTED = isSecurityManagerAllowed();
private static boolean isSecurityManagerAllowed() {
String sm = System.getProperty("java.security.manager"); //$NON-NLS-1$
if (sm == null) { // default is 'disallow' since 18 and was 'allow' before
return !JavaEnvUtils.isAtLeastJavaVersion("18"); //$NON-NLS-1$
}
// Value is either 'disallow' or 'allow' or specifies the SecurityManager class to set
return !"disallow".equals(sm); //$NON-NLS-1$
}

@eclipse-platform-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

ant/org.eclipse.ant.launching/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From 704cd241bbb00a7fd21929840091625b92ad3e63 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Tue, 17 Dec 2024 08:25:47 +0000
Subject: [PATCH] Version bump(s) for 4.35 stream


diff --git a/ant/org.eclipse.ant.launching/META-INF/MANIFEST.MF b/ant/org.eclipse.ant.launching/META-INF/MANIFEST.MF
index 59e000c87f..701a5b50f8 100644
--- a/ant/org.eclipse.ant.launching/META-INF/MANIFEST.MF
+++ b/ant/org.eclipse.ant.launching/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 Bundle-Localization: plugin
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.ant.launching;singleton:=true
-Bundle-Version: 1.4.600.qualifier
+Bundle-Version: 1.4.700.qualifier
 Bundle-Activator: org.eclipse.ant.internal.launching.AntLaunching
 Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
  org.eclipse.debug.core;bundle-version="[3.12.0,4.0.0)",
-- 
2.47.1

Further information are available in Common Build Issues - Missing version increments.

Copy link
Contributor

Test Results

 1 755 files  +  734   1 755 suites  +734   1h 34m 48s ⏱️ + 32m 34s
 4 170 tests ±    0   4 148 ✅ +   24   22 💤  - 24  0 ❌ ±0 
13 107 runs  +5 404  12 943 ✅ +5 357  164 💤 +47  0 ❌ ±0 

Results for commit 873c510. ± Comparison against base commit 9636c7e.

@merks
Copy link
Contributor Author

merks commented Dec 17, 2024

I think we need to move forward on this to stabilize and improve the builds. If there are ways to improve these changes, with less duplication, we can do that as a follow up.

@merks merks merged commit 9119e79 into eclipse-platform:master Dec 17, 2024
17 checks passed
@merks merks deleted the pr-ant-security branch December 17, 2024 09:41
HannesWell added a commit to HannesWell/eclipse.platform that referenced this pull request Dec 17, 2024
@HannesWell
Copy link
Member

I think we need to move forward on this to stabilize and improve the builds. If there are ways to improve these changes, with less duplication, we can do that as a follow up.

Thanks for this! And for the follow-up, please have a look at:

HannesWell added a commit to HannesWell/eclipse.platform that referenced this pull request Dec 17, 2024
HannesWell added a commit to HannesWell/eclipse.platform that referenced this pull request Dec 18, 2024
HannesWell added a commit to HannesWell/eclipse.platform that referenced this pull request Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants