Page MenuHomeFreeBSD

Add PAM support for lock(1). This makes "lock -p" actually useful.
ClosedPublic

Authored by trasz on Jan 18 2016, 1:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 30, 6:10 PM
Unknown Object (File)
Jan 19 2025, 4:05 PM
Unknown Object (File)
Jan 12 2025, 6:44 AM
Unknown Object (File)
Jan 3 2025, 7:15 PM
Unknown Object (File)
Jan 2 2025, 1:12 PM
Unknown Object (File)
Dec 28 2024, 12:22 PM
Unknown Object (File)
Dec 6 2024, 3:09 PM
Unknown Object (File)
Dec 3 2024, 11:36 PM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 14941
Build 15053: arc lint + arc unit

Event Timeline

trasz retitled this revision from to Add PAM support for lock(1). This makes "lock -p" actually useful..
trasz updated this object.
trasz edited the test plan for this revision. (Show Details)
usr.bin/lock/lock.c
76

PAM isn't optional in FreeBSD, so there is no need for USE_PAM.

140

PAM is not optional; S/KEY aka OPIE is only supported through PAM.

164–186

You should probably replace this with getpass() or even openpam_ttyconv() (you can either call it directly or use pam_prompt() if you have a PAM handle, which you can get even if you don't intend to use PAM to unlock).

244–249

As mentioned earlier, you can use getpass() or openpam_ttyconv() / pam_prompt() here instead of fgets().

Get rid of USE_PAM and do some other cleanups.

usr.bin/lock/lock.c
164–186

It's a good idea, but IMHO it's orthogonal to adding PAM support. I'd prefer to do that in a separate patch, especially that it might change the behaviour slightly (getpass() reads from console, the code above reads from standard input; no idea if it could make a practical difference).

trasz marked 2 inline comments as done.Sep 8 2017, 1:37 PM
usr.bin/lock/lock.c
250

Please use an explicit comparison to 0 as strcmp() is not a predicate.

usr.bin/lock/lock.c
250

Erm, but that's existing code - I'm only removing the "else" clause.

Regenerate; upstream changed a bit.

Approved, but I hope you also find the time to make the other modifications I suggested in a later commit.

This revision is now accepted and ready to land.Nov 30 2017, 12:07 PM
This revision now requires review to proceed.Feb 10 2018, 7:12 PM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 11 2018, 1:35 PM
This revision was automatically updated to reflect the committed changes.