View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006336 | The Dark Mod | Coding | public | 12.11.2023 11:43 | 02.01.2024 16:58 |
Reporter | stgatilov | Assigned To | stgatilov | ||
Priority | low | Severity | feature | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Product Version | TDM 2.11 | ||||
Target Version | TDM 2.12 | Fixed in Version | TDM 2.12 | ||
Summary | 0006336: Support several independent user addon scripts. | ||||
Description | Thanks to 0005179, there is a hardcoded script file which is included in tdm_main.script, and hardcoded global function name which is called on start. However, several people make addons, and players want to install them by merely putting them into a proper directory. For this to work, we need to include existing all script files matching a hardcoded template, and execute all global functions matching a hardcoded template. | ||||
Additional Information | Discussion thread: https://forums.thedarkmod.com/index.php?/topic/22261-support-for-multiple-user-addons/ | ||||
Tags | No tags attached. | ||||
Implemented in svn revs 10503 and 16844. The new interface for user addons can be seen in tdm_main.script: // dragofer: add support for users to add custom addon scripts to their base installation, without relying on tdm_custom_scripts.script which is often already in use by FM authors // legacy approach 0005179: include one script which can be overrided by players #include "script/tdm_user_addons.script" // new approach 0006336: include all scripts with predefined prefix #include "script/tdm_user_addons_*.script" void tdm_main() { ... // dragofer: initialises any user addons included // legacy approach 0005179: run single function (immediately) user_addon_init(); // new approach 0006336: run all functions with predefined prefix (in new threads) sys.callFunctionsByWildcard("user_addon_init_*"); } |
|
Updated instructions for creating user addons: https://wiki.thedarkmod.com/index.php?title=A_to_Z_Scripting:_Script_addons_for_players Announcement thread in the editor's guild subforum (set to hidden for now until some points are cleared up): https://forums.thedarkmod.com/index.php?/topic/22274-support-for-multiple-addons/ |
|
I was trying to assess the security aspects of this implementation (executing code in arbitrary files added to a TDM folder). My main concern was that someone may add a file to the folder without the user's knowledge and that the content of that file was executed when the user started TDM. But from what I understand, scripts are confined to only affect variables and objects created by TDM at runtime, and thus this implementation should not pose a risk. Right? |
|
If attacker can modify anything inside your TDM installation directory, then you are screwed. There are so many opportunities for arbitrary code execution that executing game scripts is not even interesting. |
|
Yes, maybe you're right. Is my description of the scripts' limitations correct? |
|
Date Modified | Username | Field | Change |
---|---|---|---|
12.11.2023 11:43 | stgatilov | New Issue | |
12.11.2023 11:43 | stgatilov | Status | new => assigned |
12.11.2023 11:43 | stgatilov | Assigned To | => stgatilov |
12.11.2023 11:43 | stgatilov | Relationship added | related to 0005179 |
12.11.2023 16:11 | Dragofer | Additional Information Updated | |
14.11.2023 11:29 | stgatilov | Note Added: 0016174 | |
14.11.2023 11:29 | stgatilov | Status | assigned => resolved |
14.11.2023 11:29 | stgatilov | Resolution | open => fixed |
14.11.2023 11:29 | stgatilov | Fixed in Version | => TDM 2.12 |
17.11.2023 23:30 | Dragofer | Note Added: 0016179 | |
02.01.2024 00:15 | Fiver | Note Added: 0016313 | |
02.01.2024 08:35 | stgatilov | Note Added: 0016314 | |
02.01.2024 16:58 | Fiver | Note Added: 0016316 |