From 0f65f7fdb1e2fcd928de03665c5b29c8fde21b02 Mon Sep 17 00:00:00 2001 From: kn Date: Mon, 10 Oct 2022 11:04:17 +0000 Subject: [PATCH] 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 --- distrib/miniroot/install.sub | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 } -- 2.20.1