Crate pam

Source
Expand description

Rustified API to the Linux-PAM authentication libary

This library supports both PAM clients and modules through the respective cargo features. If you do not want to use any high-level API, wrappers for the raw PAM related functions from pam_sys are also exported at crate root.

Re-exports§

pub use client::Client;
pub use pam_sys as ffi;

Modules§

client
Authentication related structure and functions

Structs§

PamError
PAM related error with PamReturnCode inside it
PasswordConv
A minimalistic conversation handler, that uses given login and password

Enums§

PamFlag
The Linux-PAM flags
PamItemType
The Linux-PAM item types
PamMessageStyle
The Linux-PAM message styles
PamReturnCode
The Linux-PAM return values

Traits§

Conversation
A trait representing the PAM authentification conversation

Functions§

acct_mgmt
Determine if the user’s account is valid
authenticate
Authenticate the user via the Conversation passed to start
chauthtok
Change the authentication token for the user associated with the PAM transaction
close_session
Indicate that an authenticated user session has ended
end
Terminate the PAM transaction
get_item
Retrieve PAM information of type item_type from the associated PAM transaction
getenv
Get he value of a PAM environment variable associated with the PAM transaction
getenvlist
Retrieve a complee copy of the PAM environment associated with the PAM transaction
misc_paste_env
Update the PAM environment via the supplied list
misc_setenv
Add or change PAM environment variables associated with the PAM transaction in BSD style “name=value”
open_session
Set up a user session for a previously authenticated user
putenv
Add or change PAM environment variables associated with the PAM transaction
set_item
Update PAM information of type item_type in the associated PAM transaction
setcred
Modify the credentials of the user associated with the PAM transaction
start
Create the PAM context and initiate the PAM transaction
strerror
Retrieve a CStr describing the PamReturnCode passed, potentially using LC_MESSAGES to localize the result

Type Aliases§

PamHandle
Opaque PAM main structure. Used for nearly all application functions
PamMessage
PAM message that is passed to modules
PamResponse
PAM response returned by modules
PamResult
Convenience type for functions that might fail with a PamError