summaryrefslogtreecommitdiffhomepage
path: root/build
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-03-13 23:18:13 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-03-13 23:18:13 +0000
commit5dd25cf43ee9d78d586d7d2d568d0b7e5cb9d5a2 (patch)
tree44752415c3029a96840a09df7dff3bcfc53811c6 /build
parent005fd26cf6afbf536cda69a7d235de718520b541 (diff)
build: override sys.user.getpasswd and nixio.fs.access in sdk environment
Diffstat (limited to 'build')
-rw-r--r--build/setup.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/build/setup.lua b/build/setup.lua
index 7888d23ec..f4ed76954 100644
--- a/build/setup.lua
+++ b/build/setup.lua
@@ -18,6 +18,7 @@ uci_model.inst_state = uci_model.cursor_state()
-- allow any password in local sdk
local sys = require "luci.sys"
sys.user.checkpasswd = function() return true end
+sys.user.getpasswd = function() return "x" end
-- dummy sysinfo on Darwin
require "nixio"
@@ -37,3 +38,9 @@ if not nixio.sysinfo then
}
end
end
+
+-- override nixio.fs.access() to check sysroot first
+local _access = nixio.fs.access
+function nixio.fs.access(file)
+ return _access(SYSROOT .. "/" .. file) or _access(file)
+end