fs-util: add racy RENAME_NOREPLACE fallback using access()
authorLennart Poettering <lennart@poettering.net>
Tue, 2 Oct 2018 11:34:18 +0000 (13:34 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 2 Oct 2018 14:11:10 +0000 (16:11 +0200)
commit2f15b6253af8d44bc63ce232ae236fdfb3528795
tree90dc8cc9054af57f8609a2ed91e6d01d213575a7
parenteaa680c09e5701a62e8ac819211e5969eda84f2d
fs-util: add racy RENAME_NOREPLACE fallback using access()

Apparently FAT on some recent kernels can't do RENAME_NOREPLACE, and of
course cannot do linkat()/unlinkat() either (as the hard link concept
does not exist on FAT). Add a fallback using an explicit beforehand
faccessat() check. This sucks, but what we can do if the safe operations
are not available?

Fixes: #10063
src/basic/fs-util.c