aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2022-01-07 15:10:20 +0100
committerUlrich Müller <ulm@gentoo.org>2022-01-07 15:10:20 +0100
commitde93ee70c59ad7207210f12b8238d87072054671 (patch)
treeb7e7fa294b6eb7a64999dffb2443614f065da5df
parentUpdate version to 1.4.18 (diff)
downloadeselect-de93ee70c59ad7207210f12b8238d87072054671.tar.gz
eselect-de93ee70c59ad7207210f12b8238d87072054671.tar.bz2
eselect-de93ee70c59ad7207210f12b8238d87072054671.zip
Fix canonicalise call in profile module
* modules/profile.eselect (set_symlink): Don't call canonicalise with an empty argument, bug 830707. Bug: https://bugs.gentoo.org/830707 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog5
-rw-r--r--modules/profile.eselect5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 668b7e8..2a8be3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-01-07 Ulrich Müller <ulm@gentoo.org>
+
+ * modules/profile.eselect (set_symlink): Don't call canonicalise
+ with an empty argument, bug 830707.
+
2021-12-28 Ulrich Müller <ulm@gentoo.org>
* configure.ac: Update version to 1.4.18.
diff --git a/modules/profile.eselect b/modules/profile.eselect
index 3b87441..f33f8d1 100644
--- a/modules/profile.eselect
+++ b/modules/profile.eselect
@@ -1,5 +1,5 @@
# -*-eselect-*- vim: ft=eselect
-# Copyright 2005-2020 Gentoo Authors
+# Copyright 2005-2022 Gentoo Authors
# Distributed under the terms of the GNU GPL version 2 or later
# This is a portage-only module.
@@ -137,7 +137,8 @@ set_symlink() {
"${MAKE_PROFILE}" \
|| die -q "Couldn't set new ${MAKE_PROFILE} symlink"
# check if the resulting symlink is sane
- [[ $(canonicalise "${MAKE_PROFILE}") != "$(canonicalise "${EROOT}")"/* ]] \
+ local eroot=$(canonicalise "${EROOT:-/}")
+ [[ $(canonicalise "${MAKE_PROFILE}") != "${eroot%/}"/* ]] \
&& [[ -z ${force} ]] \
&& write_warning_msg "Strange path. Check ${MAKE_PROFILE} symlink"