From 644f7bd9efceda1d9bb4c0985b02c3a98241844c Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 27 Jul 2012 14:43:40 +0200 Subject: [PATCH] Do not accept any command line arguments we can't handle When executing something like: | grml-live [...] -V B -q this doesn't skip the mksquashfs stage (and neither the chroot build stage of course) because the "B" can't be processed for obvious reasons. The user mistyped the "-B" here, but then we shouldn't even try to execute the command line, so just exit in such a case. --- grml-live | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/grml-live b/grml-live index 3964cbd..0aed77e 100755 --- a/grml-live +++ b/grml-live @@ -337,6 +337,11 @@ while getopts "a:C:c:d:D:e:g:i:I:o:r:s:t:U:v:AbBFhnNqQuVz" opt; do esac done shift $(($OPTIND - 1)) # set ARGV to the first not parsed commandline parameter + +if [ -n "$1" ] ; then + echo "Error: unknown argument '$1' in options. Exiting to avoid possible data loss." >&2 + bailout 1 +fi # }}} # read local (non-packaged) configuration {{{ -- 2.1.4