I am using (run)hugs to grade students' homework: they send some Haskell code (by email), this gets imported from a test program which is run by `runhugs' (and its output is mailed back to the sender).
Now, running arbitrary programs is potentially dangerous, but Haskell's type system ensures that they don't do nasty IO stuff - as long as students don't know about unsafePerformIO.
What is a realiable way to prohibit the usage of such functions?
You might try a Unix-style way of doing it... use chroot(1) or chroot(2) to provide an environment within which the code can do what it likes, but be insulated from the rest of the system.
Just an idea. I haven't tried it.
--KW 8-)
--
Keith Wansbrough
Keith:
You might try a Unix-style way of doing it... use chroot(1) or chroot(2) to provide an environment within which the code can do what it likes, but be insulated from the rest of the system.
OK, I'll think about this. Ideally I want the distinction (trusted / tainted code) at the Haskell module (even identifier?) level, because I want the test program to communicate with the test driver/logger, which is a Haskell program as well, that *has* to do IO things. With the above suggestion, they could only communicate via the OS (by writing files). regards, -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --
In local.hugs-users, you wrote:
I am using (run)hugs to grade students' homework: they send some Haskell code (by email), this gets imported from a test program which is run by `runhugs' (and its output is mailed back to the sender).
You might try a Unix-style way of doing it... use chroot(1) or chroot(2) to provide an environment within which the code can do what it likes, but be insulated from the rest of the system.
Don't forget setting sensible ulimits, we sat here with gleaming eyes imagineing all the funny things we could do to your machine even inside chroot :) -- Abstrakte Syntaxträume. Volker Stolz * stolz@i2.informatik.rwth-aachen.de * PGP + S/MIME
participants (3)
-
Johannes Waldmann -
Keith Wansbrough -
Volker Stolz