mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-07-10 00:06:08 -04:00
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:
parent
eb02e65df4
commit
d9cd649551
7 changed files with 39 additions and 19 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue