Initial import. Most things seem working.
This includes an abortive attempt to do a gtk4 dialog (which I don't think is possible, as gtk4 doesn't allow embedding toplevels anymore), and an iced dialog, which I just never started writing.
This commit is contained in:
8
auth/Cargo.toml
Normal file
8
auth/Cargo.toml
Normal file
@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "bscreensaver-auth"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
pam = "0.7"
|
16
auth/src/main.rs
Normal file
16
auth/src/main.rs
Normal file
@ -0,0 +1,16 @@
|
||||
use std::io;
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let stdin = io::stdin();
|
||||
|
||||
let mut username = String::new();
|
||||
stdin.read_line(&mut username)?;
|
||||
let mut password = String::new();
|
||||
stdin.read_line(&mut password)?;
|
||||
|
||||
let mut authenticator = pam::Authenticator::with_password("xscreensaver")?;
|
||||
authenticator.get_handler().set_credentials(username.trim(), password.trim());
|
||||
authenticator.authenticate()?;
|
||||
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user