Skip to content

Instantly share code, notes, and snippets.

@zerg000000
Created February 9, 2017 01:58
Show Gist options
  • Save zerg000000/315fb89c2c6694210734d55115dadab6 to your computer and use it in GitHub Desktop.
Save zerg000000/315fb89c2c6694210734d55115dadab6 to your computer and use it in GitHub Desktop.
How to clojail a symbol
(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"]])
(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