ChocolateLoverRaj/pam-any

Should there be a (unsafe) gross hack mode?

オープン

#15 opened on 2026/05/23

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (4 件のフォーク)auto 404
help wanted

Repository metrics

Stars
 (34 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド