diff options
author | Sam James <sam@gentoo.org> | 2021-12-27 03:13:52 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2021-12-27 03:51:25 +0000 |
commit | 8ba1318bc1779637a83319f05992a11e83b84069 (patch) | |
tree | c53ee6d67911f602886b41b221d7fbdb5baa84a4 /sys-apps | |
parent | sys-kernel/vanilla-kernel: replace wildcard with ${MY_P} in ppc section (diff) | |
download | gentoo-8ba1318bc1779637a83319f05992a11e83b84069.tar.gz gentoo-8ba1318bc1779637a83319f05992a11e83b84069.tar.bz2 gentoo-8ba1318bc1779637a83319f05992a11e83b84069.zip |
sys-apps/shadow: check for invalid passwd entries
- In pkg_postinst, check for invalid ${EROOT}/etc/passwd entries
by running 'pwck' in read-only mode.
In the referenced bug, this manifested as the man cronjob failing.
- Also fix another check for empty ${EROOT} (broken since EAPI 7 port).
Closes: https://bugs.gentoo.org/829872
Signed-off-by: Sam James <sam@gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/23534
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-apps')
-rw-r--r-- | sys-apps/shadow/shadow-4.10-r4.ebuild (renamed from sys-apps/shadow/shadow-4.10-r3.ebuild) | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys-apps/shadow/shadow-4.10-r3.ebuild b/sys-apps/shadow/shadow-4.10-r4.ebuild index 020224692897..3cb7d9ff4aa7 100644 --- a/sys-apps/shadow/shadow-4.10-r3.ebuild +++ b/sys-apps/shadow/shadow-4.10-r4.ebuild @@ -234,12 +234,18 @@ pkg_preinst() { } pkg_postinst() { + # Missing entries from /etc/passwd can cause odd system blips. + # See bug #829872. + if ! pwck -r -q -R "${EROOT:-/}" &>/dev/null ; then + ewarn "Running 'pwck' returned errors. Please run it manually to fix any errors." + fi + # Enable shadow groups. if [ ! -f "${EROOT}"/etc/gshadow ] ; then - if grpck -r -R "${EROOT}" 2>/dev/null ; then - grpconv -R "${EROOT}" + if grpck -r -R "${EROOT:-/}" 2>/dev/null ; then + grpconv -R "${EROOT:-/}" else - ewarn "Running 'grpck' returned errors. Please run it by hand, and then" + ewarn "Running 'grpck' returned errors. Please run it by hand, and then" ewarn "run 'grpconv' afterwards!" fi fi |