common: remove unreachable statement

We run from a non-interactive shell, so the exec which is inevitably
called will replace the current process and 'die' will never run under
any circumstances.

This also fixes a bug with the su fallback which would cause multiple
arguments to be concatenated without any whitespace between them.
This commit is contained in:
Dave Reisner 2014-05-10 09:31:26 -04:00
parent be00fcd47b
commit 98841eb694
1 changed files with 1 additions and 2 deletions

View File

@ -238,7 +238,6 @@ check_root() {
if type -P sudo >/dev/null; then
exec sudo -- "$@"
else
exec su root -c "$(printf '%q' "$@")"
exec su root -c "$(printf ' %q' "$@")"
fi
die 'This script must be run as root.'
}