lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



> From: Enrico Colombini
> Sent: Friday, June 13, 2003 1:07 AM
> To: Lua list
> Subject: Re: Restricting file access
> 
> 
> On Thursday 12 June 2003 22:51, Nick Trout wrote:
> > I disabled the "unsafe" functions by doing something like: 
> openfile = 
> > function() print("unsafe") end
> 
> This works fine for statically linked code including the Lua 
> interpreter, but 
> could break when used with a resident Lua interpreter, if the 
> latter is 
> updated to a new version containing additional functions.

Perhaps I'm missing something, are you saying that with a different
version of the code, containing different functions the above code
wouldn't work? I was advocating blocking functions explicitly when they
are deemed "unsafe". The above example with openfile is from Lua 4, Lua
5 uses io.open so it will of course need changing, as it would if you
had different libraries bound. The above process is not in any way
automatic.

Regards,
Nick