diff options
author | 2016-10-29 18:36:12 +0000 | |
---|---|---|
committer | 2016-10-29 18:36:12 +0000 | |
commit | b29a59b83e40cf057d7e92cdeeec20f058031c20 (patch) | |
tree | 5040351541ff7fa02a5000978c007750d99c51c0 | |
parent | Update the man page after the addition of MODPY_ABI_TAG (diff) | |
download | wireguard-openbsd-b29a59b83e40cf057d7e92cdeeec20f058031c20.tar.xz wireguard-openbsd-b29a59b83e40cf057d7e92cdeeec20f058031c20.zip |
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.sub | 9 |
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 |