libs/web: Even more sanity checks
authorSteven Barth <steven@midlink.org>
Mon, 11 Aug 2008 10:49:44 +0000 (10:49 +0000)
committerSteven Barth <steven@midlink.org>
Mon, 11 Aug 2008 10:49:44 +0000 (10:49 +0000)
libs/web/luasrc/sauth.lua

index 8182679..c43117f 100644 (file)
@@ -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