WeBWorK Main Forum

How turn off all security constraints on webwork problem files?

How turn off all security constraints on webwork problem files?

by Christian Seberino -
Number of replies: 4
I am the only teacher that uses my Webwork server. I also write all my own problems.

I'd like to know if there is a way to turn off all security constraints on problem files so I can easily to do things like file I/O and run Inline:Python.

Sincerely,

Chris
In reply to Christian Seberino

Re: How turn off all security constraints on webwork problem files?

by Michael Gage -
Probably not easily, but the file you need to doctor is pg/lib/WeBWorK/PG/Translator.pm. You want to either remove or open wide the Safe compartment that is created there. There may be some lines in webwork2/lib/PG/Local.pm that need doctoring as well.


In reply to Michael Gage

Re: How turn off all security constraints on webwork problem files?

by Christian Seberino -
Would it be easier for any reason if I only asked to open up a limited number of services? For example, if I could run Inline::Python and allow file I/O, that should be enough.

cs
In reply to Christian Seberino

Re: How turn off all security constraints on webwork problem files?

by Davide Cervone -
I think the way you should probably do this is to write a module that provides an interface for the features you need, and put that in a file in pg/lib and add it to the ${pg}{modules} list in your global.conf or localOverrides.conf file.

These files run outside the safe compartment, so you can do file access and system calls from them. In this way, you can make functions that you can call from your PG files that have more open access, but it is mediated by your code rather than simply opening up everything.

Davide
In reply to Davide Cervone

Re: How turn off all security constraints on webwork problem files?

by Christian Seberino -
Thank you very much. That sounds like a wonderful clean way to do it.

I'll definitely try that.

Chris