Mark Johnston <markj_at_FreeBSD.org> wrote on
Date: Fri, 08 Aug 2025 13:00:45 UTC :

> The branch main has been updated by markj:
> 
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=66c75fa63aff40e9c587345b2cc6b8148e396de8
> 
> commit 66c75fa63aff40e9c587345b2cc6b8148e396de8
> Author: Mark Johnston <ma...@freebsd.org>
> AuthorDate: 2025-08-06 20:36:05 +0000
> Commit: Mark Johnston <ma...@freebsd.org>
> CommitDate: 2025-08-08 12:51:54 +0000
> 
> freebsd-update: Fix the pkgbase check
> 
> Even on a pkgbase system, it should be possible to use freebsd-update -j
> to upgrade a non-pkgbase jail, at least for the time being. However,
> the check_pkgbase() call came before get_params, so BASEDIR was always
> set to /.
> 
> Make check_pkgbase() a pure function and call it after get_params().
> While here, use pkg -r ${BASEDIR} instead of pkg -c ${BASEDIR} since the
> latter requires root privileges.

Does this -r vs -c change have consequences such
as which /var/cache/pkg/ or whatever is updated
(or if such is updated)?

In other words, can -r fully substitute for -c?

(If it could, I'd wonder why -c even exists.)

Might there be uninstended conseqeucnes to the
change?

May be the pkg man page should be more explicit
about when to use -r vs. -c for the base dir?

> freebsd-update is supposed to be run
> as root, but it doesn't actually check this that I can see, so let's not
> make that assumption here since it affects the result of the function
> (i.e., pkg -c ${BASEDIR} always fails as a non-root user).
> 
> Reviewed by: des
> Fixes: 856e158dc4aa ("freebsd-update: improve pkgbase check")
> MFC after: 2 weeks
> Differential Revision: https://reviews.freebsd.org/D51770


===
Mark Millard
marklmi at yahoo.com


Reply via email to