On Tue, Nov 15, 2011 at 06:27:31PM +0100, Matthias Pfafferodt wrote:
> Am Dienstag, 15. November 2011, 10:59:47 schrieb Michal Mazurek:
> > On Mon, Nov 14, 2011 at 10:09:56AM +0100, Michal Mazurek wrote:
> > > Can i have other files than the default.lua and script.lua? I want each
> > > functionality (auth, newcomers) to be in a separate file.
> > I added dofile("longturn.lua") to script.lua. This is what i got:
> > 1: lua error:
> > data/longturn/script.lua:56: attempt to call global 'dofile' (a nil
> > stack traceback:
> > data/longturn/script.lua:56: in main chunk
> > 0: "data/longturn/script.lua": could not load ruleset script.
> > Why can't i dofile() in freeciv?
> The usage of such commands is restricted due to security implications. You
> not load a lua file! Only default.lua and script.lua are read. Or you have to
> use the command 'lua file <...>' (I think it is named luafile in S2_3).
In S2_3 there is only lua that executes a line of lua code. There is no
functionality to load a file, I'll try to backport it to my repo
Frankly, I dont understand how that helps with security. If you are the
administrator you can do anything anyway, so why restrict yourself?
Could you please provide a scenario when dofile can lead to something
Freeciv-dev mailing list