From 706d5aacd7ab7b37c00df1a1b210e4ced06119e1 Mon Sep 17 00:00:00 2001 From: Andrew Geissler Date: Fri, 12 Feb 2021 15:55:30 -0600 Subject: Reset poky to before our libpam hacks Things got a bit out of synch with openbmc-config due to the libpam issues and the migration from the meta-* layers. Revert the two previous commits and then put the latest poky in with the libpam revert and get openbmc-config right again. Revert "Revert "libpam: update 1.3.1 -> 1.5.1"" This reverts commit 87ddd3eab4df68e624b5350ccaab28b3b97547c0. Revert "poky: subtree update:796be0593a..10c69538c0" This reverts commit c723b72979bfac6362509cf1fe086900f6641f28. Change-Id: I3a1f405193aee6a21fe0cd24be9927c143a23d9a Signed-off-by: Andrew Geissler --- ...upport-for-defining-missing-funcitonality.patch | 68 ++++++++++++++++++++++ .../libpam/0001-Makefile.am-support-usrmage.patch | 28 --------- .../pam/libpam/include_paths_header.patch | 59 +++++++++++++++++++ poky/meta/recipes-extended/pam/libpam_1.3.1.bb | 4 ++ 4 files changed, 131 insertions(+), 28 deletions(-) create mode 100644 poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch delete mode 100644 poky/meta/recipes-extended/pam/libpam/0001-Makefile.am-support-usrmage.patch create mode 100644 poky/meta/recipes-extended/pam/libpam/include_paths_header.patch (limited to 'poky/meta/recipes-extended/pam') diff --git a/poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch b/poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch new file mode 100644 index 0000000000..c55b648139 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch @@ -0,0 +1,68 @@ +From 45d1ed58927593968faead7dbb295f3922f41a2f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 8 Aug 2015 14:16:43 -0700 +Subject: [PATCH] Add support for defining missing funcitonality + +In order to support alternative libc on linux ( musl, bioninc ) etc we +need to check for glibc-only features and provide alternatives, in this +list strndupa is first one, when configure detects that its not included +in system C library then the altrnative implementation from missing.h is +used + +Signed-off-by: Khem Raj +--- +Upstream-Status: Pending + + configure.ac | 3 +++ + libpam/include/missing.h | 12 ++++++++++++ + modules/pam_exec/pam_exec.c | 1 + + 3 files changed, 16 insertions(+) + create mode 100644 libpam/include/missing.h + +diff --git a/configure.ac b/configure.ac +index 9e1257f..cbed979 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -599,6 +599,9 @@ dnl + AC_CHECK_DECL(__NR_keyctl, [have_key_syscalls=1],[have_key_syscalls=0],[#include ]) + AC_CHECK_DECL(ENOKEY, [have_key_errors=1],[have_key_errors=0],[#include ]) + ++# musl and bionic don't have strndupa ++AC_CHECK_DECLS_ONCE([strndupa]) ++ + HAVE_KEY_MANAGEMENT=0 + if test $have_key_syscalls$have_key_errors = 11 + then +diff --git a/libpam/include/missing.h b/libpam/include/missing.h +new file mode 100644 +index 0000000..3cf011c +--- /dev/null ++++ b/libpam/include/missing.h +@@ -0,0 +1,12 @@ ++#pragma once ++ ++#if !HAVE_DECL_STRNDUPA ++#define strndupa(s, n) \ ++ ({ \ ++ const char *__old = (s); \ ++ size_t __len = strnlen(__old, (n)); \ ++ char *__new = alloca(__len + 1); \ ++ __new[__len] = '\0'; \ ++ memcpy(__new, __old, __len); \ ++ }) ++#endif +diff --git a/modules/pam_exec/pam_exec.c b/modules/pam_exec/pam_exec.c +index 17ba6ca..3aa2694 100644 +--- a/modules/pam_exec/pam_exec.c ++++ b/modules/pam_exec/pam_exec.c +@@ -59,6 +59,7 @@ + #include + #include + #include ++#include + + #define ENV_ITEM(n) { (n), #n } + static struct { +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/pam/libpam/0001-Makefile.am-support-usrmage.patch b/poky/meta/recipes-extended/pam/libpam/0001-Makefile.am-support-usrmage.patch deleted file mode 100644 index 5c6bc92705..0000000000 --- a/poky/meta/recipes-extended/pam/libpam/0001-Makefile.am-support-usrmage.patch +++ /dev/null @@ -1,28 +0,0 @@ -From c09e012590c1ec2d3b622b64f1bfc10a2286c9ea Mon Sep 17 00:00:00 2001 -From: Changqing Li -Date: Wed, 6 Jan 2021 12:08:20 +0800 -Subject: [PATCH] Makefile.am: support usrmage - -Upstream-Status: Inappropriate [oe-specific] - -Signed-off-by: Changqing Li ---- - modules/pam_namespace/Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/modules/pam_namespace/Makefile.am b/modules/pam_namespace/Makefile.am -index ddd5fc0..a1f1bec 100644 ---- a/modules/pam_namespace/Makefile.am -+++ b/modules/pam_namespace/Makefile.am -@@ -18,7 +18,7 @@ TESTS = $(dist_check_SCRIPTS) - securelibdir = $(SECUREDIR) - secureconfdir = $(SCONFIGDIR) - namespaceddir = $(SCONFIGDIR)/namespace.d --servicedir = /lib/systemd/system -+servicedir = $(systemd_system_unitdir) - - AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include \ - -DSECURECONF_DIR=\"$(SCONFIGDIR)/\" $(WARN_CFLAGS) --- -2.17.1 - diff --git a/poky/meta/recipes-extended/pam/libpam/include_paths_header.patch b/poky/meta/recipes-extended/pam/libpam/include_paths_header.patch new file mode 100644 index 0000000000..e4eb95669b --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/include_paths_header.patch @@ -0,0 +1,59 @@ +This patch adds missing include for paths.h which should provide +_PATH_LASTLOG definition + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +Index: Linux-PAM-1.1.6/modules/pam_lastlog/pam_lastlog.c +=================================================================== +--- Linux-PAM-1.1.6.orig/modules/pam_lastlog/pam_lastlog.c ++++ Linux-PAM-1.1.6/modules/pam_lastlog/pam_lastlog.c +@@ -23,9 +23,11 @@ + #include + #include + #include ++#include + #include + #include + #include ++#include + + #if defined(hpux) || defined(sunos) || defined(solaris) + # ifndef _PATH_LASTLOG +@@ -332,6 +334,23 @@ last_login_read(pam_handle_t *pamh, int + return retval; + } + ++#ifndef __GLIBC__ ++static void logwtmp(const char * line, const char * name, const char * host) ++{ ++ struct utmp u; ++ memset(&u, 0, sizeof(u)); ++ ++ u.ut_pid = getpid(); ++ u.ut_type = name[0] ? USER_PROCESS : DEAD_PROCESS; ++ strncpy(u.ut_line, line, sizeof(u.ut_line)); ++ strncpy(u.ut_name, name, sizeof(u.ut_name)); ++ strncpy(u.ut_host, host, sizeof(u.ut_host)); ++ gettimeofday(&(u.ut_tv), NULL); ++ ++ updwtmp(_PATH_WTMP, &u); ++} ++#endif /* __GLIBC__ */ ++ + static int + last_login_write(pam_handle_t *pamh, int announce, int last_fd, + uid_t uid, const char *user) +Index: Linux-PAM-1.1.6/modules/Makefile.am +=================================================================== +--- Linux-PAM-1.1.6.orig/modules/Makefile.am ++++ Linux-PAM-1.1.6/modules/Makefile.am +@@ -7,7 +7,7 @@ SUBDIRS = pam_access pam_cracklib pam_de + pam_group pam_issue pam_keyinit pam_lastlog pam_limits \ + pam_listfile pam_localuser pam_loginuid pam_mail \ + pam_mkhomedir pam_motd pam_namespace pam_nologin \ +- pam_permit pam_pwhistory pam_rhosts pam_rootok pam_securetty \ ++ pam_permit pam_pwhistory pam_rootok pam_securetty \ + pam_selinux pam_sepermit pam_shells pam_stress \ + pam_succeed_if pam_tally pam_tally2 pam_time pam_timestamp \ + pam_tty_audit pam_umask \ diff --git a/poky/meta/recipes-extended/pam/libpam_1.3.1.bb b/poky/meta/recipes-extended/pam/libpam_1.3.1.bb index b58b9ac5fa..bc72afe6ad 100644 --- a/poky/meta/recipes-extended/pam/libpam_1.3.1.bb +++ b/poky/meta/recipes-extended/pam/libpam_1.3.1.bb @@ -29,6 +29,10 @@ SRC_URI = "https://github.com/linux-pam/linux-pam/releases/download/v${PV}/Linux SRC_URI[md5sum] = "558ff53b0fc0563ca97f79e911822165" SRC_URI[sha256sum] = "eff47a4ecd833fbf18de9686632a70ee8d0794b79aecb217ebd0ce11db4cd0db" +SRC_URI_append_libc-musl = " file://0001-Add-support-for-defining-missing-funcitonality.patch \ + file://include_paths_header.patch \ + " + DEPENDS = "bison-native flex flex-native cracklib libxml2-native virtual/crypt" EXTRA_OECONF = "--includedir=${includedir}/security \ -- cgit v1.2.3