lua-users home
lua-l archive

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


In lua, you could do something like this before any of the client scripts
try to open a file:

local io_open = io.open

-- this replacement ensures that the unrestricted version becomes
unavailable
io.open=function(<args>)
	--restrict paths here
	if <path is authorized>
	then
		return io_open(<args>)
	else
		return nil
	end
end



Cheers,

Benoit.

-----Message d'origine-----
De : Zdenek Stangl [mailto:ptaczek@svamberk.net]
Envoyé : lundi 17 mars 2003 16:13
À : Multiple recipients of list
Objet : How-to LUA script file access restrictions?


Is there any possibility to restrict file access from scripts to specified
paths only without modifying the lua source code ?

Ptaczek.