Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use anyhow::{Result, anyhow};
use atomic_enum::atomic_enum;
use pam_rs::{Client, PamFlag};
use tokio::sync::{mpsc, oneshot};
use tracing::{info, warn};
use tracing::{debug, warn};
use zeroize::Zeroizing;

use crate::config::NLockConfig;
Expand Down Expand Up @@ -57,7 +57,7 @@ pub async fn run_auth_loop(config: AuthConfig, auth_rx: mpsc::Receiver<AuthReque
let username = uzers::get_current_username().ok_or(anyhow!("Current user does not exist"))?;
let username = username.to_string_lossy().to_string();

info!("Running authenticator for '{username}'");
debug!("Running authenticator for '{username}'");

let mut success = false;

Expand All @@ -74,7 +74,7 @@ pub async fn run_auth_loop(config: AuthConfig, auth_rx: mpsc::Receiver<AuthReque
let _ = responder.send(Ok(()));
}
Err(e) => {
warn!("Auth error: {e}");
debug!("Auth error: {e}");
let _ = responder.send(Err(e));
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use mio::Poll;
use nix::sys::eventfd::EventFd;
use nix::sys::timerfd::TimerFd;
use tokio::sync::{mpsc, oneshot};
use tracing::debug;
use tracing::{info, warn};
use tracing::{debug, warn};
use wayland_client::protocol::{wl_region, wl_subcompositor, wl_subsurface};
use wayland_client::{
Connection, Dispatch, QueueHandle, delegate_noop,
Expand Down Expand Up @@ -164,14 +163,14 @@ impl NLockState {

match resp_rx.await {
Ok(Ok(())) => {
info!("Authentication completed sucecssfully");
debug!("Authentication completed sucecssfully");

auth_state.store(AuthState::Success, Ordering::Relaxed);
running.store(false, Ordering::Relaxed);
let _ = state_ev.write(1);
}
Ok(Err(e)) => {
warn!("PAM authentication error: {e}");
debug!("PAM authentication error: {e}");

auth_state.store(AuthState::Fail, Ordering::Relaxed);
state_changed.store(true, Ordering::Relaxed);
Expand Down