Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 712906 - sys-libs/pam-1.3.1_p20200128-r1 installs system headers in the wrong location in Prefix
Summary: sys-libs/pam-1.3.1_p20200128-r1 installs system headers in the wrong location...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-16 17:46 UTC by Steven Trogdon
Modified: 2020-06-16 17:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Trogdon 2020-03-16 17:46:56 UTC
Installed pam:

[I] sys-libs/pam
     Available versions:  1.3.1-r2 1.3.1_p20200128-r1 {audit berkdb +cracklib debug +filecaps nis +pie selinux split-usr static-libs ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  1.3.1_p20200128-r1(12:07:30 AM 03/16/2020)(berkdb cracklib filecaps pie split-usr -audit -debug -nis -selinux -static-libs ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            https://github.com/linux-pam/linux-pam
     Description:         Linux-PAM (Pluggable Authentication Modules)


Headers:

/storage/strogdon/gentoo-rap/usr/include/pam_filter.h
/storage/strogdon/gentoo-rap/usr/include/_pam_macros.h
/storage/strogdon/gentoo-rap/usr/include/pam_ext.h
/storage/strogdon/gentoo-rap/usr/include/pam_modules.h
/storage/strogdon/gentoo-rap/usr/include/pam_misc.h
/storage/strogdon/gentoo-rap/usr/include/_pam_compat.h
/storage/strogdon/gentoo-rap/usr/include/pam_appl.h
/storage/strogdon/gentoo-rap/usr/include/pam_modutil.h
/storage/strogdon/gentoo-rap/usr/include/pam_client.h
/storage/strogdon/gentoo-rap/usr/include/_pam_types.h

These should be installed under ${EPREFIX}/include/security. This prevents building libcap

make -C pam_cap all
make[1]: Entering directory '/storage/strogdon/gentoo-rap/var/tmp/portage/sys-libs/libcap-2.33/work/libcap-2.33-abi_x86_64.amd64/pam_cap'
x86_64-pc-linux-gnu-gcc -march=native -O0 -pipe -g -ggdb -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -g  -Wall -Wwrite-strings -Wpointer-arith
 -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -g  -fPIC -I/storage/strogdon/gentoo-rap/var/tmp/portage/sys-libs/libcap-2.33/work/libcap-2.33-abi_x86_64.amd64/pam_cap/../libcap/inclu
de/uapi -I/storage/strogdon/gentoo-rap/var/tmp/portage/sys-libs/libcap-2.33/work/libcap-2.33-abi_x86_64.amd64/pam_cap/../libcap/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Dlinux -c pam_cap.c -o pam_cap.o
pam_cap.c:25:10: fatal error: security/pam_modules.h: No such file or directory
   25 | #include <security/pam_modules.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

and shadow

checking for security/openpam.h... no
checking for security/pam_misc.h... no
configure: error: PAM headers not found

!!! Please attach the following file when seeking support:
!!! /storage/strogdon/gentoo-rap/var/tmp/portage/sys-apps/shadow-4.8-r3/work/shadow-4.8/config.log

Not sure what provides openpam.h. It is not provided by pam with the USE flags I have, but pam_misc.h is certainly in the wrong place.
Comment 1 Steven Trogdon 2020-03-18 21:54:28 UTC
The issue appears to be that 

dnl Add security to include directory
        if test ${includedir} = '${prefix}/include'
        then
                includedir="${prefix}/include/security"
        fi

from configure.ac fails in Prefix which, after the configure, leaves

includedir='${prefix}/include'

in config.log.

I suppose one could appropriately patch configure.ac to fix things but adding

--includedir="${EPREFIX}"/usr/include/security

to 'myconf' in the ebuild allows the headers to be appropriately installed.

However, the ebuild also fails the postinst stage which I had't noticed originally:

>>> Failed to execute postinst for sys-libs/pam-1.3.1_p20200128-r1

 * Messages for package sys-libs/pam-1.3.1_p20200128-r1:

 * FAILED postinst: 1
 * Some software with pre-loaded PAM libraries might experience
 * warnings or failures related to missing symbols and/or versions
 * after any update. While unfortunate this is a limit of the
 * implementation of PAM and the software, and it requires you to
 * restart the software manually after the update.
 * 
 * You can get a list of such software running a command like
 *   lsof / | egrep -i 'del.*libpam\.so'
 * 
 * Alternatively, simply reboot your system.
 * Setting caps 'cap_dac_override=ep' on file '/storage/strogdon/gentoo-rap/sbin/unix_chkpwd' failed:
 * unable to set CAP_SETFCAP effective capability: Operation not permitted
 * ERROR: sys-libs/pam-1.3.1_p20200128-r1::local failed (postinst phase):
 *   could not set caps
Comment 2 wolfwood 2020-04-01 02:32:50 UTC
This header being in the wrong location prevents the installation of elogind in a prefix.
Comment 3 Benda Xu gentoo-dev 2020-05-12 12:00:08 UTC
Thanks for the report and comments.  If you figure out a way to fix it, feel free the send patches or pull requests.
Comment 4 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2020-06-16 17:37:17 UTC
fixed in pam-1.4.0