From nobody Wed Nov 24 16:42:41 2021 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 87C7218A40CA for ; Wed, 24 Nov 2021 16:42:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hzmyp32zWz4WVL for ; Wed, 24 Nov 2021 16:42:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x934.google.com with SMTP id r15so6411537uao.3 for ; Wed, 24 Nov 2021 08:42:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DYLjw+67Z5zFdtVflmppzQU521XbY9tPIuGN6+8+qhc=; b=ycnpNZSGZH3j3ibQORLsLFqrBKWQ5vtnnAyoly7Oi4fxUBKt0VJqL0K8foTYN+drNx 6Raw4sbgeTbbCU5Xv02/TO0jdbDuL3xCkr7lLLtUyIFZQawGXb/ZmNjqNMo7VwNHFVlH uCVm9oBSGFd1b+Ied8daWZV2ZVsvdFAP2xqx7QhVs21NMCt2UkbL3KeM5OTewJLxl/Lz b1o3NvY06q47tX+Jlx1uQXWF8Ym2jvKf749vTIPPGxcniQbcjXQclVNbOApsS8r7rl6H wb9eCmYf68fw87MbEKv8vo91QY3Rhy4Eh88nFaMc5oK45M6cEhkad71pJBzoYvkGAZJO LYmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DYLjw+67Z5zFdtVflmppzQU521XbY9tPIuGN6+8+qhc=; b=GelMR517Eyb54Izh+rhWhSxQv833Q3NslM7Y2H7p1Ze2hDZEATfmqVDVil/O4gWy3O ysSe/LKCxGsvWDworBNzDgnsaPpd8GNl0RrtWdD8oe/gB9UIwUzNaaQPIUtn5uRxnnk/ D7SZ/YoIUwifSZFiw1htAvUVvWD3mDYcNjgHo2uYHpVmpLcVr4f0uypUZ7qJId33dvjq pH1wg5XbmHc3RuhCaX2k2ka8V0jtqBwPsz8/obFMJ/eLJN488AkfTHzJ9JpoYZRXcMa9 Tvpr2rsW6ECH7NIfhL6XKnnvvuFtcKTGEyF7OkGHLkNZRyHBsQ04Y7heXG3v+4cVwXwz ym/Q== X-Gm-Message-State: AOAM5304OCUQ1zaZfNNSKFi2YK5SdxhxJmj3aGX+zyHK8M8/icboV4rv GN/L5tQDBZo/QqmvdelsnQOFnjfGknWeEPszTBPx7A== X-Google-Smtp-Source: ABdhPJyCk+AoBiWt75o5Xz+zgjcODnlPmFPv+GP+kqlRmulhmG5HeFgALgRDpSNSEVo+4f9HHKjY5kNt1jlU9CVSVWs= X-Received: by 2002:ab0:4405:: with SMTP id m5mr12507387uam.11.1637772172240; Wed, 24 Nov 2021 08:42:52 -0800 (PST) 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202111241528.1AOFSJdf038653@gitrepo.freebsd.org> In-Reply-To: <202111241528.1AOFSJdf038653@gitrepo.freebsd.org> From: Warner Losh Date: Wed, 24 Nov 2021 09:42:41 -0700 Message-ID: Subject: Re: git: 169e06fa7852 - main - os-release: Quote variables as documented in the manual To: Mateusz Piotrowski <0mp@freebsd.org> Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000008cc16505d18b8cbb" X-Rspamd-Queue-Id: 4Hzmyp32zWz4WVL X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --0000000000008cc16505d18b8cbb Content-Type: text/plain; charset="UTF-8" On Wed, Nov 24, 2021 at 8:28 AM Mateusz Piotrowski <0mp@freebsd.org> wrote: > The branch main has been updated by 0mp (doc, ports committer): > > URL: > https://cgit.FreeBSD.org/src/commit/?id=169e06fa7852810f4ced2cce7a3c14ca9443bf39 > > commit 169e06fa7852810f4ced2cce7a3c14ca9443bf39 > Author: Mateusz Piotrowski <0mp@FreeBSD.org> > AuthorDate: 2021-11-23 10:26:47 +0000 > Commit: Mateusz Piotrowski <0mp@FreeBSD.org> > CommitDate: 2021-11-24 15:17:01 +0000 > > os-release: Quote variables as documented in the manual > > Variables must be quoted if they contain non-alphanumeric characters. > > Warner noted in the review that the lack of quoting causing problems > here is rather an edge case. I believe that it's worth adding the > quotes > here anyway because this is what the specification says and there is no > good reason not to follow it. > The only place it might be needed is for _version. Everything else can't have troublesome characters. The manual does not say you have to quote non-alphanumeric characters in variable assignment being my main point. Certainly not the paths and URLs. That's just gratuitous and not generally done in shell scripts (which I thought was a good enough reason to not do it). I'd have preferred if that nuance had been better reflected in the commit message since the change itself won't break anything. Warner > Reviewed by: imp > Approved by: imp (src) > MFC after: 7 days > --- > libexec/rc/rc.d/os-release | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/libexec/rc/rc.d/os-release b/libexec/rc/rc.d/os-release > index c328e161a70e..16f8cb178db8 100755 > --- a/libexec/rc/rc.d/os-release > +++ b/libexec/rc/rc.d/os-release > @@ -27,14 +27,14 @@ osrelease_start() > t=$(mktemp -t os-release) > cat > "$t" <<-__EOF__ > NAME=FreeBSD > - VERSION=$_version > - VERSION_ID=$_version_id > + VERSION="$_version" > + VERSION_ID="$_version_id" > ID=freebsd > ANSI_COLOR="0;31" > PRETTY_NAME="FreeBSD $_version" > - CPE_NAME=cpe:/o:freebsd:freebsd:$_version_id > - HOME_URL=https://FreeBSD.org/ > - BUG_REPORT_URL=https://bugs.FreeBSD.org/ > + CPE_NAME="cpe:/o:freebsd:freebsd:$_version_id" > + HOME_URL="https://FreeBSD.org/" > + BUG_REPORT_URL="https://bugs.FreeBSD.org/" > __EOF__ > install -C -o root -g wheel -m ${osrelease_perms} "$t" > "${osrelease_file}" > rm -f "$t" > --0000000000008cc16505d18b8cbb--