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 795b62b..a80dd70 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