Created
February 9, 2017 01:58
-
-
Save zerg000000/315fb89c2c6694210734d55115dadab6 to your computer and use it in GitHub Desktop.
How to clojail a symbol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defproject test-cljail "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.8.0"] | |
[clojail "1.0.6"]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns my.project | |
(:use [clojail.core :only [sandbox]] | |
[clojail.testers :only [blacklist-symbols blacklist-objects]])) | |
(def tester [(blacklist-symbols #{'alter-var-root 'clojure.string/blank?}) | |
(blacklist-objects [java.lang.Thread])]) ; Create a blacklist. | |
(def sb (sandbox tester :timeout 5000)) | |
(sb '(println (clojure.string/blank? ""))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment