WeBWorK Main Forum

dangerous macros

dangerous macros

by joel robbin -
Number of replies: 2
What is dangerous about dangerousMacros.pl? Can these macros
cause the server to crash?
In reply to joel robbin

Re: dangerous macros

by Michael Gage -
These are the macros that have direct access to the hard disk and to the network. They were kept in one file so that one could check them more rigorously and make sure that this access was properly restricted. At one point in WeBWorK1 these were the only access points to the disk, but that is not completely true anymore in WeBWorK2 since it is possible to write library modules (*.pm files) which access the disk as well.

The "dangerous" macros are automatically loaded and are in constant use -- so they don't increase the probability of a server crash.


In reply to joel robbin

Re: dangerous macros

by Sam Hathaway -
Joel,

As the recently-improved docs for dangerousMacros.pl state:

dangerousMacros.pl contains macros that use potentially dangerous functions like require and eval. They can reference disk files for reading and writing, create links, and execute commands.

"dangerous" isn't really the best name for these -- think of them as "privileged" macros.
-sam