Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 2026 22:23:46 +0100
From:      Jessica Clarke <jrtc27@freebsd.org>
To:        Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
Cc:        "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>, Nami Arjmandi <namiarjmandi@gmail.com>
Subject:   Re: git: f3bd86ba1851 - main - freebsd-version(1): Disable pathname expansion in -j option
Message-ID:  <94D02914-6908-4954-9826-5AF756D3352F@freebsd.org>
In-Reply-To: <69e92839.21955.4a101d64@gitrepo.freebsd.org>

index | next in thread | previous in thread | raw e-mail

On 22 Apr 2026, at 20:57, Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org> wrote:
> 
> The branch main has been updated by pouria:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=f3bd86ba18512aca7099af2d2d49da5e46708d17
> 
> commit f3bd86ba18512aca7099af2d2d49da5e46708d17
> Author:     Nami Arjmandi <namiarjmandi@gmail.com>
> AuthorDate: 2026-04-22 16:23:22 +0000
> Commit:     Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
> CommitDate: 2026-04-22 19:55:19 +0000
> 
>    freebsd-version(1): Disable pathname expansion in -j option
> 
>    Set the -f flag to sh(1) to disable pathname expansion.
>    Also, quote the jail variable to ensure correct behavior when passed
>    to jexec(8).
> 
>    Signed-off-by:  Nami Arjmandi <namiarjmandi@gmail.com>
>    Reviewed by:    pouria
>    Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2158
> ---
> bin/freebsd-version/freebsd-version.sh.in | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/bin/freebsd-version/freebsd-version.sh.in b/bin/freebsd-version/freebsd-version.sh.in
> index 157294dfa582..42b555ccafd9 100644
> --- a/bin/freebsd-version/freebsd-version.sh.in
> +++ b/bin/freebsd-version/freebsd-version.sh.in
> @@ -26,7 +26,7 @@
> #
> #
> 
> -set -e
> +set -ef

This is a big hammer that could lead to quite surprising results. Is
there a reason we don’t just quote things appropriately? Or at least
limit the scope of set -f to be only around specific places.

Jessica

> USERLAND_VERSION="@@REVISION@@-@@BRANCH@@"
> 
> @@ -88,7 +88,7 @@ userland_version() {
> #
> jail_version() {
> for i in $jail; do
> - jexec -- $i freebsd-version
> + jexec -- "$i" freebsd-version
> done
> }
> 
> 



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?94D02914-6908-4954-9826-5AF756D3352F>