mirror of
https://github.com/swaywm/sway.git
synced 2026-04-29 06:46:22 -04:00
Make IPC client socket non-blocking
This should prevent deadlocks with malicious clients
This commit is contained in:
parent
8dec814bb4
commit
de5bf64bfc
1 changed files with 2 additions and 2 deletions
|
|
@ -163,8 +163,8 @@ int ipc_handle_connection(int fd, uint32_t mask, void *data) {
|
|||
|
||||
int flags;
|
||||
if ((flags = fcntl(client_fd, F_GETFD)) == -1
|
||||
|| fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC) == -1) {
|
||||
sway_log_errno(L_ERROR, "Unable to set CLOEXEC on IPC client socket");
|
||||
|| fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC|O_NONBLOCK) == -1) {
|
||||
sway_log_errno(L_ERROR, "Unable to set CLOEXEC|NONBLOCK on IPC client socket");
|
||||
close(client_fd);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue