summaryrefslogtreecommitdiffstats
path: root/arch-chroot.in
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2018-08-28 19:52:15 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2018-08-28 19:52:15 -0400
commit781cf3aa0d3f9a93d84481833f5c83aa9ee68ac0 (patch)
tree52cb6aa536b1f89b370210678e6e1486ec4e08d0 /arch-chroot.in
parentd929c8cbc09732337fb4805accbf3564e9cca0bb (diff)
New upstream version 19upstream/19
Diffstat (limited to 'arch-chroot.in')
-rw-r--r--arch-chroot.in5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch-chroot.in b/arch-chroot.in
index a954953..bfb83a3 100644
--- a/arch-chroot.in
+++ b/arch-chroot.in
@@ -19,6 +19,8 @@ EOF
chroot_add_resolv_conf() {
local chrootdir=$1 resolv_conf=$1/etc/resolv.conf
+ [[ -e /etc/resolv.conf ]] || return 0
+
# Handle resolv.conf as a symlink to somewhere else.
if [[ -L $chrootdir/etc/resolv.conf ]]; then
# readlink(1) should always give us *something* since we know at this point
@@ -73,6 +75,5 @@ chroot_add_resolv_conf "$chrootdir" || die "failed to setup resolv.conf"
chroot_args=()
[[ $userspec ]] && chroot_args+=(--userspec "$userspec")
-chroot_args+=("$chrootdir" "$@")
-SHELL=/bin/bash unshare --fork --pid chroot "${chroot_args[@]}"
+SHELL=/bin/bash unshare --fork --pid chroot "${chroot_args[@]}" -- "$chrootdir" "$@"