Skip to content

Commit

Permalink
os-release: Quote variables as documented in the manual
Browse files Browse the repository at this point in the history
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.

Reviewed by:	imp
Approved by:	imp (src)
MFC after:	7 days

(cherry picked from commit 169e06f)
  • Loading branch information
0mp committed Dec 5, 2021
1 parent 8460767 commit c180637
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libexec/rc/rc.d/os-release
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c180637

Please sign in to comment.