mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
Ignore SIGPIPE
Prevent wayland clients that request the X11 clipboard but closing their read fd prematurely to crash labwc because of the unhandled SIGPIPE signal. It is caused by wlroots trying to write the X11 clipboard data to the closed fd of the wayland client. See https://github.com/labwc/labwc/issues/890#issuecomment-1524962995 for a reproducer involving xclip and wl-paste | head -c 1. Fixes #890 Reported-by: @FuzzyQuills
This commit is contained in:
parent
957dd43af2
commit
ed8999456a
1 changed files with 10 additions and 0 deletions
10
src/server.c
10
src/server.c
|
|
@ -226,6 +226,16 @@ server_init(struct server *server)
|
||||||
event_loop, SIGTERM, handle_sigterm, server->wl_display);
|
event_loop, SIGTERM, handle_sigterm, server->wl_display);
|
||||||
server->wl_event_loop = event_loop;
|
server->wl_event_loop = event_loop;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Prevent wayland clients that request the X11 clipboard but closing
|
||||||
|
* their read fd prematurely to crash labwc because of the unhandled
|
||||||
|
* SIGPIPE signal. It is caused by wlroots trying to write the X11
|
||||||
|
* clipboard data to the closed fd of the wayland client.
|
||||||
|
* See https://github.com/labwc/labwc/issues/890#issuecomment-1524962995
|
||||||
|
* for a reproducer involving xclip and wl-paste | head -c 1.
|
||||||
|
*/
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The backend is a feature which abstracts the underlying input and
|
* The backend is a feature which abstracts the underlying input and
|
||||||
* output hardware. The autocreate option will choose the most suitable
|
* output hardware. The autocreate option will choose the most suitable
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue