Set umask to 0077 on daemon startup to prevent libuci from making world-readable...
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 5 Sep 2013 14:14:30 +0000 (16:14 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 5 Sep 2013 14:14:30 +0000 (16:14 +0200)
main.c

diff --git a/main.c b/main.c
index 0bb06ce..75f5cee 100644 (file)
--- a/main.c
+++ b/main.c
@@ -77,6 +77,8 @@ int main(int argc, char **argv)
        if (stat("/var/run/rpcd", &s))
                mkdir("/var/run/rpcd", 0700);
 
+       umask(0077);
+
        signal(SIGPIPE, SIG_IGN);
        signal(SIGHUP,  handle_signal);
        signal(SIGUSR1, handle_signal);