diff options
author | Michał Górny <mgorny@gentoo.org> | 2019-12-28 21:30:57 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2019-12-28 21:34:34 +0100 |
commit | 63aed098518786d1b135a6c8665d84483be2f829 (patch) | |
tree | 039388c6e6559d6263c8f99a491dff66f2c9924a /sys-kernel | |
parent | sys-kernel/vanilla-kernel: Verify version passed to has_version (diff) | |
download | gentoo-63aed098518786d1b135a6c8665d84483be2f829.tar.gz gentoo-63aed098518786d1b135a6c8665d84483be2f829.tar.bz2 gentoo-63aed098518786d1b135a6c8665d84483be2f829.zip |
sys-kernel/vanilla-kernel-bin: 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>
Diffstat (limited to 'sys-kernel')
-rw-r--r-- | sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.6.ebuild | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.6.ebuild b/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.6.ebuild index fa1b7e994f20..4908786bffb8 100644 --- a/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.6.ebuild +++ b/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.6.ebuild @@ -81,8 +81,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 |