From fdce917da5461f7b2a1a870be34da1a785cbfc4c Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Mon, 11 Aug 2008 10:49:44 +0000 Subject: [PATCH] libs/web: Even more sanity checks --- libs/web/luasrc/sauth.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/web/luasrc/sauth.lua b/libs/web/luasrc/sauth.lua index 8182679ce..c43117f3a 100644 --- a/libs/web/luasrc/sauth.lua +++ b/libs/web/luasrc/sauth.lua @@ -17,6 +17,7 @@ $Id$ module("luci.sauth", package.seeall) require("luci.fs") require("luci.util") +require("luci.sys") require("luci.config") @@ -65,7 +66,8 @@ end --- Check whether Session environment is sane. -- @return Boolean status function sane() - return luci.fs.stat(sessionpath, "mode") == "rwx------" + return luci.sys.process.info("uid") == luci.fs.stat(sessionpath, "uid") + and luci.fs.stat(sessionpath, "mode") == "rwx------" end -- 2.25.1