Skip to content

Commit

Permalink
Merge pull request #318 from lahodaj/jep-486
Browse files Browse the repository at this point in the history
Disable SecurityManager
  • Loading branch information
sid-srini authored Nov 4, 2024
2 parents 1861da0 + 33f604f commit 2115aad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
patches/remove-db.diff
patches/nbjavac-not-required.diff
patches/l10n-licence.diff
patches/no-security-manager-allow.diff
</string>
<filterchain>
<tokenfilter delimoutput=" ">
Expand Down Expand Up @@ -109,6 +110,8 @@
<move file="${lsp.build.dir}/platform/lib/nbexec" tofile="${lsp.build.dir}/platform/lib/nbexec.sh" />
<replace file="${lsp.build.dir}/bin/nbcode.sh" token="/platform*/lib/nbexec" value="/platform*/lib/nbexec.sh"/>
<replace file="${lsp.build.dir}/bin/nbcode.sh" token="basename &quot;$PRG&quot;" value="basename &quot;$PRG&quot; &quot;.sh&quot;"/>
<replace file="${lsp.build.dir}/platform/lib/nbexec.dll" token="java.security.manager" value="no.java.secur.manager" encoding="ISO-8859-1"/>
<replace file="${lsp.build.dir}/platform/lib/nbexec64.dll" token="java.security.manager" value="no.java.secur.manager" encoding="ISO-8859-1"/>
<chmod file="${lsp.build.dir}/bin/nbcode.sh" perm="u+x" />
<chmod file="${lsp.build.dir}/platform/lib/nbexec.sh" perm="u+x"/>
<chmod file="${lsp.build.dir}/java/maven/bin/mvn.sh" perm="u+x" />
Expand Down
13 changes: 13 additions & 0 deletions patches/no-security-manager-allow.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/platform/o.n.bootstrap/launcher/unix/nbexec b/platform/o.n.bootstrap/launcher/unix/nbexec
index 1d6ad6e530..228b37cbe2 100755
--- a/platform/o.n.bootstrap/launcher/unix/nbexec
+++ b/platform/o.n.bootstrap/launcher/unix/nbexec
@@ -192,7 +192,7 @@ fi
# 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 -Djava.security.manager=allow"
+jargs_without_clusters="$jargs"
jargs="-Dnetbeans.dirs=\"${clusters}\" $jargs_without_clusters"

if [ -z "$cachedirspecified" ]; then
3 changes: 2 additions & 1 deletion vscode/src/lsp/launchOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const extraLaunchOptions = [
"-J-XX:PerfMaxStringConstLength=10240",
"--locale", l10n.nbLocaleCode(),
"--start-java-language-server=listen-hash:0",
"--start-java-debug-adapter-server=listen-hash:0"
"--start-java-debug-adapter-server=listen-hash:0",
"-J-DTopSecurityManager.disable=true"
];

const prepareUserConfigLaunchOptions = (): string[] => {
Expand Down

0 comments on commit 2115aad

Please sign in to comment.