luci-base: pass session timeout as integer
[project/luci.git] / modules / luci-base / luasrc / dispatcher.lua
index 795b62b..f92af52 100644 (file)
@@ -333,7 +333,7 @@ function dispatch(request)
                                        return
                                else
                                        if not sess then
-                                               local sdat = util.ubus("session", "create", { timeout = luci.config.sauth.sessiontime })
+                                               local sdat = util.ubus("session", "create", { timeout = tonumber(luci.config.sauth.sessiontime) })
                                                if sdat then
                                                        local token = sys.uniqueid(16)
                                                        util.ubus("session", "set", {
@@ -371,6 +371,9 @@ function dispatch(request)
        end
 
        if track.setuser then
+               -- trigger ubus connection before dropping root privs
+               util.ubus()
+
                sys.process.setuser(track.setuser)
        end