Fix typo in ContextList
This commit is contained in:
@@ -31,7 +31,7 @@ impl ContextList {
|
||||
}
|
||||
|
||||
/// Get an iterator of all parents
|
||||
pub fn anchestors(&'_ self, id: ContextId) -> impl Iterator<Item = (ContextId, &Arc<RwLock<Context>>)> + '_ {
|
||||
pub fn ancestors(&'_ self, id: ContextId) -> impl Iterator<Item = (ContextId, &Arc<RwLock<Context>>)> + '_ {
|
||||
iter::successors(self.get(id).map(|context| (id, context)), move |(_id, context)| {
|
||||
let context = context.read();
|
||||
let id = context.ppid;
|
||||
@@ -47,6 +47,7 @@ impl ContextList {
|
||||
pub fn iter(&self) -> ::alloc::collections::btree_map::Iter<ContextId, Arc<RwLock<Context>>> {
|
||||
self.map.iter()
|
||||
}
|
||||
|
||||
pub fn range(&self, range: impl core::ops::RangeBounds<ContextId>) -> ::alloc::collections::btree_map::Range<'_, ContextId, Arc<RwLock<Context>>> {
|
||||
self.map.range(range)
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ impl Scheme for ProcScheme {
|
||||
|
||||
// Is it a subprocess of us? In the future, a capability could
|
||||
// bypass this check.
|
||||
match contexts.anchestors(target.ppid).find(|&(id, _context)| id == current.id) {
|
||||
match contexts.ancestors(target.ppid).find(|&(id, _context)| id == current.id) {
|
||||
Some((id, context)) => {
|
||||
// Paranoid sanity check, as ptrace security holes
|
||||
// wouldn't be fun
|
||||
|
||||
Reference in New Issue
Block a user