Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Deprecate SAFE.setting in favor of RESTRICTED.setting.

  • Loading branch information...
commit f2e4257eec803fed017e122019b1fd0709bf3c17 1 parent 86b3009
@pmichaud pmichaud authored
Showing with 21 additions and 0 deletions.
  1. +3 −0  docs/ChangeLog
  2. +18 −0 src/RESTRICTED.setting
View
3  docs/ChangeLog
@@ -1,3 +1,6 @@
+New in 2012.07
++ Deprecated SAFE.setting in favor of RESTRICTED.setting
+
New in 2012.06
+ Rakudo is now compiled with the same regex engine as user-space regexes use
+ transitive longest-token matching in protoregexes
View
18 src/RESTRICTED.setting
@@ -0,0 +1,18 @@
+sub restricted($what) {
+ die "$what is disallowed in restricted setting"
+}
+
+sub open(|$) { restricted('open') }
+sub unlink(|$) { restricted('unlink') }
+sub shell(|$) { restricted('shell') }
+sub run(|$) { restricted('run') }
+sub QX(|$) { restricted('qx, qqx') }
+sub mkdir(|$) { restricted('mkdir') }
+sub rmdir(|$) { restricted('rmdir') }
+sub rename(|$) { restricted('rename') }
+sub copy(|$) { restricted('copy') }
+
+my class IO { }
+IO.^add_fallback(
+ -> $, $ { True },
+ -> $, $ { restricted('IO') });
Please sign in to comment.
Something went wrong with that request. Please try again.