On Mon, Sep 29, 2014 at 08:27:19PM +0400, Alexander Monakov wrote: > Isn't the reason for faccessat call before unlink is that rm without the -f > flag is explicitely specified to ask for confirmation when the file is not > writable?
This may be true (it was never stated when I asked about the purpose), but in that case, faccessat still won't give the correct result unless you use AT_EACCESS (which is broken with glibc and very expensive with musl). The right way to achieve this would be to attempt to open the file (or performing some other operation that would check for write access with the correct effective/fs uid/gid) for writing before unlinking it. Rich _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
