Blob Blame History Raw
From c80103788eebe0445efc2cefb56b074231b76f39 Mon Sep 17 00:00:00 2001
From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Date: Sat, 1 Dec 2018 11:42:40 +0100
Subject: [PATCH] x2goversion: Fix situations where ${compfile} contains a
 non-absolute path (e.g. it contains '../').

---
 x2goserver/bin/x2goversion | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/x2goserver/bin/x2goversion b/x2goserver/bin/x2goversion
index aa960a28..50e45c09 100755
--- a/x2goserver/bin/x2goversion
+++ b/x2goserver/bin/x2goversion
@@ -42,7 +42,7 @@ if [ -n "${1}" ]; then
 else
 	cd "${X2GO_VERSIONS_BASEPATH}"
 	for compfile in "${X2GO_VERSIONS_BASEPATH}"/*; do
-		X2GO_COMPONENT="$(echo "${compfile}" | cut -d '.' -f '2')"
+		X2GO_COMPONENT="$(echo "$(basename ${compfile})" | cut -d '.' -f '2')"
 		X2GO_COMPONENT_VERSION="$(get_version "${compfile}")"
 		echo "${X2GO_COMPONENT}: ${X2GO_COMPONENT_VERSION}"
 	done
-- 
2.11.0