Advertisement
Guest User

Untitled

a guest
Sep 28th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. $ make
  2. ./perl6-p --target=pir --output=src/gen/RESTRICTED.setting.pir src/RESTRICTED.setting
  3. ===SORRY!===
  4. Can only use nqp_set_sc_for_object with a SixModelObject
  5. *** Error code 1
  6.  
  7. Stop.
  8. make: stopped in /usr/home/christian/perl6-roast-data/rakudo.parrot
  9.  
  10. $ cat src/RESTRICTED.setting
  11. sub restricted($what) {
  12. die "$what is disallowed in restricted setting"
  13. }
  14.  
  15. sub open(|) { restricted('open') }
  16. sub unlink(|) { restricted('unlink') }
  17. sub shell(|) { restricted('shell') }
  18. sub run(|) { restricted('run') }
  19. sub QX(|) { restricted('qx, qqx') }
  20. sub mkdir(|) { restricted('mkdir') }
  21. sub rmdir(|) { restricted('rmdir') }
  22. sub rename(|) { restricted('rename') }
  23. sub copy(|) { restricted('copy') }
  24. sub spurt(|) { restricted('spurt') }
  25. sub link(|) { restricted('link') }
  26. sub symlink(|){ restricted('symlink') }
  27. sub chmod(|) { restricted('chmod') }
  28.  
  29. my class RESTRICTED is Mu {
  30. method FALLBACK(|) { restricted(self.^name) } # NYI, but see S12
  31. method new(|) { restricted(self.^name) }
  32. method gist(|) { restricted(self.^name) }
  33. }
  34.  
  35. my class IO::Handle is RESTRICTED { }
  36. my class IO::Socket is RESTRICTED { }
  37. #?if moar
  38. my class Proc::Async is RESTRICTED { }
  39. #?endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement