#186 requestsystemaccess() (yes) isn't.

v1.5.1
closed
5
2009-02-14
2008-03-04
Selden Ball
No

The os. table should be usable in all of Celestia's Lua environments.

According to Vincent, the Lua system table os. works in the Lua Hook environment.

However, even after calling requestsystemaccess()
the os. table returns a nil when called from Celx scripts and from ScriptedOrbits and Rotations. It should return correct values.

Discussion

  • Selden Ball
    Selden Ball
    2008-03-04

    • milestone: --> v1.5.1
    • summary: os. table returns nil --> requestsystemaccess() (yes) isn't.
     
  • Selden Ball
    Selden Ball
    2008-03-04

    Logged In: YES
    user_id=662401
    Originator: YES

    According to Vincent's tests, the os. table is usable if one specifies
    ScriptSystemAccessPolicy "allow" in celestia.cfg

    However, it does not work if one specifies
    ScriptSystemAccessPolicy "ask"
    and answers yes.

    This is a bug: the two conditions (ask=yes and allow) need to be exactly equivalent.

     
  • vincent
    vincent
    2008-03-04

    Logged In: YES
    user_id=1605452
    Originator: NO

    This bug only occures with a version of Celestia built against Lua 5.1. With a version of Celestia built against Lua 5.0, setting ScriptSystemAccessPolicy to "ask" and answering 'yes' is equivalent to setting ScriptSystemAccessPolicy to "allow".

     
  • vincent
    vincent
    2008-03-04

    Logged In: YES
    user_id=1605452
    Originator: NO

    The following one-line change fixes the bug:

    --- celx.cpp (revision 4157)
    +++ celx.cpp (working copy)
    @@ -730,6 +731,7 @@
    #if LUA_VER >= 0x050100
    openLuaLibrary(costate, LUA_LOADLIBNAME, luaopen_package);
    openLuaLibrary(costate, LUA_IOLIBNAME, luaopen_io);
    + openLuaLibrary(costate, LUA_OSLIBNAME, luaopen_os);
    #else
    lua_iolibopen(costate);
    #endif

     
  • Chris Laurel
    Chris Laurel
    2008-03-05

    Logged In: YES
    user_id=159994
    Originator: NO

    Please check in this change, Vincent. The exclusion of the os library for Lua 5.1 was not intentional.

     
  • vincent
    vincent
    2009-02-14

    • status: open --> closed