AtlatestRepositorysigil-wm

sigil-wm / tree / src / csecurity-context.h

1/* SPDX-License-Identifier: BSD-3-Clause
2 * Connection metadata comes from wlroots, not client-provided identity fields.
3 * Ordinary native connections retain compatibility access. */
4static bool client_global_filter(const struct wl_client *client,
5 const struct wl_global *global,void *data) {
6 struct server *s=data;
7 const char *name=wl_global_get_interface(global)->name;
8 if(!strcmp(name,"xwayland_shell_v1"))
9 return s->xwayland && s->xwayland->server &&
10 s->xwayland->server->client==client;
11 if(!wlr_security_context_manager_v1_lookup_client(s->security_context,client))
12 return true;
13 static const char *const privileged[]={
14 "ext_session_lock_manager_v1",
15 "zwlr_screencopy_manager_v1",
16 "ext_image_copy_capture_manager_v1",
17 "ext_output_image_capture_source_manager_v1",
18 "zwlr_data_control_manager_v1",
19 "zwlr_output_power_manager_v1",
20 "zwlr_gamma_control_manager_v1",
21 "zwlr_output_manager_v1",
22 "zwlr_layer_shell_v1",
23 "ext_idle_notifier_v1",
24 "zwp_virtual_keyboard_manager_v1",
25 "zwlr_virtual_pointer_manager_v1",
26 "zwlr_foreign_toplevel_manager_v1",
27 "ext_foreign_toplevel_list_v1",
28 "wp_security_context_manager_v1",
29 };
30 for(size_t i=0;i<sizeof(privileged)/sizeof(privileged[0]);i++)
31 if(!strcmp(name,privileged[i])) return false;
32 return true;