ubusd: use umask of 0177 for now to prevent a world- and group-writable unix socket
This commit is contained in:
parent
d486006ab9
commit
6ae17d0298
1 changed files with 2 additions and 0 deletions
2
ubusd.c
2
ubusd.c
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue