pub struct LocalPrincipal {
pub uid: u32,
pub gid: u32,
pub pid: Option<u32>,
}Expand description
A principal the kernel proved, on a local transport.
Captured at connect time and fixed for the life of the connection, which
is what SO_PEERCRED and LOCAL_PEERCRED give and all they give
(docs/research/ipc.md §1.5, §2.2). Two rules come with it
(decisions/0010 §4.4):
the credential is the one taken at connect and never at send time, and a
PID is an observation — it MUST NOT be the thing an application
authorizes on, because it is reusable and racy where it exists at all.
macOS reports no PID, so pid is None there.
Fields§
§uid: u32Effective user id of the peer process at connect time.
gid: u32Primary group id, where the platform reports one.
pid: Option<u32>Process id, where the platform reports one. An observation only.
Trait Implementations§
Source§impl Clone for LocalPrincipal
impl Clone for LocalPrincipal
impl Copy for LocalPrincipal
Source§impl Debug for LocalPrincipal
impl Debug for LocalPrincipal
impl Eq for LocalPrincipal
Source§impl Hash for LocalPrincipal
impl Hash for LocalPrincipal
Source§impl PartialEq for LocalPrincipal
impl PartialEq for LocalPrincipal
impl StructuralPartialEq for LocalPrincipal
Auto Trait Implementations§
impl Freeze for LocalPrincipal
impl RefUnwindSafe for LocalPrincipal
impl Send for LocalPrincipal
impl Sync for LocalPrincipal
impl Unpin for LocalPrincipal
impl UnsafeUnpin for LocalPrincipal
impl UnwindSafe for LocalPrincipal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more