~goorzhel/radm

cc4466174c297790f21ef0bcd09b918b3503d0e6 — Antonio Gurgel 3 months ago 7637547
Don't clone username; use struct it was moved into
1 files changed, 3 insertions(+), 3 deletions(-)

M src/auth.rs
M src/auth.rs => src/auth.rs +3 -3
@@ 39,13 39,13 @@ pub fn login() -> Result<impl Authenticator> {
        // 2. PAM autologin: Identical authenticate() except no `let password`.
        // 3. !PAM password: I'll have to bone up on scrypt or something.
        // 4. !PAM autologin: Probably a `getgrouplist` call.
        let mut pam = PamPassword::new(username.clone())?;
        let mut pam = PamPassword::new(username)?;
        match pam.authenticate() {
            Err(e) => {
                error!("Failed to authenticate {}: {}", &username, e);
                error!("Failed to authenticate {}: {}", pam.username(), e);
            }
            Ok(_) => {
                info!("Authenticated {}", &username);
                info!("Authenticated {}", pam.username());
                return Ok(pam);
            }
        }