Skip to content

Instantly share code, notes, and snippets.

@ashgti
Created August 27, 2010 19:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ashgti/553994 to your computer and use it in GitHub Desktop.
module Safe {
our sub forbidden(*@a, *%h) { die "Operation not permitted in safe mode" };
Q:PIR {
$P0 = get_hll_namespace
$P1 = get_hll_global ['Safe'], '&forbidden'
$P0['!qx'] = $P1
null $P1
set_hll_global ['IO'], 'Socket', $P1
};
};
Q:PIR {
.local pmc s
s = get_hll_global ['Safe'], '&forbidden'
$P0 = getinterp
$P0 = $P0['outer';'lexpad';1]
$P0['&run'] = s
$P0['&open'] = s
$P0['&slurp'] = s
$P0['&unlink'] = s
$P0['&dir'] = s
};
# EVALBOT ARTIFACT
use FORBID_PIR;
Perl6::Compiler.interactive();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment