From 8f4a746da0317d557b2b5e530bf73da969649e18 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Mon, 10 Mar 2025 07:53:19 +0100 Subject: [PATCH] security-context: fix assertion failure This regression was caused by turning my brain off a bit too much during the zig 0.14 upgrade. --- river/Server.zig | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/river/Server.zig b/river/Server.zig index 401689a..ea06842 100644 --- a/river/Server.zig +++ b/river/Server.zig @@ -19,6 +19,7 @@ const Server = @This(); const build_options = @import("build_options"); const std = @import("std"); const assert = std.debug.assert; +const mem = std.mem; const posix = std.posix; const wlr = @import("wlroots"); const wl = @import("wayland").server.wl; @@ -299,13 +300,16 @@ fn allowlist(server: *Server, global: *const wl.Global) bool { // such as wl_output and wl_seat since the wl_global_create() function will // advertise the global to clients and invoke this filter before returning // the new global pointer. - // + if ((mem.orderZ(u8, global.getInterface().name, "wl_output") == .eq) or + (mem.orderZ(u8, global.getInterface().name, "wl_seat") == .eq)) + { + return true; + } + // For other globals I like the current pointer comparison approach as it // should catch river accidentally exposing multiple copies of e.g. wl_shm // with an assertion failure. - return global.getInterface() == wl.Output.interface or - global.getInterface() == wl.Seat.interface or - global == server.shm.global or + return global == server.shm.global or global == server.single_pixel_buffer_manager.global or global == server.viewporter.global or global == server.fractional_scale_manager.global or