1
0
Fork 0
forked from wry/wry

config: add uid client criteria

This commit is contained in:
Julian Orth 2025-05-03 12:48:44 +02:00
parent 9bf79bf23c
commit 587ffc7ee5
13 changed files with 63 additions and 2 deletions

View file

@ -19,3 +19,4 @@ macro_rules! fixed_root_criterion {
pub mod clmm_sandboxed;
pub mod clmm_string;
pub mod clmm_uid;

View file

@ -0,0 +1,20 @@
use {
crate::{
client::Client,
criteria::{RootMatcherMap, clm::RootMatchers, crit_graph::CritRootCriterion},
},
std::rc::Rc,
uapi::c,
};
pub struct ClmMatchUid(pub c::uid_t);
impl CritRootCriterion<Rc<Client>> for ClmMatchUid {
fn matches(&self, data: &Rc<Client>) -> bool {
data.pid_info.uid == self.0
}
fn nodes(roots: &RootMatchers) -> Option<&RootMatcherMap<Rc<Client>, Self>> {
Some(&roots.uid)
}
}