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
This commit is contained in:
Nami Arjmandi
2026-04-22 16:23:22 +00:00
committed by Pouria Mousavizadeh Tehrani
parent 81f60a964a
commit f3bd86ba18
+2 -2
View File
@@ -26,7 +26,7 @@
#
#
set -e
set -ef
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
}