From 377066dabd5eb8545645195ee231eb1017517fe4 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 4 Dec 2024 07:49:14 +0100 Subject: libpam: update 1.6.1 -> 1.7.0 Change from autotools to meson. ptest support is removed for now, as pam-ptest isn't executed on the autobuilder. Adjust packaging as pam now installs everything into /usr rather than /. (From OE-Core rev: 00eb730291f9630eb70480d37ed48fbadecc547a) Signed-off-by: Alexander Kanavin Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- ...-correct-check-for-existence-of-two-prepr.patch | 40 +++++ .../pam/libpam/libpam-xtests.patch | 45 ----- meta/recipes-extended/pam/libpam_1.6.1.bb | 190 --------------------- meta/recipes-extended/pam/libpam_1.7.0.bb | 163 ++++++++++++++++++ 4 files changed, 203 insertions(+), 235 deletions(-) create mode 100644 meta/recipes-extended/pam/libpam/0001-meson.build-correct-check-for-existence-of-two-prepr.patch delete mode 100644 meta/recipes-extended/pam/libpam/libpam-xtests.patch delete mode 100644 meta/recipes-extended/pam/libpam_1.6.1.bb create mode 100644 meta/recipes-extended/pam/libpam_1.7.0.bb diff --git a/meta/recipes-extended/pam/libpam/0001-meson.build-correct-check-for-existence-of-two-prepr.patch b/meta/recipes-extended/pam/libpam/0001-meson.build-correct-check-for-existence-of-two-prepr.patch new file mode 100644 index 0000000000..ef087ffc06 --- /dev/null +++ b/meta/recipes-extended/pam/libpam/0001-meson.build-correct-check-for-existence-of-two-prepr.patch @@ -0,0 +1,40 @@ +From 9b5182d4781bcd6fb37a4030faf325965fde3e93 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Thu, 28 Nov 2024 20:32:17 +0100 +Subject: [PATCH] meson: correct check for existence of two preprocessor + defines + +sizeof is meant for *types*, and in case of cross compiling +the test program produced by it has incorrect syntax + __NR_keyctl something; +and will always fail to compile. + +* meson.build: Use cc.get_define() instead of cc.sizeof() to check for +preprocessor symbols. + +Co-authored-by: Dmitry V. Levin +Upstream-Status: Backport [https://github.com/linux-pam/linux-pam/pull/861] +Signed-off-by: Alexander Kanavin +--- + meson.build | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index f6a7dafe9..307fed0aa 100644 +--- a/meson.build ++++ b/meson.build +@@ -198,12 +198,12 @@ foreach ident: check_functions + endif + endforeach + +-enable_pam_keyinit = cc.sizeof('__NR_keyctl', prefix: '#include ') > 0 ++enable_pam_keyinit = cc.get_define('__NR_keyctl', prefix: '#include ') != '' + + if get_option('mailspool') != '' + cdata.set_quoted('PAM_PATH_MAILDIR', get_option('mailspool')) + else +- have = cc.sizeof('_PATH_MAILDIR', prefix: '#include ') > 0 ++ have = cc.get_define('_PATH_MAILDIR', prefix: '#include ') != '' + cdata.set('PAM_PATH_MAILDIR', have ? '_PATH_MAILDIR' : '"/var/spool/mail"') + endif + diff --git a/meta/recipes-extended/pam/libpam/libpam-xtests.patch b/meta/recipes-extended/pam/libpam/libpam-xtests.patch deleted file mode 100644 index f2dafa72a5..0000000000 --- a/meta/recipes-extended/pam/libpam/libpam-xtests.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 060726f7e60c8ecb5bf50fd776910b290d9a0a69 Mon Sep 17 00:00:00 2001 -From: Kang Kai -Date: Tue, 19 Jul 2011 17:08:31 +0800 -Subject: [PATCH] This patch is used to create a new sub package libpam-xtests - to do more checks. - -Upstream-Status: Pending - -Signed-off-by: Kang Kai ---- - xtests/Makefile.am | 17 ++++++++++++++++- - 1 file changed, 16 insertions(+), 1 deletion(-) - -diff --git a/xtests/Makefile.am b/xtests/Makefile.am -index acf9746..9826c9f 100644 ---- a/xtests/Makefile.am -+++ b/xtests/Makefile.am -@@ -8,7 +8,7 @@ AM_CFLAGS = -DLIBPAM_COMPILE -I$(top_srcdir)/libpam/include \ - LDADD = $(top_builddir)/libpam/libpam.la \ - $(top_builddir)/libpam_misc/libpam_misc.la - --CLEANFILES = *~ $(XTESTS) -+CLEANFILES = *~ - - EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \ - tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd \ -@@ -55,3 +55,18 @@ EXTRA_PROGRAMS = $(XTESTS) - - xtests: $(XTESTS) run-xtests.sh - "$(srcdir)"/run-xtests.sh "$(srcdir)" ${XTESTS} ${NOSRCTESTS} -+ -+all: $(XTESTS) -+ -+install: install_xtests -+ -+install_xtests: -+ $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests -+ for file in $(EXTRA_DIST) ; do \ -+ $(INSTALL) $(srcdir)/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \ -+ done -+ for file in $(XTESTS); do \ -+ $(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \ -+ done -+ -+.PHONY: all install_xtests diff --git a/meta/recipes-extended/pam/libpam_1.6.1.bb b/meta/recipes-extended/pam/libpam_1.6.1.bb deleted file mode 100644 index a48f78187b..0000000000 --- a/meta/recipes-extended/pam/libpam_1.6.1.bb +++ /dev/null @@ -1,190 +0,0 @@ -DISABLE_STATIC = "" -SUMMARY = "Linux-PAM (Pluggable Authentication Modules)" -DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), a flexible mechanism for authenticating users" -HOMEPAGE = "https://fedorahosted.org/linux-pam/" -BUGTRACKER = "https://fedorahosted.org/linux-pam/newticket" -SECTION = "base" -# PAM is dual licensed under GPL and BSD. -# /etc/pam.d comes from Debian libpam-runtime in 2009-11 (at that time -# libpam-runtime-1.0.1 is GPL-2.0-or-later), by openembedded -LICENSE = "GPL-2.0-or-later | BSD-3-Clause" -LIC_FILES_CHKSUM = "file://COPYING;md5=7eb5c1bf854e8881005d673599ee74d3 \ - file://libpamc/License;md5=a4da476a14c093fdc73be3c3c9ba8fb3 \ - " - -SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/Linux-PAM-${PV}.tar.xz \ - file://99_pam \ - file://pam.d/common-account \ - file://pam.d/common-auth \ - file://pam.d/common-password \ - file://pam.d/common-session \ - file://pam.d/common-session-noninteractive \ - file://pam.d/other \ - file://libpam-xtests.patch \ - file://run-ptest \ - file://pam-volatiles.conf \ - " - -SRC_URI[sha256sum] = "f8923c740159052d719dbfc2a2f81942d68dd34fcaf61c706a02c9b80feeef8e" - -DEPENDS = "bison-native flex-native libxml2-native virtual/crypt" - -EXTRA_OECONF = "--includedir=${includedir}/security \ - --libdir=${base_libdir} \ - --with-systemdunitdir=${systemd_system_unitdir} \ - --disable-nis \ - --disable-regenerate-docu \ - --disable-doc \ - --disable-prelude" - -CFLAGS += "-fPIC " - -S = "${WORKDIR}/Linux-PAM-${PV}" - -inherit autotools gettext pkgconfig systemd ptest github-releases - -PACKAGECONFIG ??= "" -PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit," -PACKAGECONFIG[userdb] = "--enable-db=db,--enable-db=no,db," - -PACKAGES += "${PN}-runtime ${PN}-xtests" -FILES:${PN} = " \ - ${base_libdir}/lib*${SOLIBS} \ - ${nonarch_libdir}/tmpfiles.d/*.conf \ -" -FILES:${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}" -FILES:${PN}-runtime = "${sysconfdir} ${sbindir} ${systemd_system_unitdir}" -FILES:${PN}-xtests = "${datadir}/Linux-PAM/xtests" - -# libpam installs /etc/environment for use with the pam_env plugin. Make sure it is -# packaged with the pam-plugin-env package to avoid breaking installations which -# install that file via other packages -FILES:pam-plugin-env = "${sysconfdir}/environment" - -PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*" - -def get_multilib_bit(d): - baselib = d.getVar('baselib') or '' - return baselib.replace('lib', '') - -libpam_suffix = "suffix${@get_multilib_bit(d)}" - -RPROVIDES:${PN} += "${PN}-${libpam_suffix}" -RPROVIDES:${PN}-runtime += "${PN}-runtime-${libpam_suffix}" - -RDEPENDS:${PN}-runtime = "${PN}-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-deny-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-permit-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-warn-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-unix-${libpam_suffix} \ - " -RDEPENDS:${PN}-xtests = "${PN}-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-access-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-debug-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-pwhistory-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-succeed-if-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-time-${libpam_suffix} \ - bash coreutils" - -# FIXME: Native suffix breaks here, disable it for now -RRECOMMENDS:${PN} = "${PN}-runtime-${libpam_suffix}" -RRECOMMENDS:${PN}:class-native = "" - -python populate_packages:prepend () { - def pam_plugin_hook(file, pkg, pattern, format, basename): - pn = d.getVar('PN') - libpam_suffix = d.getVar('libpam_suffix') - - rdeps = d.getVar('RDEPENDS:' + pkg) - if rdeps: - rdeps = rdeps + " " + pn + "-" + libpam_suffix - else: - rdeps = pn + "-" + libpam_suffix - d.setVar('RDEPENDS:' + pkg, rdeps) - - provides = d.getVar('RPROVIDES:' + pkg) - if provides: - provides = provides + " " + pkg + "-" + libpam_suffix - else: - provides = pkg + "-" + libpam_suffix - d.setVar('RPROVIDES:' + pkg, provides) - - mlprefix = d.getVar('MLPREFIX') or '' - dvar = d.expand('${WORKDIR}/package') - pam_libdir = d.expand('${base_libdir}/security') - pam_sbindir = d.expand('${sbindir}') - pam_filterdir = d.expand('${base_libdir}/security/pam_filter') - pam_pkgname = mlprefix + 'pam-plugin%s' - - do_split_packages(d, pam_libdir, r'^pam(.*)\.so$', pam_pkgname, - 'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='', prepend=True) - do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='') -} - -do_compile_ptest() { - cd tests - sed -i -e 's/$(MAKE) $(AM_MAKEFLAGS) check-TESTS//' Makefile - oe_runmake check-am - cd - -} - -do_install() { - autotools_do_install - - # don't install /var/run when populating rootfs. Do it through volatile - rm -rf ${D}${localstatedir} - - if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then - rm -rf ${D}${sysconfdir}/init.d/ - rm -rf ${D}${sysconfdir}/rc* - install -d ${D}${nonarch_libdir}/tmpfiles.d - install -m 0644 ${UNPACKDIR}/pam-volatiles.conf \ - ${D}${nonarch_libdir}/tmpfiles.d/pam.conf - else - install -d ${D}${sysconfdir}/default/volatiles - install -m 0644 ${UNPACKDIR}/99_pam \ - ${D}${sysconfdir}/default/volatiles/ - fi - - install -d ${D}${sysconfdir}/pam.d/ - install -m 0644 ${UNPACKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ - - # The lsb requires unix_chkpwd has setuid permission - chmod 4755 ${D}${sbindir}/unix_chkpwd - - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session - fi - if [ "${base_libdir}" != "${libdir}" ]; then - install -d ${D}/${libdir}/ - mv ${D}/${base_libdir}/pkgconfig ${D}/${libdir}/ - fi -} - -do_install_ptest() { - mkdir -p ${D}${PTEST_PATH}/tests - install -m 0755 ${B}/tests/.libs/* ${D}${PTEST_PATH}/tests - install -m 0644 ${S}/tests/confdir ${D}${PTEST_PATH}/tests -} - -pkg_postinst:${PN}() { - if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then - /etc/init.d/populate-volatile.sh update - fi -} - -inherit features_check -ANY_OF_DISTRO_FEATURES = "pam systemd" - -BBCLASSEXTEND = "nativesdk native" - -CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-session" -CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-auth" -CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-password" -CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-session-noninteractive" -CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-account" -CONFFILES:${PN}-runtime += "${sysconfdir}/security/limits.conf" - -GITHUB_BASE_URI = "https://github.com/linux-pam/linux-pam/releases" - -CVE_PRODUCT = "linux-pam" diff --git a/meta/recipes-extended/pam/libpam_1.7.0.bb b/meta/recipes-extended/pam/libpam_1.7.0.bb new file mode 100644 index 0000000000..ec1c868d21 --- /dev/null +++ b/meta/recipes-extended/pam/libpam_1.7.0.bb @@ -0,0 +1,163 @@ +DISABLE_STATIC = "" +SUMMARY = "Linux-PAM (Pluggable Authentication Modules)" +DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), a flexible mechanism for authenticating users" +HOMEPAGE = "https://fedorahosted.org/linux-pam/" +BUGTRACKER = "https://fedorahosted.org/linux-pam/newticket" +SECTION = "base" +# PAM is dual licensed under GPL and BSD. +# /etc/pam.d comes from Debian libpam-runtime in 2009-11 (at that time +# libpam-runtime-1.0.1 is GPL-2.0-or-later), by openembedded +LICENSE = "GPL-2.0-or-later | BSD-3-Clause" +LIC_FILES_CHKSUM = "file://COPYING;md5=7eb5c1bf854e8881005d673599ee74d3 \ + file://libpamc/License;md5=a4da476a14c093fdc73be3c3c9ba8fb3 \ + " + +SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/Linux-PAM-${PV}.tar.xz \ + file://99_pam \ + file://pam.d/common-account \ + file://pam.d/common-auth \ + file://pam.d/common-password \ + file://pam.d/common-session \ + file://pam.d/common-session-noninteractive \ + file://pam.d/other \ + file://run-ptest \ + file://pam-volatiles.conf \ + file://0001-meson.build-correct-check-for-existence-of-two-prepr.patch \ + " + +SRC_URI[sha256sum] = "57dcd7a6b966ecd5bbd95e1d11173734691e16b68692fa59661cdae9b13b1697" + +DEPENDS = "bison-native flex-native libxml2-native virtual/crypt" + +EXTRA_OEMESON = "-Ddocs=disabled" + +S = "${WORKDIR}/Linux-PAM-${PV}" + +inherit meson gettext pkgconfig systemd ptest github-releases + +PACKAGECONFIG ??= "" +PACKAGECONFIG[audit] = "-Daudit=enabled,-Daudit=disabled,audit," +PACKAGECONFIG[userdb] = "-Dpam_userdb=enabled -Ddb=gdbm,-Dpam_userdb=disabled,gdbm," + +PACKAGES += "${PN}-runtime ${PN}-xtests" +FILES:${PN} = " \ + ${libdir}/lib*${SOLIBS} \ + ${nonarch_libdir}/tmpfiles.d/*.conf \ +" +FILES:${PN}-dev += "${libdir}/security/*.la ${libdir}/*.la ${libdir}/lib*${SOLIBSDEV}" +FILES:${PN}-runtime = "${sysconfdir} ${sbindir} ${nonarch_libdir}/systemd/system" +FILES:${PN}-xtests = "${datadir}/Linux-PAM/xtests" + +# libpam installs /etc/environment for use with the pam_env plugin. Make sure it is +# packaged with the pam-plugin-env package to avoid breaking installations which +# install that file via other packages +FILES:pam-plugin-env = "${sysconfdir}/environment" + +PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*" + +def get_multilib_bit(d): + baselib = d.getVar('baselib') or '' + return baselib.replace('lib', '') + +libpam_suffix = "suffix${@get_multilib_bit(d)}" + +RPROVIDES:${PN} += "${PN}-${libpam_suffix}" +RPROVIDES:${PN}-runtime += "${PN}-runtime-${libpam_suffix}" + +RDEPENDS:${PN}-runtime = "${PN}-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-deny-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-permit-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-warn-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-unix-${libpam_suffix} \ + " +RDEPENDS:${PN}-xtests = "${PN}-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-access-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-debug-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-pwhistory-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-succeed-if-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-time-${libpam_suffix} \ + bash coreutils" + +# FIXME: Native suffix breaks here, disable it for now +RRECOMMENDS:${PN} = "${PN}-runtime-${libpam_suffix}" +RRECOMMENDS:${PN}:class-native = "" + +python populate_packages:prepend () { + def pam_plugin_hook(file, pkg, pattern, format, basename): + pn = d.getVar('PN') + libpam_suffix = d.getVar('libpam_suffix') + + rdeps = d.getVar('RDEPENDS:' + pkg) + if rdeps: + rdeps = rdeps + " " + pn + "-" + libpam_suffix + else: + rdeps = pn + "-" + libpam_suffix + d.setVar('RDEPENDS:' + pkg, rdeps) + + provides = d.getVar('RPROVIDES:' + pkg) + if provides: + provides = provides + " " + pkg + "-" + libpam_suffix + else: + provides = pkg + "-" + libpam_suffix + d.setVar('RPROVIDES:' + pkg, provides) + + mlprefix = d.getVar('MLPREFIX') or '' + dvar = d.expand('${WORKDIR}/package') + pam_libdir = d.expand('${libdir}/security') + pam_sbindir = d.expand('${sbindir}') + pam_filterdir = d.expand('${libdir}/security/pam_filter') + pam_pkgname = mlprefix + 'pam-plugin%s' + + do_split_packages(d, pam_libdir, r'^pam(.*)\.so$', pam_pkgname, + 'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='', prepend=True) + do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='') +} + +do_install:append() { + # don't install /var/run when populating rootfs. Do it through volatile + rm -rf ${D}${localstatedir} + + if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then + rm -rf ${D}${sysconfdir}/init.d/ + rm -rf ${D}${sysconfdir}/rc* + install -d ${D}${nonarch_libdir}/tmpfiles.d + install -m 0644 ${UNPACKDIR}/pam-volatiles.conf \ + ${D}${nonarch_libdir}/tmpfiles.d/pam.conf + else + install -d ${D}${sysconfdir}/default/volatiles + install -m 0644 ${UNPACKDIR}/99_pam \ + ${D}${sysconfdir}/default/volatiles/ + fi + + install -d ${D}${sysconfdir}/pam.d/ + install -m 0644 ${UNPACKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ + + # The lsb requires unix_chkpwd has setuid permission + chmod 4755 ${D}${sbindir}/unix_chkpwd + + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session + fi +} + +pkg_postinst:${PN}() { + if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then + /etc/init.d/populate-volatile.sh update + fi +} + +inherit features_check +ANY_OF_DISTRO_FEATURES = "pam systemd" + +BBCLASSEXTEND = "nativesdk native" + +CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-session" +CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-auth" +CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-password" +CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-session-noninteractive" +CONFFILES:${PN}-runtime += "${sysconfdir}/pam.d/common-account" +CONFFILES:${PN}-runtime += "${sysconfdir}/security/limits.conf" + +GITHUB_BASE_URI = "https://github.com/linux-pam/linux-pam/releases" + +CVE_PRODUCT = "linux-pam" -- cgit v1.2.3-54-g00ecf