From 7bae9ca0d00db0998ada14a19a513095e14cc692 Mon Sep 17 00:00:00 2001 From: Pete Peterson Date: Fri, 9 Jan 2026 15:50:08 -0500 Subject: [PATCH] Check that the path to an environment is absolute This makes it so it doesn't accidentally match a relative path in the pwd. --- rpm/nsd-app-wrap.spec | 2 +- src/nsd-app-wrap.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rpm/nsd-app-wrap.spec b/rpm/nsd-app-wrap.spec index 0fdc299..9ff6454 100644 --- a/rpm/nsd-app-wrap.spec +++ b/rpm/nsd-app-wrap.spec @@ -1,5 +1,5 @@ Name: nsd-app-wrap -Version: 2.18 +Version: 2.19 Release: 1%{?dist} Summary: Wrapper scripts to launch python applications installed via anaconda Vendor: Peter F. Peterson diff --git a/src/nsd-app-wrap.sh b/src/nsd-app-wrap.sh index f21218b..0fb6464 100755 --- a/src/nsd-app-wrap.sh +++ b/src/nsd-app-wrap.sh @@ -19,9 +19,11 @@ _get_pixi_manifest_path() { # pixi environment PIXI_ENV="${1}" - if [ -d "${PIXI_ENV}" ]; then + if [[ (-d "${PIXI_ENV}") && ("${PIXI_ENV}" = "$(realpath "${PIXI_ENV}")"*) ]]; then + # it is a directory and is an absolute path echo "${PIXI_ENV}" else + # return the simple case input echo "${PIXI_PREFIX%/}/${PIXI_ENV}" fi } -- GitLab