fp-pam.sh 763 B

1234567891011121314151617
  1. #!/bin/bash
  2. # PAM entry point for fingerprint auth (sudo / polkit).
  3. # Expected context: pam_exec runs this as root -> drop fully to nebulon
  4. # (Wine checks the REAL uid against the prefix owner; pam_exec's seteuid alone
  5. # is not enough and setpriv then fails with exit 127).
  6. # success => exit 0 => PAM_SUCCESS; anything else => fallback to password.
  7. export PATH=/usr/local/bin:/usr/bin:/bin
  8. export HOME=/home/nebulon
  9. export FP_VERIFY_TIMEOUT="${FP_VERIFY_TIMEOUT:-15}"
  10. if [ "$(id -u)" = "0" ]; then
  11. exec setpriv --reuid=nebulon --regid=nebulon --init-groups \
  12. /home/nebulon/projects/fingerprint/work/fp-verify.sh
  13. else
  14. # already the target user (manual test / corrected PAM context)
  15. exec /home/nebulon/projects/fingerprint/work/fp-verify.sh
  16. fi