[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How-to LUA script file access restrictions?
- From: "Peter Hill" <corwin@...>
- Date: Tue, 18 Mar 2003 11:09:34 +0800
>> Is there any possibility to restrict file access from scripts to
>> specified paths only without modifying the lua source code ?
Wim Couwenberg:
> You can redefine (in Lua) the lua functions that take a filename argument
> to check for validity of the path first.
> For lua 5.0: loadfile | dofile | io.open | io.input | io.output | io.lines
There seems to be a variety of places to intercept. Perhaps there should be
a single internal function (eg, "io.checkpath") that all these functions
use. It could take the specified path and return the real path (or nil if
the specified path is invalid).
It could be used to restrict access to full paths (returns argument
unchanged unless access is invalid) or to redirect access (prepending a full
path onto the argument).
*cheers*
Peter Hill.