Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | DISABLE_STATIC = "" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 2 | SUMMARY = "Linux-PAM (Pluggable Authentication Modules)" |
| 3 | DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), a flexible mechanism for authenticating users" |
| 4 | HOMEPAGE = "https://fedorahosted.org/linux-pam/" |
| 5 | BUGTRACKER = "https://fedorahosted.org/linux-pam/newticket" |
| 6 | SECTION = "base" |
| 7 | # PAM is dual licensed under GPL and BSD. |
| 8 | # /etc/pam.d comes from Debian libpam-runtime in 2009-11 (at that time |
| 9 | # libpam-runtime-1.0.1 is GPLv2+), by openembedded |
| 10 | LICENSE = "GPLv2+ | BSD" |
Brad Bishop | f8caae3 | 2019-03-25 13:13:56 -0400 | [diff] [blame] | 11 | LIC_FILES_CHKSUM = "file://COPYING;md5=7eb5c1bf854e8881005d673599ee74d3 \ |
| 12 | file://libpamc/License;md5=a4da476a14c093fdc73be3c3c9ba8fb3 \ |
| 13 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 14 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 15 | SRC_URI = "https://github.com/linux-pam/linux-pam/releases/download/v${PV}/Linux-PAM-${PV}.tar.xz \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 16 | file://99_pam \ |
| 17 | file://pam.d/common-account \ |
| 18 | file://pam.d/common-auth \ |
| 19 | file://pam.d/common-password \ |
| 20 | file://pam.d/common-session \ |
| 21 | file://pam.d/common-session-noninteractive \ |
| 22 | file://pam.d/other \ |
| 23 | file://libpam-xtests.patch \ |
Andrew Geissler | 87ddd3e | 2021-01-28 18:27:13 -0600 | [diff] [blame] | 24 | file://pam-security-abstract-securetty-handling.patch \ |
| 25 | file://pam-unix-nullok-secure.patch \ |
| 26 | file://crypt_configure.patch \ |
| 27 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 28 | |
Andrew Geissler | 87ddd3e | 2021-01-28 18:27:13 -0600 | [diff] [blame] | 29 | SRC_URI[md5sum] = "558ff53b0fc0563ca97f79e911822165" |
| 30 | SRC_URI[sha256sum] = "eff47a4ecd833fbf18de9686632a70ee8d0794b79aecb217ebd0ce11db4cd0db" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 31 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 32 | DEPENDS = "bison-native flex flex-native cracklib libxml2-native virtual/crypt" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 33 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 34 | EXTRA_OECONF = "--includedir=${includedir}/security \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 35 | --libdir=${base_libdir} \ |
| 36 | --disable-nis \ |
| 37 | --disable-regenerate-docu \ |
| 38 | --disable-prelude" |
| 39 | |
| 40 | CFLAGS_append = " -fPIC " |
| 41 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 42 | S = "${WORKDIR}/Linux-PAM-${PV}" |
| 43 | |
Andrew Geissler | 87ddd3e | 2021-01-28 18:27:13 -0600 | [diff] [blame] | 44 | inherit autotools gettext pkgconfig |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 45 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 46 | PACKAGECONFIG ??= "" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 47 | PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit," |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 48 | PACKAGECONFIG[userdb] = "--enable-db=db,--enable-db=no,db," |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 49 | |
| 50 | PACKAGES += "${PN}-runtime ${PN}-xtests" |
| 51 | FILES_${PN} = "${base_libdir}/lib*${SOLIBS}" |
| 52 | FILES_${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}" |
Andrew Geissler | 87ddd3e | 2021-01-28 18:27:13 -0600 | [diff] [blame] | 53 | FILES_${PN}-runtime = "${sysconfdir}" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 54 | FILES_${PN}-xtests = "${datadir}/Linux-PAM/xtests" |
| 55 | |
| 56 | PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*" |
| 57 | |
| 58 | def get_multilib_bit(d): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 59 | baselib = d.getVar('baselib') or '' |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 60 | return baselib.replace('lib', '') |
| 61 | |
| 62 | libpam_suffix = "suffix${@get_multilib_bit(d)}" |
| 63 | |
| 64 | RPROVIDES_${PN} += "${PN}-${libpam_suffix}" |
| 65 | RPROVIDES_${PN}-runtime += "${PN}-runtime-${libpam_suffix}" |
| 66 | |
| 67 | RDEPENDS_${PN}-runtime = "${PN}-${libpam_suffix} \ |
| 68 | ${MLPREFIX}pam-plugin-deny-${libpam_suffix} \ |
| 69 | ${MLPREFIX}pam-plugin-permit-${libpam_suffix} \ |
| 70 | ${MLPREFIX}pam-plugin-warn-${libpam_suffix} \ |
| 71 | ${MLPREFIX}pam-plugin-unix-${libpam_suffix} \ |
| 72 | " |
| 73 | RDEPENDS_${PN}-xtests = "${PN}-${libpam_suffix} \ |
| 74 | ${MLPREFIX}pam-plugin-access-${libpam_suffix} \ |
| 75 | ${MLPREFIX}pam-plugin-debug-${libpam_suffix} \ |
Andrew Geissler | 87ddd3e | 2021-01-28 18:27:13 -0600 | [diff] [blame] | 76 | ${MLPREFIX}pam-plugin-cracklib-${libpam_suffix} \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 77 | ${MLPREFIX}pam-plugin-pwhistory-${libpam_suffix} \ |
| 78 | ${MLPREFIX}pam-plugin-succeed-if-${libpam_suffix} \ |
| 79 | ${MLPREFIX}pam-plugin-time-${libpam_suffix} \ |
Andrew Geissler | 87ddd3e | 2021-01-28 18:27:13 -0600 | [diff] [blame] | 80 | coreutils" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 81 | |
| 82 | # FIXME: Native suffix breaks here, disable it for now |
| 83 | RRECOMMENDS_${PN} = "${PN}-runtime-${libpam_suffix}" |
| 84 | RRECOMMENDS_${PN}_class-native = "" |
| 85 | |
| 86 | python populate_packages_prepend () { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 87 | def pam_plugin_hook(file, pkg, pattern, format, basename): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 88 | pn = d.getVar('PN') |
| 89 | libpam_suffix = d.getVar('libpam_suffix') |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 90 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 91 | rdeps = d.getVar('RDEPENDS_' + pkg) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 92 | if rdeps: |
| 93 | rdeps = rdeps + " " + pn + "-" + libpam_suffix |
| 94 | else: |
| 95 | rdeps = pn + "-" + libpam_suffix |
| 96 | d.setVar('RDEPENDS_' + pkg, rdeps) |
| 97 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 98 | provides = d.getVar('RPROVIDES_' + pkg) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 99 | if provides: |
| 100 | provides = provides + " " + pkg + "-" + libpam_suffix |
| 101 | else: |
| 102 | provides = pkg + "-" + libpam_suffix |
| 103 | d.setVar('RPROVIDES_' + pkg, provides) |
| 104 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 105 | mlprefix = d.getVar('MLPREFIX') or '' |
| 106 | dvar = d.expand('${WORKDIR}/package') |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 107 | pam_libdir = d.expand('${base_libdir}/security') |
| 108 | pam_sbindir = d.expand('${sbindir}') |
| 109 | pam_filterdir = d.expand('${base_libdir}/security/pam_filter') |
| 110 | pam_pkgname = mlprefix + 'pam-plugin%s' |
| 111 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 112 | do_split_packages(d, pam_libdir, r'^pam(.*)\.so$', pam_pkgname, |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 113 | 'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='') |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 114 | do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='') |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 115 | } |
| 116 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 117 | do_compile_ptest() { |
| 118 | cd tests |
| 119 | sed -i -e 's/$(MAKE) $(AM_MAKEFLAGS) check-TESTS//' Makefile |
| 120 | oe_runmake check-am |
| 121 | cd - |
| 122 | } |
| 123 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 124 | do_install() { |
| 125 | autotools_do_install |
| 126 | |
| 127 | # don't install /var/run when populating rootfs. Do it through volatile |
| 128 | rm -rf ${D}${localstatedir} |
| 129 | install -d ${D}${sysconfdir}/default/volatiles |
| 130 | install -m 0644 ${WORKDIR}/99_pam ${D}${sysconfdir}/default/volatiles |
| 131 | |
| 132 | install -d ${D}${sysconfdir}/pam.d/ |
| 133 | install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ |
| 134 | |
| 135 | # The lsb requires unix_chkpwd has setuid permission |
| 136 | chmod 4755 ${D}${sbindir}/unix_chkpwd |
| 137 | |
| 138 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 139 | echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session |
| 140 | fi |
| 141 | } |
| 142 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 143 | do_install_ptest() { |
| 144 | if [ ${PTEST_ENABLED} = "1" ]; then |
| 145 | mkdir -p ${D}${PTEST_PATH}/tests |
| 146 | install -m 0755 ${B}/tests/.libs/* ${D}${PTEST_PATH}/tests |
| 147 | fi |
| 148 | } |
| 149 | |
Brad Bishop | 6dbb316 | 2019-11-25 09:41:34 -0500 | [diff] [blame] | 150 | inherit features_check |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 151 | REQUIRED_DISTRO_FEATURES = "pam" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 152 | |
| 153 | BBCLASSEXTEND = "nativesdk native" |
| 154 | |
| 155 | CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session" |
| 156 | CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-auth" |
| 157 | CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-password" |
| 158 | CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session-noninteractive" |
| 159 | CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-account" |
| 160 | CONFFILES_${PN}-runtime += "${sysconfdir}/security/limits.conf" |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 161 | |
| 162 | UPSTREAM_CHECK_URI = "https://github.com/linux-pam/linux-pam/releases" |
Brad Bishop | 1d80a2e | 2019-11-15 16:35:03 -0500 | [diff] [blame] | 163 | |
| 164 | CVE_PRODUCT = "linux-pam" |