<p>Hi all,</p>
<p>I have my students handing in an assignment via the handin server, in which I've asked them to use bitmap/url to load a particular image from my Web server. This obviously runs afoul of the sandbox rules, so I looked into the sandbox configuration docs and believe that what I need to do is something like</p>
<p>> (sandbox-network-guard<br>
> (lambda (caller host port cli/srv)<br>
> (unless (and (equal? host "<a href="http://my-server.com">my-server.com</a>")<br>
> (= port 80)<br>
> (eq? cli/srv 'client))<br>
> (error caller<br>
> "network permissions denied; failed to contact ~a:~a"<br>
> host port))))</p>
<p>(I would restrict it further to allow only fetching the one particular file, but don't see how.) The question I have is, how should I install this lambda in the sandbox-network-guard parameter so that it works properly? The problems I see are:</p>
<p>1. If I simply include the above code before the (check: ...) expression, it seems to work correctly for the first assignment handed in, and none thereafter.</p>
<p>2. Writing (parameterize ([sandbox-network-guard (lambda ...)]) (check: ...)) doesn't work, because (check: ...) must be at top-level to provide the checker function.</p>
<p>Thanks,<br>
jmj</p>