Permalink
Browse files

Refuse to load .so files from the filesystem. JRUBY-1263: JRuby is tr…

…ying to parse .so files.

git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@7847 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information...
headius committed Oct 7, 2008
1 parent 4002bfe commit 1b3f31c52dd7bd1c868f8f2fab829cf23cd5ca5e
Showing with 8 additions and 1 deletion.
  1. +3 −1 src/org/jruby/runtime/load/LoadService.java
  2. +1 −0 test/bogus.so
  3. +4 −0 test/test_load.rb
@@ -645,7 +645,9 @@ private Library createLibrary(SearchState state, LoadServiceResource resource) {
return null;
}
String file = state.loadName;
- if (file.endsWith(".jar")) {
+ if (file.contains(".so")) {
+ throw runtime.newLoadError("JRuby does not support .so libraries from filesystem");
+ } else if (file.endsWith(".jar")) {
return new JarredScript(resource);
} else if (file.endsWith(".class")) {
return new JavaCompiledScript(resource);
View
@@ -0,0 +1 @@
+fail
View
@@ -129,4 +129,8 @@ def require(file)
assert_equal File.expand_path(File.join('test', 'test_loading_behavior.rb')), res
end
+
+ def test_loading_so_fails
+ assert_raise(LoadError) { load("test/bogus.so") }
+ end
end

0 comments on commit 1b3f31c

Please sign in to comment.