From nobody Fri Jan 24 19:41:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfp9B5kYfz5lq2J; Fri, 24 Jan 2025 19:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfp9B1T31z3SYj; Fri, 24 Jan 2025 19:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737747710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mlRgaDLA2r87ta/TFFCqGA6FiubtDXzVhIk26DRTjx4=; b=FdSE0Bs+a3fa66Q1edTeDasH0u5F1+wS3xcU/rfluoZ4JSN07FvsjqP74kcOAB1qDQJyK1 SmHBhrtxk6CJkrfOjgfWWwveyJ+U9p6YXyBLPfCc345oXbVB5S5NStQuXZLlY8U8YJkeW1 CgXGxxW/kE/NauGDOnPpGri43sWBRruy/OjvgfEO/pcS0M4dU6F1Qf61nmb8g0aLaHiFaA yHOWmdH6gk5rHE6DzalGyaybIJv/hJyGy6bwOr6tG0XWbDiO5+5yuN3yXmawq8e/XNe45p DxAVj+g3coPHA2sCtr3QBJ+/MBVg/m0zDjnzUMuBnsA5hdmg7mqDZeBHqOgxvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737747710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mlRgaDLA2r87ta/TFFCqGA6FiubtDXzVhIk26DRTjx4=; b=OyNP9lSXQf0oovaEX2FRXQhrrCHRRQPZBnUewK5VnUQ2PIsCqjBCH9ihrWv/hyjEP8BvH0 fOqqiezARQUguVnReFS7CHREFB5GzjBV/extuhfggETMRGk6vofFLytfNfmVtyFdlnAoNh /wr5LuiaNcofE0vBu/LjvOHesOmaAp2KuFKML/QCAxgCT2lzElnEBLREMWeU9/rdwyPAE7 yUhQqYgnXzdc+CIx7XqcktNEDRCwzvnMGmaFNdBmOyGKXbUdqEmR3VkMhPe3UKA2+/H0Vb NKIIYuE/tgZNsB60PKgLUv2esJJS8ums65b9I1s8jVtSMXnJkT84Hl0tDzJwOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737747710; a=rsa-sha256; cv=none; b=DnFtv7LRpMVkVsx2zGwJRKsMLcZXo/XDSNHv0+Sw8tGO4OsVxkk0TxJW7doTi0mWTsZ7LR p22p6Kt+i2GcBYg/138CNPAOVCESLGMWsvUNwtX0WFR4N/U8jMCLTizykgDyIB2/uOR2Mf 3avBNaYxvqOh1Ro0YAju6qeJspfP/k/FZ68Sud69Eg4boVrVyg3jwoQSqgaNT57PoVKnP5 yn6KQ4gDJ9Rld64HnWDLo1ivD53rkMoEBdEXjww67gBF4mI7IkMBMYXpVNEfR+2uddn0Py PEcvICRTHqdr9IjtNhlJpZukRRQkWNRONPzf1ml9yrag50rExV+Ss3okZuTyng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfp9B11yVzgJB; Fri, 24 Jan 2025 19:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OJfoex083246; Fri, 24 Jan 2025 19:41:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OJfoWN083243; Fri, 24 Jan 2025 19:41:50 GMT (envelope-from git) Date: Fri, 24 Jan 2025 19:41:50 GMT Message-Id: <202501241941.50OJfoWN083243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3c61bbebc416 - main - Update rc.initdiskless, fix error handling of remount_optional List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c61bbebc4166ca209b9becfd1529298bac6ed66 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3c61bbebc4166ca209b9becfd1529298bac6ed66 commit 3c61bbebc4166ca209b9becfd1529298bac6ed66 Author: Keve Müller AuthorDate: 2024-10-27 13:09:24 +0000 Commit: Warner Losh CommitDate: 2025-01-24 19:40:33 +0000 Update rc.initdiskless, fix error handling of remount_optional chkerr() ignores the exit code of a preceding mount command in case a file ```remount_optional``` exists. The check is performed and a subshell is launched to log the informational message and return. The return is executed in the context of the subshell, not the context of the chkerr() function, hence is a NOP. The remount_optional check is hence ineffective. Change the code to if/then/fi, so the return is evaluated in the context of the chkerr function, to make the check effective. Reviewed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1497 --- libexec/rc/rc.initdiskless | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.initdiskless b/libexec/rc/rc.initdiskless index a4c6c613b85a..3b66a3c4928a 100644 --- a/libexec/rc/rc.initdiskless +++ b/libexec/rc/rc.initdiskless @@ -174,7 +174,10 @@ log() { chkerr() { lastitem () ( n=$(($# - 1)) ; shift $n ; echo $1 ) mountpoint="$(lastitem $2)" - [ -r $mountpoint/remount_optional ] && ( echo "$2 failed: ignoring due to remount_optional" ; return ) + if [ -r $mountpoint/remount_optional ]; then + echo "$2 failed: ignoring due to remount_optional" + return + fi case $1 in 0) ;;