Re: poudriere 3.4.0 regression: -i runs as NON_ROOT user

From: Gleb Popov <arrowd_at_freebsd.org>
Date: Mon, 15 Jan 2024 04:54:05 UTC
On Mon, Jan 15, 2024 at 5:10 AM Craig Leres <leres@freebsd.org> wrote:
>
> On 1/14/24 14:07, Tomoaki AOKI wrote:
> > IIRC, poudriere[-devel] ran as nobody (65534) initially, but it started
> > running as root (0) when I started using ccache.
>
> Interesting. It's starting to sound to me as if there's just one bug;
> poudriere is not passing the correct value for UID to make.
>
> I commented out CCACHE_DIR in my poudriere.conf and indeed things run as
> user nobody.

Yes, this is documented in the config:
https://github.com/freebsd/poudriere/blob/acde697efbe6f857c9b00bc90737dd2d97c95ba5/src/etc/poudriere.conf.sample#L287

> But looking at the build log I see UID is set to 0 in the
> environment. And I don't understand how poudriere does this ("ps e"
> doesn't show UID in the environment of any jail process).
>
>                 Craig
>
> ---Begin Environment---
> SHELL=/bin/csh
> [...]
> UID=0
> [...]
>

"Begin Environment" is the environment that Poudriere itself was
started in, the host one. Also note that when you do "testport -i" and
get into the jail, you'll be given root even if nobody was used during
building.