From: kn Date: Mon, 10 Oct 2022 11:04:17 +0000 (+0000) Subject: Discard stdout/err only where needed in check_unattendedupgrade() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0f65f7fdb1e2fcd928de03665c5b29c8fde21b02;p=openbsd Discard stdout/err only where needed in check_unattendedupgrade() We should be fine silencing only the test condition which produces legit output and warnings. All else produces no output and should not error out; if it does, those warnings should be printed and fixed. Feedback OK halex --- diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index e7ae9f4f955..26d00cdb082 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1210 2022/10/05 19:30:47 kn Exp $ +# $OpenBSD: install.sub,v 1.1211 2022/10/10 11:04:17 kn Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -3317,7 +3317,7 @@ check_unattendedupgrade() { _d=${_d%% *} if [[ -n $_d ]]; then make_dev $_d - if mount -t ffs -r /dev/${_d}a /mnt; then + if mount -t ffs -r /dev/${_d}a /mnt 2>/dev/null; then [[ -f /mnt/bsd.upgrade && -f /mnt/auto_upgrade.conf ]] _rc=$? ((_rc == 0)) && cp /mnt/auto_upgrade.conf / @@ -3325,7 +3325,7 @@ check_unattendedupgrade() { umount /mnt fi rm -f /dev/{r,}$_d? - fi >/dev/null 2>&1 + fi return $_rc }