#1138512 fakeroot: flistxattr can not list xattrs set up in fakeroot

Package:
fakeroot
Source:
fakeroot
Description:
tool for simulating superuser privileges
Submitter:
RocketDev
Date:
2026-05-31 07:33:02 UTC
Severity:
normal
#1138512#5
Date:
2026-05-31 07:30:58 UTC
From:
To:
Dear Maintainer,

I am an Arch Linux user and I confirmed that the following bug applies
to the latest fakeroot source code.

This is a regression bug introduced by commit 9613bbb4, which
pass through flistxattr syscall to underlying file system even though
some xattr is set up in fakeroot container. I attached a script to
demonstrate the issue: when packaging software, packaging helper may
setcap on a file in container, which is emulated; getcap on that file is
OK, due to fakeroot emulation filters user xattrs, so capabilities are
emulated correctly and getcap can print the cap set. However, flistxattr
is not filtered and returns immediately if underlying file system xattr
query does not fail, leading to capabilities drop.

If the problem exists, y.tar does not contain PaxHeader/y at the header
as no xattr is found. I think fakeroot should fall back to emulate
xattrs if the underlying file in file system does not contain any xattr?