ubusd: use umask of 0177 for now to prevent a world- and group-writable unix socket

This commit is contained in:
Jo-Philipp Wich 2013-09-28 17:23:01 +00:00 committed by Felix Fietkau
parent d486006ab9
commit 6ae17d0298

View file

@ -12,6 +12,7 @@
*/
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/uio.h>
#include <signal.h>
#include <stdio.h>
@ -321,6 +322,7 @@ int main(int argc, char **argv)
}
unlink(ubus_socket);
umask(0177);
server_fd.fd = usock(USOCK_UNIX | USOCK_SERVER | USOCK_NONBLOCK, ubus_socket, NULL);
if (server_fd.fd < 0) {
perror("usock");