Commit: c4e42c23dfb998696fe0d39cae424bfb59ea2396
Parent: e8fb483bbde25c5718a185259ab441c53a01c458
Author: Randy Palamar
Date: Sun, 15 Jan 2023 10:00:17 -0700
don't call eval in munge()
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/spm b/spm
@@ -63,7 +63,7 @@ munge() {
abspath="$(readlink -f "${STORE_DIR}"/"${1}")"
case "${abspath}" in
"${STORE_DIR}"*)
- eval ${2}=\"${abspath#${STORE_DIR}}\"
+ echo "${abspath#${STORE_DIR}/}"
;;
*)
usage 'bad traversal'
@@ -123,7 +123,7 @@ add|del|search|show)
list)
[ "${2:-}" = -g ] && gflag=1 && shift 1
[ ${#} -gt 2 ] && usage 'too many arguments'
- [ -n "${2:-}" ] && munge "${2}" relpath
+ [ -n "${2:-}" ] && relpath=$(munge "${2}")
list "${relpath:-}"
;;
help)