pub enum PamHandle {}
Expand description

Opaque type, used as a pointer when making pam API calls.

A module is invoked via an external function such as pam_sm_authenticate. Such a call provides a pam handle pointer. The same pointer should be given as an argument when making API calls.

Implementations§

source§

impl PamHandle

source

pub unsafe fn get_data<'a, T>(&'a self, key: &str) -> PamResult<&'a T>

§Safety

Gets some value, identified by key, that has been set by the module previously.

See pam_get_data in http://www.linux-pam.org/Linux-PAM-html/mwg-expected-by-module-item.html

source

pub fn set_data<T>(&self, key: &str, data: Box<T>) -> PamResult<()>

Stores a value that can be retrieved later with get_data. The value lives as long as the current pam cycle.

See pam_set_data in http://www.linux-pam.org/Linux-PAM-html/mwg-expected-by-module-item.html

source

pub fn get_item<'a, T: PamItem>(&self) -> PamResult<&'a T>

Retrieves a value that has been set, possibly by the pam client. This is particularly useful for getting a PamConv reference.

See pam_get_item in http://www.linux-pam.org/Linux-PAM-html/mwg-expected-by-module-item.html

source

pub fn set_item_str<T: PamItem>(&mut self, item: &str) -> PamResult<()>

Sets a value in the pam context. The value can be retrieved using get_item.

Note that all items are strings, except PAM_CONV and PAM_FAIL_DELAY.

See pam_set_item in http://www.linux-pam.org/Linux-PAM-html/mwg-expected-by-module-item.html

source

pub fn get_user(&self, prompt: Option<&str>) -> PamResult<String>

Retrieves the name of the user who is authenticating or logging in.

This is really a specialization of get_item.

See pam_get_user in http://www.linux-pam.org/Linux-PAM-html/mwg-expected-by-module-item.html

source

pub fn get_authtok(&self) -> PamResult<Option<String>>

source

pub fn get_tty(&self) -> PamResult<Option<String>>

source

pub fn get_rhost(&self) -> PamResult<Option<String>>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more