Revision: 4666
          http://sourceforge.net/p/vexi/code/4666
Author:   mkpg2
Date:     2014-02-25 11:53:24 +0000 (Tue, 25 Feb 2014)
Log Message:
-----------
Fix. Security issue when running in a browser.

Modified Paths:
--------------
    trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Launcher.java

Modified: trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Launcher.java
===================================================================
--- trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Launcher.java       
2014-02-25 10:37:54 UTC (rev 4665)
+++ trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Launcher.java       
2014-02-25 11:53:24 UTC (rev 4666)
@@ -12,6 +12,7 @@
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.net.URLConnection;
+import java.security.Permission;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -464,7 +465,15 @@
                    
                    spawn(command);
             }else{
-
+               // REMARK this is required, otherwise the classes loaded by the 
URLClassLoader
+               // do not have full rights (cannot read system props, access 
files ... etc.)
+               // There may be a more proper way to achieve this ...
+               System.setSecurityManager(new SecurityManager(){
+                        public void checkPermission(Permission perm) {  
+                               return;  
+                        } 
+               }); 
+               
                String[] argsArr = (String[])args.toArray(new 
String[args.size()]);
                URL[] urls = new URL[]{corefile.toURI().toURL()};
                URLClassLoader cl = new URLClassLoader(urls);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to