diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2020-08-24 14:33:26 +0200 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2020-08-24 14:36:40 +0200 |
commit | 67bb8e2907a1c503e5bc841c70e253c217812347 (patch) | |
tree | b2b344ccab4fa5572caa2db9d4ad36497e204ca8 /sys-kernel/genkernel | |
parent | dev-python/pycurl: Force building using distutils (diff) | |
download | gentoo-67bb8e2907a1c503e5bc841c70e253c217812347.tar.gz gentoo-67bb8e2907a1c503e5bc841c70e253c217812347.tar.bz2 gentoo-67bb8e2907a1c503e5bc841c70e253c217812347.zip |
sys-kernel/genkernel: try to detect and warn for problematic /run permissions
Closes: https://bugs.gentoo.org/737270
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'sys-kernel/genkernel')
-rw-r--r-- | sys-kernel/genkernel/genkernel-4.1.0-r2.ebuild | 18 | ||||
-rw-r--r-- | sys-kernel/genkernel/genkernel-9999.ebuild | 18 |
2 files changed, 34 insertions, 2 deletions
diff --git a/sys-kernel/genkernel/genkernel-4.1.0-r2.ebuild b/sys-kernel/genkernel/genkernel-4.1.0-r2.ebuild index 56ac783bac63..c5db490b8eb2 100644 --- a/sys-kernel/genkernel/genkernel-4.1.0-r2.ebuild +++ b/sys-kernel/genkernel/genkernel-4.1.0-r2.ebuild @@ -277,10 +277,26 @@ pkg_postinst() { fi local n_root_args=$(grep -o -- '\<root=' /proc/cmdline 2>/dev/null | wc -l) - if [[ ${n_root_args} > 1 ]]; then + if [[ ${n_root_args} > 1 ]] ; then ewarn "WARNING: Multiple root arguments (root=) on kernel command-line detected!" ewarn "If you are appending non-persistent device names to kernel command-line," ewarn "next reboot could fail in case running system and initramfs do not agree" ewarn "on detected root device name!" fi + + if [[ -d /run ]] ; then + local permission_run_expected="drwxr-xr-x" + local permission_run=$(stat -c "%A" /run) + if [[ "${permission_run}" != "${permission_run_expected}" ]] ; then + ewarn "Found the following problematic permissions:" + ewarn "" + ewarn " ${permission_run} /run" + ewarn "" + ewarn "Expected:" + ewarn "" + ewarn " ${permission_run_expected} /run" + ewarn "" + ewarn "This is known to be causing problems for any UDEV-enabled service." + fi + fi } diff --git a/sys-kernel/genkernel/genkernel-9999.ebuild b/sys-kernel/genkernel/genkernel-9999.ebuild index e9d3133ce6fe..deecdc19176f 100644 --- a/sys-kernel/genkernel/genkernel-9999.ebuild +++ b/sys-kernel/genkernel/genkernel-9999.ebuild @@ -275,10 +275,26 @@ pkg_postinst() { fi local n_root_args=$(grep -o -- '\<root=' /proc/cmdline 2>/dev/null | wc -l) - if [[ ${n_root_args} > 1 ]]; then + if [[ ${n_root_args} > 1 ]] ; then ewarn "WARNING: Multiple root arguments (root=) on kernel command-line detected!" ewarn "If you are appending non-persistent device names to kernel command-line," ewarn "next reboot could fail in case running system and initramfs do not agree" ewarn "on detected root device name!" fi + + if [[ -d /run ]] ; then + local permission_run_expected="drwxr-xr-x" + local permission_run=$(stat -c "%A" /run) + if [[ "${permission_run}" != "${permission_run_expected}" ]] ; then + ewarn "Found the following problematic permissions:" + ewarn "" + ewarn " ${permission_run} /run" + ewarn "" + ewarn "Expected:" + ewarn "" + ewarn " ${permission_run_expected} /run" + ewarn "" + ewarn "This is known to be causing problems for any UDEV-enabled service." + fi + fi } |