diff options
author | Simon Ser <contact@emersion.fr> | 2024-01-04 15:01:26 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2024-01-26 15:14:47 +0100 |
commit | f7f5ac7a97a94d0acc01b09002ebf3d465755911 (patch) | |
tree | a70e5dd90e7bac092bfe3761e6173235dda89184 | |
parent | readme: add swaybg as optional dep (diff) | |
download | sway-f7f5ac7a97a94d0acc01b09002ebf3d465755911.tar.gz sway-f7f5ac7a97a94d0acc01b09002ebf3d465755911.tar.zst sway-f7f5ac7a97a94d0acc01b09002ebf3d465755911.zip |
Mark DRM lease protocol privileged
Allowing sandboxed clients to request DRM leases has security
implications.
(cherry picked from commit c5fd8c050f7ddbfe3e5b7abc8f5f6ace3a3c5307)
-rw-r--r-- | sway/server.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/server.c b/sway/server.c index 217c9ac9..9edc8bfc 100644 --- a/sway/server.c +++ b/sway/server.c | |||
@@ -75,6 +75,17 @@ static void handle_drm_lease_request(struct wl_listener *listener, void *data) { | |||
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | static bool is_privileged(const struct wl_global *global) { | 77 | static bool is_privileged(const struct wl_global *global) { |
78 | #if WLR_HAS_DRM_BACKEND | ||
79 | if (server.drm_lease_manager != NULL) { | ||
80 | struct wlr_drm_lease_device_v1 *drm_lease_dev; | ||
81 | wl_list_for_each(drm_lease_dev, &server.drm_lease_manager->devices, link) { | ||
82 | if (drm_lease_dev->global == global) { | ||
83 | return true; | ||
84 | } | ||
85 | } | ||
86 | } | ||
87 | #endif | ||
88 | |||
78 | return | 89 | return |
79 | global == server.output_manager_v1->global || | 90 | global == server.output_manager_v1->global || |
80 | global == server.output_power_manager_v1->global || | 91 | global == server.output_power_manager_v1->global || |