1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

relay: set mode 700 on the unix socket file (only the owner can use it)

This commit is contained in:
Sébastien Helleu
2019-05-12 22:27:43 +02:00
parent ef1fcbd183
commit d1577b34da
+5
View File
@@ -26,6 +26,7 @@
#include <time.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -646,6 +647,10 @@ relay_server_create_socket (struct t_relay_server *server)
return 0;
}
/* change permissions: only the owner can use the unix socket */
if (server->unix_socket)
chmod (server->path, 0700);
#ifdef SOMAXCONN
if (listen (server->sock, SOMAXCONN) != 0)
#else