comparison src/luan/modules/PackageLuan.java @ 1330:f41919741100

fix security
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 11 Feb 2019 01:38:55 -0700
parents 2c8d1d76a82a
children 25746915a241
comparison
equal deleted inserted replaced
1329:5a39b006acd1 1330:f41919741100
91 try { 91 try {
92 boot = (LuanTable)luan.require("luan:Boot.luan"); 92 boot = (LuanTable)luan.require("luan:Boot.luan");
93 } catch(LuanException e) { 93 } catch(LuanException e) {
94 throw new RuntimeException(e); 94 throw new RuntimeException(e);
95 } 95 }
96 Luan.Security security = Luan.setSecurity(luan,null);
96 try { 97 try {
97 return (String)Luan.first(boot.call("read",uri)); 98 return (String)Luan.first(boot.call("read",uri));
98 } catch(LuanException e) { 99 } catch(LuanException e) {
99 return null; 100 return null;
101 } finally {
102 if( security != null )
103 Luan.setSecurity(luan,security);
100 } 104 }
101 } 105 }
102 106
103 public static void enableLoad(LuanState luan,String... mods) throws LuanException { 107 public static void enableLoad(LuanState luan,String... mods) throws LuanException {
104 if( !luan.isLocked ) 108 if( !luan.isLocked )