[plt-scheme] Re: Using planet packages with the Handin server?

From: John Clements (clements at brinckerhoff.org)
Date: Tue Sep 22 18:53:13 EDT 2009

On Sep 22, 2009, at 12:23 PM, John Clements wrote:

> On Sep 21, 2009, at 2:52 PM, John Clements wrote:
>> Well, I'm coming back to this five months later, because PLAI is  
>> now a planet package, which means that my inability to refer to  
>> planet packages in the handin server now means that I can't make  
>> the handin server work with PLAI at all.
>> Specifically, I'm hoping that you or someone else with additional  
>> namespace-fu can help me with the necessary plumbing to implement  
>> your suggestion.  Alternatively, since (IIRC) you are use PLAI  
>> yourself, perhaps you've already extended the handin server to work  
>> with planet packages in a way that's not already obvious to me.
> Per a phone conversation with Eli, it appears that the key to making  
> this work in a nice way is to give "read" and "read-bytecode"  
> privileges to the planet directory, using 'sandbox-path-permissions'.
> This works:
> #lang scheme
> (require scheme/sandbox)
> (sandbox-path-permissions `((read-bytecode ,(string->path "/Users/ 
> clements/Library/PLT Scheme/"))
>                            (read ,(string->path "/"))))
> ((make-evaluator '(planet plai/plai) '(test (+ 3 4) 8)) 13)
> ... but I have to say, I was a bit alarmed by the requirement of  
> going all the way up to the *root* in the "read" permissions.  That  
> is, without this clause (or with a version of the clause that  
> specifies my planet directory) I get the error:
> cleanse-path: `exists' access denied for ../../../collects
> ... which befuddles me.

I looked at this just a bit more, and I have a conjecture about what's  
going on, though it's kind of a crazy one.  It looks like the call to  
'eval' is trying to locate a collections directory, and it looks like  
it's starting somewhere and just cruising on up through parent links  
until it finds one.  Perhaps it's starting with the location of the  
language?  So in this case, it starts with something in the planet  
tree, and keeps going up... until it hits the root of the filesystem.   
My conjecture does not explain why the thing would work when read  
access is granted to the whole file system; I would have instead  
expected some error about an inability to find the main collects dir.

In any case, if what I'm describing is correct, it would suggest that  
something in the mzscheme code implicitly assumes that the language is  
located in the main collects tree... of course, that's based on a  
tenuous chain of guesswork.

Any suggestions appreciated; giving access to student programs to the  
whole filesystem seems like an unfortunate solution.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20090922/224b5972/attachment.p7s>

Posted on the users mailing list.