security_context_v1: set CLOEXEC for client FDs

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/work_items/3949
(cherry picked from commit 327f000532)
This commit is contained in:
Simon Ser 2026-07-03 13:59:01 +02:00 committed by Simon Zeni
parent eb02e65df4
commit d9cd649551
7 changed files with 39 additions and 19 deletions

View file

@ -7,6 +7,7 @@
#include <wlr/types/wlr_security_context_v1.h>
#include <wlr/util/log.h>
#include "security-context-v1-protocol.h"
#include "util/fd.h"
#define SECURITY_CONTEXT_MANAGER_V1_VERSION 1
@ -129,6 +130,11 @@ static int security_context_handle_listen_fd_event(int listen_fd, uint32_t mask,
return 0;
}
if (!set_cloexec(client_fd, true)) {
close(client_fd);
return 0;
}
struct wlr_security_context_v1_client *security_context_client =
calloc(1, sizeof(*security_context_client));
if (security_context_client == NULL) {