[Commits] [wesnoth/wesnoth] 76d407: Expose preferences to Lua

GitHub noreply at github.com
Sat Sep 24 15:32:14 UTC 2016


  Branch: refs/heads/expose-preferences-to-lua
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 76d407e733b9bf1e0cc62a8c79f0ab69151242c1
      https://github.com/wesnoth/wesnoth/commit/76d407e733b9bf1e0cc62a8c79f0ab69151242c1
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2016-09-24 (Sat, 24 Sep 2016)

  Changed paths:
    M changelog
    M projectfiles/VC12/wesnoth.vcxproj
    M projectfiles/VC12/wesnoth.vcxproj.filters
    M src/CMakeLists.txt
    M src/SConscript
    M src/scripting/lua_kernel_base.cpp
    A src/scripting/lua_preferences.cpp
    A src/scripting/lua_preferences.hpp

  Log Message:
  -----------
  Expose preferences to Lua


  Commit: c2d3607d4959022685c319a9ca503357c3cd873c
      https://github.com/wesnoth/wesnoth/commit/c2d3607d4959022685c319a9ca503357c3cd873c
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2016-09-24 (Sat, 24 Sep 2016)

  Changed paths:
    M changelog
    M src/scripting/application_lua_kernel.cpp
    M src/scripting/lua_kernel_base.cpp

  Log Message:
  -----------
  Restrict preference access to plugins

@gfgtdf pointed out that preferences contain MP passwords. We can't allow
untrusted code to access them. Since we only need preference access from
plugins for now, the simplest way to avoid security issues is to block Lua
code outside of plugins from accessing preferences at all.


  Commit: 02b2ac5a17d365f64aff46669a09df8e32b0d4cd
      https://github.com/wesnoth/wesnoth/commit/02b2ac5a17d365f64aff46669a09df8e32b0d4cd
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2016-09-24 (Sat, 24 Sep 2016)

  Changed paths:
    M src/preferences.cpp
    M src/preferences.hpp
    M src/scripting/lua_preferences.cpp
    M src/scripting/lua_preferences.hpp

  Log Message:
  -----------
  Address feedback

* Changed the plugin preference API to use luaW_pushscalar() and
luaW_toscalar() to handle preference values.
* Set the __metatable field in the "preferences" table, which blocks Lua
code from changing the metatable and allows developers to query where the
metatable originates.
* Added empty lines to the end of new files.


Compare: https://github.com/wesnoth/wesnoth/compare/460270baaf7d...02b2ac5a17d3


More information about the Commits mailing list