ChocolateLoverRaj/pam-any

Should there be a (unsafe) gross hack mode?

Offen

#15 geöffnet am 23.05.2026

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (4 Forks)auto 404
help wanted

Repository-Metriken

Stars
 (34 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Based on https://github.com/lvkv/pam-rs/issues/13 and #3 , I determined that pam_conv (which is the Conv struct in the Rust bindings) cannot be sent across threads, and the unsafe send marking of Conv is not correct. I'm pretty sure pam-fprint-grosshack also sends pam_conv across threads and breaks the same rule that we do.

Sending Conv to another thread is needed in order to return from the sm_authenticate function before a prompt is complete. WIthout sending Conv to another thread, it would be less convenient for the user.

I see two options:

  • Remove gross hack mode completely
  • Remove gross hack mode by default but leave it as an option

I decided that I will add a gross hack mode if there is demand for it. However, it would be two separate binaries, one with 100% safe Rust (without gross hack), and one with the unsafe send on Conv (for gross hack). This way it isolates the unsafe from affecting non-gross hack usage.

Contributor Guide