From b86774de65406bf8b8daed92a0a994fdc8225a4e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 5 Sep 2013 16:14:30 +0200 Subject: [PATCH] Set umask to 0077 on daemon startup to prevent libuci from making world-readable directories --- main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.c b/main.c index 0bb06ce..75f5cee 100644 --- 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);