summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-01-20 19:06:28 +0100
committerJohn Crispin <blogic@openwrt.org>2014-01-20 19:06:28 +0100
commit311eb167fce73dbc97c7d9dfcc43a59b5695a8f7 (patch)
treef9ccbd81f07b4982225dcd8ad0885153b3eb975b
parent2dc572df0e3002263c0a49ebbc329ed1b6c42a01 (diff)
downloadunitd-311eb167fce73dbc97c7d9dfcc43a59b5695a8f7.tar
unitd-311eb167fce73dbc97c7d9dfcc43a59b5695a8f7.zip
state.c: pass ubus commandline is writable buffer to service_start_early()
The service_start_early() function uses strtok() on the command line argument, therfore we cannot pass it constant string literals directly. Fixes OpenWrt bug #14832 Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
-rw-r--r--state.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/state.c b/state.c
index 9f3033b..e5f0015 100644
--- a/state.c
+++ b/state.c
@@ -37,6 +37,7 @@ static int reboot_event;
static void state_enter(void)
{
+ char ubus_cmd[] = "/sbin/ubusd";
switch (state) {
case STATE_EARLY:
@@ -54,7 +55,7 @@ static void state_enter(void)
LOG("- init -\n");
service_init();
- service_start_early("ubus", "/sbin/ubusd");
+ service_start_early("ubus", ubus_cmd);
procd_inittab();
procd_inittab_run("respawn");