From nobody Tue Nov 29 03:41:50 2022 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 4NLp6k5SDLz4jmfB; Tue, 29 Nov 2022 03: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NLp6k4pk0z4JgM; Tue, 29 Nov 2022 03: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=1669693310; 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=xyZjXFRPd1PognhBsB6/s13vPfwF1p1g2E70Lq8pF8Y=; b=b1toEr2x2ZWYJbxezvZbktfxGWojDjhJiBKMgpaGvi8CC5751qHqqDor8DqgKsNOpRgMJE Ce6h8kZCOBT2NBesoShiyPviVSVrDuFLMwYS2dSVk/dff372bUwB0/I36rieZhuWZcyatP 2Wsani1lQPoXzvIxrc6OMgWVyc01ZP5pErQMJ5W1VYUDQ/EgqjlCFQcinSQ6X18seNR1x7 Arnr8OjpjrwxIaqtxXT90v9T2dVii2JDGDlkRhnnvJ/5YoRD473u8Fr1e8dnWoYxgU4nmN npotSPstCHCceSRe1dvCq2V4KYYXDEMY31Q/kH0jZgUTnOngmXaGLHqFOujdRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669693310; 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=xyZjXFRPd1PognhBsB6/s13vPfwF1p1g2E70Lq8pF8Y=; b=Y4surQgQNeFS3HvARbBK7FKmlpQupzAtCX7XbFpaS8UTORAK+Vk2urGscvT7vtJu+Vq4FA UF/C9U/ECaq1U/PwrINZggL/RvKm2AEkAWGxNCCPnrfWi7+DMYdSYZGYlBCRrbOvRvI9D7 /kUEEiqOK+hVdHSX2uZ+6tOotmbxgutJvoFo3YYq7nXKNjbaHuaP+pUPYHRbVkMJh1YoE2 bG7xR8b5eL49vtkgpRzddmfWtzi2T0ITBjVl/ClzQUqSFytGLrjOhDX8dNjMucooSyV+uE 8hW3BWvoH3THuLdPOkKx09iRH+QKngdTe6n5XqEFgNeRufnRtMZhUVY/jXGy9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669693310; a=rsa-sha256; cv=none; b=UKIohw4B6T5zblN3dyGW0ugy0MhNRlnvsptkR4Uf+qKGDtjldRdqFjZ7eV2h5rOOHIYxgg zrKEKQYJ+9dTeU00ef1kTYV6Fc6WGg7mDS3LNPEvZBNljf+vQAUpwiHjhneTHu9hiVtmsa lHyY8NlkhYywyYc3tEcrlDWCQda1CtCsSiBY3zonFlftJANvHoyfTGvcFqOuFXNCFD31Ry ZqheenNsKoaYyY0cixhMHFxK/Y/osI2hwFyBUueLN7Ot0j4GHSzB0N/EjW2yYSH7SpXFJf Ec2Oor/JEJvoSrWjtwPnioDYVfJ9oO9zaKTrTUOkxBttV2bSskaJaZVLNePMxA== 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 4NLp6k3w5vz130Z; Tue, 29 Nov 2022 03:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AT3fo48059185; Tue, 29 Nov 2022 03:41:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AT3foa2059184; Tue, 29 Nov 2022 03:41:50 GMT (envelope-from git) Date: Tue, 29 Nov 2022 03:41:50 GMT Message-Id: <202211290341.2AT3foa2059184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 91985bc5adac - main - bsdinstall: Fix issues parsing rc.conf.services on revisit 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91985bc5adace75a938d51a97099c2a44cf5c661 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=91985bc5adace75a938d51a97099c2a44cf5c661 commit 91985bc5adace75a938d51a97099c2a44cf5c661 Author: Jessica Clarke AuthorDate: 2022-11-29 02:56:25 +0000 Commit: Jessica Clarke CommitDate: 2022-11-29 03:33:47 +0000 bsdinstall: Fix issues parsing rc.conf.services on revisit There are a few issues here, some of which are hiding others. The first is that we don't use double quotes around the command substitution so every word in the conf file is treated as a separate argument to eval, resulting in spaces being used in place of newlines and thus comments in the file commenting out the rest of the file, not just to the end of their line. In particular, we insert one comment just before the dumpdev entry (the final one in the file) and so we never see dumpdev as set, and thus set a default value of on for the menu. The second issue is that, for dumpdev, it takes a value of AUTO not YES when set, but we don't replace this with on when eval'ing, so then end up giving AUTO to bsddialog which is interpreted the same as off (which seems to match GPL dialog). Thus handle AUTO like YES otherwise it will always appear as unchecked on revisit. The final issue is that our case-insensitive YES/NO (and now AUTO) replacements have no word boundaries around them so match the middle of words too. As it happens this doesn't matter in practice at the moment, but it could in future; currently the only effect is that it rewrites moused_nondefault_enable to moused_offndefault_enable, but since this variable is never read, only written based on moused(_enable) this is harmless, but we should fix it in case a service comes along in future that does get affected by it. --- usr.sbin/bsdinstall/scripts/services | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/services b/usr.sbin/bsdinstall/scripts/services index 44d7c5f138e6..294e044c74ae 100755 --- a/usr.sbin/bsdinstall/scripts/services +++ b/usr.sbin/bsdinstall/scripts/services @@ -32,8 +32,8 @@ BSDCFG_SHARE="/usr/share/bsdconfig" : ${BSDDIALOG_OK=0} if [ -f $BSDINSTALL_TMPETC/rc.conf.services ]; then - eval $( sed -e s/YES/on/i -e s/NO/off/i \ - $BSDINSTALL_TMPETC/rc.conf.services ) + eval "$( sed -E -e 's/\<(YES|AUTO)\>/on/i' -e 's/\/off/i' \ + $BSDINSTALL_TMPETC/rc.conf.services )" else # Default service states. Everything is off if not enabled. sshd_enable="on"