Permalink
Browse files

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.
  • Loading branch information...
1 parent 1584694 commit 644f7bd9efceda1d9bb4c0985b02c3a98241844c @mika mika committed Jul 27, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 grml-live
View
@@ -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 {{{

0 comments on commit 644f7bd

Please sign in to comment.