Created
January 4, 2015 19:26
-
-
Save KillerGoldFisch/e176b703e8fc68f75493 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/bin/env python | |
| # This Module is a wrapper for the gentoo sandbox tool. | |
| # For Debian based systems take a look at https://wiki.debian.org/Sandbox | |
| import subprocess, os | |
| def addto(varname, value): | |
| tmpval = "" | |
| #if varname in os.environ: | |
| # tmpval += os.environ + ":" | |
| tmpval += ":".join(value) | |
| os.environ[varname] = tmpval | |
| def startsandbox(cmd, deny=[], write=[], read=[], predict=[]): | |
| addto("SANDBOX_DENY", deny) | |
| addto("SANDBOX_WRITE", write) | |
| addto("SANDBOX_READ", read) | |
| addto("SANDBOX_PREDICT", predict) | |
| cmd = "sandbox \"" + " ".join(cmd) + "\"" | |
| print "Run in Sandbox: " + cmd | |
| subprocess.call(cmd , shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment