From: Sabbir Ahmed Date: Sat, 12 Sep 2015 09:11:18 +0000 (+0600) Subject: modules/luci-mod-rpc: fix attempt to index global 'luci' (a nil value) X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7ad426e54f538da988edf037dc6cdc05d6dc0920;p=oweals%2Fluci.git modules/luci-mod-rpc: fix attempt to index global 'luci' (a nil value) --- diff --git a/modules/luci-mod-rpc/luasrc/controller/rpc.lua b/modules/luci-mod-rpc/luasrc/controller/rpc.lua index 129ca43b5..759bb749c 100644 --- a/modules/luci-mod-rpc/luasrc/controller/rpc.lua +++ b/modules/luci-mod-rpc/luasrc/controller/rpc.lua @@ -49,10 +49,10 @@ function rpc_auth() server.challenge = function(user, pass) local sid, token, secret - require "luci.config" + local config = require "luci.config" if sys.user.checkpasswd(user, pass) then - local sdat = util.ubus("session", "create", { timeout = luci.config.sauth.sessiontime }) + local sdat = util.ubus("session", "create", { timeout = config.sauth.sessiontime }) if sdat then sid = sdat.ubus_rpc_session token = sys.uniqueid(16)