pub struct GetentResolver { /* private fields */ }Expand description
Decides which getent binary name resolution spawns, hardened against PATH
attacks when privileged. Built once from the CLI via GetentResolver::from_cli.
The decision is deliberately not made at construction time: a numeric-only
invocation (--owner 0) never needs getent, so the trusted-directory probe — and
its “getent not found” error — must not fire then. The probe runs only when a name is
actually looked up.
Implementations§
Source§impl GetentResolver
impl GetentResolver
Sourcepub fn from_cli(getent_path: Option<PathBuf>, privileged: bool) -> Result<Self>
pub fn from_cli(getent_path: Option<PathBuf>, privileged: bool) -> Result<Self>
Build from the parsed CLI. getent_path is an explicit --getent-path (already
reduced to at most one by the caller); privileged is is_privileged. A
relative --getent-path is rejected here (fail-fast) — a relative program would
re-introduce a PATH/cwd lookup, defeating the point.
Trait Implementations§
Source§impl Clone for GetentResolver
impl Clone for GetentResolver
Source§fn clone(&self) -> GetentResolver
fn clone(&self) -> GetentResolver
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GetentResolver
impl Debug for GetentResolver
Source§impl Default for GetentResolver
The unprivileged, no-override default: a normal PATH search. Used by tests and as a
sensible base; production builds the resolver from the CLI via GetentResolver::from_cli.
impl Default for GetentResolver
The unprivileged, no-override default: a normal PATH search. Used by tests and as a
sensible base; production builds the resolver from the CLI via GetentResolver::from_cli.
Auto Trait Implementations§
impl Freeze for GetentResolver
impl RefUnwindSafe for GetentResolver
impl Send for GetentResolver
impl Sync for GetentResolver
impl Unpin for GetentResolver
impl UnsafeUnpin for GetentResolver
impl UnwindSafe for GetentResolver
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request