<html><head/><body><html><head></head><body>Hi all,<br>
<br>
My immediate need for a response to the message below has passed, but I'd still like to know for next time, at least if my idea of a solution was accurate. Anybody?<br>
<br>
Thanks,<br>
jmj <br>
-- <br>
Sent from my Android phone with K-9 Mail.<br><br><div class="gmail_quote">Jordan Johnson <jmj@fellowhuman.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<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>
<p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><pre style="white-space: pre-wrap; word-wrap:break-word; font-family: monospace; margin-top: 0px">____________________<br />Racket Users list:<br /><a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br /></pre></blockquote></div></body></html></body></html>