Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/lib/archroot.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/archroot.sh')
-rw-r--r--src/lib/archroot.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/archroot.sh b/src/lib/archroot.sh
index d7917da..3f48dc1 100644
--- a/src/lib/archroot.sh
+++ b/src/lib/archroot.sh
@@ -9,13 +9,14 @@ CHROOT_VERSION='v4'
##
# usage : check_root $keepenv
##
-orig_argv=("${BASH_SOURCE[0]}" "$@")
check_root() {
local keepenv=$1
+ shift
+ local orig_argv=("$@")
(( EUID == 0 )) && return
if type -P sudo >/dev/null; then
- exec sudo --preserve-env=$keepenv -- "${orig_argv[@]}"
+ exec sudo --preserve-env="${keepenv}" -- "${orig_argv[@]}"
else
exec su root -c "$(printf ' %q' "${orig_argv[@]}")"
fi