Mageia Bugzilla – Attachment 10730 Details for
Bug 23158
jruby new security issues CVE-2018-100007[3-9]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Summary of jruby tests including some code snippets, all at a very basic level.
report.23158 (text/plain), 2.71 KB, created by
Len Lawrence
on 2019-02-04 16:35:24 CET
(
hide
)
Description:
Summary of jruby tests including some code snippets, all at a very basic level.
Filename:
MIME Type:
Creator:
Len Lawrence
Created:
2019-02-04 16:35:24 CET
Size:
2.71 KB
patch
obsolete
>mga6, x86_64 > >$ jruby -v >jruby 1.7.22 (1.9.3p551) 2017-05-17 fffffff on OpenJDK 64-Bit Server VM 1.8.0_191-b12 +jit [linux-amd64] > >The CVEs lead to descriptive reports and recommendations without any hints about reproducing the vulnerabilities. > >List of jruby tutorials at https://github.com/jruby/jruby/wiki/WalkthroughsAndTutorials > >The javaSwingHello.rb script can be run to display a minimal HelloWorld gui. >$ jruby javaSwingHello.rb > >Find the code at http://rubylearning.com/satishtalim/jruby_tutorial.html >Note that the jruby wiki and some other links on that page appear to be dead. > >There is a more extensive example of using Java::Swing at https://www.oracle.com/technetwork/articles/dsl/jruby-141877.html#cj >See attachment: jruby_swing.rb. >However, I could not get it to run: >$ jruby jruby_swing.rb >ArgumentError: Java package `java.lang' does not have a method `boolean' > method_missing at file:/usr/lib/java/jruby/jruby-core.jar!/jruby/java/java_package_module_template.rb:13 > (root) at jruby_swing.rb:10 > >java does have a boolean type but apparently not implemented in jruby. > >Updated the packages. > >Same version of jruby but package is 1.7.22-5.1. > >Tutorial at https://www.techrepublic.com/article/jruby-an-introduction/ >Fails from the command-line interface, because the 'java' module requires the jruby framework. Somewhere I saw 'jirb' being used instead of irb but have lost the link. > >https://www.roseindia.net/tutorials/jruby/ has some basic scripts of this sort: >------------------------------------------------------- ># helloworld.rb >require "java" > >message = "Hello World courtesy of jruby" >stringdate = java.util.Date.new >puts message >puts "Date is #{stringdate}" >------------------------------------------------------- > >$ jruby helloworld.rb >Hello World courtesy of jruby >Date is Mon Feb 04 10:25:27 GMT 2019 > >------------------------------------------------------- ># arraylist.rb ># Very contrived example >require "java" > >names = %w[ Suzy Caroline Amanda Lucy ] >java_import "java.util.ArrayList" > >blackbook = ArrayList.new >names.each { |name| blackbook.add name } >puts blackbook >------------------------------------------------------- > >$ jruby arraylist.rb >[Suzy, Caroline, Amanda, Lucy] > >File reading... >------------------------------------------------------- ># filereader.rb > >require "java" > >java_import "java.io.BufferedReader" >java_import "java.io.FileReader" > >filename = ARGV[0] || Dir.home+"/.bashrc" > >filereader = FileReader.new filename >buffer = BufferedReader.new filereader >line = buffer.readLine > >while line > puts line > line = buffer.readLine >end >------------------------------------------------------- > >Usage: jruby filereader.rb sometextfile > or > jruby filereader.rb > > >Godd to go on the strength of this. > >
mga6, x86_64 $ jruby -v jruby 1.7.22 (1.9.3p551) 2017-05-17 fffffff on OpenJDK 64-Bit Server VM 1.8.0_191-b12 +jit [linux-amd64] The CVEs lead to descriptive reports and recommendations without any hints about reproducing the vulnerabilities. List of jruby tutorials at https://github.com/jruby/jruby/wiki/WalkthroughsAndTutorials The javaSwingHello.rb script can be run to display a minimal HelloWorld gui. $ jruby javaSwingHello.rb Find the code at http://rubylearning.com/satishtalim/jruby_tutorial.html Note that the jruby wiki and some other links on that page appear to be dead. There is a more extensive example of using Java::Swing at https://www.oracle.com/technetwork/articles/dsl/jruby-141877.html#cj See attachment: jruby_swing.rb. However, I could not get it to run: $ jruby jruby_swing.rb ArgumentError: Java package `java.lang' does not have a method `boolean' method_missing at file:/usr/lib/java/jruby/jruby-core.jar!/jruby/java/java_package_module_template.rb:13 (root) at jruby_swing.rb:10 java does have a boolean type but apparently not implemented in jruby. Updated the packages. Same version of jruby but package is 1.7.22-5.1. Tutorial at https://www.techrepublic.com/article/jruby-an-introduction/ Fails from the command-line interface, because the 'java' module requires the jruby framework. Somewhere I saw 'jirb' being used instead of irb but have lost the link. https://www.roseindia.net/tutorials/jruby/ has some basic scripts of this sort: ------------------------------------------------------- # helloworld.rb require "java" message = "Hello World courtesy of jruby" stringdate = java.util.Date.new puts message puts "Date is #{stringdate}" ------------------------------------------------------- $ jruby helloworld.rb Hello World courtesy of jruby Date is Mon Feb 04 10:25:27 GMT 2019 ------------------------------------------------------- # arraylist.rb # Very contrived example require "java" names = %w[ Suzy Caroline Amanda Lucy ] java_import "java.util.ArrayList" blackbook = ArrayList.new names.each { |name| blackbook.add name } puts blackbook ------------------------------------------------------- $ jruby arraylist.rb [Suzy, Caroline, Amanda, Lucy] File reading... ------------------------------------------------------- # filereader.rb require "java" java_import "java.io.BufferedReader" java_import "java.io.FileReader" filename = ARGV[0] || Dir.home+"/.bashrc" filereader = FileReader.new filename buffer = BufferedReader.new filereader line = buffer.readLine while line puts line line = buffer.readLine end ------------------------------------------------------- Usage: jruby filereader.rb sometextfile or jruby filereader.rb Godd to go on the strength of this.
View Attachment As Raw
Actions:
View
Attachments on
bug 23158
:
10727
|
10729
| 10730