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:
2022-05-03 17:05:06 -07:00
commit 2e86445c3d
29 changed files with 4597 additions and 0 deletions

8
auth/Cargo.toml Normal file
View 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
View 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(())
}