Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isolated lua states #4

Merged
merged 1 commit into from
Oct 27, 2024
Merged

Conversation

Absolucy
Copy link
Contributor

This adds isolated Lua states, intended for use with untrusted code (my intent is to try to use this to replace NTSL on MonkeStation)

An isolated state can be created by passing TRUE as an argument to new_state. This is not a breaking change - if no argument is given, it will default to a normal, non-isolated state.

A new exported function is also available, is_isolated, which is exactly what it says on the tin, it just returns true/false if the given state is isolated or not.

State isolation is store as a boolean registry value named isolated.

Isolated states do not have the dm, list, or pointer modules, and any sort of userdata will just be converted to nil.

@Y0SH1M4S73R
Copy link
Collaborator

Don't see any problems here. I'll prepare a release commit.

@Y0SH1M4S73R Y0SH1M4S73R merged commit b98ebce into tgstation:master Oct 27, 2024
4 checks passed
@Absolucy Absolucy deleted the isolation branch October 27, 2024 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants