Set umask to 0077 on daemon startup to prevent libuci from making world-readable directories

This commit is contained in:
Jo-Philipp Wich 2013-09-05 16:14:30 +02:00
parent fa53571f2b
commit b86774de65

2
main.c
View file

@ -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);