diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-07-30 18:12:59 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-07-30 18:12:59 -0700 |
commit | 5f2ba9dfea24a141c27af726d8a5e2781a6485ab (patch) | |
tree | bfcd9185c2af56308e02c4dfe925c52b80e52ca9 | |
parent | 1c8946a09d1a15a5422177ac4bac4fa4180e0554 (diff) | |
parent | dd04275bd3092ae47392f0db91d9befac0cf3bc9 (diff) | |
download | vyatta-cfg-quagga-5f2ba9dfea24a141c27af726d8a5e2781a6485ab.tar.gz vyatta-cfg-quagga-5f2ba9dfea24a141c27af726d8a5e2781a6485ab.zip |
Merge branch 'mendocino' of git.vyatta.com:/git/vyatta-cfg-system into mendocino
-rw-r--r-- | debian/changelog | 6 | ||||
-rwxr-xr-x | scripts/install/install-image-existing | 13 | ||||
-rwxr-xr-x | scripts/install/install-image-new | 5 |
3 files changed, 20 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index 237f4368..9ebf6ef7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +vyatta-cfg-system (0.17.78) unstable; urgency=low + + * Bugfix 5711: Don't allow special characters in image names. + + -- Bob Gilligan <gilligan@vyatta.com> Wed, 28 Jul 2010 02:47:32 -0700 + vyatta-cfg-system (0.17.77) unstable; urgency=low * new API changes diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing index 27d19f4d..b05de08e 100755 --- a/scripts/install/install-image-existing +++ b/scripts/install/install-image-existing @@ -59,9 +59,18 @@ NEWNAME=$NEWVER echo -n "What would you like to name this image? [$NEWNAME]: " read response if [ -n "$response" ]; then + badchars=`echo $response | sed -e 's/[a-zA-Z0-9\.\_+-]//g'` + if [ -n "$badchars" ]; then + echo "Image name must be composed of a-z, A-Z, 0-9, or one of ._+-" + exit 1 + fi NEWNAME=$response fi +if [ -z "$NEWNAME" ]; then + failure_exit 'Invalid image name.' +fi + # Validate image name if [ "$NEWNAME" = "grub" -o "${NEWNAME:0:7}" = "vmlinuz" -o \ "${NEWNAME:0:6}" = "initrd" -o "${NEWNAME:0:10}" = "System.map" -o \ @@ -70,10 +79,6 @@ if [ "$NEWNAME" = "grub" -o "${NEWNAME:0:7}" = "vmlinuz" -o \ exit 1; fi -if [ -z "$NEWNAME" ]; then - failure_exit 'Invalid image name.' -fi - echo "OK. This image will be named: $NEWNAME" # this is the default if current install is union diff --git a/scripts/install/install-image-new b/scripts/install/install-image-new index 5726fa03..c669da8e 100755 --- a/scripts/install/install-image-new +++ b/scripts/install/install-image-new @@ -33,6 +33,11 @@ fi echo -n "What would you like to name this image? [$image_name]: " read response if [ -n "$response" ]; then + badchars=`echo $response | sed -e 's/[a-zA-Z0-9\.\_+-]//g'` + if [ -n "$badchars" ]; then + echo "Image name must be composed of a-z, A-Z, 0-9, or one of ._+-" + exit 1 + fi image_name=$response fi |