Bug 276094

Summary: freebsd-update: -j/-b have incomplete/unclear semantics
Product: Base System Reporter: Michael Osipov <michaelo>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Some People CC: emaste, michaelo
Priority: ---    
Version: 13.2-STABLE   
Hardware: Any   
OS: Any   
URL: https://github.com/BastilleBSD/bastille/issues/658
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235318
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209628
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253989

Description Michael Osipov freebsd_committer freebsd_triage 2024-01-03 11:22:17 UTC
manpage says for -j:
>     -j jail        Operate on the given jail specified by jid or name.  (The
>                    version of the installed userland is detected and the
>                    --currently-running option is no more required.)

So I would assume that all file/dir related operations: -b, -d, -f, -k are rebased on top of the basedir of the jail, but this does not happen. Only -b is set.
Issues:
* Bug 235318, Bug 253989: host's workdir is shredded
* -f  is used from the host, resulting in different conf applied, all paths from that conffile need to be rebase on top of basedir
* -k since -f is not rebased the wrong key might be used.

Expectatation is that all operations runs fully isolated from the host, namely jailed. Even if a jail isn't used -b should describe where and how it is applied...
Comment 1 Michael Osipov freebsd_committer freebsd_triage 2024-01-03 11:23:29 UTC
This issue is visibible when using Bastille-managed jails:
* https://github.com/BastilleBSD/bastille/blob/master/usr/local/share/bastille/upgrade.sh
* https://github.com/BastilleBSD/bastille/blob/master/usr/local/share/bastille/update.sh

I will create an issue there...for the time being.
Comment 2 Michael Osipov freebsd_committer freebsd_triage 2024-01-03 11:49:36 UTC
Reported downstream.