[英]Clojail does not throw Security Exception in Clojure
I'm using clojail library for sandboxing but it does not behave as expected. 我正在使用clojail库进行沙盒处理,但它没有按预期运行。
Here is the code: 这是代码:
(ns jail.core
(:require [clojail.core :as s]
[clojail.testers :as t]))
(def my-tester [(t/blacklist-objects [clojure.lang.RT])
(t/blanket "clojail")])
(def sb (s/sandbox my-tester))
(println (sb '(do
(import clojure.lang.RT)
(RT/errPrintWriter))))
At (import clojure.lang.RT)
line it has to throw SecurityException but it does not. 在(import clojure.lang.RT)
行,它必须抛出SecurityException但它没有。
It returns PrintWriter(errPrintWriter) object. 它返回PrintWriter(errPrintWriter)对象。
It turns out if I don't pass the class object to import
macro, it just works but I think the behaviour is kinda odd. 事实证明,如果我不传递类对象import
宏,它只是工作,但我认为这种行为有点奇怪。
Here: 这里:
(println (sb '(do
clojure.lang.RT
(RT/errPrintWriter))))
Now I'm getting Security Exception, the import
macro somehow prevents clojail to throw Security Exception . 现在我得到安全异常, import
宏以某种方式阻止clojail抛出安全异常 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.