summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/pam
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2021-12-08 16:59:44 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-12 11:27:23 +0000
commite6cc1b4245c7f34a0411a9ee2855fb6fae20d01c (patch)
treed1e17a25de804e43de5b7eaa57a53ad4380735e0 /meta/recipes-extended/pam
parentd4f4ed77b15496d882e2142f1e7132dd82cea038 (diff)
downloadpoky-e6cc1b4245c7f34a0411a9ee2855fb6fae20d01c.tar.gz
libpam: Backport ptest fix checking whether files exist
Backport a patch to check whether files exist. Before the patch: # ./run-xtests.sh . tst-pam_access1 mv: cannot stat '/etc/security/opasswd': No such file or directory PASS: tst-pam_access1 mv: cannot stat '/etc/security/opasswd-pam-xtests': No such file or directory ================== 1 tests passed 0 tests not run ================== After the patch: # ./run-xtests.sh . tst-pam_access1 PASS: tst-pam_access1 ================== 1 tests passed 0 tests not run ================== (From OE-Core rev: 4903fdbace057df2e39c10aaef3440f89748eed2) Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/pam')
-rw-r--r--meta/recipes-extended/pam/libpam/0001-run-xtests.sh-check-whether-files-exist.patch65
-rw-r--r--meta/recipes-extended/pam/libpam_1.5.2.bb1
2 files changed, 66 insertions, 0 deletions
diff --git a/meta/recipes-extended/pam/libpam/0001-run-xtests.sh-check-whether-files-exist.patch b/meta/recipes-extended/pam/libpam/0001-run-xtests.sh-check-whether-files-exist.patch
new file mode 100644
index 0000000000..40040a873a
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/0001-run-xtests.sh-check-whether-files-exist.patch
@@ -0,0 +1,65 @@
1From e8e8ccfd57e0274b431bc5717bf37c488285b07b Mon Sep 17 00:00:00 2001
2From: Mingli Yu <mingli.yu@windriver.com>
3Date: Wed, 27 Oct 2021 10:30:46 +0800
4Subject: [PATCH] run-xtests.sh: check whether files exist
5
6Fixes:
7 # ./run-xtests.sh . tst-pam_access1
8 mv: cannot stat '/etc/security/opasswd': No such file or directory
9 PASS: tst-pam_access1
10 mv: cannot stat '/etc/security/opasswd-pam-xtests': No such file or directory
11 ==================
12 1 tests passed
13 0 tests not run
14 ==================
15
16Upstream-Status: Backport [https://github.com/linux-pam/linux-pam/commit/e8e8ccfd57e0274b431bc5717bf37c488285b07b]
17
18Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
19---
20 xtests/run-xtests.sh | 20 +++++++++++++-------
21 1 file changed, 13 insertions(+), 7 deletions(-)
22
23diff --git a/xtests/run-xtests.sh b/xtests/run-xtests.sh
24index 14f585d9..ff9a4dc1 100755
25--- a/xtests/run-xtests.sh
26+++ b/xtests/run-xtests.sh
27@@ -18,10 +18,12 @@ all=0
28
29 mkdir -p /etc/security
30 for config in access.conf group.conf time.conf limits.conf ; do
31- cp /etc/security/$config /etc/security/$config-pam-xtests
32+ [ -f "/etc/security/$config" ] &&
33+ mv /etc/security/$config /etc/security/$config-pam-xtests
34 install -m 644 "${SRCDIR}"/$config /etc/security/$config
35 done
36-mv /etc/security/opasswd /etc/security/opasswd-pam-xtests
37+[ -f /etc/security/opasswd ] &&
38+ mv /etc/security/opasswd /etc/security/opasswd-pam-xtests
39
40 for testname in $XTESTS ; do
41 for cfg in "${SRCDIR}"/$testname*.pamd ; do
42@@ -47,11 +49,15 @@ for testname in $XTESTS ; do
43 all=`expr $all + 1`
44 rm -f /etc/pam.d/$testname*
45 done
46-mv /etc/security/access.conf-pam-xtests /etc/security/access.conf
47-mv /etc/security/group.conf-pam-xtests /etc/security/group.conf
48-mv /etc/security/time.conf-pam-xtests /etc/security/time.conf
49-mv /etc/security/limits.conf-pam-xtests /etc/security/limits.conf
50-mv /etc/security/opasswd-pam-xtests /etc/security/opasswd
51+
52+for config in access.conf group.conf time.conf limits.conf opasswd ; do
53+ if [ -f "/etc/security/$config-pam-xtests" ]; then
54+ mv /etc/security/$config-pam-xtests /etc/security/$config
55+ else
56+ rm -f /etc/security/$config
57+ fi
58+done
59+
60 if test "$failed" -ne 0; then
61 echo "==================="
62 echo "$failed of $all tests failed"
63--
642.32.0
65
diff --git a/meta/recipes-extended/pam/libpam_1.5.2.bb b/meta/recipes-extended/pam/libpam_1.5.2.bb
index ee3a84a3b6..28ede8ff90 100644
--- a/meta/recipes-extended/pam/libpam_1.5.2.bb
+++ b/meta/recipes-extended/pam/libpam_1.5.2.bb
@@ -21,6 +21,7 @@ SRC_URI = "https://github.com/linux-pam/linux-pam/releases/download/v${PV}/Linux
21 file://pam.d/common-session-noninteractive \ 21 file://pam.d/common-session-noninteractive \
22 file://pam.d/other \ 22 file://pam.d/other \
23 file://libpam-xtests.patch \ 23 file://libpam-xtests.patch \
24 file://0001-run-xtests.sh-check-whether-files-exist.patch \
24 file://run-ptest \ 25 file://run-ptest \
25 file://pam-volatiles.conf \ 26 file://pam-volatiles.conf \
26 " 27 "