From 1fa4df90c418803188ce7863223f62d8b4e8131b Mon Sep 17 00:00:00 2001 From: Jami Kettunen Date: Wed, 1 May 2024 12:28:32 +0300 Subject: [PATCH] export: consider only absolute candidate icon paths that exist (#1318) Previously (for nearly two years?) attempting e.g. "distrobox-export -a htop" with a file/dir named "htop" in $PWD it would mistakenly get detected as the icon for the program, copied over to ~/.local/share/icons/ and attempted to be used by the .desktop file. --- distrobox-export | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/distrobox-export b/distrobox-export index 54e7c914df..8962801640 100755 --- a/distrobox-export +++ b/distrobox-export @@ -477,7 +477,8 @@ export_application() { icon_name="$(grep Icon= "${desktop_file}" | cut -d'=' -f2- | paste -sd "@" -)" for icon in ${icon_name}; do - if [ -e "${icon_name}" ]; then + if case "${icon_name}" in "/"*) true ;; *) false ;; esac && + [ -e "${icon_name}" ]; then # In case it's an hard path, conserve it and continue icon_files="${icon_files}@${icon_name}" else