summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2019-12-28 21:29:45 +0100
committerMichał Górny <mgorny@gentoo.org>2019-12-28 21:34:33 +0100
commit46fe7b1894a7fbbf7e29e7515eac4e5c78d4eee6 (patch)
tree57098e064b4d07a84d63d3ee59a2ae821f9ea732
parentwww-apps/webmcp: remove unused patch (diff)
downloadgentoo-46fe7b18.tar.gz
gentoo-46fe7b18.tar.bz2
gentoo-46fe7b18.zip
sys-kernel/vanilla-kernel: Verify version passed to has_version
Verify the version read from /usr/src/linux symlink and make sure that it consists of plain [0-9.] before passing it to has_version. If it doesn't conform, it isn't our symlink anyway. Closes: https://bugs.gentoo.org/703822 Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--sys-kernel/vanilla-kernel/vanilla-kernel-5.4.6-r1.ebuild5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.6-r1.ebuild b/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.6-r1.ebuild
index 7e340bb44335..62465876eca3 100644
--- a/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.6-r1.ebuild
+++ b/sys-kernel/vanilla-kernel/vanilla-kernel-5.4.6-r1.ebuild
@@ -174,8 +174,9 @@ pkg_postinst() {
fi
local symlink_target=$(readlink "${EROOT}"/usr/src/linux)
- if [[ ${symlink_target} == linux-[0-9]* ]]; then
- local symlink_ver=${symlink_target#linux-}
+ local symlink_ver=${symlink_target#linux-}
+ if [[ ${symlink_target} == linux-* && -z ${symlink_ver//[0-9.]/} ]]
+ then
local symlink_pkg=${CATEGORY}/${PN}-${symlink_ver}
# if the current target is either being replaced, or still
# installed (probably depclean candidate), update the symlink