modules: add SOCK_CLOEXEC to all socket() calls

This commit is contained in:
Daniel Eklöf 2022-03-29 18:21:13 +02:00
parent 3ff1c95208
commit 4bb81e8940
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 5 additions and 5 deletions

View file

@ -223,7 +223,7 @@ wait_for_socket_create(const struct module *mod)
struct stat st;
if (stat(m->host, &st) == 0 && S_ISSOCK(st.st_mode)) {
int s = socket(AF_UNIX, SOCK_STREAM, 0);
int s = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
struct sockaddr_un addr = {.sun_family = AF_UNIX};
strncpy(addr.sun_path, m->host, sizeof(addr.sun_path) - 1);