weston/xwayland
Daniel Stone 08a35d307f xwayland: Fix X11 lock file size confusion
The X11 lock file was somewhat opaque. Into a sized array of 16
characters, we previously read 11 bytes. 61beda653b fixed the parsing of
this input to ensure that we only considered the first 10 bytes: this
has the effect of culling a LF byte at the end of the string.

This commit more explicitly NULLs the entire string before reading, and
trims trailing LF characters only.

It also adds some documentation by way of resizing pid, an explicit size
check on snprintf's return, and comments.

Verified manually that it emits lock files with a trailing \n, as Xorg
does. Also verified manually that it ignores misformatted lock files,
but accepts either \n or \0 in the trailing position.

Related Mutter issue: https://bugzilla.gnome.org/show_bug.cgi?id=774613

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-11-21 09:47:25 +00:00
..
dnd.c xwayland: Move includes to avoid deprecation warnings 2016-11-01 17:02:38 +00:00
hash.c Make config.h inclusion consistent 2016-06-16 11:01:54 -07:00
hash.h include stdint.h for int32_t/uint32_t 2016-07-26 16:26:08 -07:00
launcher.c xwayland: Fix X11 lock file size confusion 2016-11-21 09:47:25 +00:00
selection.c xwayland: Fix crash when run with no input device 2016-11-16 16:44:20 +00:00
window-manager.c xwayland: Fix crash when run with no input device 2016-11-16 16:44:20 +00:00
xwayland-api.h xwayland: Introduce a private struct for XWayland interface 2016-08-14 09:29:08 +02:00
xwayland-internal-interface.h xwayland: Introduce a private struct for XWayland interface 2016-08-14 09:29:08 +02:00
xwayland.h xwayland: make the plugin usable by libweston compositors 2016-07-01 14:34:33 +03:00