Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Feb 2026 15:45:52 +0000
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 097458ac665d - main - freebsd-update: Error for -b basedir without UNAME_r set
Message-ID:  <698ca430.22081.5723249e@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=097458ac665db732cc91a22279da4cc14f694da2

commit 097458ac665db732cc91a22279da4cc14f694da2
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-12-10 13:47:34 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-02-11 15:44:45 +0000

    freebsd-update: Error for -b basedir without UNAME_r set
    
    freebsd-update sets the currently running release from UNAME -r, which
    can be overridden via the --currently-running commandline option (or by
    setting UNAME_r in the environment).  This may be invalid if -b is used
    to specify a basedir other than /, so error out if -b is specified
    without setting the currently running version.
    
    PR:             283229
    Reviewed by:    cperciva
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D48016
---
 usr.sbin/freebsd-update/freebsd-update.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh
index aa42af13a302..a58b50e9ca2e 100644
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -755,6 +755,10 @@ fetchupgrade_check_params () {
 	esac
 	chmod 700 ${WORKDIR}
 	cd ${WORKDIR} || exit 1
+	if [ "$BASEDIR" != / ] && [ -z "$UNAME_r" ]; then
+		echo "$(basename $0): -b basedir requires --currently-running to be specified."
+		exit 1
+	fi
 
 	# Generate release number.  The s/SECURITY/RELEASE/ bit exists
 	# to provide an upgrade path for FreeBSD Update 1.x users, since


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?698ca430.22081.5723249e>