#1134673 fakeroot does not fake ownership of files through "nftw"

Package:
faketime
Source:
faketime
Description:
Report faked system time to programs (command-line tool)
Submitter:
Sachi King
Date:
2026-07-03 20:51:01 UTC
Severity:
normal
#1134673#5
Date:
2024-09-17 02:29:51 UTC
From:
To:
When using fakeroot with mkfs.btrfs v6.10.1 with a rootdir, the files are owned by the user and not root.

btrfs-progs switched to using `nftw` to walk the directory tree in c6464d3f99ed1dabceff1168eabb207492c37624, and the stat passed to the `fn` argument of `nftw` is not faked.

nftw: https://man7.org/linux/man-pages/man3/nftw.3p.html

Example:

#1134673#10
Date:
2026-04-22 23:13:50 UTC
From:
To:
Unfortunately this bug is still present in the current fakeroot 1.37.2,
I encountered it trying to build a btrfs image with btrfs-progs 6.19.1.

#1134673#15
Date:
2026-04-23 01:07:20 UTC
From:
To:
reassign 1081976 faketime
quit

Hi folks,

Based on Sachi's original bug report, it looks like this is not
about fakeroot.  If I am confused, feel free to reassign it back.

#1134673#24
Date:
2026-04-23 01:13:01 UTC
From:
To:
Hi Clint,

Sorry, I was submitting a bug report to both fakeroot and faketime simultaneously, as they both use similar methods to perform their modifications.

I copied the wrong reproduction line here as I reproduced the issues independently for reporting.

Fakeroot does indeed not fake the owner when nftw is the creator of the files as is used in recent versions of mkfs.btrfs.

Cheers,
Sachi

#1134673#29
Date:
2026-04-23 01:33:28 UTC
From:
To:
reassign 1081976 fakeroot
clone 1081976 -1
reasign -1 faketime
quit

I have an idea but I don't know if it'll work.  How should I reproduce?