Le lundi 7 décembre 2015, 12:06:55 Gianfranco Costamagna a écrit :
>
> I guess the libraries are somewhat opened in the lines below
> "local lfs = require "lfs"" <<- lua-filesystem
> "local lpeg = require "lpeg"" <<- lua-lpeg
> 
> but I don't think you are actually opening the sofiles but the .lua version
> http://www.lua.org/pil/8.1.html
> (require keyword)
> 
> also please check the "luaL_openlibs" function in the source code.
> 
> there are many "require" in the code, I would check all of them :)

I trust what I know:  strace.

There's one library missing: "lua-socket", which is solely used
for a call-home / breach of privacy anti-feature.

I would disable it at build-time with sed.
(beacause lua-socket might have been pulled
by an other package)


CorsixTH/Lua/config_finder.lua
-- Create config.txt if it doesn't exist
local config_defaults = {
  check_for_updates = true
}


strace -e open -F corsix-th  2>&1 | grep /usr/lib | cut -f2 -d\" | sort -u | 
grep lua
/usr/lib/lua/5.2/socket.so
/usr/lib/x86_64-linux-gnu/liblua5.2.so.0
/usr/lib/x86_64-linux-gnu/lua/5.2/lfs.so
/usr/lib/x86_64-linux-gnu/lua/5.2/lpeg.so
/usr/lib/x86_64-linux-gnu/lua/5.2/socket.so

LANG=C dpkg -S $(strace -e open -F corsix-th  2>&1 | grep /usr/lib | cut -f2 
-d\" | sort -u | grep lua)
dpkg-query: no path found matching pattern /usr/lib/lua/5.2/socket.so
liblua5.2-0:amd64: /usr/lib/x86_64-linux-gnu/liblua5.2.so.0
lua-filesystem:amd64: /usr/lib/x86_64-linux-gnu/lua/5.2/lfs.so
lua-lpeg:amd64: /usr/lib/x86_64-linux-gnu/lua/5.2/lpeg.so
dpkg-query: no path found matching pattern 
/usr/lib/x86_64-linux-gnu/lua/5.2/socket.so

-------------------------------------------------

CorsixTH/Lua/app.lua

  local success, socket = pcall(require, "socket")

  if not success then
    -- LuaSocket is not available, just return
    print "Cannot check for updates since LuaSocket is not available."
    return
  else
    self.lua_socket_available = true
  end
  local http = require "socket.http"
  local url = require "socket.url"

  print "Checking for CorsixTH updates..."
  local update_body, status, headers = http.request(update_url)

Reply via email to