From: us on
"Jan Sieber" <jan.sieber(a)port.ac.uk> wrote in message <hm6ujc$34k$1(a)fred.mathworks.com>...
> This is a teaching related question:
>
> I want to test automatically Matlab functions written by students using a Matlab script. I can easily catch errors with try/catch but how can I prevent from exexcution malicious code such as system calls or access to caller workspace inside the tested function? I have not found anything in the help about this topic.
>
> At the moment, my resort is to run these tests calling Matlab as a different user but this is impractical because then I cannot run Matlab under my original name anymore (licensing restriction).
>
> Any help would be appreciated,
> Jan

why would any of your students create -malicious- code(?)...
also, since you -probably- have to rate their submission(s), do you not have to at least glance at the code(?)...

us
From: Jan Simon on
Dear Us!

> why would any of your students create -malicious- code(?)...

Criminal intent is not logical. There is no reason to create any computer viruses. The mentioned cup of coffee method would be more efficient than:
"Give me an A and I'll give you the password to decrypt your private data..."

What about this: Force the students to demonstrate their code on their private laptops!

Jan
From: us on
"Jan Simon"
> What about this: Force the students to demonstrate their code on their private laptops!

well, if(f) one assumes a REALLY MALICIOUS person, he/she could easily fork a function's behavior according to some unique id from the computer/ip/...

but again, it should be easy for an experienced ML user to find such spots by looking at the code...

us
From: Matt Dunham on
"Jan Sieber" <jan.sieber(a)port.ac.uk> wrote in message <hm6ujc$34k$1(a)fred.mathworks.com>...
> This is a teaching related question:
>
> I want to test automatically Matlab functions written by students using a Matlab script. I can easily catch errors with try/catch but how can I prevent from exexcution malicious code such as system calls or access to caller workspace inside the tested function? I have not found anything in the help about this topic.
>
> At the moment, my resort is to run these tests calling Matlab as a different user but this is impractical because then I cannot run Matlab under my original name anymore (licensing restriction).
>
> Any help would be appreciated,
> Jan

What about installing vmware on your system, and Matlab within a virtual session?