diff options
Diffstat (limited to 'lockchain-core/src/users/auth.rs')
-rw-r--r-- | lockchain-core/src/users/auth.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lockchain-core/src/users/auth.rs b/lockchain-core/src/users/auth.rs index ad25757..ec2aea7 100644 --- a/lockchain-core/src/users/auth.rs +++ b/lockchain-core/src/users/auth.rs @@ -6,7 +6,7 @@ // use nix::sys::wait::*; // use nix::unistd::{fork, ForkResult}; -use pam_auth::{self, Authenticator, PamError, Result as PamResult}; +use pam_auth::Authenticator; #[derive(Debug)] pub enum AuthError { @@ -17,22 +17,21 @@ pub enum AuthError { } /// Simple way to authenticate a user for administrative actions -/// +/// /// Attempts to open a PAM session for the provided user/pw combination /// then attempts to write to a tmpfile in the lockchain config directory. /// If this action is successful the user is either the same running the /// lockchain server *or* has access to the file via group permissions. -/// +/// /// This does rely on `lockchain` being properly configured on the server /// i.e. not using public permissions for the configuration/ state directory. -/// +/// /// **Note** as of `lockchain v0.9.0` this function has not been implemented /// yet due to issues in the `pam-auth` dependency. #[allow(unused_variables)] pub fn pam_authenticate(username: &str, password: &str) -> Result<(), AuthError> { // Err(AuthError::FailedPAM) - // match fork().map_err(|_| AuthError::FailedFork)? { // ForkResult::Parent { child } => { // waitpid(child, None).unwrap(); |