From ca81f8e7f15bb92a81988d33ce788dc7c3c4a31b Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Fri, 20 Mar 2015 19:06:18 +0100 Subject: [PATCH] xbps-src/shutils/common.sh: check $version, - and _ are now forbidden. --- common/xbps-src/shutils/common.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index 4982c1f4ce8..ed01ac2c551 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -289,6 +289,16 @@ setup_pkg() { fi done + # Check if version is valid. + case "$version" in + *-*) msg_error "version contains invalid character: -\n";; + *_*) msg_error "version contains invalid character: _\n";; + esac + case "$version" in + *[0-9]*) : good ;; + *) msg_error "version must contain at least one digit.\n";; + esac + # Check if base-chroot is already installed. if [ -z "$bootstrap" ]; then check_installed_pkg base-chroot-0.1_1