]> Savannah Git Hosting - gnulib.git/commit
fts: fix race + mishandling of fstatat failure
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 6 Dec 2022 18:27:43 +0000 (10:27 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 6 Dec 2022 18:42:45 +0000 (10:42 -0800)
commit440b528b1d81dd31b2a2e4dde20d5c837c147811
treee05d01bc02a7a35ffd4819480f92e3281cd090b7
parent83f482f09850774a5a82c678c4981d1038f21655
fts: fix race + mishandling of fstatat failure

I hope this fixes a Luke Dashjr coreutils bug report about ext4
ramdisks; see “9.1: du Aborted (corrupt filesystem)”
<https://debbugs.gnu.org/59821>.
* lib/fts.c (fts_build): Fix two bugs.  First, fts_stat was being
called without checking its return value, causing a later abort.
Second, there was a race between opening a directory and statting
it, fixed by using fstat on the file descriptor rather than
fstatat on the directory name.
ChangeLog
lib/fts.c