Re: [OE-core] [PATCH 3/3] shadow: Drop pointless patch

Richard Purdie
2026-04-22T06:44:30Z

Hi Qi,

On Wed, 2026-04-22 at 13:51 +0800, ChenQi wrote:
>  I'm the author of the original patch, so I just double checked it.
>
> This might be counter-intuitive, but this patch does solve some
> problem in pseudo environment.
>
> Without this patch, running a simple 'bitbake ptest-runner' fails.
> The error message is like:
>
> NOTE: ptest-runner: Performing useradd with [--root
> /path/to/build/tmp/work/x86-64-v3-poky-linux/ptest-
> runner/2.5.1/recipe-sysroot --system --no-create -home --home / --
> user-group ptest]
>  useradd: cannot open /etc/passwd
>  ERROR: ptest-runner: useradd command did not succeed.
>
> Anyway, I see in another patch, you switched from '--root' to '--
> prefix', so I guess this patch is not needed after the switch.

I did suspect it was working around some issue but the patch does not
explain what and in theory it should be no change. I therefore sent a
"remove it " patch to work out if it was still needed after 12 years
and if so, what the real issue was.

It turns out that shadow-native on systems using fortify source would
break when building something like ptest-runner. Initially I tested on
a system without fortify source where you don't see the issue.

Looking at the useradd binary from shadow, it was optimising open() to
call __open_2(), and it turns out we're missing a wrapper for that in
pseudo.

I've therefore added it to pseudo and that should remove the need for
the patch. A local test on a system I reproduced it on did show it
being fixed.

We still needed to do this even with the --prefix change, I'll probably
hold off that until the next development cycle though.

Cheers,

Richard