wayland: prevent unprivileged clients from binding secure globals
This commit is contained in:
parent
6c9e058c3f
commit
1e9cc60693
2 changed files with 13 additions and 7 deletions
|
|
@ -174,8 +174,16 @@ impl Globals {
|
|||
self.broadcast(state, global.secure(), |r| r.send_global(&global));
|
||||
}
|
||||
|
||||
pub fn get(&self, name: GlobalName) -> Result<Rc<dyn Global>, GlobalsError> {
|
||||
self.take(name, false)
|
||||
pub fn get(
|
||||
&self,
|
||||
name: GlobalName,
|
||||
allow_secure: bool,
|
||||
) -> Result<Rc<dyn Global>, GlobalsError> {
|
||||
let global = self.take(name, false)?;
|
||||
if global.secure() && !allow_secure {
|
||||
return Err(GlobalsError::GlobalDoesNotExist(name));
|
||||
}
|
||||
Ok(global)
|
||||
}
|
||||
|
||||
pub fn remove<T: WaylandGlobal>(&self, state: &State, global: &T) -> Result<(), GlobalsError> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue