1wilkens / pam

Safe Rust API to the Linux Pluggable Authentication Modules (PAM)
https://docs.rs/pam/
Apache License 2.0
88 stars 37 forks source link

Usage document not correct #44

Open hohaidang opened 2 months ago

hohaidang commented 2 months ago

extern crate pam; pub fn main() { let service = ""; let user = ""; let password = "";

    let mut auth = pam::Authenticator::with_password(service).unwrap();
    auth.handler_mut().set_credentials(user, password);
    if auth.authenticate().is_ok() && auth.open_session().is_ok() {
        println!("Successfully opened a session!");
    }
    else {
        println!("Authentication failed =/");
    }

}

There is no pam::Authenticator anymore??