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

How to limit access to filesystem? #27

Closed
bbuck opened this issue May 8, 2015 · 4 comments
Closed

How to limit access to filesystem? #27

bbuck opened this issue May 8, 2015 · 4 comments

Comments

@bbuck
Copy link

bbuck commented May 8, 2015

If I wanted to "lockdown" the Lua thread running so that it only had access to a select number of files that are predetermined or determined by an outside source how would I go about doing so?

I can't seem to find any functions that would allow this behavior so the only course of action I can see is replacing loRequire with something else (reassigning that global) and removing the load* series and dofile methods.

Do you have a clean way to do this other than what my thoughts are?

Also, secondary, but you don't provide any examples of LUserData on the README, perhaps add some? As I become more familiar with this library, if you haven't done them already I'll see about doing it to help out.

@yuin
Copy link
Owner

yuin commented May 9, 2015

Sandboxing in Lua has been discussed on web from a while before.
It is basically achieved by replacing unsafe functions with safe ones using setfenv( or simply assigning nil to global variables).
Please refer to following urls.

Ok, I will write about LUserData to the README.

@bbuck
Copy link
Author

bbuck commented May 9, 2015

Thanks for the quick reply, I'll check those links. Thanks for this library too! 👍

yuin added a commit that referenced this issue May 9, 2015
@yuin
Copy link
Owner

yuin commented May 9, 2015

Ok, I will write about LUserData to the README.

I wrote it down here.

@bbuck
Copy link
Author

bbuck commented May 12, 2015

Thanks for the information, I'll close this issue since you've provided a response to everything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants