[plt-scheme] continuation barrier

From: DTNOIZR (dtnoizerz58 at yandex.ru)
Date: Sat Apr 18 02:15:28 EDT 2009

> This code runs without problems in PLT Scheme 4.1.5
I use 4.1.4. because of 4.1.5. have some errors ...

i wanna create web scheme interpreter
every user have its own sandbox with its own tweaks

(define make-personal-evaluator (lambda (e-mail)
  ;;functions, allowed for user (e-mail is user)
  (define allowed (get-allowed-functions-list e-mail))
  ;;make personal module for user
  ;;this module consist of allowed functions
  ;; '(module m ...)
  (define m `(module m scheme
               (require ;(only-in "livecoding/all.ss" , at allowed)
                        ;;all.ss - all functions that may be allowed
                        ;;now temporary without restrictions, just all.ss
  ;;some rules for evaluator
  ;;now it's simple
  ;;can I remove continuation barrier here ?
  (sandbox-security-guard (current-security-guard))
  (sandbox-make-code-inspector (let ([cci (current-code-inspector)])
                                 (lambda () cci)))
  ;;создаём персональный evaluator
  (make-module-evaluator m)))

then, using send/suspend inside and outside sandboxes
use sandboxing to create some parts of web-application
wanna create web-engine that can be developed by livecoding in its engine

18.04.09, 03:44, "Thomas Chust" <chust at web.de>:

> 2009-04-17 DTNOIZR <dtnoizerz58 at yandex.ru>:
> > [...]
> > how to remove continuation barrier from sandbox?
> > using sandboxing with web - using send/suspend - using continuations ...
> > send/suspend dont work in sandbox
> > [...]
> Hello,
> I don't think it is possible to remove a continuation barrier -- if
> that was possible it would defy the security aspect of this feature.
> However, a quick experiment with scheme/sandbox makes me doubt that
> sandbox evaluators really automatically install continuation barriers
> around the code they run:
> (require
>  scheme/sandbox)
> (define my-eval
>   (parameterize ([sandbox-output (current-output-port)])
>     (make-evaluator 'scheme/base)))
> ((my-eval '(begin
>              (define resume
>                #f)
>              (define ((set-resume!/value v) k)
>                (set! resume k) v)
>              (display (call/cc (set-resume!/value 1)))
>              (newline)
>              resume))
>  2)
> This code runs without problems in PLT Scheme 4.1.5, thus it is
> apparently possible to invoke a continuation created inside the
> sandbox outside of it.
> Maybe a more detailed description of your problem would shed some
> light on the situation...
> cu,
> Thomas
> -- 
> When C++ is your hammer, every problem looks like your thumb.

Posted on the users mailing list.