Skip to content

Commit

Permalink
Update to 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynes committed Oct 14, 2011
1 parent b0257d4 commit e05be37
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
9 changes: 2 additions & 7 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
(defproject clojail "0.4.0-SNAPSHOT"
(defproject clojail "0.4.1"
:description "An experimental sandboxing library."
:dependencies [[clojure "1.2.0"]
[amalloy/utils "[0.3.7,)"]]
:dev-dependencies [[swank-clojure "1.2.1"]
[clojure-contrib "1.2.0"]
[cake-autodoc "0.0.1-SNAPSHOT"]]
:tasks [cake-autodoc.tasks]
:dependencies [[clojure "1.3.0"]]
:main clojail.main)
9 changes: 7 additions & 2 deletions src/clojail/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,17 @@
[~'obj-class#
~'obj#
(.getPackage ~'obj-class#)])]

(throw (SecurityException. (str "You tripped the alarm! " ~'bad# " is bad!")))
(. ~object# ~method# ~@args#))))
~(with-bindings bindings (ensafen code)))]
(jvm-sandbox #(with-bindings bindings (eval code)) context))))
~(doseq [[var new-var] bindings]
(alter-var-root var (constantly new-var)))
~(ensafen code))]
(jvm-sandbox #(eval code) context))))
timeout :ms transform)))))

(+ 4 5)

(defn sandbox
"Convenience wrapper function around sandbox* to create a sandbox function out of a tester.
Takes the same arguments as sandbox* with the addition of the tester argument. Returns a
Expand Down
3 changes: 2 additions & 1 deletion test/clojail/core_test.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns clojail.core-test
(:use [clojail core testers]
clojure.test))
clojure.test)
(:import java.io.StringWriter))

(def sb (sandbox secure-tester))
(def easy (sandbox #{}))
Expand Down

0 comments on commit e05be37

Please sign in to comment.