lua-users home
lua-l archive

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

----- Original Message ----- 
From: "Hans Fuchs" <>
To: "Multiple recipients of list" <>
Sent: Friday, August 30, 2002 10:21 AM
Subject: Functions with ACLs

> By using this method I see a big performance problem, the function isn't 
> just once compiled when it is defined. It is compiled each time the 
> function is accessed. There for I thought I might use luac and 
> luab_dostring. So I would keep a already compiled version of the script 
> returning my function.

I don't see any problems with doing this like this; however, I might keep
the compiled and uncompiled versions around in the database (depends on
what kind of multiuser database your writing), if the uncompiled version
changes, I would then recompile it once and update the compiled version.

> Would using the precompiled script reach almost the same perfomance as a 
> normaly defined function?

The only real difference in Lua between precompiled scripts and
non-precompiled scripts is the loading phase.  The actuall execution speed
of the scripts does not change.

] ... SNIP ... [

> Ideas?

Just as a thought, I don't for see the actual Lua code necessarily needing
to be checked by an ACL, I would think the "dangerous" functions that would
need something like an ACL would be written in C.  In which case you would
do your ACL checks there, and return error codes to your Lua scripts
so they could take approperate actions.

Obviously, this may not always be the case, you might have a legitamit
reason for wanting your Lua function to protected by an ACL.  Your index
method is a very nice idea, I hadn't thought of it myself, but is it run
against every function or just a select few?  If its every function I
would raise possible conserns about performance.

And of course my last question is about the ACL itself.  Can the scripts
actually modify or change the ACL?  Can the check the ACL for entries?
Where are you saving the ACL?  How is it protected?  Etc, so on and so
forth.  These are mostly security conserns, but imporant ones.
Implenting an ACL, is a Good Idea(tm) though.

Kelmar K. Firesun (IRL: Bryce Simonds)