From c11f334af513145bdcb501fef942177c4b7c839f Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 13 Mar 2024 18:33:24 +0100 Subject: libpam: update 1.5.3 -> 1.6.0 (From OE-Core rev: 2a194d5dd1d82f233fa28a44412aea1ba4ccd434) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- ...es-Replace-use-of-termio.h-with-termios.h.patch | 39 ----- .../pam/libpam/libpam-xtests.patch | 22 ++- meta/recipes-extended/pam/libpam_1.5.3.bb | 192 --------------------- meta/recipes-extended/pam/libpam_1.6.0.bb | 191 ++++++++++++++++++++ 4 files changed, 206 insertions(+), 238 deletions(-) delete mode 100644 meta/recipes-extended/pam/libpam/0001-examples-Replace-use-of-termio.h-with-termios.h.patch delete mode 100644 meta/recipes-extended/pam/libpam_1.5.3.bb create mode 100644 meta/recipes-extended/pam/libpam_1.6.0.bb diff --git a/meta/recipes-extended/pam/libpam/0001-examples-Replace-use-of-termio.h-with-termios.h.patch b/meta/recipes-extended/pam/libpam/0001-examples-Replace-use-of-termio.h-with-termios.h.patch deleted file mode 100644 index 95c437df4f..0000000000 --- a/meta/recipes-extended/pam/libpam/0001-examples-Replace-use-of-termio.h-with-termios.h.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 9b96fcfa5748934b8b6a4db4ee25a5e3165905c0 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 1 Jul 2023 07:48:17 -0700 -Subject: [PATCH] examples: Replace use of termio.h with termios.h - -Fixes build with musl and makes it portable - -Upstream-Status: Backport [https://github.com/linux-pam/linux-pam/commit/5374f677e4cae669eb9accf2449178b602e8a40a] -Signed-off-by: Khem Raj ---- - examples/tty_conv.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/examples/tty_conv.c b/examples/tty_conv.c -index 23f0684..db22500 100644 ---- a/examples/tty_conv.c -+++ b/examples/tty_conv.c -@@ -6,7 +6,8 @@ - #include - #include - #include --#include -+#include -+#include - #include - - /*************************************** -@@ -16,7 +17,7 @@ - ***************************************/ - static void echoOff(int fd, int off) - { -- struct termio tty; -+ struct termios tty; - if (ioctl(fd, TCGETA, &tty) < 0) - { - fprintf(stderr, "TCGETA failed: %s\n", strerror(errno)); --- -2.41.0 - diff --git a/meta/recipes-extended/pam/libpam/libpam-xtests.patch b/meta/recipes-extended/pam/libpam/libpam-xtests.patch index ea145899b4..f2dafa72a5 100644 --- a/meta/recipes-extended/pam/libpam/libpam-xtests.patch +++ b/meta/recipes-extended/pam/libpam/libpam-xtests.patch @@ -1,13 +1,21 @@ -This patch is used to create a new sub package libpam-xtests to do more checks. +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 -Index: Linux-PAM-1.3.0/xtests/Makefile.am -=================================================================== ---- Linux-PAM-1.3.0.orig/xtests/Makefile.am -+++ Linux-PAM-1.3.0/xtests/Makefile.am -@@ -7,7 +7,7 @@ AM_CFLAGS = -DLIBPAM_COMPILE -I$(top_src +--- + 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 @@ -16,7 +24,7 @@ Index: Linux-PAM-1.3.0/xtests/Makefile.am EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \ tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd \ -@@ -51,3 +51,18 @@ EXTRA_PROGRAMS = $(XTESTS) +@@ -55,3 +55,18 @@ EXTRA_PROGRAMS = $(XTESTS) xtests: $(XTESTS) run-xtests.sh "$(srcdir)"/run-xtests.sh "$(srcdir)" ${XTESTS} ${NOSRCTESTS} diff --git a/meta/recipes-extended/pam/libpam_1.5.3.bb b/meta/recipes-extended/pam/libpam_1.5.3.bb deleted file mode 100644 index 2a53bb4cc5..0000000000 --- a/meta/recipes-extended/pam/libpam_1.5.3.bb +++ /dev/null @@ -1,192 +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://0001-examples-Replace-use-of-termio.h-with-termios.h.patch \ - file://run-ptest \ - file://pam-volatiles.conf \ - file://0001-pam_namespace-include-stdint-h.patch \ - " - -SRC_URI[sha256sum] = "7ac4b50feee004a9fa88f1dfd2d2fa738a82896763050cd773b3c54b0a818283" - -DEPENDS = "bison-native flex-native cracklib 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:append = " -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 ${WORKDIR}/pam-volatiles.conf \ - ${D}${nonarch_libdir}/tmpfiles.d/pam.conf - else - install -d ${D}${sysconfdir}/default/volatiles - install -m 0644 ${WORKDIR}/99_pam \ - ${D}${sysconfdir}/default/volatiles/ - fi - - install -d ${D}${sysconfdir}/pam.d/ - install -m 0644 ${WORKDIR}/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 ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','false','true',d)}; 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.6.0.bb b/meta/recipes-extended/pam/libpam_1.6.0.bb new file mode 100644 index 0000000000..e1ed940d1e --- /dev/null +++ b/meta/recipes-extended/pam/libpam_1.6.0.bb @@ -0,0 +1,191 @@ +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 \ + file://0001-pam_namespace-include-stdint-h.patch \ + " + +SRC_URI[sha256sum] = "fff4a34e5bbee77e2e8f1992f27631e2329bcbf8a0563ddeb5c3389b4e3169ad" + +DEPENDS = "bison-native flex-native cracklib 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:append = " -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 ${WORKDIR}/pam-volatiles.conf \ + ${D}${nonarch_libdir}/tmpfiles.d/pam.conf + else + install -d ${D}${sysconfdir}/default/volatiles + install -m 0644 ${WORKDIR}/99_pam \ + ${D}${sysconfdir}/default/volatiles/ + fi + + install -d ${D}${sysconfdir}/pam.d/ + install -m 0644 ${WORKDIR}/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 ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','false','true',d)}; 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" -- cgit v1.2.3-54-g00ecf