Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/shadow/
Date: Mon, 27 Dec 2021 03:51:57
Message-Id: 1640577085.8ba1318bc1779637a83319f05992a11e83b84069.sam@gentoo
1 commit: 8ba1318bc1779637a83319f05992a11e83b84069
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 27 03:13:52 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 27 03:51:25 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ba1318b
7
8 sys-apps/shadow: check for invalid passwd entries
9
10 - In pkg_postinst, check for invalid ${EROOT}/etc/passwd entries
11 by running 'pwck' in read-only mode.
12
13 In the referenced bug, this manifested as the man cronjob failing.
14
15 - Also fix another check for empty ${EROOT} (broken since EAPI 7 port).
16
17 Closes: https://bugs.gentoo.org/829872
18 Signed-off-by: Sam James <sam <AT> gentoo.org>
19 Closes: https://github.com/gentoo/gentoo/pull/23534
20 Signed-off-by: Sam James <sam <AT> gentoo.org>
21
22 .../shadow/{shadow-4.10-r3.ebuild => shadow-4.10-r4.ebuild} | 12 +++++++++---
23 1 file changed, 9 insertions(+), 3 deletions(-)
24
25 diff --git a/sys-apps/shadow/shadow-4.10-r3.ebuild b/sys-apps/shadow/shadow-4.10-r4.ebuild
26 similarity index 94%
27 rename from sys-apps/shadow/shadow-4.10-r3.ebuild
28 rename to sys-apps/shadow/shadow-4.10-r4.ebuild
29 index 020224692897..3cb7d9ff4aa7 100644
30 --- a/sys-apps/shadow/shadow-4.10-r3.ebuild
31 +++ b/sys-apps/shadow/shadow-4.10-r4.ebuild
32 @@ -234,12 +234,18 @@ pkg_preinst() {
33 }
34
35 pkg_postinst() {
36 + # Missing entries from /etc/passwd can cause odd system blips.
37 + # See bug #829872.
38 + if ! pwck -r -q -R "${EROOT:-/}" &>/dev/null ; then
39 + ewarn "Running 'pwck' returned errors. Please run it manually to fix any errors."
40 + fi
41 +
42 # Enable shadow groups.
43 if [ ! -f "${EROOT}"/etc/gshadow ] ; then
44 - if grpck -r -R "${EROOT}" 2>/dev/null ; then
45 - grpconv -R "${EROOT}"
46 + if grpck -r -R "${EROOT:-/}" 2>/dev/null ; then
47 + grpconv -R "${EROOT:-/}"
48 else
49 - ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
50 + ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
51 ewarn "run 'grpconv' afterwards!"
52 fi
53 fi