Skip to content

Commit 1bea97d

Browse files
ids1024Drakulix
authored andcommitted
Don't check for privileged for creator of security context
This is redundant since unprivileged clients can't create security contexts. If we expose this protocol, trust `sandbox_engine`, etc. to be correct.
1 parent 5c40d8b commit 1bea97d

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/wayland/handlers/security_context.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ impl SecurityContextHandler for State {
2626
.get_client_data(security_context.creator_client_id.clone())
2727
.ok();
2828

29-
let privileged = client_data
30-
.as_ref()
31-
.and_then(|data| data.downcast_ref::<ClientState>())
32-
.map(|data| data.privileged)
33-
.unwrap_or(false);
34-
3529
let new_state = state.new_client_state();
3630

3731
let drm_node = client_data
@@ -50,9 +44,8 @@ impl SecurityContextHandler for State {
5044
client_stream,
5145
Arc::new(ClientState {
5246
security_context: Some(security_context.clone()),
53-
privileged: privileged
54-
&& security_context.sandbox_engine.as_deref()
55-
== Some("com.system76.CosmicPanel"),
47+
privileged: security_context.sandbox_engine.as_deref()
48+
== Some("com.system76.CosmicPanel"),
5649
advertised_drm_node: drm_node,
5750
..new_state
5851
}),

0 commit comments

Comments
 (0)