diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/core/luasrc/sys.lua | 2 | ||||
-rw-r--r-- | libs/web/luasrc/dispatcher.lua | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libs/core/luasrc/sys.lua b/libs/core/luasrc/sys.lua index c5c471a75f..e5f19f20b8 100644 --- a/libs/core/luasrc/sys.lua +++ b/libs/core/luasrc/sys.lua @@ -289,7 +289,7 @@ function user.checkpasswd(username, password) local account = user.getuser(username) -- FIXME: detect testing environment - if luci.fs.isfile("/etc/shadow") and not luci.fs.access("/etc/shadow", "r") then + if luci.fs.stat("/etc/shadow") and not luci.fs.access("/etc/shadow", "r") then return true elseif account then if account.passwd == "!" then diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua index 7c28f6a78e..689d060d52 100644 --- a/libs/web/luasrc/dispatcher.lua +++ b/libs/web/luasrc/dispatcher.lua @@ -75,7 +75,7 @@ function sysauth(default) if user and luci.sys.user.checkpasswd(user, pass) then local sid = luci.sys.uniqueid(16) - luci.http.header("Set-Cookie", "sysauth=" .. sid) + luci.http.header("Set-Cookie", "sysauth=" .. sid.."; path=/") luci.sauth.write(sid, user) return true else @@ -291,7 +291,7 @@ end -- Reassigns a node to another position function assign(path, clone, title, order) - local obj = node(path) + local obj = node(unpack(path)) obj.nodes = nil obj.module = nil |