From nobody Sun Mar 16 14:50:47 2025 X-Original-To: dev-commits-src-main@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 4ZG1Hq5PDzz5qbY4; Sun, 16 Mar 2025 14:50:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZG1Hq4Bgqz3Pwv; Sun, 16 Mar 2025 14:50:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1742136647; 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=McFqI/ec+GVdyiv4crhJ2lUkKA0mHG2uHNAwBQQKnKc=; b=MMmf0Z+Yb/Zr03bJY2KWe/bU2XQSTbEK/C3X4zRLIyAVQMdzuMC3/lxm66fvHmK1GM4vV3 l2wJ7YvOC9cSjnN8KoXXeeAd7TFyxeNQr5Ya0SQipEV8PqtejzfgD8EohdwSqSME7pv6XE 40xHHulQhOwMEwy2fmY3f6l/II7T8etSv/PniPN/sEmrp96dGiD8Z0Q/Bxd8+X30+c0zVM gfc958rBay3WWA/I4lC2DpCbP7ByrtIt9gjkTmRVYV1ZDZy0mDwZYfymnPqqRG9bL1h24D HcEPdl6CTxOzNeg2Cxw1URDnNdXmnuVBeVMggHmdSe2YH1ldUDiPUG4n63y6xg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1742136647; a=rsa-sha256; cv=none; b=Nx3mwTGM/z5K76iQxU752YthBfNr1k5ED6mkRmrvuklut2d9/PjBa5g6YfmNWIf/zJZCnT GsZUkbVynbMp8S6ygaV4WDVAS6p38BS2OUR548NPD6xZeZAfA49xLksg4UiAQ63W9xeOXL wsGCvODh5g0QPNNxLGb9HE5R2XZ1+KRjdz4S8J2PBJh2tww9vsyZ2Hz9gVXf+ccuG2D399 wLqrpi8IKMibmSV8ri+M1neleiz3AUoYTw90wOH6GZgm1wyFkrMEi9CqEzZRlXjA4pRpSW IeimeEVji673rZw+GE0TNM6+6OZCeC3EwuCNWIGCC0EW5l56DMSrOy4k2pxZvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1742136647; 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=McFqI/ec+GVdyiv4crhJ2lUkKA0mHG2uHNAwBQQKnKc=; b=gZ2dWAl7ZvvPDA83uYEgBdeHV+diaT74x9ZBZRR9C5KgVk5hMdbHEa/e2ZyhgFW1y9IABh MlGXMAVS/H3ZtM6jrPWQ/0Xl3uRzqmrK+cERtsJ+Ziv1nV7FUlMLwELF3y+EzebuNIfJmt zJTAdLO0TxflfqFqE7VrqPYIw+ug/dUKfcRhnXHnjz1bW2w47WK5dLgFUzIRfNVKA4VLL1 4uqoy8LG37oNALawZAqKRxw2vBVzZlq9H/s5TjTlfmj6dXrk1APa/XVLQ2kTyJ42F5dMTc XBG1JEcF9X3JN45AveM4CEuZckOD68tkwHp73cuc5sHvi4IBtEaNe5NYRM8BvA== 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 4ZG1Hq3mmjz14v7; Sun, 16 Mar 2025 14:50:47 +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 52GEolK9004108; Sun, 16 Mar 2025 14:50:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52GEolES004105; Sun, 16 Mar 2025 14:50:47 GMT (envelope-from git) Date: Sun, 16 Mar 2025 14:50:47 GMT Message-Id: <202503161450.52GEolES004105@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: b39f500e6ac8 - main - stand: lines with comments a '"' in loader.conf are ignored List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: b39f500e6ac8404aa0acdc025bd12829e881fcd1 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b39f500e6ac8404aa0acdc025bd12829e881fcd1 commit b39f500e6ac8404aa0acdc025bd12829e881fcd1 Author: Cyrus Rahman AuthorDate: 2025-03-16 14:44:57 +0000 Commit: Warner Losh CommitDate: 2025-03-16 14:46:57 +0000 stand: lines with comments a '"' in loader.conf are ignored So the problem is that the lua parser in /boot/lua/config.lua is splitting the line on the '=', sending the first match to the key and the second to the value. In the problem case, the value is: '"test b" # This is "test_directive_b"' Then the value gets matched against QVALEXPR = '"(.*)"'. This cleans up the value by removing the first and last '"', but in this case turns it into: test b" # This is "test_directive_b which then gets rejected in processEnvVar() with MSG_FAILSYN_QUOTE, since values aren't allowed to contain '"'. Changing QVALEXPR to '([-%w_]+)' fixes this problem. Since the value is explicitly prevented from containing quotes, it's not unreasonable to load it from an expression that excludes them. The only other place this is used is in the 'exec="command"' expression, which also should not contain '"' in the command value. PR: 265001 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D35975 --- stand/lua/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/lua/config.lua b/stand/lua/config.lua index 86f5ef6174a2..26f65ecc17b6 100644 --- a/stand/lua/config.lua +++ b/stand/lua/config.lua @@ -65,7 +65,7 @@ local MSG_FAILSYN_BADVAR = "Malformed variable expression at position '%d'" -- env_var entries in the pattern table. This is perhaps a good target for a -- little refactoring. local MODULEEXPR = '([%w%d-_.]+)' -local QVALEXPR = '"(.*)"' +local QVALEXPR = '"([^"]*)"' local QVALREPL = QVALEXPR:gsub('%%', '%%%%') local WORDEXPR = "([-%w%d][-%w%d_.]*)" local WORDREPL = WORDEXPR:gsub('%%', '%%%%')