Commit Graph

5 Commits

Author SHA1 Message Date
Isaac Freund 5a5aa72571 security-context: constify lookup_client()
This is worth doing despite wl_client_get_destroy_listener() incorrectly
accepting a mutable wl_client pointer since this lookup_client()
function will primarily be used with a wl_display_global_filter_func_t
which only provides a const wl_client pointer.

Work around this libwayland API wart in wlroots so compositors don't
have to.
2024-03-18 08:18:51 +00:00
Simon Ser 842093bb84 Define _POSIX_C_SOURCE globally
Stop trying to maintain a per-file _POSIX_C_SOURCE. Instead,
require POSIX.1-2008 globally. A lot of core source files depend
on that already.

Some care must be taken on a few select files where we need a bit
more than POSIX. Some files need XSI extensions (_XOPEN_SOURCE) and
some files need BSD extensions (_DEFAULT_SOURCE). In both cases,
these feature test macros imply _POSIX_C_SOURCE. Make sure to not
define both these macros and _POSIX_C_SOURCE explicitly to avoid
POSIX requirement conflicts (e.g. _POSIX_C_SOURCE says POSIX.1-2001
but _XOPEN_SOURCE says POSIX.1-2008).

Additionally, there is one special case in render/vulkan/vulkan.c.
That file needs major()/minor(), and these are system-specific.
On FreeBSD, _POSIX_C_SOURCE hides system-specific symbols so we need
to make sure it's not defined for this file. On Linux, we can
explicitly include <sys/sysmacros.h> and ensure that apart from
symbols defined there the file only uses POSIX toys.
2024-02-15 15:41:12 +01:00
Kirill Primak 58bb49a00b security-context-v1: fix possible leaks on wl_client_create() and state copying errors 2024-01-17 15:44:37 +00:00
Simon Ser ccb153f024 security-context-v1: add commit event 2023-10-10 10:34:01 +02:00
Simon Ser c58deb7a7d security-context-v1: new protocol implementation
Co-authored-by: Puck Meerburg <puck@puckipedia.com>
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/68
2023-10-10 10:34:01 +02:00