freebsd-src/usr.sbin/freebsd-update
Ed Maste 856e158dc4 freebsd-update: improve pkgbase check
The previous version used a case-insensitive match (default for -x).
The presence of packages like freebsd-git-devtools and freebsd-ftpd
would falsely trigger the packaged base check.

Instead, just use `pkg which /usr/bin/uname` as a packaged base
indication.  pkg uses /usr/bin/uname to determine ABI, so we can rely on
it existing.  If it comes from a package then packaged base is in use.

Also, extend the check to all freebsd-update commands.  It is easier to
just disallow all commands, and easier to test.

Reported by: Mark Millard
Reviewed by: manu
Fixes: cf1aba2857 ("freebsd-update: refuse to operate on a pkgbase system")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47378
2024-11-02 15:24:39 -04:00
..
freebsd-update.8 freebsd-update(8): Update date 2024-02-02 13:36:50 -07:00
freebsd-update.conf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
freebsd-update.sh freebsd-update: improve pkgbase check 2024-11-02 15:24:39 -04:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00