From: Steven Barth Date: Mon, 11 Aug 2008 10:49:44 +0000 (+0000) Subject: libs/web: Even more sanity checks X-Git-Tag: 0.8.0~471 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=fdce917da5461f7b2a1a870be34da1a785cbfc4c libs/web: Even more sanity checks --- 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