Global preferences - Lua
Preliminary code

You can enter some initial scripting that is executed every time that the Lua script engine is created. This can be used to set up a "sandbox", that is a safe environment for your scripts.

The default behaviour is to disable the "os" library (operating system calls), which could be used to execute arbitrary commands, and rename or delete files.

Also the "io" library is disabled, which could be used to read or overwrite existing files.

To revert to the default settings, delete everything from this window, and then close and re-execute MUSHclient.

Edit...

Click to edit the code in a larger window.

Allow DLLs to be loaded

Check this to allow DLLs to be loaded by Lua code.

Only check this if you are sure that you are not going to run untrusted scripts.

We suggest that before checking "Allow DLLs to be loaded" you edit the "sandbox" code and disallow use of the package library except for trusted worlds or plugins. For example, enter these lines in the sandbox:


package.loadlib = nil      --> disable loadlib function
package.loaders [3] = nil  --> disable DLL loader
package.loaders [4] = nil  --> disable all-in-one loader


The reason for the last two lines is that doing a "require" can trigger the DLL and all-in-one loaders, which are designed to load DLLs.


See Also ...

Topics

DOC_Arrays Arrays
DOC_lua_base Lua base functions
DOC_lua_bc Lua bc (big number) functions
DOC_lua_bit Lua bit manipulation functions
DOC_lua_coroutines Lua coroutine functions
DOC_lua_debug Lua debug functions
DOC_lua_io Lua io functions
DOC_lua_math Lua math functions
DOC_lua_os Lua os functions
DOC_lua_package Lua package functions
DOC_lua_rex Lua PCRE regular expression functions
DOC_lua Lua script extensions
DOC_lua_string Lua string functions
DOC_lua_tables Lua table functions
DOC_lua_utils Lua utilities
DOC_plugins Plugins
DOC_scripting Scripting
DOC_mxp_callbacks Scripting callbacks - MXP
DOC_plugin_callbacks Scripting callbacks - plugins
DOC_data_types Scripting data types
DOC_function_list Scripting functions list
DOC_errors Scripting return codes
DOC_utils Utilities
DOC_variables Variables
DOC_world World functions

Dialog

DLG_IDD_GLOBAL_PREFSP1 Global preferences - world lists and directories

(Help topic: dialog=IDD_GLOBAL_PREFSP13)

DOC_contents Documentation contents page