1
0
Fork 0
forked from wry/wry

security: remove context protocol

This commit is contained in:
kossLAN 2026-05-29 18:13:14 -04:00
parent 6f913d5f69
commit 8a35bc3ca4
No known key found for this signature in database
16 changed files with 42 additions and 423 deletions

View file

@ -14,7 +14,6 @@ use {
},
leaks::Tracker,
object::{Interface, Object, ObjectId, WL_DISPLAY_ID},
security_context_acceptor::AcceptorMetadata,
state::State,
utils::{
asyncevent::AsyncEvent,
@ -95,6 +94,14 @@ pub struct Clients {
shutdown_clients: RefCell<AHashMap<ClientId, ClientHolder>>,
}
#[derive(Default)]
pub struct ClientMetadata {
pub sandboxed: bool,
pub sandbox_engine: Option<String>,
pub app_id: Option<String>,
pub instance_id: Option<String>,
}
impl Clients {
pub fn new() -> Self {
Self {
@ -126,12 +133,12 @@ impl Clients {
id: ClientId,
global: &Rc<State>,
socket: Rc<OwnedFd>,
acceptor: &Rc<AcceptorMetadata>,
metadata: &Rc<ClientMetadata>,
) -> Result<(), ClientError> {
let Some((uid, pid)) = get_socket_creds(&socket) else {
return Ok(());
};
self.spawn2(id, global, socket, uid, pid, false, acceptor)?;
self.spawn2(id, global, socket, uid, pid, false, metadata)?;
Ok(())
}
@ -143,7 +150,7 @@ impl Clients {
uid: c::uid_t,
pid: c::pid_t,
is_xwayland: bool,
acceptor: &Rc<AcceptorMetadata>,
metadata: &Rc<ClientMetadata>,
) -> Result<Rc<Client>, ClientError> {
let data = Rc::new_cyclic(|slf| Client {
id,
@ -173,7 +180,7 @@ impl Clients {
focus_stealing_serial: Default::default(),
changed_properties: Default::default(),
destroyed: Default::default(),
acceptor: acceptor.clone(),
metadata: metadata.clone(),
});
track!(data, data);
let display = Rc::new(WlDisplay::new(&data));
@ -292,7 +299,7 @@ pub struct Client {
pub focus_stealing_serial: Cell<Option<u64>>,
pub changed_properties: Cell<ClMatcherChange>,
pub destroyed: CopyHashMap<CritMatcherId, Weak<dyn CritDestroyListener<Self>>>,
pub acceptor: Rc<AcceptorMetadata>,
pub metadata: Rc<ClientMetadata>,
}
pub const NUM_CACHED_SERIAL_RANGES: usize = 64;