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 
> value)
> > 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 
> can 
> 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
tomorrow.


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
nasty?

-- 
Michal Mazurek

_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to