diff -Nru libnb-platform18-java-12.1/debian/changelog libnb-platform18-java-12.1/debian/changelog --- libnb-platform18-java-12.1/debian/changelog 2020-10-05 16:24:20.000000000 +0000 +++ libnb-platform18-java-12.1/debian/changelog 2024-04-15 20:20:35.000000000 +0000 @@ -1,3 +1,10 @@ +libnb-platform18-java (12.1-2ubuntu1) noble; urgency=medium + + * d/p/allow-security-manager.patch: cherry-pick upstream patch to + allow setting Java Security Manager (LP: #2061363). + + -- Vladimir Petko Tue, 16 Apr 2024 08:20:35 +1200 + libnb-platform18-java (12.1-2) unstable; urgency=medium * Upload to unstable. diff -Nru libnb-platform18-java-12.1/debian/control libnb-platform18-java-12.1/debian/control --- libnb-platform18-java-12.1/debian/control 2020-10-05 16:24:20.000000000 +0000 +++ libnb-platform18-java-12.1/debian/control 2024-04-15 20:20:35.000000000 +0000 @@ -1,7 +1,8 @@ Source: libnb-platform18-java Section: java Priority: optional -Maintainer: Debian Java Maintainers +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian Java Maintainers Uploaders: Markus Koschany Build-Depends: diff -Nru libnb-platform18-java-12.1/debian/patches/allow-security-manager.patch libnb-platform18-java-12.1/debian/patches/allow-security-manager.patch --- libnb-platform18-java-12.1/debian/patches/allow-security-manager.patch 1970-01-01 00:00:00.000000000 +0000 +++ libnb-platform18-java-12.1/debian/patches/allow-security-manager.patch 2024-04-15 20:20:35.000000000 +0000 @@ -0,0 +1,226 @@ +Description: A prototype of allowing SecurityManager. + Java 21 disables setting the security manager without + -Djava.security.manager property set. + Set the property to allow the Netbeans platform to manipulate + SecurityManager. +Author: Jan Lahoda +Origin: https://github.com/apache/netbeans/commit/4c9d9492f70b09aaeae2b8b10fc26ae29433d667 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libnb-platform18-java/+bug/2061363 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1069015 +Forwarded: not-needed +Last-Update: 2024-04-15 +--- + .../org/netbeans/core/netigso/Netigso.java | 1 + + platform/o.n.bootstrap/launcher/unix/nbexec | 2 +- + platform/o.n.bootstrap/src/allow.java | 188 ++++++++++++++++++ + 3 files changed, 190 insertions(+), 1 deletion(-) + create mode 100644 platform/o.n.bootstrap/src/allow.java + +--- a/platform/core.netigso/src/org/netbeans/core/netigso/Netigso.java ++++ b/platform/core.netigso/src/org/netbeans/core/netigso/Netigso.java +@@ -142,6 +142,7 @@ + } + framework = frameworkFactory.newFramework(configMap); + try { ++ System.clearProperty("java.security.manager"); + framework.init(); + NetigsoServices ns = new NetigsoServices(this, framework); + } catch (BundleException ex) { +--- a/platform/o.n.bootstrap/launcher/unix/nbexec ++++ b/platform/o.n.bootstrap/launcher/unix/nbexec +@@ -189,7 +189,7 @@ + # rename old heap dump to .old + mv "${userdir}/var/log/heapdump.hprof" "${userdir}/var/log/heapdump.hprof.old" > /dev/null 2>&1 + +-jargs_without_clusters="$jargs" ++jargs_without_clusters="$jargs -Djava.security.manager=allow" + jargs="-Dnetbeans.dirs=\"${clusters}\" $jargs_without_clusters" + + if [ -z "$cachedirspecified" ]; then +--- /dev/null ++++ b/platform/o.n.bootstrap/src/allow.java +@@ -0,0 +1,184 @@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one ++ * or more contributor license agreements. See the NOTICE file ++ * distributed with this work for additional information ++ * regarding copyright ownership. The ASF licenses this file ++ * to you under the Apache License, Version 2.0 (the ++ * "License"); you may not use this file except in compliance ++ * with the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, ++ * software distributed under the License is distributed on an ++ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ++ * KIND, either express or implied. See the License for the ++ * specific language governing permissions and limitations ++ * under the License. ++ */ ++ ++import java.io.FileDescriptor; ++import java.net.InetAddress; ++import java.security.Permission; ++ ++/** ++ * ++ */ ++public class allow extends SecurityManager { ++ ++ @Override ++ public void checkAccept(String host, int port) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkAccess(Thread t) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkAccess(ThreadGroup g) { ++ uninstall(); ++ } ++ ++ public void checkAwtEventQueueAccess() { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkConnect(String host, int port) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkConnect(String host, int port, Object context) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkCreateClassLoader() { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkDelete(String file) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkExec(String cmd) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkExit(int status) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkLink(String lib) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkListen(int port) { ++ uninstall(); ++ } ++ ++ public void checkMemberAccess(Class clazz, int which) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkMulticast(InetAddress maddr) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkMulticast(InetAddress maddr, byte ttl) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkPackageAccess(String pkg) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkPackageDefinition(String pkg) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkPermission(Permission perm) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkPermission(Permission perm, Object context) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkPrintJobAccess() { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkPropertiesAccess() { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkPropertyAccess(String key) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkRead(FileDescriptor fd) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkRead(String file) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkRead(String file, Object context) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkSecurityAccess(String target) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkSetFactory() { ++ uninstall(); ++ } ++ ++ public void checkSystemClipboardAccess() { ++ uninstall(); ++ } ++ ++ public boolean checkTopLevelWindow(Object window) { ++ uninstall(); ++ return true; ++ } ++ ++ @Override ++ public void checkWrite(FileDescriptor fd) { ++ uninstall(); ++ } ++ ++ @Override ++ public void checkWrite(String file) { ++ uninstall(); ++ } ++ ++ private void uninstall() { ++ System.setSecurityManager(null); ++ } ++} diff -Nru libnb-platform18-java-12.1/debian/patches/series libnb-platform18-java-12.1/debian/patches/series --- libnb-platform18-java-12.1/debian/patches/series 2020-10-05 16:24:20.000000000 +0000 +++ libnb-platform18-java-12.1/debian/patches/series 2024-04-15 20:19:54.000000000 +0000 @@ -19,3 +19,4 @@ platform-libs.batik.read.patch platform-libs.flatlaf.patch netbeans-apisupport.harness.patch +allow-security-manager.patch