1
0
Fork 0
forked from wry/wry

wayland: prevent unprivileged clients from binding secure globals

This commit is contained in:
Julian Orth 2022-05-07 19:59:51 +02:00
parent 6c9e058c3f
commit 1e9cc60693
2 changed files with 13 additions and 7 deletions

View file

@ -44,11 +44,9 @@ impl WlRegistry {
fn bind(&self, parser: MsgParser<'_, '_>) -> Result<(), WlRegistryError> {
let bind: Bind = self.client.parse(self, parser)?;
let global = self
.client
.state
.globals
.get(GlobalName::from_raw(bind.name))?;
let name = GlobalName::from_raw(bind.name);
let globals = &self.client.state.globals;
let global = globals.get(name, self.client.secure)?;
if global.interface().name() != bind.interface {
return Err(WlRegistryError::InvalidInterface(InterfaceError {
name: global.name(),