From 7eb26cb11b9d6ef5071e71c8202ec03ea125dc94 Mon Sep 17 00:00:00 2001 From: rtlhq Date: Mon, 16 Oct 2023 13:17:25 +0800 Subject: [PATCH] update version info. --- build.xml | 12 +++-- debian/changelog | 6 +++ .../01_EnableBsfAdapter_buildXml.patch | 18 ------- debian/patches/02_GNUvms_workaround.patch | 49 ------------------- debian/patches/03_target13_buildXml.patch | 14 ------ debian/patches/04_fix_typo.patch | 14 ------ debian/patches/05_link_javadoc.patch | 18 ------- debian/patches/07_java9_compatibility.patch | 14 ------ debian/patches/CVE-2016-2510.patch | 44 ----------------- debian/patches/series | 6 --- debian/source/format | 2 +- lib/keep | 1 + src/bsh/BshClassManager.java | 2 +- src/bsh/Console.java | 26 ++++++---- src/bsh/XThis.java | 8 ++- src/bsh/util/AWTConsole.java | 2 - 16 files changed, 40 insertions(+), 196 deletions(-) delete mode 100644 debian/patches/01_EnableBsfAdapter_buildXml.patch delete mode 100644 debian/patches/02_GNUvms_workaround.patch delete mode 100644 debian/patches/03_target13_buildXml.patch delete mode 100644 debian/patches/04_fix_typo.patch delete mode 100644 debian/patches/05_link_javadoc.patch delete mode 100644 debian/patches/07_java9_compatibility.patch delete mode 100644 debian/patches/CVE-2016-2510.patch delete mode 100644 debian/patches/series create mode 100644 lib/keep diff --git a/build.xml b/build.xml index 8d8ec87..52bfe64 100644 --- a/build.xml +++ b/build.xml @@ -54,10 +54,10 @@ --> + - + --> diff --git a/debian/changelog b/debian/changelog index 43217b0..acab1dd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +bsh (2.0b4-ok1.2) nile; urgency=medium + + * update version info. + + -- rtlhq Mon, 16 Oct 2023 13:07:39 +0800 + bsh (2.0b4-ok1.1) nile; urgency=medium * Build for openkylin. diff --git a/debian/patches/01_EnableBsfAdapter_buildXml.patch b/debian/patches/01_EnableBsfAdapter_buildXml.patch deleted file mode 100644 index 439df93..0000000 --- a/debian/patches/01_EnableBsfAdapter_buildXml.patch +++ /dev/null @@ -1,18 +0,0 @@ -Description: Build without the BSF adapter. -Author: Wolfgang Baer - ---- bsh~/build.xml 2005-08-08 19:56:01.000000000 +0200 -+++ bsh/build.xml 2005-08-06 21:16:21.000000000 +0200 -@@ -54,10 +54,10 @@ - --> - - -+ - -- -+ --> - diff --git a/debian/patches/07_java9_compatibility.patch b/debian/patches/07_java9_compatibility.patch deleted file mode 100644 index 61a8e68..0000000 --- a/debian/patches/07_java9_compatibility.patch +++ /dev/null @@ -1,14 +0,0 @@ -Description: Fixes the build failure with Java 9 -Author: Emmanuel Bourg -Forwarded: no ---- a/src/bsh/util/AWTConsole.java -+++ b/src/bsh/util/AWTConsole.java -@@ -220,8 +220,6 @@ - Great. What a piece of crap. - */ - public void setCaretPosition( int pos ) { -- ((java.awt.peer.TextComponentPeer)getPeer()).setCaretPosition( -- pos + countNLs() ); - } - - /* diff --git a/debian/patches/CVE-2016-2510.patch b/debian/patches/CVE-2016-2510.patch deleted file mode 100644 index c0c110d..0000000 --- a/debian/patches/CVE-2016-2510.patch +++ /dev/null @@ -1,44 +0,0 @@ -From: Markus Koschany -Date: Fri, 26 Feb 2016 14:24:31 +0100 -Subject: CVE-2016-2510 - -An application that includes BeanShell on the classpath may be vulnerable if -another part of the application uses Java serialization or XStream to -deserialize data from an untrusted source. - -A vulnerable application could be exploited for remote code execution, -including executing arbitrary shell commands. - -https://github.com/beanshell/beanshell/commit/7c68fde2d6fc65e362f20863d868c112a90a9b49 -https://github.com/beanshell/beanshell/commit/1ccc66bb693d4e46a34a904db8eeff07808d2ced ---- - src/bsh/XThis.java | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/bsh/XThis.java b/src/bsh/XThis.java -index 3f05974..94bcc22 100644 ---- a/src/bsh/XThis.java -+++ b/src/bsh/XThis.java -@@ -65,7 +65,7 @@ public class XThis extends This - */ - Hashtable interfaces; - -- InvocationHandler invocationHandler = new Handler(); -+ transient InvocationHandler invocationHandler = new Handler(); - - public XThis( NameSpace namespace, Interpreter declaringInterp ) { - super( namespace, declaringInterp ); -@@ -122,8 +122,12 @@ public class XThis extends This - classes aren't there (doesn't it?) This class shouldn't be loaded - if an XThis isn't instantiated in NameSpace.java, should it? - */ -- class Handler implements InvocationHandler, java.io.Serializable -+ class Handler implements InvocationHandler - { -+ private Object readResolve() throws java.io.ObjectStreamException { -+ throw new java.io.NotSerializableException(); -+ } -+ - public Object invoke( Object proxy, Method method, Object[] args ) - throws Throwable - { diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 53c696a..0000000 --- a/debian/patches/series +++ /dev/null @@ -1,6 +0,0 @@ -01_EnableBsfAdapter_buildXml.patch -02_GNUvms_workaround.patch -04_fix_typo.patch -05_link_javadoc.patch -CVE-2016-2510.patch -07_java9_compatibility.patch diff --git a/debian/source/format b/debian/source/format index 163aaf8..89ae9db 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) diff --git a/lib/keep b/lib/keep new file mode 100644 index 0000000..2fa992c --- /dev/null +++ b/lib/keep @@ -0,0 +1 @@ +keep diff --git a/src/bsh/BshClassManager.java b/src/bsh/BshClassManager.java index ecd5e02..8f66b48 100644 --- a/src/bsh/BshClassManager.java +++ b/src/bsh/BshClassManager.java @@ -493,7 +493,7 @@ public class BshClassManager if ( cur != null ) throw new InterpreterError("Defining class problem: "+className +": BeanShell cannot yet simultaneously define two or more " - +"dependant classes of the same name. Attempt to define: " + +"dependent classes of the same name. Attempt to define: " + className +" while defining: "+cur ); definingClasses.put( className, NOVALUE ); diff --git a/src/bsh/Console.java b/src/bsh/Console.java index bb8481f..b27db2e 100644 --- a/src/bsh/Console.java +++ b/src/bsh/Console.java @@ -35,6 +35,7 @@ package bsh; import bsh.util.*; +import java.util.Properties; /** Console startup class. @@ -47,18 +48,25 @@ public class Console System.out.println("Can't find the BeanShell utilities..."); if ( Capabilities.haveSwing() ) - { - bsh.util.Util.startSplashScreen(); - try { - new Interpreter().eval("desktop()"); - } catch ( EvalError e ) { - System.err.println("Couldn't start desktop: "+e); + { + + // Test if gnu classpath vm + Properties props = System.getProperties(); + if(props.getProperty("gnu.classpath.version") == null) { // ok sun vm + + bsh.util.Util.startSplashScreen(); + try { + new Interpreter().eval("desktop()"); + } catch ( EvalError e ) { + System.err.println("Couldn't start desktop: "+e); + } + } + else { // gnu classpath derived vm + AWTConsole.main( args ); } } else { System.err.println( - "Can't find javax.swing package: " - +" An AWT based Console is available but not built by default."); - //AWTConsole.main( args ); + "Can't find javax.swing package ! "); } } } diff --git a/src/bsh/XThis.java b/src/bsh/XThis.java index 3f05974..cd225c7 100644 --- a/src/bsh/XThis.java +++ b/src/bsh/XThis.java @@ -65,7 +65,7 @@ public class XThis extends This */ Hashtable interfaces; - InvocationHandler invocationHandler = new Handler(); + transient InvocationHandler invocationHandler = new Handler(); public XThis( NameSpace namespace, Interpreter declaringInterp ) { super( namespace, declaringInterp ); @@ -122,8 +122,12 @@ public class XThis extends This classes aren't there (doesn't it?) This class shouldn't be loaded if an XThis isn't instantiated in NameSpace.java, should it? */ - class Handler implements InvocationHandler, java.io.Serializable + class Handler implements InvocationHandler { + private Object readResolve() throws java.io.ObjectStreamException { + throw new java.io.NotSerializableException(); + } + public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { diff --git a/src/bsh/util/AWTConsole.java b/src/bsh/util/AWTConsole.java index aca67d4..ad0b484 100644 --- a/src/bsh/util/AWTConsole.java +++ b/src/bsh/util/AWTConsole.java @@ -220,8 +220,6 @@ public class AWTConsole extends TextArea Great. What a piece of crap. */ public void setCaretPosition( int pos ) { - ((java.awt.peer.TextComponentPeer)getPeer()).setCaretPosition( - pos + countNLs() ); } /*