Page MenuHomeFreeBSD

fprintd: fix the shared object install path for pam_fprintd
AbandonedPublic

Authored by aokblast on May 7 2025, 3:49 PM.
Tags
None
Referenced Files
F121117277: D50239.id155750.diff
Mon, Jun 23, 7:50 PM
Unknown Object (File)
Mon, Jun 16, 5:58 PM
Unknown Object (File)
Mon, Jun 16, 6:19 AM
Unknown Object (File)
Sun, Jun 15, 6:42 AM
Unknown Object (File)
Sun, Jun 15, 3:33 AM
Unknown Object (File)
Thu, Jun 12, 2:40 PM
Unknown Object (File)
Tue, Jun 10, 10:33 AM
Unknown Object (File)
Tue, Jun 10, 8:25 AM

Details

Summary

The openpam in FreeBSD search the .so in /usr/local/lib instead of
/usr/local/lib/security. In this patch, we move the binary to the correct
location.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 64318
Build 61202: arc lint + arc unit

Event Timeline

aokblast created this revision.
This revision is now accepted and ready to land.May 7 2025, 6:16 PM
lwhsu requested changes to this revision.May 7 2025, 6:22 PM

I found that currently all the pam_* ports install pam_*.so under lib/security/, perhaps we also need to check if the behavior of openpam has been changed.

This revision now requires changes to proceed.May 7 2025, 6:22 PM

There is no change. See pam.conf(5).

The module-path field specifies the name or full path of the module to
     call.  If only the name is specified, the PAM library will search for it
     in the following locations:

     1.   /usr/lib

     2.   /usr/local/lib

Then use git blame

git blame contrib/openpam/doc/man/pam.conf.5

It shows these line is added from import of 2013 pam module

There is no change. See pam.conf(5).

The module-path field specifies the name or full path of the module to
     call.  If only the name is specified, the PAM library will search for it
     in the following locations:

     1.   /usr/lib

     2.   /usr/local/lib

Then use git blame

git blame contrib/openpam/doc/man/pam.conf.5

It shows these line is added from import of 2013 pam module

Understood, but I am wondering why the original version worked, and all other ports install pam_*.so into lib/security/. I suspect that the pam library in the base system also searches modules under lib/security/ but undocumented, and that behavior has been modified or removed.

If that's the older behavior of pam, I'm not sure if we should restore it, or update all the ports install pam module into lib/security/ ...

No, see git blame contrib/openpam/lib/libpam/openpam_constants.c of history of openpam_module_path

We never overwrite it

There is no change. See pam.conf(5).

The module-path field specifies the name or full path of the module to
     call.  If only the name is specified, the PAM library will search for it
     in the following locations:

     1.   /usr/lib

     2.   /usr/local/lib

Then use git blame

git blame contrib/openpam/doc/man/pam.conf.5

It shows these line is added from import of 2013 pam module

Understood, but I am wondering why the original version worked, and all other ports install pam_*.so into lib/security/. I suspect that the pam library in the base system also searches modules under lib/security/ but undocumented, and that behavior has been modified or removed.

If that's the older behavior of pam, I'm not sure if we should restore it, or update all the ports install pam module into lib/security/ ...

@des: what's the correct path for pam modules installed from ports? ${PREFIX}/lib or ${PREFIX}/lib/security ?

@des: what's the correct path for pam modules installed from ports? ${PREFIX}/lib or ${PREFIX}/lib/security ?

The former, otherwise you have to use the full path in the policy file. OpenPAM does not look for a security subdirectory and never has. As far as I can tell, FreeBSD didn't use a security subdirectory even when we had Linux-PAM. I'm not sure who made that decision (jdp I guess?) or why, but since I wrote OpenPAM mainly for the purpose of replacing Linux-PAM in FreeBSD, I followed FreeBSD's example rather than use Linux-PAM's upstream default.

Use symlink instead of copy file

des added inline comments.
security/fprintd/Makefile
27

ln is usually spelled ${LN} in Makefiles.

@des wrote:

OpenPAM does not look for a security subdirectory and never has.

@lwhsu wrote:

Understood, but I am wondering why the original version worked, and all other ports install pam_*.so into lib/security/.

Before we proceed, do we have a definitive answer for these two questions? If there's a bigger problem here I'd rather fix that instead of band-aiding individual port(s).

des requested changes to this revision.May 23 2025, 6:13 PM
@des wrote:

OpenPAM does not look for a security subdirectory and never has.

@lwhsu wrote:

Understood, but I am wondering why the original version worked, and all other ports install pam_*.so into lib/security/.

Before we proceed, do we have a definitive answer for these two questions?

The first is not a question, it's a statement.

The answer to the second is that even though the module is in the wrong location, it still works if you provide the full path in your PAM policy.

We can either:

  1. fix all ports that install PAM modules to install them in the correct location, but that will break existing configurations unless we leave a symlink in the incorrect location, or
  2. make OpenPAM look in ${LOCALBASE}/lib/security, but that won't help users of existing releases.
This revision now requires changes to proceed.May 23 2025, 6:13 PM
In D50239#1152486, @des wrote:
@des wrote:

OpenPAM does not look for a security subdirectory and never has.

@lwhsu wrote:

Understood, but I am wondering why the original version worked, and all other ports install pam_*.so into lib/security/.

Before we proceed, do we have a definitive answer for these two questions?

The first is not a question, it's a statement.

The answer to the second is that even though the module is in the wrong location, it still works if you provide the full path in your PAM policy.

We can either:

  1. fix all ports that install PAM modules to install them in the correct location, but that will break existing configurations unless we leave a symlink in the incorrect location, or
  2. make OpenPAM look in ${LOCALBASE}/lib/security, but that won't help users of existing releases.

I discover you requries a change to this patch. What is the request change you want me to do? I already use softlink.

I discover you requries a change to this patch. What is the request change you want me to do? I already use softlink.

Not intentionally. Probably a bug in Phabricator.

This revision now requires review to proceed.May 23 2025, 8:45 PM

Close it as the maintainer decide to fix at the src side.