commit:     de93ee70c59ad7207210f12b8238d87072054671
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  7 14:10:20 2022 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Jan  7 14:10:20 2022 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=de93ee70

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 <AT> gentoo.org>

 ChangeLog               | 5 +++++
 modules/profile.eselect | 5 +++--
 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  <u...@gentoo.org>
+
+       * modules/profile.eselect (set_symlink): Don't call canonicalise
+       with an empty argument, bug 830707.
+
 2021-12-28  Ulrich Müller  <u...@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"
 

Reply via email to