summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Peichaer <rpe@cvs.openbsd.org>2016-10-29 18:36:13 +0000
committerRobert Peichaer <rpe@cvs.openbsd.org>2016-10-29 18:36:13 +0000
commit81fb79d4d2f5306771c395b836ac1994713707b1 (patch)
treee5c57a82aa075ae351b4ebfd8ed4ae58b90fd469
parent13b789a0407beb4585eb93e3aca06fa6272f471e (diff)
Fix an issue found by naddy@ where the installer was not able
to fetch local sets without a SHA256.sig file in a directory unreachable by the unprivileged users. The missing SHA256.sig file caused an early exit from the for-loop where the _unpriv variable is unset in case of local sets. - Move the check of the set location (local/net) to the top - Set the ftp command title based on the _srclocal variable - Remove the now unnecessary second _unpriv= OK naddy@
-rw-r--r--distrib/miniroot/install.sub9
1 files changed, 6 insertions, 3 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index e39510c1146..43f3383c14a 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sub,v 1.927 2016/10/28 17:07:34 rpe Exp $
+# $OpenBSD: install.sub,v 1.928 2016/10/29 18:36:12 rpe Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
@@ -1332,6 +1332,9 @@ install_files() {
_tmpfs _tmpsrc _cfile=/tmp/SHA256 _fsrc _unver _t _issue
local _srclocal=false _unpriv=unpriv
+ # Fetch sets from local sources (disk, cdrom, nfs) as root.
+ [[ $_src == file://* ]] && _srclocal=true _unpriv=
+
# Initialize _sets to the list of sets found in _src, and initialize
# _get_sets to the intersection of _sets and DEFAULTSETS.
#
@@ -1408,7 +1411,7 @@ install_files() {
rm -f $_cfile $_cfile.sig
_t=Get/Verify
- [[ $_src == file://* ]] && _srclocal=true _t='Verifying ' _unpriv=
+ $_srclocal && _t='Verifying '
# Fetch signature file.
! $_unpriv ftp -D "$_t" -Vmo - "$_src/SHA256.sig" >"$_cfile.sig" &&
@@ -1464,7 +1467,7 @@ install_files() {
for _f in $_get_sets; do
_fsrc="$_src/$_f"
- [[ -f $_tmpsrc/$_f ]] && _fsrc="file://$_tmpsrc/$_f" _unpriv=
+ [[ -f $_tmpsrc/$_f ]] && _fsrc="file://$_tmpsrc/$_f"
case $_fsrc in
*.tgz) $_unpriv ftp -D Installing -Vmo - "$_fsrc" | tar -zxphf - -C /mnt
if [[ $_f == ?(x)base*.tgz && $MODE == install ]]; then