close stdin/out/err before forking an instance
authorJohn Crispin <blogic@openwrt.org>
Mon, 8 Jul 2013 19:40:14 +0000 (21:40 +0200)
committerJohn Crispin <blogic@openwrt.org>
Mon, 8 Jul 2013 19:40:14 +0000 (21:40 +0200)
Signed-off-by: John Crispin <blogic@openwrt.org>
instance.c

index b5ecad07bced86e358f21085e7ecb63f5c3d2923..28e5c94d5611a539ac6dcbb5055bcbecf4fa0a2a 100644 (file)
@@ -81,6 +81,9 @@ instance_run(struct service_instance *in)
                argv[argc++] = blobmsg_data(cur);
 
        argv[argc] = NULL;
+       close(STDIN_FILENO);
+       close(STDOUT_FILENO);
+       close(STDERR_FILENO);
        execvp(argv[0], argv);
        exit(127);
 }