projects
/
oweals
/
ubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d486006
)
ubusd: use umask of 0177 for now to prevent a world- and group-writable unix socket
author
Jo-Philipp Wich
<jow@openwrt.org>
Sat, 28 Sep 2013 17:23:01 +0000
(17:23 +0000)
committer
Felix Fietkau
<nbd@openwrt.org>
Sat, 28 Sep 2013 15:23:29 +0000
(17:23 +0200)
ubusd.c
patch
|
blob
|
history
diff --git
a/ubusd.c
b/ubusd.c
index 03215b33525f9011d0a681dfb185ae085292ccd4..59dee3e6d92acb2a0bfb9fd5311aeddb7f25bd1c 100644
(file)
--- a/
ubusd.c
+++ b/
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");