[racket] Handin Server + PLAI problem [and 1 more messages] [and 2 more messages]

From: Eli Barzilay (eli at barzilay.org)
Date: Sun Jan 15 19:45:04 EST 2012

50 minutes ago, Robby Findler wrote:
> 
> I'm not sure either (this is certainly not the only contract that's
> checked during the execution of PLAI programs, but maybe it's the
> only provide/contract one?), but once I disabled that, my sample
> solution for the next exercise went through.
> 
> It would be good to know how to get a better short-term solution,
> however (like making a more relaxed sandbox that allows exists
> queries in the handin server).

This is "easy":

  (parameterize ([sandbox-path-permissions '([exists "/"])])
    ...make the evaluator...)

except that I think that in the context of the handin server you don't
create it directly.  It's probably doable by making the change
globally, via a hook:

Create a "hook.rkt" file with:

  #lang racket/base
  (provide hook)
  (require racket/sandbox)
  (define (hook what session alist)
    (when (eq? what 'server-start)
      (sandbox-path-permissions '([exists "/"]))))

Then wire it in with an entry in the config file that says:

  (hook-file "hook.rkt")

Or, if you already have a hook, then add the parameter change to it.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.