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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user