luci-base: establish ubus connection before dropping privileges (#310)
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 9 Feb 2015 11:14:20 +0000 (12:14 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 9 Feb 2015 11:14:20 +0000 (12:14 +0100)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
modules/luci-base/luasrc/dispatcher.lua

index 795b62bedbff28b5e3a1bd31ffda91fe9e7e6474..a80dd706e0575892cf9bd4bc9bb0c1b88296641a 100644 (file)
@@ -371,6 +371,9 @@ function dispatch(request)
        end
 
        if track.setuser then
+               -- trigger ubus connection before dropping root privs
+               util.ubus()
+
                sys.process.setuser(track.setuser)
        end