-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
When tripping a tester that uses the ClojailWrapper, the error message uses the default Object.toString and thus doesn't contain much useful context:
=> (let [sb (sandbox secure-tester)]
(sb '(java.util.concurrent.ForkJoinPool.)))
Execution error (SecurityException) at clojail.core/security-exception (core.clj:119).
You tripped the alarm! clojail.testers.ClojailWrapper@5f0e3437 is bad!It looks like this could be fixed by adding a toString implementation to ClojailWrapper:
--- a/src/clojail/testers.clj
+++ b/src/clojail/testers.clj
@@ -5,12 +5,15 @@
(:require [bultitude.core :as nses]
[serializable.fn :as sfn]))
-(deftype ClojailWrapper [object])
+(deftype ClojailWrapper [object]
+ Object
+ (toString [this]
+ (pr-str object)))
(defmethod print-method ClojailWrapper
[p out]
(.write out (str "#clojail.testers.ClojailWrapper["
- (binding [*print-dup* true] (pr-str (.object p)))
+ (binding [*print-dup* true] (str p))
"]")))
(defn wrap-object=> (let [sb (sandbox secure-tester)]
(sb '(java.util.concurrent.ForkJoinPool.)))
Execution error (SecurityException) at clojail.core/security-exception (core.clj:119).
You tripped the alarm! "java.util.concurrent" is bad!Metadata
Metadata
Assignees
Labels
No labels