pub trait CallContextExt {
// Required method
fn peer_executable(&self) -> Option<PathBuf>;
}Expand description
Adds peer_executable to the daemon’s CallContext.
Required Methods§
Sourcefn peer_executable(&self) -> Option<PathBuf>
fn peer_executable(&self) -> Option<PathBuf>
The executable of the process on the other end of this connection, as the OS reports it and the transport verified it: the caller is a local app, its pid, uid or SID, and start time are the ones recorded at accept (so a reused pid is refused), and the connection is still open. Canonicalised when the file still exists.
None fails closed: a device caller (no OS peer), a peer whose pid or executable cannot
be established, a process that exited or changed while it was identified, a platform that
cannot read a process’s executable. Never a guess.
This is a fact for display and audit (a consent prompt, a log line). It is not an
authorisation: to gate a method on a program use
CallContext::verify_peer_executable, which compares against the program you expect.
Run it per call; do not cache the answer past the connection.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".