Re: [yocto-patches] [pseudo] [PATCH] linkat: Fix AT_EMPTY_PATH handling

Paul Barker <[email protected]> Mon, 20 Jul 2026 11:37:11 +0100
Newsgroups org.yoctoproject.lists.yocto-patches
Message-ID <[email protected]>
--=-1Y1Va+eP+jlAtPtuaFqR
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, 2026-07-17 at 14:19 +0100, Richard Purdie via
lists.yoctoproject.org wrote:
> Currently we don't cover the case where AT_EMPTY_PATH is set for atlink.

Typo: s/atlink/linkat/

> Update the code to handle this case in a similar way to the /proc/self
> case which is similar.
>=20
> This is used by some systemd tools which OE might run at rootfs time
> such as hwdb generation.
>=20
> Signed-off-by: Richard Purdie <[email protected]>
> ---
>  ports/unix/guts/linkat.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>=20
> diff --git a/ports/unix/guts/linkat.c b/ports/unix/guts/linkat.c
> index 60fbf63..36ffc0f 100644
> --- a/ports/unix/guts/linkat.c
> +++ b/ports/unix/guts/linkat.c
> @@ -35,13 +35,18 @@
>  	}
>  #endif
>  	oldpath =3D oldname;
> -	if (pseudo_chroot_len && !strncmp(oldpath, pseudo_chroot, pseudo_chroot=
_len) &&
> +	if (oldpath && !*oldpath && pseudo_chroot_len && !strncmp(oldpath, pseu=
do_chroot, pseudo_chroot_len) &&

Should this be if (oldpath && *oldpath && ... ?

i.e. if oldpath is non-NULL and has non-zero length.

Best regards,

--=20
Paul Barker


--=-1Y1Va+eP+jlAtPtuaFqR
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----

iIcEABYKAC8WIQSzjPXf5Y1BDWhU2iCrY1Tsnbr0bgUCal36VxEccGF1bEBwYmFy
a2VyLmRldgAKCRCrY1Tsnbr0bqy3AP0SqVYHvX2Oe+8k+Mf6dDgbvF04EH5sRExG
nAkg9xo54AEA4w3Y2NrZyQwfre9/1qO4h/3zaOL0qg/afmqt5zHGqw4=
=9Wq/
-----END PGP SIGNATURE-----

--=-1Y1Va+eP+jlAtPtuaFqR--